Method and system for uniformly performing feature extraction

Through a unified feature extraction method and system, the contradiction between throughput and response speed in the feature extraction process in the existing technology is solved, seamless connection between online and offline scenarios is achieved, and it is compatible with sequential and non-sequential feature extraction, reducing development costs. and improved efficiency.

CN111949349BActive Publication Date: 2024-09-20THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010795856.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-21
Publication Date
2024-09-20
Estimated Expiration
2038-08-21

AI Technical Summary

Technical Problem

Existing machine learning platforms focus on throughput rather than response speed in the feature extraction process during the training and estimation stages, resulting in high estimation costs and the inability to unify online and offline feature extraction scenarios, making development more difficult.

Method used

Provide a unified feature extraction method and system that obtains feature extraction scripts, parses and generates execution plans, and executes them locally or in a cluster according to feature extraction scenarios. It supports seamless docking of online and offline scenarios, and is compatible with time series and non-time series. Feature extraction.

Benefits of technology

It achieves unified execution in various feature extraction scenarios, reduces development costs, improves the real-time performance of online feature extraction and the throughput of offline feature extraction, and reduces the workload of developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949349B
    Figure CN111949349B
Patent Text Reader

Abstract

A method and system for uniformly executing feature extraction are provided. The method comprises: obtaining a feature extraction script for defining processing logic related to feature extraction; parsing the feature extraction script to generate an execution plan for performing feature extraction; and executing the generated execution plan by a local machine or a cluster based on a feature extraction scenario. According to the method and system, feature extraction can be uniformly executed in various feature extraction scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of August 21, 2018, application number 201810954494.5, and titled “Method and system for uniformly performing feature extraction”. Technical Field

[0002] The present invention generally relates to the field of data processing, and more particularly, to a method and system for uniformly performing feature extraction. Background Art

[0003] With the emergence of massive data, people tend to use machine learning technology to mine value from data. Machine learning is the inevitable product of artificial intelligence research and development to a certain stage. It is committed to using experience through computational means to improve the performance of the system itself. In computer systems, "experience" usually exists in the form of "data". Through machine learning algorithms, "models" can be generated from data. In other words, by providing empirical data to machine learning algorithms, models can be generated based on these empirical data; when faced with new situations, the trained model is used to obtain corresponding prediction results. Whether it is the stage of training machine learning models or the stage of using machine learning models for estimation, it is necessary to extract features from the data to obtain machine learning samples including various features.

[0004] The current machine learning platform or system mainly implements the function of training machine learning models, that is, the process of using the collected large-scale data to perform operations such as feature extraction, model construction, and model tuning. This stage does not focus on response speed, but on throughput, that is, the amount of data processed per unit time. If you need to use a trained machine learning model for estimation, you often care about response speed instead of throughput. This forces technicians to carry out additional development for the estimation stage, especially for the feature extraction process, resulting in a high cost for achieving estimation. Summary of the invention

[0005] An exemplary embodiment of the present invention provides a method and system for uniformly performing feature extraction, which can uniformly perform feature extraction in various feature extraction scenarios.

[0006] According to an exemplary embodiment of the present invention, a method for uniformly performing feature extraction is provided, wherein the method comprises: obtaining a feature extraction script for defining a processing logic related to feature extraction; parsing the feature extraction script to generate an execution plan for performing feature extraction; and executing the generated execution plan locally or in a cluster based on a feature extraction scenario.

[0007] Optionally, the step of executing the generated execution plan through the local machine or the cluster based on the feature extraction scenario includes: when the feature extraction scenario is an online feature extraction scenario, executing the generated execution plan through the local machine in a stand-alone mode; and when the feature extraction scenario is an offline feature extraction scenario, executing the generated execution plan through the cluster in a distributed mode.

[0008] Optionally, the step of parsing the feature extraction script to generate an execution plan for feature extraction includes: dividing the processing logic defined by the feature extraction script according to a processing order to generate an execution plan for feature extraction.

[0009] Optionally, the processing logic involves feature extraction in at least one time window, and the step of dividing the processing logic defined by the feature extraction script according to the processing order to generate an execution plan for feature extraction includes: for each time window, dividing the corresponding processing logic according to the processing order to generate an execution plan for feature extraction.

[0010] Optionally, the execution plan is a directed acyclic graph composed of nodes, wherein the nodes correspond to the processing logic after segmentation, and the step of executing the generated execution plan by the local machine or the cluster based on the feature extraction scenario includes: based on the feature extraction scenario, executing the generated execution plan by implementing the processing logic corresponding to each node by the local machine or the cluster.

[0011] Optionally, the node comprises a computing node corresponding to a processing logic for obtaining features from a data table.

[0012] Optionally, the node further includes a table splicing node corresponding to a processing logic for performing data table splicing and / or a feature splicing node corresponding to a processing logic for performing feature aggregation.

[0013] Optionally, implementing the processing logic corresponding to the computing node through the local machine or the cluster includes: compiling the processing logic corresponding to the computing node into at least one executable file through the local machine or the cluster, and running the at least one executable file, wherein, in the process of compiling the processing logic corresponding to the computing node into the executable file, common sub-expressions in the processing logic are replaced with intermediate variables, and / or part of the processing logic that has a close operation relationship and is independent of other processing logics is compiled into the same executable file.

[0014] Optionally, the time window is defined by a source data table, a partition reference field, a time reference field, a time span and / or a window size.

[0015] Optionally, the feature extraction scenario is specified by a user or automatically determined.

[0016] Optionally, when the feature extraction scenario is an offline feature extraction scenario, the step of executing the generated execution plan in a distributed mode through the cluster includes: when the feature extraction scenario is an offline feature extraction scenario, providing a list of candidate clusters to the user; and executing the generated execution plan in a distributed mode through the cluster selected by the user from the list.

[0017] Optionally, the processing logic for performing data table splicing includes processing logic for performing data table splicing for source fields of features.

[0018] Optionally, the processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and / or performing time series feature extraction in a time window with a window size not equal to 1.

[0019] According to another exemplary embodiment of the present invention, a system for uniformly performing feature extraction is provided, wherein the system includes: a script acquisition device for acquiring a feature extraction script for defining a processing logic related to feature extraction; a plan generation device for parsing the feature extraction script to generate an execution plan for performing feature extraction; and a plan execution device for executing the generated execution plan locally or in a cluster based on a feature extraction scenario.

[0020] Optionally, when the feature extraction scenario is an online feature extraction scenario, the plan execution device executes the generated execution plan in a stand-alone mode through the local machine; and when the feature extraction scenario is an offline feature extraction scenario, the plan execution device executes the generated execution plan in a distributed mode through a cluster.

[0021] Optionally, the plan generating device divides the processing logic defined by the feature extraction script according to the processing order to generate an execution plan for feature extraction.

[0022] Optionally, the processing logic involves feature extraction in at least one time window, and the plan generation device divides the corresponding processing logic in a processing order for each time window to generate an execution plan for feature extraction.

[0023] Optionally, the execution plan is a directed acyclic graph composed of nodes, wherein the nodes correspond to the segmented processing logic, and the plan execution device executes the generated execution plan based on the feature extraction scenario by implementing the processing logic corresponding to each node locally or in a cluster.

[0024] Optionally, the node comprises a computing node corresponding to a processing logic for obtaining features from a data table.

[0025] Optionally, the node further includes a table splicing node corresponding to a processing logic for performing data table splicing and / or a feature splicing node corresponding to a processing logic for performing feature aggregation.

[0026] Optionally, the plan execution device compiles the processing logic corresponding to the computing node into at least one executable file through the local machine or the cluster, and runs the at least one executable file, wherein, in the process of compiling the processing logic corresponding to the computing node into the executable file, the plan execution device replaces common sub-expressions in the processing logic with intermediate variables, and / or compiles part of the processing logic that has a close operation relationship and is independent of other processing logics into the same executable file.

[0027] Optionally, the time window is defined by a source data table, a partition reference field, a time reference field, a time span and / or a window size.

[0028] Optionally, the feature extraction scenario is specified by a user or automatically determined.

[0029] Optionally, when the feature extraction scenario is an offline feature extraction scenario, the plan execution device provides a list of candidate clusters to the user; and executes the generated execution plan in a distributed mode through the cluster selected by the user from the list.

[0030] Optionally, the processing logic for performing data table splicing includes processing logic for performing data table splicing for source fields of features.

[0031] Optionally, the processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and / or performing time series feature extraction in a time window with a window size not equal to 1.

[0032] According to another exemplary embodiment of the present invention, a system is provided, comprising at least one computing device and at least one storage device storing instructions, wherein the instructions, when executed by the at least one computing device, prompt the at least one computing device to execute the method for uniformly performing feature extraction as described above.

[0033] According to another exemplary embodiment of the present invention, a computer-readable storage medium storing instructions is provided, wherein when the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the method of uniformly performing feature extraction as described above.

[0034] According to the method and system for uniformly performing feature extraction of an exemplary embodiment of the present invention, it is possible to support uniform execution of feature extraction in various feature extraction scenarios. As an example, on the one hand, it is possible to be compatible with online feature extraction scenarios and offline feature extraction scenarios, and achieve seamless connection between online feature extraction scenarios and offline feature extraction scenarios, so that there is no need to develop specific operation modes for the same feature extraction script in online feature extraction scenarios and offline feature extraction scenarios, respectively, thereby reducing the workload of developers; on the other hand, it is possible to efficiently perform feature extraction in an offline feature extraction scenario with a higher throughput, and in an online feature extraction scenario, it is possible to perform feature extraction with high real-time performance and low latency. In addition, according to the method and system, it is possible to be compatible with time series feature extraction and non-time series feature extraction.

[0035] Additional aspects and / or advantages of the present general inventive concept will be set forth in part in the following description and in part will be obvious from the description, or may be learned through practice of the present general inventive concept. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The above and other objects and features of the exemplary embodiments of the present invention will become more apparent through the following description in conjunction with the accompanying drawings which exemplarily illustrate the embodiments, in which:

[0037] Figure 1 A flow chart showing a method for uniformly performing feature extraction according to an exemplary embodiment of the present invention is shown;

[0038] Figure 2 shows an example of an execution plan according to an exemplary embodiment of the present invention;

[0039] Figure 3 A flow chart showing a method for uniformly performing feature extraction according to another exemplary embodiment of the present invention is shown;

[0040] Figure 4 A block diagram of a system for uniformly performing feature extraction according to an exemplary embodiment of the present invention is shown. DETAILED DESCRIPTION

[0041] Reference will now be made in detail to embodiments of the present invention, examples of which are shown in the accompanying drawings, wherein like reference numerals refer to like parts throughout. The embodiments will be described below with reference to the drawings in order to explain the present invention.

[0042] Figure 1A flow chart of a method for uniformly performing feature extraction according to an exemplary embodiment of the present invention is shown. Here, as an example, the method can be performed by a computer program, or by a hardware device or a collection of hardware and software resources specifically used to perform machine learning, big data computing, or data analysis, for example, the method can be performed by a machine learning platform for implementing machine learning related services.

[0043] Reference Figure 1 In step S10, a feature extraction script for defining a processing logic related to feature extraction is obtained.

[0044] Here, the processing logic related to feature extraction may include any processing logic related to feature extraction. As an example, the processing logic related to feature extraction may include processing logic for obtaining features from a data table. Here, the data table may be an original data table, or a data table obtained by processing the original data table (for example, splicing multiple original data tables).

[0045] As an example, when the data table is a data table obtained by splicing multiple original data tables, the processing logic related to feature extraction may also include processing logic for splicing data tables. As a preferred example, the processing logic for splicing data tables may include processing logic for splicing data tables for source fields of features. Here, the processing logic for splicing data tables for source fields of features is: processing logic for splicing only the source fields of features in the data tables to be spliced ​​to form a new data table.

[0046] Here, each data record in the data table can be regarded as a description of an event or object, corresponding to an example or sample. The data record includes attribute information that reflects the performance or nature of the event or object in a certain aspect, that is, a field. For example, a row of the data table corresponds to a data record, and a column of the data table corresponds to a field.

[0047] As an example, the processing logic associated with feature extraction may involve feature extraction under one or more time windows. Here, the time window can be used to filter out one or more data records that need to be relied upon when generating features, wherein when the time window is set to include only one data record, it can be used to generate non-time series features, and when the time window is set to include multiple data records, it can be used to generate time series features. It should be understood that the processing logic associated with feature extraction may involve the extraction of one or more features under each time window. As an example, when the processing logic associated with feature extraction involves feature extraction under multiple time windows, the processing logic associated with feature extraction may also include processing logic for feature aggregation.

[0048] As an example, a time window can be defined by a source data table, a partitioning reference field, a time reference field, a time span and / or a window size. Specifically, the source data table of the time window is the data table based on which feature extraction is performed under the time window; the partitioning reference field of the time window is the field (e.g., user ID) based on which data records in the source data table are grouped (i.e., sharded); the time reference field of the time window is the field based on which each group of data records is sorted (e.g., user card swiping time); the time span of the time window is the time range (e.g., one week) corresponding to the time reference field of the data records in the time window, and the window size of the time window is the number of data in the time window, and the window size is an integer greater than zero. It should be understood that when defining a time window, one of the time span and the window size can be set, or both the time span and the window size can be set.

[0049] As an example, when the processing logic related to feature extraction involves feature extraction under multiple time windows, the multiple time windows are different from each other, that is, the multiple time windows are different in at least one of the following items: source data table, partition reference field, time reference field, time span, window size.

[0050] As an example, the processing logic related to feature extraction may involve performing non-temporal feature extraction in a time window with a window size of 1 and / or performing temporal feature extraction in a time window with a window size not of 1.

[0051] Regarding time series feature extraction, time series feature extraction is generally required when processing time series data. Time series data has a strong sequential nature, and the previous and subsequent data generally have dependencies, cycles, and other relationships. For example, transaction data may show a strong correlation over time, so that the statistical results of transaction data can be used as sample features. Therefore, features reflecting time series behavior (e.g., recent transaction habits (such as amount)) can be generated based on time windows. Generally, it is necessary to specify the dimensions of time series data (i.e., the division reference field of the time window), for example, whether to extract relevant features (e.g., time series statistical features about transaction amounts) according to natural persons (e.g., user IDs) or to extract the relevant features according to the card number of the transaction; in addition, it is also necessary to specify the scope of historical data involved in the time series features (i.e., the time span and / or window size of the time window), for example, the transaction amount involved in the last week. The time window corresponding to the time series feature extraction can specify all data records (including current data records and / or historical data records) on which the current feature to be extracted depends, and then the current feature to be extracted can be calculated based on the relevant field values ​​in these data records.

[0052] According to an exemplary embodiment of the present invention, it is possible to consider extracting non-temporal features under a time window with a window size of 1, so that a unified time window setting can be used to be compatible with the extraction of both temporal features and non-temporal features. However, it should be understood that exemplary embodiments of the present invention may also not extract non-temporal features under a time window.

[0053] As an example, when the processing logic related to feature extraction only involves non-temporal feature extraction, the processing logic related to feature extraction may not involve a time window, that is, it is not necessary to set any time window for extracting features.

[0054] As an example, when the processing logic related to feature extraction involves non-temporal feature extraction and temporal feature extraction, the processing logic related to feature extraction may involve non-temporal feature extraction in a time window with a window size of 1 and temporal feature extraction in a time window with a window size not of 1.

[0055] As an example, a feature extraction script for defining a processing logic related to feature extraction can be directly obtained from the outside. As another example, a feature extraction script can be obtained based on a code for defining a processing logic related to feature extraction input by a user through an input box and / or a configuration item for defining a processing logic related to feature extraction configured by a user. For example, the method can be performed by a machine learning platform for executing a machine learning process, and the machine learning platform can provide a graphical interface for configuring a feature extraction process (e.g., an interface for configuring feature engineering) to the user in response to a user operation, wherein the graphical interface may include an input control for inputting a processing logic for defining feature extraction; then, an input operation performed by a user on the input control on the graphical interface can be received, and a feature extraction script for defining a processing logic related to feature extraction can be obtained according to the input operation. As an example, the input control may include a content input box for inputting a code and / or a configuration item for defining a processing logic related to feature extraction, and / or a selection control for selecting between candidate configuration items for processing logic related to feature extraction.

[0056] In step S20, the acquired feature extraction script is parsed to generate an execution plan for feature extraction.

[0057] As an example, the processing logic defined by the acquired feature extraction script can be segmented according to the processing order to generate an execution plan for feature extraction. Since the feature extraction process needs to be executed according to a certain processing order, for example, the feature extraction process needs to sequentially go through data table splicing, obtain features from the data table, summarize the generated features, etc., therefore, the processing logic defined by the acquired feature extraction script can be segmented according to the processing order of the feature extraction process. For example, the processing logic defined by the acquired feature extraction script can be segmented into a processing logic part for data table splicing, a processing logic part for obtaining features from the data table, and a processing logic part for feature summary; then, an execution plan for feature extraction can be generated based on each segmented processing logic part.

[0058] As an example, when the processing logic defined by the acquired feature extraction script involves feature extraction under at least one time window, the corresponding processing logic can be divided according to the processing order for each time window to generate an execution plan for feature extraction. That is, the processing logic corresponding to different time windows will not be divided into the same processing logic part. For example, when the processing logic defined by the acquired feature extraction script involves feature extraction under multiple time windows, the processing logic corresponding to the time window can be divided according to the processing order of the feature extraction process for each time window. For example, the processing logic defined by the acquired feature extraction script can be divided into: a processing logic part for data table splicing and a processing logic part for obtaining features from the data table for each time window, and a processing logic part for feature aggregation of features generated for all time windows; then, an execution plan for feature extraction can be generated based on each divided processing logic part.

[0059] As an example, the execution plan generated for feature extraction can be a directed acyclic graph (DAG graph) composed of nodes, wherein the nodes correspond to the processing logic after segmentation. As an example, the nodes may include a computing node corresponding to the processing logic for obtaining features from a data table. In addition, the nodes may also include a table splicing node corresponding to the processing logic for splicing data tables and / or a feature splicing node corresponding to the processing logic for performing feature aggregation. As an example, the processing logic for obtaining features from a data table for different time windows may correspond to different computing nodes, and the processing logic for splicing out different data tables may correspond to different table splicing nodes. It should be understood that the connection relationship between the nodes corresponding to the processing logic parts after each segmentation can be determined based on the relationship between the input variables and / or output variables of the processing logic parts after segmentation.

[0060] Figure 2 An example of an execution plan according to an exemplary embodiment of the present invention is shown. Figure 2 As shown, the processing logic defined by the acquired feature extraction script can be divided into the following according to the processing order of the feature extraction process: a processing logic part for data table splicing for time window 1 (for example, a processing logic part for splicing data table 1 and data table 2 to obtain the source data table of time window 1), a processing logic part for time window 1 for obtaining features from the data table (i.e., performing feature extraction), a processing logic part for data table splicing for time window 2 (for example, a processing logic part for splicing data table 1 and data table 3 to obtain the source data table of time window 2), a processing logic part for time window 2 for obtaining features from the data table, and a processing logic part for summarizing the features obtained based on time window 1 and the features obtained based on time window 2. Then, based on the divided processing logic parts, the following can be generated: Figure 2 The directed acyclic graph composed of nodes shown in the figure (i.e., an execution plan for feature extraction) corresponds to the table splicing node 1 and the processing logic part for data table splicing for time window 1, the computing node 1 corresponds to the processing logic part for obtaining features from the data table for time window 1, the table splicing node 2 corresponds to the processing logic part for data table splicing for time window 2, the computing node 2 corresponds to the processing logic part for obtaining features from the data table for time window 2, and the feature splicing node corresponds to the processing logic part for aggregating features obtained based on time window 1 and features obtained based on time window 2.

[0061] return Figure 1 In step S30, based on the feature extraction scenario, the generated execution plan is executed by the local machine or the cluster. As an example, the feature extraction scenario can be an online feature extraction scenario or an offline feature extraction scenario.

[0062] As an example, when the generated execution plan is a directed acyclic graph composed of nodes, based on the feature extraction scenario, the generated execution plan can be executed by implementing the processing logic corresponding to each node on the local machine or cluster according to the connection relationship between the nodes in the directed acyclic graph.

[0063] As an example, implementing the processing logic corresponding to the computing node by the local machine or cluster may include: directly running the computing node by the local machine or cluster. As another example, implementing the processing logic corresponding to the computing node by the local machine or cluster may include: compiling the processing logic corresponding to the computing node into at least one executable file by the local machine or cluster, and running the at least one executable file. Preferably, when compiling into an executable file, corresponding optimization may be performed.

[0064] As a preferred example, in the process of compiling the processing logic corresponding to the computing node into an executable file, the common sub-expression in the processing logic can be replaced by an intermediate variable. For example, when the processing logic corresponding to the computing node includes f1=discrete(max(col1)) and f2=continous(max(col1)), in the process of compiling the processing logic corresponding to the computing node into an executable file, the common sub-expression max(col1) can be used as an intermediate variable, that is, let a=max(col1), f1=discrete(a), f2=continous(a), so that when executing the corresponding executable file, it is only necessary to calculate the value of a once, and f1 and f2 can reuse the calculation result of a. By reusing intermediate variables, the reuse of intermediate calculation results can be achieved, thereby reducing the amount of calculation in the feature extraction process and improving the execution efficiency of the feature extraction process.

[0065] As a preferred example, in the process of compiling the processing logic corresponding to the computing node into an executable file, part of the processing logic that has a close operational relationship and is independent of other processing logics can be compiled into the same executable file. For example, the part of the processing logic that has a close operational relationship and is independent of other processing logics can be a part of the processing logic that uses the same common sub-expression and is not logically related to other processing logics. In this way, the part of the processing logic can share intermediate variables, and since different executable files do not share intermediate variables, different executable files can be executed in parallel. Therefore, according to the above method, the JIT (Just-In-Time) function of the compiler can be reused to improve the execution efficiency of the code in the compiled executable file, and logical isolation can be done for the concurrent execution feature extraction process to realize the parallel execution of multiple executable files.

[0066] As an example, for each computing node, the processing logic corresponding to the computing node may be compiled into at least one executable file.

[0067] Figure 3 A flowchart of a method for uniformly performing feature extraction according to another exemplary embodiment of the present invention is shown. Here, step S30 specifically includes step S301, step S302 and step S303. Step S10 and step S20 can refer to the method according to Figure 1 and Figure 2 The specific implementation method described is implemented and will not be repeated here.

[0068] In step S301, a feature extraction scenario is determined.

[0069] As an example, a feature extraction scenario specified by a user may be obtained. For example, the method may be performed by a machine learning platform for performing a machine learning process, and the machine learning platform may provide a graphical interface for specifying a feature extraction scenario to the user, and obtain the feature extraction scenario specified by the user according to an input operation performed by the user through the graphical interface.

[0070] As another example, the feature extraction scenario can be automatically determined. For example, when the current machine learning scenario is a machine learning scenario for training a machine learning model, the feature extraction scenario can be automatically determined as an offline feature extraction scenario; when the current machine learning scenario is a machine learning scenario for estimating using a trained machine learning model, the feature extraction scenario can be automatically determined as an online feature extraction scenario.

[0071] When it is determined in step S301 that the feature extraction scenario is an online feature extraction scenario, the generated execution plan is executed by the local machine in a stand-alone mode. As an example, the generated execution plan can be executed by the local machine in a stand-alone mode based on a memory database. For example, the processing logic for data table splicing and / or the processing logic for feature aggregation can be implemented by the local machine's memory database.

[0072] When it is determined in step S301 that the feature extraction scenario is an offline feature extraction scenario, step S303 is executed to execute the generated execution plan in a distributed mode through the cluster. In other words, the generated execution plan can be executed in parallel by multiple computing devices in the cluster. It should be noted that the computing device mentioned here can indicate both a physical entity and a virtual entity. For example, the computing device can indicate an actual computing machine or a logical entity deployed on the computing machine.

[0073] As an example, the generated execution plan can be executed in a distributed mode through a cluster based on the parallel computing framework Spark. For example, the processing logic for data table splicing, the processing logic for feature aggregation, and other processing logic can be implemented through the underlying interface of Spark. For example, the generated execution plan for feature extraction can be distributed to each computing device in the cluster based on Spark, so that each computing device executes the generated execution plan based on the data stored therein and returns the execution result. In addition, the generated execution plan can also be executed in a distributed mode through a cluster based on other parallel computing frameworks.

[0074] As an example, step S303 may include: providing a list of candidate clusters to the user; and then executing the generated execution plan in a distributed mode through the cluster selected by the user from the list.

[0075] According to the method for uniformly executing feature extraction of an exemplary embodiment of the present invention, for the same feature extraction script, a unified execution plan is executed by the local machine or the cluster according to the feature extraction scenario. As an example, in the online feature extraction scenario, the execution plan generated by the local machine is executed, and in the offline feature extraction scenario, the execution plan generated by the cluster is executed. On the one hand, it can be compatible with the online feature extraction scenario and the offline feature extraction scenario, and realizes the seamless connection between the online feature extraction scenario and the offline feature extraction scenario. Therefore, there is no need to develop specific operation modes for the online feature extraction scenario and the offline feature extraction scenario for the same feature extraction script, respectively, reducing the workload of developers; on the other hand, it can efficiently perform feature extraction in a high throughput manner in the offline feature extraction scenario, and can perform feature extraction with high real-time performance and low latency in the online feature extraction scenario.

[0076] As an example, step S303 may include: performing the following operations in a distributed mode through a cluster to implement the processing logic of feature extraction under the time window corresponding to the computing node: dividing the data records with the same partition reference field value in the source data table of the time window into the same group (that is, different groups correspond to different partition reference field values), and sorting the data records in the same group in the order of the time reference field value from small to large (that is, the order of time corresponding to the time reference field value); then, based on the sorted data records in the same group, feature extraction is performed under the time window, specifically, for the current data record, each data record in the corresponding time window can be used to process the value of the source field on which each feature depends to obtain each feature, wherein each data record in the time window is filtered out from the corresponding group by time span and / or window size.

[0077] As an example, step S302 may include: performing the following operations by the local machine in stand-alone mode to implement the processing logic for feature extraction in a time window corresponding to the computing node: for the current data record, each data record in the corresponding time window can be used to process the value of the source field on which each feature depends to obtain the said each feature, wherein each data record in the time window is filtered out from the corresponding group by time span and / or window size.

[0078] Figure 4 1 is a block diagram of a system for uniformly performing feature extraction according to an exemplary embodiment of the present invention. Figure 4 As shown, a system for uniformly performing feature extraction according to an exemplary embodiment of the present invention includes: a script acquisition device 10, a plan generation device 20 and a plan execution device 30.

[0079] Specifically, the script acquisition device 10 is used to acquire a feature extraction script for defining a processing logic related to feature extraction.

[0080] Here, the processing logic related to feature extraction may include any processing logic related to feature extraction. As an example, the processing logic related to feature extraction may include processing logic for obtaining features from a data table. Here, the data table may be an original data table, or a data table obtained by processing the original data table (for example, splicing multiple original data tables).

[0081] As an example, when the data table is a data table obtained by splicing multiple original data tables, the processing logic related to feature extraction may also include processing logic for splicing data tables. As a preferred example, the processing logic for splicing data tables may include processing logic for splicing data tables for source fields of features. Here, the processing logic for splicing data tables for source fields of features is: processing logic for splicing only the source fields of features in the data tables to be spliced ​​to form a new data table.

[0082] As an example, the processing logic associated with feature extraction may involve feature extraction under one or more time windows. Here, the time window can be used to filter out one or more data records that need to be relied upon when generating features, wherein when the time window is set to include only one data record, it can be used to generate non-time series features, and when the time window is set to include multiple data records, it can be used to generate time series features. It should be understood that the processing logic associated with feature extraction may involve the extraction of one or more features under each time window. As an example, when the processing logic associated with feature extraction involves feature extraction under multiple time windows, the processing logic associated with feature extraction may also include processing logic for feature aggregation.

[0083] As an example, a time window can be defined by a source data table, a partitioning reference field, a time reference field, a time span and / or a window size. Specifically, the source data table of the time window is the data table based on which feature extraction is performed under the time window; the partitioning reference field of the time window is the field (e.g., user ID) based on which data records in the source data table are grouped (i.e., sharded); the time reference field of the time window is the field based on which each group of data records is sorted (e.g., user card swiping time); the time span of the time window is the time range (e.g., one week) corresponding to the time reference field of the data records in the time window; the window size of the time window is the number of data in the time window, and the window size is an integer greater than zero. It should be understood that when defining a time window, one of the time span and the window size can be set, or both the time span and the window size can be set.

[0084] As an example, when the processing logic related to feature extraction involves feature extraction under multiple time windows, the multiple time windows are different from each other, that is, the multiple time windows are different in at least one of the following items: source data table, partition reference field, time reference field, time span, window size.

[0085] As an example, the processing logic related to feature extraction may involve performing non-temporal feature extraction in a time window with a window size of 1 and / or performing temporal feature extraction in a time window with a window size not of 1.

[0086] As an example, the script acquisition device 10 may directly acquire a feature extraction script for defining a processing logic related to feature extraction from the outside. As another example, the script acquisition device 10 may acquire a feature extraction script based on a code for defining a processing logic related to feature extraction input by a user through an input box and / or a configuration item for defining a processing logic related to feature extraction configured by a user.

[0087] The plan generating device 20 is used to parse the feature extraction script to generate an execution plan for feature extraction.

[0088] As an example, the plan generating device 20 may divide the processing logic defined by the feature extraction script according to the processing order to generate an execution plan for feature extraction.

[0089] As an example, when the processing logic involves feature extraction in at least one time window, the plan generating device 20 may divide the corresponding processing logic in the processing order for each time window to generate an execution plan for feature extraction.

[0090] As an example, the execution plan generated for feature extraction can be a directed acyclic graph (DAG graph) composed of nodes, wherein the nodes correspond to the processing logic after segmentation. As an example, the nodes may include a computing node corresponding to the processing logic for obtaining features from a data table. In addition, the nodes may also include a table splicing node corresponding to the processing logic for splicing data tables and / or a feature splicing node corresponding to the processing logic for performing feature aggregation. As an example, the processing logic for obtaining features from a data table for different time windows may correspond to different computing nodes, and the processing logic for splicing out different data tables may correspond to different table splicing nodes. It should be understood that the connection relationship between the nodes corresponding to the processing logic parts after each segmentation can be determined based on the relationship between the input variables and / or output variables of the processing logic parts after segmentation.

[0091] The plan execution device 30 is used to execute the generated execution plan by the local machine or the cluster based on the feature extraction scenario. As an example, the feature extraction scenario can be an online feature extraction scenario or an offline feature extraction scenario.

[0092] As an example, the plan execution device 30 may obtain a feature extraction scenario specified by a user. For example, the system may be deployed on a machine learning platform for executing a machine learning process, a display device may provide a graphical interface for specifying a feature extraction scenario to a user, and the plan execution device 30 may obtain the feature extraction scenario specified by the user according to an input operation performed by the user through the graphical interface.

[0093] As another example, the plan execution device 30 may automatically determine the feature extraction scenario. For example, when the current machine learning scenario is a machine learning scenario for training a machine learning model, the plan execution device 30 may automatically determine the feature extraction scenario as an offline feature extraction scenario; when the current machine learning scenario is a machine learning scenario for estimating using a trained machine learning model, the plan execution device 30 may automatically determine the feature extraction scenario as an online feature extraction scenario.

[0094] As an example, the plan execution device 30 can execute the generated execution plan in a stand-alone mode by the local machine when the feature extraction scenario is an online feature extraction scenario. As an example, the system can be deployed on a machine learning platform for executing a machine learning process, and the local machine is a computing device currently using the machine learning platform for feature extraction.

[0095] As an example, the plan execution device 30 may execute the generated execution plan in a distributed mode through a cluster when the feature extraction scenario is an offline feature extraction scenario.

[0096] As an example, the plan execution device 30 may execute the generated execution plan in a distributed mode through a cluster based on the parallel computing framework Spark.

[0097] As an example, when the execution plan is a directed acyclic graph composed of nodes, the plan execution device 30 can execute the generated execution plan based on the feature extraction scenario by implementing the processing logic corresponding to each node locally or in a cluster.

[0098] As an example, the plan execution device 30 can compile the processing logic corresponding to the computing node into at least one executable file through the local machine or cluster, and run the at least one executable file. Preferably, the plan execution device 30 can perform corresponding optimization when compiling the executable file.

[0099] As an example, the plan execution device 30 may replace common sub-expressions in the processing logic corresponding to the computing node with intermediate variables when compiling the processing logic corresponding to the computing node into an executable file.

[0100] As an example, the plan execution device 30 may compile part of the processing logic that has a close computational relationship and is independent of other processing logics into the same executable file when compiling the processing logic corresponding to the computing node into an executable file.

[0101] As an example, when the feature extraction scenario is an offline feature extraction scenario, the plan execution device 30 may provide a list of candidate clusters to the user; and execute the generated execution plan in a distributed mode through the cluster selected by the user from the list.

[0102] It should be understood that the specific implementation of the system for uniformly performing feature extraction according to the exemplary embodiment of the present invention can be referred to in conjunction with Figures 1 to 3 The relevant specific implementation methods described are implemented and will not be repeated here.

[0103] The devices included in the system for uniformly performing feature extraction according to an exemplary embodiment of the present invention may be configured as software, hardware, firmware, or any combination of the above items to perform specific functions. For example, these devices may correspond to a dedicated integrated circuit, or may correspond to pure software code, or may correspond to a module combining software and hardware. In addition, one or more functions implemented by these devices may also be uniformly executed by components in a physical entity device (e.g., a processor, a client, or a server, etc.).

[0104] It should be understood that the method for uniformly performing feature extraction according to an exemplary embodiment of the present invention can be implemented by a program recorded on a computer-readable medium. For example, according to an exemplary embodiment of the present invention, a computer-readable medium for uniformly performing feature extraction can be provided, wherein a computer program for executing the following method steps is recorded on the computer-readable medium: obtaining a feature extraction script for defining processing logic related to feature extraction; parsing the feature extraction script to generate an execution plan for performing feature extraction; and executing the generated execution plan locally or in a cluster based on the feature extraction scenario.

[0105] The computer program in the computer-readable medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. It should be noted that the computer program can also be used to perform additional steps in addition to the above steps or perform more specific processing when performing the above steps. The contents of these additional steps and further processing have been referred to in Figures 1 to 3 The description has been made, and will not be repeated here to avoid repetition.

[0106] It should be noted that the system for uniformly performing feature extraction according to an exemplary embodiment of the present invention can completely rely on the operation of a computer program to implement the corresponding functions, that is, each device corresponds to each step in the functional architecture of the computer program, so that the entire system is called through a special software package (for example, a lib library) to implement the corresponding functions.

[0107] On the other hand, the various devices included in the system for uniformly performing feature extraction according to an exemplary embodiment of the present invention may also be implemented by hardware, software, firmware, middleware, microcode, or any combination thereof. When implemented by software, firmware, middleware, or microcode, the program code or code segment for performing the corresponding operation may be stored in a computer-readable medium such as a storage medium, so that the processor can perform the corresponding operation by reading and running the corresponding program code or code segment.

[0108] For example, an exemplary embodiment of the present invention may also be implemented as a computing device, which includes a storage component and a processor, wherein a computer executable instruction set is stored in the storage component, and when the computer executable instruction set is executed by the processor, a method for uniformly performing feature extraction is performed.

[0109] Specifically, the computing device may be deployed in a server or client, or may be deployed on a node device in a distributed network environment. In addition, the computing device may be a PC, a tablet device, a personal digital assistant, a smart phone, a web application, or other device capable of executing the above instruction set.

[0110] Here, the computing device is not necessarily a single computing device, but may be any device or circuit collection that can execute the above instructions (or instruction sets) individually or jointly. The computing device may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0111] In the computing device, the processor may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. By way of example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0112] Some operations described in the method for uniformly performing feature extraction according to an exemplary embodiment of the present invention may be implemented by software, some operations may be implemented by hardware, and furthermore, these operations may be implemented by a combination of software and hardware.

[0113] The processor may execute instructions or codes stored in one of the storage components, which may also store data. Instructions and data may also be sent and received over a network via a network interface device, which may employ any known transmission protocol.

[0114] The storage component may be integrated with the processor, for example, RAM or flash memory is arranged within an integrated circuit microprocessor, etc. In addition, the storage component may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The storage component and the processor may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor can read files stored in the storage component.

[0115] In addition, the computing device may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the computing device may be connected to each other via a bus and / or a network.

[0116] The operations involved in the method for uniformly performing feature extraction according to an exemplary embodiment of the present invention can be described as various interconnected or coupled functional blocks or functional diagrams. However, these functional blocks or functional diagrams can be equally integrated into a single logical device or operated according to non-exact boundaries.

[0117] For example, as described above, a computing device that uniformly performs feature extraction according to an exemplary embodiment of the present invention may include a storage component and a processor, wherein a set of computer-executable instructions is stored in the storage component, and when the set of computer-executable instructions is executed by the processor, the following steps are performed: obtaining a feature extraction script for defining processing logic related to feature extraction; parsing the feature extraction script to generate an execution plan for performing feature extraction; and executing the generated execution plan locally or in a cluster based on a feature extraction scenario.

[0118] The above describes various exemplary embodiments of the present invention, it should be understood that the above description is only exemplary, not exhaustive, and the present invention is not limited to the disclosed exemplary embodiments. Without departing from the scope and spirit of the present invention, many modifications and changes are obvious to those of ordinary skill in the art. Therefore, the scope of protection of the present invention should be based on the scope of the claims.

Claims

1. A method for uniformly performing feature extraction, wherein: The method comprises: Obtain a feature extraction script for defining processing logic related to feature extraction; parsing the feature extraction script to generate an execution plan for performing feature extraction; and Based on the feature extraction scenario, the generated execution plan is executed locally or in a cluster; Among them, when the feature extraction includes non-time series feature extraction and time series feature extraction, the processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and performing time series feature extraction in a time window with a window size not of 1; and the step of parsing the feature extraction script to generate an execution plan for feature extraction includes: for each time window, splitting the processing logic to generate an execution plan for feature extraction.

2. The method according to claim 1, wherein: The steps of executing the generated execution plan based on the feature extraction scenario on the local machine or cluster include: When the feature extraction scenario is an online feature extraction scenario, the generated execution plan is executed by the local machine in a stand-alone mode; and When the feature extraction scenario is an offline feature extraction scenario, the generated execution plan is executed in a distributed mode through the cluster.

3. The method according to claim 1, wherein: The step of parsing the feature extraction script to generate an execution plan for feature extraction includes: The processing logic defined in the feature extraction script is divided according to the processing order to generate an execution plan for feature extraction.

4. The method according to claim 3, wherein: The processing logic involves performing feature extraction under at least one time window, and, The step of dividing the processing logic defined by the feature extraction script according to the processing order to generate an execution plan for feature extraction includes: for each time window, dividing the corresponding processing logic according to the processing order to generate an execution plan for feature extraction.

5. The method according to claim 4, wherein: The execution plan is a directed acyclic graph consisting of nodes, wherein the nodes correspond to the processing logic after segmentation. Furthermore, the step of executing the generated execution plan by the local machine or the cluster based on the feature extraction scenario includes: based on the feature extraction scenario, executing the generated execution plan by implementing the processing logic corresponding to each node by the local machine or the cluster.

6. The method according to claim 5, wherein: The nodes include computing nodes corresponding to processing logic for obtaining features from a data table.

7. The method according to claim 6, wherein: The nodes also include table splicing nodes corresponding to the processing logic for performing data table splicing and / or feature splicing nodes corresponding to the processing logic for performing feature aggregation.

8. The method according to claim 6, wherein: Implementing the processing logic corresponding to the computing node by the local machine or the cluster includes: compiling the processing logic corresponding to the computing node into at least one executable file by the local machine or the cluster, and running the at least one executable file, In the process of compiling the processing logic corresponding to the computing node into an executable file, the common sub-expressions in the processing logic are replaced by intermediate variables, and / or part of the processing logic that has a close operation relationship and is independent of other processing logics is compiled into the same executable file.

9. The method according to claim 4, wherein: The time window is defined by a source data table, a partition reference field, a time reference field, a time span and / or a window size.

10. The method according to claim 1, wherein: The feature extraction scenario is specified by a user or automatically determined.

11. The method according to claim 2, wherein: When the feature extraction scenario is an offline feature extraction scenario, the steps of executing the generated execution plan in a distributed mode through the cluster include: When the feature extraction scenario is an offline feature extraction scenario, providing a list of candidate clusters to a user; and The generated execution plan is executed in distributed mode over the cluster selected by the user from the list.

12. The method according to claim 7, wherein: The processing logic for performing data table splicing includes processing logic for performing data table splicing on source fields of features.

13. The method according to claim 9, wherein: The processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and / or performing time series feature extraction in a time window with a window size not of 1.

14. A system for uniformly performing feature extraction, wherein: The system comprises: A script acquisition device, which acquires a feature extraction script for defining a processing logic related to feature extraction; a plan generating device, parsing the feature extraction script to generate an execution plan for performing feature extraction; and A plan execution device, based on the feature extraction scenario, executes the generated execution plan locally or in a cluster; Among them, when the feature extraction includes non-time series feature extraction and time series feature extraction, the processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and performing time series feature extraction in a time window with a window size not equal to 1; and, the plan generation device divides the processing logic for each time window to generate an execution plan for feature extraction.

15. The system of claim 14, wherein: The plan execution device executes the generated execution plan in a stand-alone mode by the local machine when the feature extraction scenario is an online feature extraction scenario; as well as The plan execution device executes the generated execution plan in a distributed mode through the cluster when the feature extraction scenario is an offline feature extraction scenario.

16. The system of claim 14, wherein: The plan generating device divides the processing logic defined by the feature extraction script according to the processing order to generate an execution plan for feature extraction.

17. The system of claim 16, wherein: The processing logic involves performing feature extraction under at least one time window, and, The plan generating device divides the corresponding processing logic according to the processing order for each time window to generate an execution plan for feature extraction.

18. The system of claim 17, wherein: The execution plan is a directed acyclic graph consisting of nodes, wherein the nodes correspond to the processing logic after segmentation. Furthermore, the plan execution device executes the generated execution plan based on the feature extraction scenario by implementing the processing logic corresponding to each node locally or in a cluster.

19. The system of claim 18, wherein: The nodes include computing nodes corresponding to processing logic for obtaining features from a data table.

20. The system of claim 19, wherein: The nodes also include table splicing nodes corresponding to the processing logic for performing data table splicing and / or feature splicing nodes corresponding to the processing logic for performing feature aggregation.

21. The system of claim 19, wherein: The plan execution device compiles the processing logic corresponding to the computing node into at least one executable file through the local machine or the cluster, and runs the at least one executable file. In the process of compiling the processing logic corresponding to the computing node into an executable file, the plan execution device replaces the common sub-expressions in the processing logic with intermediate variables, and / or compiles part of the processing logic that has a close operation relationship and is independent of other processing logics into the same executable file.

22. The system of claim 17, wherein: The time window is defined by a source data table, a partition reference field, a time reference field, a time span and / or a window size.

23. The system of claim 14, wherein: The feature extraction scenario is specified by a user or automatically determined.

24. The system of claim 15, wherein: When the feature extraction scenario is an offline feature extraction scenario, the plan execution device provides a list of candidate clusters to the user; and executes the generated execution plan in a distributed mode through the cluster selected by the user from the list.

25. The system of claim 20, wherein: The processing logic for performing data table splicing includes processing logic for performing data table splicing on source fields of features.

26. The system of claim 22, wherein: The processing logic involves performing non-time series feature extraction in a time window with a window size of 1 and / or performing time series feature extraction in a time window with a window size not of 1.

27. A system comprising at least one computing device and at least one storage device storing instructions, wherein: When the instructions are executed by the at least one computing device, the at least one computing device is prompted to perform the method for uniformly performing feature extraction as claimed in any one of claims 1 to 13.

28. A computer-readable storage medium storing instructions, wherein: When the instructions are executed by at least one computing device, the at least one computing device is prompted to execute the method for uniformly performing feature extraction as claimed in any one of claims 1 to 13.