Feature engineering compilation optimization method and apparatus

By constructing a dependent directed graph and using constant propagation processing, the computation process of feature engineering is optimized, solving the efficiency problem of feature engineering when converting data into feature vectors and achieving more efficient computation.

CN115774557BActive Publication Date: 2025-11-07SHANGHAI BILIBILI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211465237.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-11-07
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

Existing feature engineering techniques are computationally inefficient when converting data into feature vectors and have not been effectively optimized.

Method used

By constructing a directed graph of dependencies between feature configurations, feature configurations that meet preset constant conditions are determined, and constant propagation processing is performed. The calculation is then performed in conjunction with the topological sorting of the dependencies.

Benefits of technology

It improves the computational efficiency of feature engineering, simplifies the calculation process, reduces useless calculations, and increases calculation speed and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115774557B_ABST
    Figure CN115774557B_ABST
Patent Text Reader

Abstract

The application discloses a feature engineering compilation optimization method and device. The method comprises the following steps: constructing a dependency directed graph based on the dependency relationship between feature configurations; determining a first feature configuration meeting a preset constant condition; performing constant propagation processing on other feature configurations according to the first feature configuration according to the dependency directed graph, to obtain processed feature configurations; sequentially reading the processed feature configurations according to the dependency directed graph, and calculating the feature configurations according to an input data set; wherein the input data set comprises a first input data set, and if the value of the first input data set remains unchanged within a preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set. The feature configurations are optimized through the construction of the dependency directed graph and the constant propagation processing, so that the processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a feature engineering compilation optimization method and device. BACKGROUND

[0002] Feature engineering is a process of using professional knowledge and skills to process data, converting raw data into feature vectors, so that feature vectors can play a better role on machine learning algorithms. Data and features determine the online of machine learning, therefore, feature engineering is particularly important in machine learning.

[0003] The existing feature engineering generally only collects data, and performs basic operations such as cleaning dirty data and supplementing missing values, without considering optimization during data conversion to feature vectors, resulting in low computing efficiency. Therefore, there is an urgent need for a feature engineering compilation optimization method to improve the computing efficiency of feature engineering. SUMMARY

[0004] In view of the above problems, the present application is proposed to provide a feature engineering compilation optimization method and device to overcome the above problems or at least partially solve the above problems.

[0005] According to a first aspect of the present application, a feature engineering compilation optimization method is provided, which comprises:

[0006] constructing a dependency directed graph based on the dependency relationship between the feature configurations;

[0007] determining a first feature configuration meeting a preset constant condition, performing constant propagation processing on other feature configurations according to the first feature configuration based on the dependency directed graph, and obtaining processed feature configurations;

[0008] reading the processed feature configurations in sequence according to the dependency directed graph, and calculating the feature configurations according to the input data set; wherein the input data set includes a first input data set, and if the value of the first input data set remains unchanged within a preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set.

[0009] Optionally, constructing a dependency directed graph based on the dependency relationship between the feature configurations further comprises:

[0010] regarding each feature configuration as a node of the dependency directed graph;

[0011] traversing each feature configuration, obtaining the dependent feature configurations of each feature configuration, constructing the directed edges of the dependency directed graph according to the dependency relationship between each feature configuration and the corresponding dependent feature configuration, and obtaining the dependency directed graph; wherein the directed edges point from the dependent feature configurations to the feature configurations.

[0012] Optionally, determining the first feature configuration meeting the preset constant condition further comprises:

[0013] determining whether the feature configuration meets a preset constant condition; the preset constant condition comprises that values of the input data set corresponding to the feature configuration remain unchanged within a preset second time;

[0014] if yes, determining the feature configuration as the first feature configuration, and replacing the first feature configuration with the values of the input data set corresponding to the first feature configuration.

[0015] Optionally, performing constant propagation processing on the other feature configurations according to the first feature configuration further comprises:

[0016] performing constant propagation processing on the other feature configurations having a dependency relationship with the first feature configuration according to the dependency directed graph; the dependency relationship comprises a direct dependency relationship or an indirect dependency relationship.

[0017] Optionally, performing constant propagation processing on the other feature configurations having a dependency relationship with the first feature configuration according to the dependency directed graph further comprises:

[0018] traversing each node in the dependency directed graph, determining a dominating boundary of each node, and obtaining a static single assignment (SSA);

[0019] performing constant propagation processing on the other feature configurations having a dependency relationship with the first feature configuration according to the SSA and a preset propagation rule.

[0020] Optionally, traversing each node in the dependency directed graph, determining a dominating boundary of each node, and obtaining a static single assignment (SSA) further comprises:

[0021] Step S1, obtaining any node in the dependency directed graph, and determining whether the node has more than a preset number of pre-nodes; if yes, performing step S2; if no, performing step S1 cyclically until each node in the dependency directed graph is traversed;

[0022] Step S2, obtaining the plurality of pre-nodes of the node;

[0023] Step S3, setting any pre-node as an execution node;

[0024] Step S4, determining whether the execution node is a dominating node of the node; if no, determining the node as a dominating boundary of the execution node, and updating the execution node as the dominating node of the execution node, and performing step S4 cyclically until the execution node is the dominating node of the node; if yes, performing step S3 cyclically until the plurality of pre-nodes are traversed;

[0025] Step S5, analyzing the dependency directed graph, and determining branch confluence nodes in the dependency directed graph according to the dominating boundaries of each node, adding a preset assignment function to the feature configuration of the branch confluence nodes, and obtaining the SSA.

[0026] Optionally, according to the SSA, the constant propagation processing of the other feature configurations having the dependency relationship by using the first feature configuration according to the preset propagation rule further includes:

[0027] According to the assignment in the SSA, the constant value of the first feature configuration is propagated to the other feature configurations having the dependency relationship according to the preset propagation rule to replace the first feature configuration.

[0028] Optionally, the calculation of the feature configurations according to the input data set further includes:

[0029] According to the dependency directed graph, the topological sorting of the calculation of each feature configuration is obtained by traversing from the start node of the dependency directed graph, so that the calculation of the feature configurations according to the input data set is performed according to the topological sorting.

[0030] Optionally, the topological sorting of the calculation of each feature configuration is obtained by traversing from the start node of the dependency directed graph according to the dependency directed graph, so that the calculation of each feature configuration is performed according to the topological sorting.

[0031] The topological sorting of the calculation of each feature configuration is obtained by performing depth-first traversal from the start node of the dependency directed graph, so that the calculation of each feature configuration is performed according to the topological sorting.

[0032] Optionally, if the value of the first input data set remains unchanged within a preset first time, the calculation of the feature configuration of the first input data set according to the value of the first input data set further includes:

[0033] If the value of the first input data set remains unchanged within a preset first time, the calculation of the feature configuration of the first input data set according to the value of the first input data set is performed according to the topological sorting, the obtained calculation result is cached, and the repeated calculation of the feature configuration of the first input data set according to the topological sorting is stopped by freezing.

[0034] If the calculation of the feature configuration of the second input data set depends on the calculation result of the feature configuration of the first input data set, the value of the second input data set changes within a preset first time, the cached calculation result is obtained, and the feature configuration of the second input data set is calculated according to the value of the second input data set according to the topological sorting.

[0035] According to a second aspect of the embodiment of the application, a feature engineering compilation optimization device is provided, which includes:

[0036] The constructing module is adapted to construct a dependency directed graph based on the dependency relationship among the feature configurations.

[0037] The constantizing module is adapted to determine a first feature configuration meeting a preset constant condition, and perform constant propagation processing on other feature configurations according to the first feature configuration based on the dependency directed graph, to obtain processed feature configurations.

[0038] The calculating module is adapted to sequentially read the processed feature configurations according to the dependency directed graph, and perform calculation on the feature configurations according to the input data set; wherein the input data set includes a first input data set, and if a value of the first input data set remains unchanged within a preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set.

[0039] According to a third aspect of the embodiments of the present application, a computing device is provided, which includes a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface complete communication with each other through the communication bus.

[0040] The memory is configured to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the feature engineering compilation optimization method.

[0041] According to a fourth aspect of the embodiments of the present application, a computer storage medium is provided, and the storage medium stores at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the feature engineering compilation optimization method.

[0042] According to the feature engineering compilation optimization method and device provided by the present application, the dependency directed graph is constructed according to the dependency relationship among the feature configurations, and the first feature configuration meeting the preset constant condition is used to perform constant propagation processing based on the dependency directed graph, so that the calculation is simplified, the useless calculation is removed, and the calculation speed is improved. According to the dependency directed graph, the features are calculated in sequence according to the dependency relationship among the features, so that the previous feature configuration on which the feature configuration depends is calculated first, and the calculation waiting time is avoided. Further, for the value of the first input data set remaining unchanged within the preset first time, the feature configuration of the first input data set can be calculated according to the value of the first input data set, without multiple calculations on the value of the first input data set, so that the calculation amount is greatly reduced, and the calculation efficiency is improved.

[0043] The above description is only a summary of the technical solutions of the present application, in order to more clearly understand the technical means of the present application, the specific embodiments of the present application can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the following specific embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS

[0044] Various other advantages and benefits will become apparent to those of ordinary skill in the art, upon reading the following detailed description of the preferred embodiment. The accompanying drawings are included to provide a better understanding of the preferred embodiment, and are not intended to be limiting of the application. Moreover, in the drawings, like reference numerals denote similar parts throughout the several views. In the drawings:

[0045] Figure 1 A flow chart of a feature engineering compilation optimization method according to one embodiment of the application is shown;

[0046] Figure 2 A flow chart of a feature engineering compilation optimization method according to another embodiment of the application is shown;

[0047] Figure 3 A flow chart of building a static single assignment from a dependency directed graph is shown;

[0048] Figure 4 A diagram of a semi-lattice used for constant propagation is shown;

[0049] Figure 5 A diagram of a topological sort based on feature configuration of multiple input data is shown;

[0050] Figure 6 A diagram of a feature engineering compilation optimization apparatus according to one embodiment of the application is shown;

[0051] Figure 7 A diagram of a computing device according to one embodiment of the application is shown. DETAILED DESCRIPTION

[0052] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. While exemplary embodiments of the present application are illustrated, it is to be understood that the application is not limited to the embodiments described herein, but can be practiced with variation within the scope and spirit of the application. Rather, the embodiments are provided as exemplary of the application so as to convey the scope and content of the application to those skilled in the art.

[0053] First, the nomenclature used in connection with one or more embodiments of the application is explained.

[0054] Topological sorting: In computer science, a topological sorting or topological order of a directed graph is a linear ordering of its nodes such that for every directed edge uv from node u to node v, u comes before v in the ordering; it is a linear ordering of the vertices of a directed acyclic graph, or equivalently of a directed acyclic graph, that is, a set of tasks comprising a finite number of tasks, where each task can be dependent on earlier but not later tasks;

[0055] Dataflow analysis: A technique for collecting information about the values computed by a computer program at different points. A control flow graph (CFG) of a program is used to determine which parts of a program a value assigned to a variable can propagate to. This information is often used by compilers to optimize programs. A typical example of dataflow analysis is the computation of available definitions;

[0056] Constant propagation: In the field of computer science, sparse conditional constant propagation is an optimization technique commonly used in optimizing compilers that work in static single assignment (SSA) form, which can remove some useless code in a program and propagate constants. It is more powerful than dead code elimination and constant propagation.

[0057] Figure 1 A flow chart of a feature engineering compilation optimization method according to an embodiment of the present application is shown, as shown in Figure 1 The method comprises the following steps:

[0058] Step S101, constructing a dependency directed graph based on the dependency relationship between feature configurations.

[0059] In this embodiment, the feature engineering is compiled and optimized, mainly based on the input data set when converting the feature vector, by analyzing each feature configuration, such as feature conf analysis, according to various relationships between each feature conf, such as dependency relationship, calculation order, etc., the feature configuration is optimized, so that before the feature vector calculated based on the feature configuration is input to the machine learning, the feature configuration has been transformed, such as equivalent transformation, replaced by equivalent methods, such as constant propagation, to reduce the calculation of the feature configuration, thereby greatly improving the feature engineering compilation calculation efficiency.

[0060] The dependency directed graph can adopt a DAG (Directed Acyclic Graph) graph, and the directed edges in the DAG graph can be used to record the order of the dependency relationship. The feature configuration records the dependent feature configuration it depends on, and the feature configuration and the dependent feature configuration have a dependency relationship. For example, feature configuration A and feature configuration B, wherein the dependency relationship of feature configuration A is feature configuration B, that is, the dependent feature configuration of feature configuration A is feature configuration B. According to the obtained dependency relationship between each feature configuration, the dependency relationship can be used for topological sorting to create a DAG graph. For example, for feature configuration A and feature configuration B, a DAG graph of feature configuration A and feature configuration B can be established. Feature configuration A and feature configuration B are nodes of the DAG graph, and a directed edge is created between feature configuration A and feature configuration B, pointing from feature configuration B to feature configuration A, that is, the head node is feature configuration B and the tail node is feature configuration A. When processing the feature configuration subsequently, feature configuration B can be processed first, and then feature configuration A that depends on feature configuration B can be processed according to the directed edge. This avoids the situation that feature configuration A needs to wait for feature configuration B when calculating feature configuration A, and can improve the processing speed.

[0061] For a plurality of feature configurations, each feature configuration can be traversed, and each node and directed edge of the dependency directed graph can be constructed according to the dependency relationship between each feature configuration.

[0062] In step S102, a first feature configuration that meets a preset constant condition is determined, and other feature configurations are processed according to the first feature configuration according to the dependency directed graph to obtain processed feature configurations.

[0063] The preset constant condition can be used to determine whether the feature configuration is a constant. For example, the preset constant condition includes that the value of the input data set corresponding to the feature configuration remains unchanged within a preset second time. The preset second time can be set to, for example, the time range in which the input data set is used for feature engineering compilation, the time spent in calculating the input data set, and the like. For example, the input data set includes an occurrence time. If the occurrence time is obtained in days, the occurrence time in the input data set is the same day, which is a known constant that does not change. The feature configuration corresponding to the occurrence time meets the preset constant condition, and the feature configuration can be determined as the first feature configuration. The first feature configuration can be replaced with the value of the corresponding input data set, that is, replaced with a constant value, such as the occurrence time November 9, 2022, Wednesday (e.g., 3). The above is an example to illustrate that when determining the first feature configuration that meets the preset constant condition, the value of the input data set that remains unchanged within the preset second time can be determined according to the input data set, and the feature configuration corresponding to the value of the input data set is determined as the first feature configuration. Accordingly, the first feature configuration is replaced with the value of the input data set, simplifying the calculation of the first feature configuration and improving the calculation speed.

[0064] After determining the first feature configuration, constant values of the first feature configuration can be propagated based on the dependency directed graph, and constant propagation processing can be performed on other feature configurations. For example, the constant value of the first feature configuration is 3, and other feature configurations involve related calculations of the first feature configuration, such as other feature configurations = first feature configuration + 1. The constant propagation processing of other feature configurations can be performed by directly calculating 4, and the calculation amount of the feature configuration is reduced. Specifically, according to the dependency directed graph, starting from the node of the first feature configuration, the nodes having a direct dependency relationship with the first feature configuration, such as the node a pointed by the directed edge of the node where the first feature configuration is located, the feature configuration of the node a has a direct dependency relationship with the first feature configuration, and the constant propagation processing can be performed according to the first feature configuration, or the nodes having an indirect dependency relationship with the first feature configuration, such as the node a pointed by the directed edge of the node where the first feature configuration is located, the node b pointed by the directed edge of the node a, and the feature configuration of the node b has an indirect dependency relationship with the first feature configuration, and the constant propagation processing can also be performed according to the first feature configuration. The above is an example for illustration, and in actual application, the propagation direction of each node can be analyzed according to data flow analysis, and the constant propagation processing of other feature configurations by using the first feature configuration can be determined.

[0065] In step S103, the processed feature configurations are read in sequence according to the dependency directed graph, and the feature configurations are calculated according to the input data set.

[0066] After processing, the feature configurations of each node can be topologically sorted according to the order of the dependency relationship in the dependency directed graph. The calculation order of each node can be determined by using the topological sorting, the calculation order of each feature configuration can be calculated according to the calculation order, and it can also be determined which node's feature configuration has been calculated, and the feature configuration of the node does not need to be calculated.

[0067] According to the dependency directed graph, the calculation order of the feature configuration of each node is determined, and according to the input data set, such as user, time, commodity, etc., the corresponding calculation result is calculated in sequence according to the calculation order of the feature configuration. The calculation result finally represents, such as a feature vector, for example, the input data set is user, time, and commodity, and the corresponding feature vector represents the operation of the user on the commodity at the time. Here, the corresponding calculation result is not expanded, and the specific implementation is obtained according to the implementation.

[0068] Further, the input data set includes a first input data set, if the value of the first input data set remains unchanged within a preset first time, the preset first time can be, for example, a specified time range, a time range for feature engineering compilation of obtained input data, a time range spent for input data calculation, etc., which is not limited here. The feature configuration of the first input data set is calculated according to the value of the first input data set. Here, the calculation can be performed only once, for example, in multiple input data sets, such as a userid of a user and an itemid of a commodity, 1 userid and 10 itemids are input into the feature engineering as input data sets for calculation. For example, the userid is 1, which remains unchanged within the preset first time, and the userid is the first input data set. The itemid is multiple, that is, it changes multiple times within the preset first time, corresponding to different itemid values, and the itemid is the second input data set. When inputting, 1 userid and 1 itemid can be inputted, and 10 groups can be inputted, wherein the value of the userid in each group is unchanged, and the value of the itemid is different; or when inputting, the userid is inputted only once, and the itemid is inputted 10 times, etc., which is not limited here. When calculating, since the value of the first input data set userid is only 1, the feature configuration corresponding to the userid can be calculated only once. After calculation, the calculation result obtained can be cached, when different itemids need to use the calculation result of the userid, the intermediate calculation result or the final calculation result, the corresponding calculation result can be obtained from the cache directly, without calculating the userid again every time when calculating 10 commodities, which can greatly reduce the calculation amount. That is, the feature configuration of the first input data is calculated according to the first input data set, the calculation result obtained is cached, and the calculation of the feature configuration related to the first input data set is ended. The feature configuration calculation of the first input data set will not be repeated, and the second input data set can directly use the cached calculation result to complete the calculation of the feature configuration of the second input data set when calculating, which reduces the calculation times of the feature configuration of the first input data set, the calculation result is directly cached and obtained, and the overall calculation speed is improved.

[0069] According to the feature engineering compilation optimization method provided in the present application, a dependency directed graph is constructed according to the dependency relationship between feature configurations, and the first feature configuration meeting the preset constant condition can be used for constant propagation processing based on the dependency directed graph, so that the calculation is simplified, the useless calculation is removed, and the calculation speed is improved. According to the dependency directed graph, the calculation can also be performed in sequence according to the dependency relationship between the feature configurations, so that the previous feature configuration on which the feature configuration depends is calculated first, and the calculation waiting time is avoided. Further, for the value of the first input data set which remains unchanged within a preset first time, the feature configuration of the first input data set can be calculated according to the value of the first input data set, without the need for multiple calculations on the value of the first input data set, thereby greatly reducing the calculation amount and improving the calculation efficiency.

[0070] Figure 2 A flowchart of a feature engineering compilation optimization method according to an embodiment of the present application is shown, as shown in Figure 2 The method comprises the following steps:

[0071] In step S201, a dependency directed graph is constructed based on the dependency relationship between feature configurations.

[0072] For feature configuration, each feature configuration can be taken as a node of the dependency directed graph, such as feature configurations A, B, C, D, E, etc., to obtain multiple nodes of the dependency directed graph. Then each feature configuration is traversed to obtain the dependent feature configuration of each feature configuration, which is determined according to the dependency relationship, such as the dependency relationship of feature configuration A being feature configuration B, that is, the dependent feature configuration of feature configuration A is feature configuration B. By traversing each feature configuration, the corresponding dependent feature configuration of each feature configuration (except the feature configuration corresponding to the starting node) can be found, and according to the dependency relationship between each feature configuration and the corresponding dependent feature configuration, a directed edge of the dependency directed graph can be constructed, with the directed edge pointing from the dependent feature configuration to the feature configuration, such as feature configuration B pointing to feature configuration A, that is, the directed edge BA, and in the calculation, feature configuration B is calculated first, and then feature configuration A is calculated by depending on feature configuration B. If a feature configuration has multiple dependent feature configurations, such as the dependent feature configurations of feature configuration B being feature configurations C and D, when constructing the directed edge, feature configurations C and D point to feature configuration B respectively, and two directed edges are constructed; or the dependent feature configurations of feature configurations C and D are both feature configuration E, when constructing the directed edge, feature configuration E points to feature configurations C and D respectively, and two directed edges are constructed, that is, when a feature configuration has multiple dependent feature configurations, or multiple feature configurations have the same dependent feature configuration, multiple directed edges can be constructed. In the traversal, any feature configuration can be taken as the starting point of the traversal, such as in the order of feature configurations A, B, C, D, and E, to ensure that each feature configuration is traversed, so as to obtain the dependency directed graph constructed by the nodes and the directed edges. The dependency directed graph can be constructed using the following code, taking the dependency directed graph as an example:

[0073] DAG graph = {} -- set the DAG graph to empty

[0074] for each feature conf -- traverse each feature configuration (feature conf) for each dependent feature parent of feature conf -- traverse the dependent feature configuration of each feature configuration

[0075] add a directed edge formed by (conf, parent) to the DAG graph -- add the directed edge constructed by each feature configuration and the dependent feature configuration to the DAG graph

[0076] The above is a pseudo code example, and the specific implementation is set according to the implementation, which is not limited here.

[0077] In step S202, a first feature configuration meeting a preset constant condition is determined.

[0078] The preset constant condition includes that the value of the input data set corresponding to the feature configuration remains unchanged within a preset second time. The preset second time can be set as, for example, the time range for obtaining the input data for feature engineering compilation, the time spent for input data calculation, etc. The above is an example and the specific implementation is subject to the actual situation.

[0079] According to the preset constant condition, the input data set is judged to determine the first feature configuration whose value remains unchanged within the preset second time. For example, the input data set is a fixed value such as the time of occurrence on the same day, etc. The specific implementation is subject to the actual situation.

[0080] In step S203, each node in the dependency directed graph is traversed to determine the domination boundary of each node, and a static single assignment (SSA) is obtained.

[0081] After determining the first feature configuration, an SSA (Static Single-Assignment) is constructed before performing constant propagation processing. SSA is an intermediate representation form, and static single assignment means that each name involved is assigned only once in SSA, which facilitates constant propagation based on SSA. SSA can improve the efficiency of analyzing sparsity and improve the efficiency of constant propagation.

[0082] When constructing SSA, it can be completed based on the dependency directed graph. For the dependency directed graph, the assignment in each node is set to a single assignment form, so that the related variable name in the node is assigned only once in SSA. For example, traversing each node contains y=1, y=2, x=y, etc. SSA converts it to y1=1, y2=2, x1=y2, etc. Each variable name is assigned only once. The above is an example and the specific implementation is subject to the actual situation, and the processing of each feature configuration in the node is not affected. In addition to traversing the dependency directed graph, the domination boundary of each node also needs to be found. For example, the predecessor node of node b in the dependency directed graph is node a, and node b has no other route to reach, node a is the domination node of node b; node c is the predecessor node of node d, but node c does not directly dominate node d, and node d also has other predecessor node e, then node c and node e are the domination boundary of node d. The smallest SSA can be determined according to the domination boundary.

[0083] Specifically, the SSA is determined by traversing the dependency directed graph to find the node domination boundary, as shown in FIG. 2. Figure 3 The following steps are performed:

[0084] In step S301, any node in the dependency directed graph is traversed to determine whether the node has more than a preset number of predecessor nodes; if yes, step S302 is performed; if no, other nodes in the dependency directed graph are continuously traversed until each node is traversed.

[0085] Since each node in the dependency directed graph needs to be traversed, the traversal can start from any node. After obtaining any node in the dependency directed graph, it is first determined whether the node has more than a preset number of preceding nodes. The preset number is set to 1, for example, and it is determined whether the node has two or more preceding nodes. Here, the preceding node is the head node of the directed edge. If yes, step S302 is executed to continue to determine the node. If no, that is, the node has only one dominating node, another node in the dependency directed graph is obtained for further determination until each node in the dependency directed graph is traversed.

[0086] In step S302, the multiple preceding nodes of the node are obtained.

[0087] When it is determined that the node has more than a preset number of preceding nodes, the multiple preceding nodes of the node are obtained.

[0088] In step S303, the multiple preceding nodes are traversed, and for any preceding node, the preceding node is set as an execution node.

[0089] Here, the multiple preceding nodes need to be traversed and determined one by one. First, based on any preceding node, the preceding node is set as an execution node.

[0090] In step S304, it is determined whether the execution node is a dominating node of the node.

[0091] It is determined whether the execution node is a dominating node of the node in step S301. If yes, step S306 is executed to determine whether each preceding node is traversed. If no, step S305 is executed.

[0092] In step S305, the node is determined as a dominating boundary of the execution node, and the execution node is updated as a dominating node of the execution node. Step S304 is executed in a loop until the execution node is a dominating node of the node.

[0093] It can be determined that a node belongs to the dominance boundary of the execution node, and the node is added to the dominance boundary of the execution node. Then, the execution node is updated to become the dominant node of the original execution node. Then, it is checked whether the updated execution node is the dominant node of the node. If it is still not, the node is added to the dominance boundary of the updated execution node, and the execution node is updated to become the dominant node of the execution node. This process is repeated until the execution node is determined to be the dominant node of the node. Then, step S3 is executed again to obtain other predecessor nodes for judgment, until all predecessor nodes have been traversed. For example, node 1 points to node 2 and node 3, and node 2 and node 3 point to node 4. The predecessor nodes of node 4 include nodes 2 and 3. Taking node 3 as the execution node, it can be determined that node 4 is the dominator boundary of node 3. The execution node is then updated to node 1. Next, it is determined that node 1 is the dominator node of node 4. Taking node 2 as the execution node, it can be determined that node 4 is the dominator boundary of node 2. The execution node is then updated to node 1. This process is repeated until all predecessor nodes are traversed, thus obtaining the dominator boundaries of the nodes. The above is an example illustration. It can be implemented using the following code, relying on a directed graph (DAG) as an example:

[0094] For each node b in the DAG graph

[0095] Let the dominance boundary of b be the empty set {}

[0096] For each node b in the DAG graph

[0097] if the number of predecessor nodes of node b is greater than 1

[0098] For each b, the preceding node p

[0099] runner:=p

[0100] While runner! = the dominating node of b

[0101] runner's dominance boundary := runner's dominance boundary U{b}

[0102] The dominant node of runner:=b

[0103] The above is pseudocode. The actual execution settings will vary depending on the implementation situation, and no restrictions are set here.

[0104] Step S306: Determine whether each preceding node has been traversed.

[0105] If it is determined that each predecessor node has been traversed, step S307 is executed, otherwise step S303 is executed to reacquire another predecessor node. After the predecessor node is set as the execution node, the execution node is determined.

[0106] In step S307, the dependence directed graph is analyzed, and based on the dominance frontier of each node, a branch merge node in the dependence directed graph is determined. A preset assignment function is added to the characteristic configuration of the branch merge node to obtain the SSA.

[0107] After the dominance frontier of the node is determined, the dependence directed graph is analyzed, and based on the dominance frontier of each node, a branch merge node in the dependence directed graph is determined. For example, for the node 1, the node 2, the node 3, and the node 4 in step S4, the node 4 is determined as the branch merge node in the dependence directed graph. A preset assignment function, such as a phi function, is added to the characteristic configuration of the branch merge node. After the phi function is inserted, it is ensured that only one assignment processing corresponding to the node reaching the branch merge node can reach the branch merge node, which depends on the processing of each node before the branch merge node. Finally, the SSA is obtained.

[0108] In step S204, based on the SSA, a constant propagation processing is performed on other characteristic configurations having a dependence relationship with the first characteristic configuration according to a preset propagation rule.

[0109] The dependence relationship includes a direct dependence relationship or an indirect dependence relationship, and the dominance frontier of the SSA includes the above dependence relationships. According to the assignment in the SSA, a constant value of the first characteristic configuration can be propagated to other characteristic configurations having a dependence relationship according to a preset propagation rule to replace the first characteristic configuration. The constant propagation can use a data flow analysis technology. For example, if the input data of the first characteristic configuration is a time constant date, other characteristic configurations to which the date can be propagated are also replaced with a constant, that is, the data flow analysis technology.

[0110] In this embodiment, the constant propagation can use the SCCP (sparse conditional constant propagation), which can remove some useless program codes in the node and perform the constant propagation. The SSA is used to improve the efficiency of analyzing the sparsity, and has the ability to detect control flow edges that are never executed due to constant branch conditions. When the constant propagation processing is performed, the constant propagation can be performed according to a preset propagation rule. The constant propagation processing can refer to Figure 4The constant propagation uses the semi-lattice shown, each variable in the constant propagation is such a semi-lattice, and the value of the variable is an element in the semi-lattice, wherein c1, c2, c3, c4 represent a possible constant value, in the initial stage of the constant propagation analysis, the value of all variables is uncertain, represents undefined, represents non-undefined, means not constant or cannot be determined as constant, for the Meet Operator processing in the constant propagation, the preset propagation rules include the following cases, for example:

[0111] Undefined meet non-undefined = non-undefined

[0112] Undefined meet variable = variable

[0113] Constant 1 meet constant 2 = constant 1 (if constant 1 is equal to constant 2)

[0114] Constant 1 meet constant 2 = variable (if constant 1 is not equal to constant 2)

[0115] The above is an example, and other propagation rules can also be set according to the implementation, which is not limited here.

[0116] According to the SSA, the constant value based on the first feature configuration is used for constant propagation processing of other feature configurations, the SCCP performs constant propagation analysis on the representation of the SSA, judges the conditions in the conditional branch, distinguishes the executable and non-executable, removes the influence of the non-executable branch, and makes the constant propagation more accurate.

[0117] The steps S201-S204 can be executed when the feature configuration is loaded, and the optimization of the feature configuration is completed before the calculation of the feature configuration.

[0118] In step S205, according to the dependency directed graph, the topological sorting of each feature configuration in the calculation is obtained by traversing from the start node of the dependency directed graph, so as to calculate the feature configuration according to the input data set according to the topological sorting.

[0119] This step is when the feature configuration is calculated online, the topological sorting of the feature configuration can be performed according to the dependency directed graph, and it is ensured that the pre-node (i.e. each variable of the dependent feature configuration) of a node N has been calculated when the node N is calculated. When the feature configuration is written, the order of the feature configuration in the specific file can be ignored.

[0120] Specifically, the depth-first search is performed from the starting node of the directed graph in sequence, the next level node under the starting node is acquired first, for each next level node, each lower level node under the next level node is acquired, until the end node, the above operation is repeated for another next level node, until all next level nodes of the starting node are processed, and the topological sorting of the calculation of each feature configuration is obtained, so as to calculate each feature configuration according to the topological sorting. The depth-first search can use the following code, taking the DAG graph as an example:

[0121] L <- empty list

[0122] S <- starting node in DAG graph

[0123] while S is not empty do

[0124] remove a node n from S and add n to L

[0125] add n to L

[0126] for each edge e of n, let m be the end node of e do

[0127] remove e from DAG graph

[0128] if m has no incoming edges

[0129] add m to S

[0130] The above is a pseudo code example, and the specific implementation is set according to the implementation condition, which is not limited here.

[0131] After obtaining the topological sorting of the calculation of each feature configuration, the feature configuration is calculated according to the input data set according to the topological sorting. Using the topological sorting, the topological sorting of the calculation of userid (user identifier) and itemid (item identifier) can be obtained as shown in Figure 5 As shown in Figure 5 , the userid is calculated to obtain a variable val1, and then fea1 (feature 1) is calculated; the itemid is calculated to obtain a variable val2, the variable val2 is calculated to obtain fea2 (feature 2) and fea3 (feature 3) and a variable val3, and fea4 (feature 4) is calculated according to the variable val3 combined with the variable val1 obtained by the userid. The above is an example, and the specific implementation is set according to the implementation condition, which is not limited here.

[0132] In step S206, if the value of the first input data set remains unchanged within the preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set in topological order, the obtained calculation result is cached, and the repeated calculation of the feature configuration of the first input data set according to the topological order is stopped by freezing. If the calculation of the feature configuration of the second input data set depends on the calculation result of the feature configuration of the first input data set, the value of the second input data set changes within the preset first time, the cached calculation result is obtained, and the feature configuration of the second input data set is calculated according to the value of the second input data set in topological order.

[0133] It is considered that the value of some input data sets in multiple input data sets remains unchanged within the preset first time, such as the operation of the same user on multiple different commodities. The input data set includes the userid of the user and the itemid of the commodity, wherein userid is one numerical value and itemid is multiple numerical values. The value of userid remains unchanged within the preset first time, userid is the first input data set, and itemid is multiple different numerical values, i.e., the numerical values change within the preset first time, and itemid is the second input data set. As shown in Figure 5 The feature configuration of the first input data set is calculated according to the value of the first input data set userid in topological order, such as the calculation of variable val1 from userid, and the calculation of fea1 (feature 1), and the obtained calculation result is cached. Here, the calculation result includes intermediate calculation result, final calculation result, etc., and the calculation result can be cached according to the calculation dependence of the specific feature configuration of the second input data set, such as Figure 5As shown, the second input data set itemid depends on the intermediate calculation result variable val1 during calculation, the intermediate calculation result variable val1 is cached, and the calculation of the related topological sorting of the feature configuration of the first input data set userid is frozen to stop. When calculating different itemid values in the second input data set, the variable val1 is not repeated to obtain the variable val1. When calculating the second input data set, the cached calculation result variable val1 is obtained, and the calculation of the feature configuration of the second input data set is calculated according to the value of the second input data set according to the topological sorting. Above, the calculation of the feature configuration of the second input data set depends on the calculation result of the feature configuration of the first input data set. Taking 1 userid and 10 itemid as an example, if the calculation of the related topological sorting of the feature configuration of the first input data set userid is not frozen, when 1 userid and 10 itemid are calculated to obtain 1 userid fea1 (feature 1) and 10 itemid respectively corresponding fea2 (feature 2), fea3 (feature 3), fea4 (feature 4), 40 calculations need to be performed, that is, 1 userid needs to correspond to 10 itemid, and 10 times are executed to obtain 10 same fea1 (feature 1), 10 itemid obtains 10 fea2 (feature 2), 10 fea3 (feature 3), and 10 fea4 (feature 4). The calculation of the userid is frozen after the calculation of 1 userid fea1 (feature 1) is performed once, and 10 fea2 (feature 2), 10 fea3 (feature 3), and 10 fea4 (feature 4) are obtained by performing 30 times of calculation of 10 itemid. This greatly reduces the calculation amount and improves the calculation efficiency.

[0134] According to the feature engineering compilation optimization method provided in the application, a dependency directed graph is constructed according to the dependency relationship between the feature configurations, and then the domination boundary of the node is determined based on the dependency directed graph to obtain the smallest SSA. The SSA is used to perform constant propagation processing on the first feature configuration that meets the preset constant condition, to simplify the assignment calculation in advance and also to reduce useless calculation, thereby greatly reducing the calculation amount and improving the calculation speed. The topological sorting of the feature configuration is obtained by performing depth-first traversal on the dependency directed graph, and the feature configuration that is sorted first is calculated first, thereby avoiding the calculation waiting time. For the value of the first input data set that remains unchanged within the preset first time, the feature configuration of the first input data set can be calculated according to the value of the first input data set, the calculation result is cached, and the calculation related to the feature configuration of the first input data set is frozen to avoid repeated calculation of the first input data set. The second input data set can directly use the cached calculation result for calculation, thereby greatly reducing the calculation amount and improving the calculation efficiency.

[0135] Figure 6 A structural schematic diagram of a feature engineering compilation optimization apparatus is shown. As shown in the figure, the apparatus comprises: Figure 6 A construction module 610, adapted to construct a dependency directed graph based on dependency relationships between feature configurations;

[0136] A constantization module 620, adapted to determine a first feature configuration that meets a preset constant condition, and perform constant propagation processing on other feature configurations according to the first feature configuration based on the dependency directed graph, to obtain processed feature configurations;

[0137] A calculation module 630, adapted to sequentially read the processed feature configurations according to the dependency directed graph, and perform calculation on the feature configurations according to an input data set; wherein the input data set comprises a first input data set, and if a value of the first input data set remains unchanged within a preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set.

[0138]

[0139] Optionally, the construction module 610 is further adapted to:

[0140] regard each feature configuration as a node of the dependency directed graph;

[0141] traverse each feature configuration, obtain dependency feature configurations of each feature configuration, construct directed edges of the dependency directed graph according to dependency relationships between each feature configuration and the corresponding dependency feature configurations, and obtain the dependency directed graph; wherein the directed edges point from the dependency feature configurations to the feature configurations.

[0142] Optionally, the constantization module 620 is further adapted to:

[0143] determine whether the feature configuration meets a preset constant condition; the preset constant condition comprises that a value of an input data set corresponding to the feature configuration remains unchanged within a preset second time;

[0144] if yes, determine that the feature configuration is the first feature configuration, and replace the first feature configuration with the value of the corresponding input data set.

[0145] Optionally, the constantization module 620 is further adapted to:

[0146] perform constant propagation processing on other feature configurations that have dependency relationships with the first feature configuration according to the dependency directed graph; the dependency relationships comprise direct dependency relationships or indirect dependency relationships.

[0147] Optionally, the constantization module 620 is further adapted to:

[0148] traverse each node in the dependency directed graph, determine domination boundaries of each node, and obtain a static single assignment (SSA).​

[0149] According to the SSA, the constant propagation processing is performed on other feature configurations having a dependency relationship with the first feature configuration according to a preset propagation rule.

[0150] Optionally, the constantization module 620 is further adapted to:

[0151] Step S1, acquiring any node in the dependency directed graph, judging whether the node has more than a preset number of pre-nodes; if yes, executing step S2; if no, executing step S1 cyclically until each node in the dependency directed graph is traversed;

[0152] Step S2, acquiring the plurality of pre-nodes of the node;

[0153] Step S3, for any pre-node, setting the pre-node as an execution node;

[0154] Step S4, judging whether the execution node is a dominating node of the node; if no, determining that the node is a dominating boundary of the execution node, and updating the execution node as the dominating node of the execution node, executing step S4 cyclically until the execution node is the dominating node of the node; if yes, executing step S3 cyclically until the plurality of pre-nodes are traversed;

[0155] Step S5, analyzing the dependency directed graph, and according to the dominating boundaries of the nodes, determining a branch confluence node in the dependency directed graph, adding a preset assignment function to the feature configuration of the branch confluence node to obtain the SSA.

[0156] Optionally, the constantization module 620 is further adapted to:

[0157] According to the SSA, the constant propagation processing is performed on other feature configurations having a dependency relationship with the first feature configuration according to a preset propagation rule.

[0158] Optionally, the calculation module 630 is further adapted to:

[0159] According to the dependency directed graph, traversing from a start node of the dependency directed graph to obtain a topological order of the calculation of each feature configuration, so as to calculate the feature configuration according to the input data set according to the topological order.

[0160] Optionally, the calculation module 630 is further adapted to:

[0161] According to the dependency directed graph, traversing from a start node of the dependency directed graph to obtain a topological order of the calculation of each feature configuration, so as to calculate the feature configuration according to the input data set according to the topological order.

[0162] Optionally, the calculation module 630 is further adapted to:

[0163] If the value of the first input dataset remains unchanged within a preset first time period, the feature configuration of the first input dataset is calculated according to the value of the first input dataset in a topological sort. The calculated result is cached and frozen to stop the repeated calculation of the feature configuration of the first input dataset according to the topological sort.

[0164] If the calculation of the feature configuration of the second input dataset depends on the calculation result of the feature configuration of the first input dataset, and the value of the second input dataset changes within a preset first time period, the cached calculation result is obtained, and the feature configuration of the second input dataset is calculated according to the topological sorting based on the value of the second input dataset.

[0165] The descriptions of the above modules refer to the corresponding descriptions in the method embodiments, and will not be repeated here.

[0166] According to the feature engineering compilation optimization apparatus provided in this application, by constructing a dependency directed graph based on the dependencies between feature configurations, constant propagation processing can be performed using the first feature configuration that meets the preset constant conditions based on the dependency directed graph. This simplifies the calculation, removes useless calculations, and improves the calculation speed. Furthermore, the dependency directed graph can also be used to calculate in the order of dependencies between feature configurations, ensuring that the preceding feature configuration that a feature configuration depends on is calculated first, avoiding calculation waiting time. For unchanging first input data, after calculating the result of the feature configuration of the first input data, the calculation result is cached, and the calculations related to the feature configuration of the first input data are frozen. The feature configuration of other changed second input data can be calculated based on the cached calculation results, eliminating the need for multiple calculations on the first input data, greatly reducing the amount of computation and improving computational efficiency.

[0167] This application also provides a non-volatile computer storage medium storing at least one executable instruction that can execute the feature engineering compilation optimization method in any of the above method embodiments.

[0168] Figure 7 The diagram shows a structural schematic of a computing device according to an embodiment of the present application. The specific embodiments of the present application do not limit the specific implementation of the computing device.

[0169] like Figure 7 As shown, the computing device may include: a processor 702, a communications interface 704, a memory 706, and a communications bus 708.

[0170] in:

[0171] The processor 702, the communication interface 704, and the memory 706 communicate with each other through a communication bus 708.

[0172] The communication interface 704 is configured to communicate with network elements such as clients or other servers.

[0173] The processor 702 is configured to execute the program 710, and specifically can execute the related steps in the feature engineering compilation optimization method embodiments described above.

[0174] Specifically, the program 710 can include program codes including computer operation instructions.

[0175] The processor 702 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the present application. The one or more processors included in the computing device can be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0176] The memory 706 is configured to store the program 710. The memory 706 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.

[0177] The program 710 can be specifically used to enable the processor 702 to execute the feature engineering compilation optimization method in any of the method embodiments described above. The specific implementation of each step in the program 710 can refer to the corresponding description in the corresponding steps and units in the feature engineering compilation optimization embodiments described above, and will not be described here. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the devices and modules described above can refer to the corresponding process description in the foregoing method embodiments, and will not be described here.

[0178] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, based on the description as set forth above. In terms of structure, those skilled in the art will appreciate that the required structure for a variety of these general purpose systems follows from the description above. In addition, the present application is not intended to be bound by any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the present application described herein, and that the description above of a specific language is intended to disclose a preferred embodiment of the present application.

[0179] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order not to obscure the understanding of this description.

[0180] Similarly, it is to be understood that the embodiments of the present application can be used in the exact form disclosed herein, carried in parts, used, or carried out but not used, in variations of one or more embodiments suggested herein, and / or in variations of one or more embodiments of the prior art disclosed in this description. It is to be understood that such modifications are to be considered as falling within the scope of the present application comprising the embodiments disclosed herein.

[0181] Those skilled in the art will appreciate that the modules in the apparatuses in the embodiments can be adapted and placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination of all the features disclosed in the present specification (including the accompanying claims, abstract and drawings), and all processes or units of any methods or apparatuses disclosed so far can be adopted. Unless explicitly stated, each feature disclosed in the present specification (including the accompanying claims, abstract and drawings) can be replaced by alternative features that serve the same, equivalent or similar purpose.

[0182] Further, those skilled in the art will appreciate that a combination of features of different embodiments can mean within the scope of the present application and form a different embodiment. For example, in the following claims, any one of the claimed embodiments can be used in any combination.

[0183] Various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. As will be appreciated by those skilled in the art, a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality of some or all of the components according to the present application. The present application can also be implemented as a program of instructions for performing part or all of the methods described herein, e.g., a computer program and a computer program product. Such program of the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.

[0184] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed with a comma. Such listing does not imply that the devices must be co-located. Individual elements listed in a 'list of elements' can be implemented in, as a whole, by one and the same thing. The mere fact that certain measures are recited in mutually different claims does not indicate that a combination of these measures cannot be used to advantage. The use of relative terms in the claims (for example, 'about') typically refers to plus or minus 10%.

Claims

1. A feature engineering compilation optimization method, comprising: constructing a dependency directed graph based on dependency relationships between feature configurations; determining a first feature configuration that meets a preset constant condition, performing constant propagation on other feature configurations according to the first feature configuration based on the dependency directed graph, and obtaining processed feature configurations; reading the processed feature configurations in sequence according to the dependency directed graph, and calculating the processed feature configurations based on an input data set; wherein the input data set comprises a first input data set, and if a value of the first input data set remains unchanged within a preset first time, calculating a feature configuration of the first input data set based on the value of the first input data set.

2. The method of claim 1, wherein, The step of constructing a dependency directed graph based on dependency relationships between feature configurations further comprises: regarding each feature configuration as a node of the dependency directed graph; traversing each feature configuration, obtaining dependent feature configurations of each feature configuration, constructing directed edges of the dependency directed graph based on dependency relationships between each feature configuration and the corresponding dependent feature configurations, and obtaining the dependency directed graph; wherein the directed edges point to the feature configuration according to the dependent feature configurations.

3. The method of claim 1, wherein, The step of determining a first feature configuration that meets a preset constant condition further comprises: judging whether a feature configuration meets a preset constant condition; the preset constant condition comprises a value of an input data set corresponding to the feature configuration remaining unchanged within a preset second time; if yes, determining the feature configuration as the first feature configuration, and replacing the first feature configuration with the value of the corresponding input data set.

4. The method of claim 1, wherein, The step of performing constant propagation on other feature configurations according to the first feature configuration based on the dependency directed graph further comprises: performing constant propagation on other feature configurations having a dependency relationship with the first feature configuration according to the dependency directed graph; the dependency relationship comprises a direct dependency relationship or an indirect dependency relationship.

5. The method of claim 4, wherein, The step of performing constant propagation on other feature configurations having a dependency relationship with the first feature configuration according to the dependency directed graph further comprises: traversing each node in the dependency directed graph, determining dominance boundaries of each node, and obtaining a static single assignment (SSA); performing constant propagation on other feature configurations having a dependency relationship with the first feature configuration according to the first feature configuration based on the SSA and a preset propagation rule.

6. The method of claim 5, wherein, The step of traversing each node in the dependency directed graph, determining dominance boundaries of each node, and obtaining a static single assignment (SSA) further comprises: step S1: obtaining any node in the dependency directed graph, judging whether the node has more than a preset number of predecessor nodes; if yes, performing step S2; if no, performing step S1 cyclically until each node in the dependency directed graph is traversed; step S2: obtaining the plurality of predecessor nodes of the node; step S3: setting any predecessor node as an execution node. Step S4, judging whether the execution node is a dominating node of the node; if not, determining that the node is a dominating boundary of the execution node, and updating the execution node as the dominating node of the execution node, and executing step S4 circularly until the execution node is the dominating node of the node; if yes, executing step S3 circularly until the plurality of preceding nodes are traversed; Step S5, analyzing the dependency directed graph, and determining a branch confluence node in the dependency directed graph according to the dominating boundaries of the nodes, adding a preset assignment function to a feature configuration of the branch confluence node to obtain an SSA.

7. The method of claim 5, wherein, The constant propagation processing of the first feature configuration to other feature configurations with a dependency relationship according to the SSA and the preset propagation rule further includes: According to the assignment in the SSA, a constant value of the first feature configuration is propagated to other feature configurations with a dependency relationship according to the preset propagation rule to replace the first feature configuration.

8. The method of any one of claims 1-7, wherein, The calculation of the processed feature configuration according to the input data set further includes: According to the dependency directed graph, a topological order of each feature configuration in calculation is obtained by traversing from a starting node of the dependency directed graph, so that the processed feature configuration is calculated according to the input data set according to the topological order.

9. The method of claim 8, wherein, The calculation of the processed feature configuration according to the input data set further includes: According to the dependency directed graph, a topological order of each feature configuration in calculation is obtained by traversing from a starting node of the dependency directed graph, so that the processed feature configuration is calculated according to the input data set according to the topological order.

10. The method of claim 8, wherein, The calculation of the processed feature configuration according to the input data set further includes: According to the dependency directed graph, a topological order of each feature configuration in calculation is obtained by traversing from a starting node of the dependency directed graph, so that the processed feature configuration is calculated according to the input data set according to the topological order. The calculation of the processed feature configuration according to the input data set further includes: If the value of the first input data set remains unchanged within a preset first time, the feature configuration of the first input data set is calculated according to the value of the first input data set according to the topological order, the calculation result is cached, and the repeated calculation of the feature configuration of the first input data set according to the topological order is stopped by freezing; If the calculation of the feature configuration of the second input data set depends on the calculation result of the feature configuration of the first input data set, the value of the second input data set changes within a preset first time, the cached calculation result is obtained, and the feature configuration of the second input data set is calculated according to the value of the second input data set according to the topological order.

11. A feature engineering compilation optimization device, comprising: a construction module adapted to construct a dependency directed graph based on a dependency relationship between feature configurations; a constantization module adapted to determine a first feature configuration meeting a preset constant condition, and to perform constant propagation processing of the first feature configuration on other feature configurations according to the dependency directed graph to obtain processed feature configurations. The computing module is adapted to read the processed feature configurations in sequence according to the dependency directed graph, and perform computation on the processed feature configurations according to an input data set; wherein the input data set comprises a first input data set, and if a value of the first input data set remains unchanged within a preset first time, a feature configuration of the first input data set is computed according to the value of the first input data set.

12. A computing device comprising: The processor, the memory, the communication interface and the communication bus complete communication among each other through the communication bus; The memory is used for storing at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the feature engineering compilation optimization method in any one of claims 1-10.

13. A computer storage medium, the storage medium storing at least one executable instruction, and the executable instruction causing the processor to perform operations corresponding to the feature engineering compilation optimization method in any one of claims 1-10.

14. A computer program product, comprising at least one executable instruction, and the executable instruction causing the processor to perform operations corresponding to the feature engineering compilation optimization method in any one of claims 1-10.

Citation Information

Patent Citations

  • Method and system for optimizing computer program

    CN101876899A

  • Method for calculating data dependency relationship in program and computer readable storage medium

    CN113741861A