Method and device for realizing machine learning, electronic equipment and storage medium

By converting SQL statements into target statements supported by the underlying engine, it solves the problem of developers needing to learn multiple programming languages ​​to implement machine learning tasks, reduces learning costs and limitations, improves development efficiency, and provides convenient editing. Interface operation.

CN118535585APending Publication Date: 2024-08-23BEIJING HONGTENG INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310193266.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, developers need to learn multiple programming languages ​​to implement machine learning tasks, which results in high learning costs and limitations. It cannot effectively reduce developers' learning costs and the limitations of implementing machine learning tasks.

Method used

By obtaining the structured query language SQL statement corresponding to the target machine learning task, and converting it into a target statement with the same semantics, so that it can be supported by the underlying engine, thereby executing the machine learning task and reducing unfamiliarity with complex programming languages ​​and rules. reduce developer learning costs and overcome the limitations of implementing machine learning tasks.

Benefits of technology

It enables developers who are not familiar with complex programming languages ​​and rules to perform machine learning tasks through SQL statements, reducing learning costs, improving development efficiency, simplifying the process, and displaying input and execution results on the editing interface to achieve convenient machine learning task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535585A
    Figure CN118535585A
Patent Text Reader

Abstract

The invention provides a method and device for achieving machine learning, electronic equipment and a storage medium. The method comprises the steps that firstly, a structured query language (SQL) statement corresponding to a target machine learning task is obtained; converting the SQL statement into a target statement with the same semantics as the SQL statement, wherein the target statement can be supported by a bottom engine; and executing the target statement through an underlying engine to realize a target machine learning task. By means of the method, developers unfamiliar with complex programming languages and rules can execute the machine learning task through the SQL statement, the learning cost of the developers unfamiliar with complex programming languages and rules can be reduced, and the limitation of achieving the machine learning task can be overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a method, device, electronic device and storage medium for implementing machine learning. Background Art

[0002] Nowadays, with the continuous advancement of science and technology, artificial intelligence technology is being used more and more widely in people's daily lives. As the core of artificial intelligence technology, machine learning has also become a research focus for researchers. At present, machine learning has been widely used, such as data mining, computer vision, natural language processing, biometric recognition, search engines, etc. Generally speaking, Python programming language is needed to implement machine learning tasks.

[0003] However, most developers use different programming languages, and for the same programming language, there are different technical frameworks, but the functions implemented by these programming languages ​​are similar. If developers need to relearn other programming languages ​​to implement machine learning tasks, they need to invest a lot of learning costs. If machine learning tasks can only be implemented through some specific programming languages, there will be certain limitations.

[0004] Therefore, how to reduce the learning cost of developers and overcome the limitations of implementing machine learning tasks has become an urgent problem to be solved. Summary of the invention

[0005] The present application provides a method, apparatus, device and storage medium for implementing machine learning, which can reduce the learning cost of developers and overcome the limitations of implementing machine learning tasks.

[0006] In a first aspect, a method for implementing machine learning is provided, the method comprising: obtaining a structured query language SQL statement corresponding to a target machine learning task; converting the SQL statement into a target statement with the same semantics as the SQL statement, and the target statement can be supported by an underlying engine; and executing the target statement through the underlying engine to implement the target machine learning task.

[0007] In the above technical solution, a structured query language SQL statement corresponding to the target machine learning task is first obtained; then the SQL statement is converted into a target statement with the same semantics as the SQL statement, and the target statement can be supported by the underlying engine; then the target statement is executed by the underlying engine to achieve the target machine learning task. Through the above method, developers who are not familiar with complex programming languages ​​and rules can also perform machine learning tasks through SQL statements, which can reduce the learning cost of developers who are not familiar with complex programming languages ​​and rules, and can overcome the limitations of achieving machine learning tasks.

[0008] In combination with the first aspect, in certain implementations of the first aspect, the SQL statement is expressed in a preset grammar, and the SQL statement is converted into a target statement with the same semantics as the SQL statement, including: parsing the SQL statement according to the preset grammar to obtain the semantics of the SQL statement; and converting the SQL statement into the target statement with the same semantics as the SQL statement according to the semantics of the SQL statement.

[0009] In combination with the first aspect and the above-mentioned implementations, in some implementations of the first aspect, the preset grammar is formed in the following manner: based on the SQL grammar of the underlying engine, a machine learning operator is added to form the preset grammar.

[0010] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, the SQL statement is converted into a target statement with the same semantics as the SQL statement, including: when the underlying engine supports the SQL statement, adding an objective function corresponding to the target machine learning task to the SQL statement to form the target statement.

[0011] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, when the underlying engine does not support the SQL statement, the SQL statement is converted into a target type of code; wherein the target type of code can be supported by the underlying engine; and the target statement is formed based on the target type of code.

[0012] In combination with the first aspect and the above-mentioned implementation methods, in some implementation methods of the first aspect, obtaining the structured query language SQL statement corresponding to the target machine learning task includes: displaying an editing interface; obtaining the SQL statement corresponding to the target machine learning task entered through the editing interface.

[0013] In combination with the first aspect and the above-mentioned implementation manners, in some implementation manners of the first aspect, the method further includes: displaying the execution result of the target statement on the editing interface.

[0014] Through the above method, the structured query language SQL statement corresponding to the target machine learning task input through the editing interface is first obtained, and then the SQL statement is converted into a target statement with the same semantics as the SQL statement, and the target statement can be supported by the underlying engine; then the target statement is executed by the underlying engine to achieve the target machine learning task. Through the above method, developers who are not familiar with big data development languages ​​and rules can also perform machine learning tasks through SQL statements, which can reduce the learning cost of developers who are not familiar with big data development languages ​​and rules. In addition, the input SQL statement and the result of executing the target statement can also be displayed on the editing interface. Developers can modify the input SQL statement at any time during the editing process of the SQL statement, and there is no need for complex compilation and saving. After the SQL statement is converted, the execution result can be directly obtained, which is more convenient to use.

[0015] In a second aspect, a device for implementing machine learning is provided, which includes: an acquisition module for acquiring a structured query language SQL statement corresponding to a target machine learning task; a conversion module for converting the SQL statement into a target statement with the same semantics as the SQL statement, and the target statement can be supported by an underlying engine; and an execution module for executing the target statement through the underlying engine to implement the target machine learning task.

[0016] In combination with the second aspect, in certain implementations of the second aspect, the conversion module is specifically used to: parse the SQL statement according to the preset grammar to obtain the semantics of the SQL statement; and convert the SQL statement into the target statement having the same semantics as the SQL statement according to the semantics of the SQL statement.

[0017] In combination with the second aspect, in certain implementations of the second aspect, the preset grammar is formed in the following manner: based on the SQL grammar of the underlying engine, a machine learning operator is added to form the preset grammar.

[0018] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the SQL statement is converted into the target statement with the same semantics as the SQL statement, including: when the underlying engine supports the SQL statement, adding an objective function corresponding to the target machine learning task to the SQL statement to form the target statement.

[0019] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the SQL statement is converted into the target statement with the same semantics as the SQL statement, including: when the underlying engine does not support the SQL statement, converting the SQL statement into a target type of code; wherein the target type of code can be supported by the underlying engine; and forming the target statement according to the target type of code.

[0020] In combination with the second aspect and the above-mentioned implementation methods, in some implementation methods of the second aspect, the acquisition module is specifically used to: display an editing interface; and obtain the SQL statement corresponding to the target machine learning task entered through the editing interface.

[0021] In combination with the second aspect and the above-mentioned implementation manners, in some implementation manners of the second aspect, the device further includes: a display module, which is used to display the execution result of the target statement on the editing interface.

[0022] In a third aspect, an electronic device is provided, comprising a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method for implementing machine learning in the above-mentioned first aspect and any possible implementation of the first aspect.

[0023] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method for implementing machine learning in the above-mentioned first aspect and any possible implementation of the first aspect.

[0024] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method for implementing machine learning in the above-mentioned first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a schematic flow chart of a method for implementing machine learning provided in an embodiment of the present application;

[0026] Figure 2 is a schematic flow chart of another method for implementing machine learning provided in an embodiment of the present application;

[0027] Figure 3 is a schematic flow chart of another method for implementing machine learning provided in an embodiment of the present application;

[0028] Figure 4 is a schematic diagram of the structure of a device for implementing machine learning provided in an embodiment of the present application;

[0029] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0031] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0032] Figure 1 1 is a schematic flow chart of a method for implementing machine learning provided in an embodiment of the present application. The method for implementing machine learning provided in an embodiment of the present application can be applied to electronic devices, and the electronic devices can be tablet computers, laptop computers, ultra mobile personal computers (UMPCs), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.

[0033] For example, Figure 1 As shown, the method 100 includes:

[0034] S101, obtaining a structured query language SQL statement corresponding to a target machine learning task.

[0035] Among them, Structured Query Language (SQL) is a database language with multiple functions such as data manipulation and data definition. This language is interactive and can provide great convenience for users. SQL language can not only be used independently in terminals, but also can be used as a sub-language to provide effective assistance for other program designs.

[0036] Specifically, the SQL statement corresponding to the target machine learning task can be input by the developer in order to achieve the target machine learning task.

[0037] Exemplarily, the machine learning task may be a regression task, a classification task, a clustering task, a dimensionality reduction task, etc. The embodiments of the present application do not limit the type of machine learning tasks.

[0038] Specifically, the regression task in the machine learning task can be to predict a specific value based on the input data, such as predicting housing prices, predicting stock market conditions, and predicting weather conditions, etc. For example, the developer can complete the prediction of housing prices by inputting SQL statements related to predicting housing prices, that is, the SQL statements obtained in S101 can be SQL statements related to predicting housing prices.

[0039] S102: Convert the SQL statement into a target statement having the same semantics as the SQL statement.

[0040] It should be understood that the target statement is a statement that can be supported by the underlying engine, that is, the target statement is a statement that can be recognized by the underlying engine. The target statement with the same semantics as the SQL statement can be a quasi-SQL statement, so that the embodiment of the present application can implement machine learning tasks based on quasi-SQL statements.

[0041] Optionally, the target statement may be Python code, C++ code, Java code, C# code, etc. having the same semantics as the SQL statement. The embodiment of the present application does not limit the type of the target statement.

[0042] S103, executing the target statement through the underlying engine to achieve the target machine learning task.

[0043] It should be understood that in the embodiments of the present application, the underlying engine can be understood as a big data processing framework. At present, there are two major demands for big data processing, one is batch processing and the other is stream processing. In practical applications, only batch processing or stream processing may be required, or both batch processing and stream processing may be required. Therefore, illustratively, the big data processing framework can generally include: a batch processing framework, a stream processing framework, and a batch + stream processing framework. Among them, the batch processing framework can be Apache Hadoop, the stream processing framework can be Apache Storm or Apache Samza, and the batch + stream processing framework can be Apache Spark or Apache Flink.

[0044] Specifically, the batch processing framework can be mainly used to operate large-capacity static data sets. The stream processing framework mainly performs computational operations on data entering the system in real time. The batch + stream processing framework can not only provide the methods required to process data, but also provide its own integrated items, libraries, and tools to meet the needs of various scenarios such as graphic analysis, machine learning, and interactive queries. Therefore, in the embodiment of the present application, the batch + stream processing framework, namely Apache Spark and Apache Flink, can be used to achieve the target machine learning task.

[0045] The embodiment of the present application provides a method for implementing machine learning, which first obtains a structured query language SQL statement corresponding to a target machine learning task; then converts the SQL statement into a target statement with the same semantics as the SQL statement, and the target statement can be supported by the underlying engine; then the target statement is executed by the underlying engine to implement the target machine learning task. Through the above method, developers who are not familiar with complex programming languages ​​and rules can also perform machine learning tasks through SQL statements, which can reduce the learning cost of developers who are not familiar with complex programming languages ​​and rules, and can overcome the limitations of implementing machine learning tasks.

[0046] Figure 2 It is a schematic flowchart of another method for implementing machine learning provided in an embodiment of the present application.

[0047] Exemplarily, the SQL statement is expressed in a preset syntax, where the preset syntax is set according to actual conditions. Figure 2 As shown, the method 200 is to Figure 1 A refinement of method 100 in .

[0048] Figure 1 S102 specifically includes Figure 2 Among S201 and S202.

[0049] S201, parsing the SQL statement according to the preset grammar to obtain the semantics of the SQL statement.

[0050] It should be understood that SQL statements are expressed in a preset syntax.

[0051] Specifically, the obtained SQL statement can be parsed through Antlr4.

[0052] It should be understood that Antlr4 (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing or translating structured text or binary files. It is widely used to build languages, tools and frameworks. Antlr4 generates a parser based on the grammar definition, and the parser can build and traverse the grammar tree. In addition, the grammar of all programming languages ​​can be defined using Antlr4. Therefore, in the embodiments of the present application, the preset grammar can be defined by Antlr4.

[0053] In a possible implementation, the preset grammar may be formed in the following manner: based on the SQL grammar of the underlying engine, a machine learning operator is added to form the preset grammar.

[0054] Optionally, based on the SQL syntax of the underlying engine Apache Spark, new machine learning related operators can be added to form a preset syntax. Based on the syntax of stream SQL in the underlying engine Apache Flink, new machine learning related operators can also be added to form a preset syntax. Among them, stream SQL can also be called stream computing SQL. Stream computing SQL is usually a SQL-like declarative language, mainly used for continuous queries on streaming data (Streams).

[0055] It should be understood that machine learning operators may include fit operators, train operators, and prediction operators, etc. Different machine learning operators are used to perform different machine learning tasks. For example, a prediction operator may perform a regression task and may predict a specific value based on input data.

[0056] Exemplarily, the semantics of an SQL statement can be presented in the form of a syntax tree. A syntax tree is a graphical representation of a sentence structure, which represents the derivation result of a sentence and is helpful for understanding the hierarchy of the sentence grammatical structure. Therefore, the embodiment of the present application can parse an SQL statement to obtain a syntax tree of the SQL statement, and the syntax tree can intuitively reflect the semantics of the input SQL statement.

[0057] S202: According to the semantics of the SQL statement, convert the SQL statement into the target statement having the same semantics as the SQL statement.

[0058] It should be understood that the codes for executing the same machine learning task in two different programming languages ​​may look very different. If the two codes are parsed and the syntax trees corresponding to the two codes are obtained, it can be found that the syntax tree structures of the two codes are the same. Therefore, although the codes entered in two different programming languages ​​may be very different, if the codes in the two programming languages ​​entered execute the same machine learning task, the syntax tree structures corresponding to the codes in the two programming languages ​​are the same, that is, the semantics corresponding to the codes in the two programming languages ​​are the same. In the embodiments of the present application, the SQL statements and the target statements can be understood as the codes in the two different programming languages ​​with the same semantics as above.

[0059] Specifically, the semantics of the SQL statement can be obtained first, and the semantics of the SQL statement can be presented in the form of a syntax tree. After the semantics of the SQL statement presented in the form of a syntax tree are obtained, the syntax tree of the SQL statement can be traversed to obtain a rule structure corresponding to the syntax tree, wherein the rule structure can be a syntax rule of a preset syntax, and then the SQL statement can be converted into a target statement with the same semantics as the SQL statement according to the obtained syntax rule of the preset syntax.

[0060] Exemplarily, Antlr4 provides two methods to traverse the syntax tree, one is through the Parse-TreeListener method, and the other is through the Parse-Tree Visitor method. Using Parse-Tree Visitor to traverse the syntax tree is simpler than using Parse-Tree Listener to traverse the syntax tree, and using Parse-TreeVisitor to traverse the syntax tree can control the order of traversing the syntax tree. Therefore, in the embodiment of the present application, the SQL statement can be traversed by the Parse-Tree Visitor generated by Antlr4, and then the SQL statement is converted into a target statement with the same semantics as the SQL statement according to the grammatical rules of the preset grammar.

[0061] In a possible implementation, when the underlying engine supports SQL statements, a target function is added to the SQL statement to form a target statement.

[0062] It should be understood that the objective function corresponds to the machine learning task being performed. The underlying engine supporting SQL statements can be understood as the underlying engine being able to recognize SQL statements.

[0063] For example, if the semantics of the SQL statement entered by the user is parsed to perform a regression task in a machine learning task, and it is parsed that the user wants to predict a specific value by entering some data, a function related to prediction that has been trained in advance can be added to the SQL statement entered by the user to form a target statement that can achieve prediction.

[0064] In another possible implementation, when the underlying engine does not support SQL statements, the SQL statements are converted into target type codes through a grammar generator; wherein the target type codes can be supported by the underlying engine; and target statements are formed according to the target type codes.

[0065] It should be understood that the underlying engine not supporting the SQL statement can be understood as the underlying engine being unable to recognize the SQL statement. The SQL statement can be converted into a target type of code that can be recognized by the underlying engine.

[0066] Exemplarily, the target type of code may be Java code. The SQL statement written by the user may be converted into Java code by Antlr4, and the Java code may be determined as the target statement. The Java code may be supported by the underlying engine Apache Spark or Apache Flink.

[0067] Exemplarily, the obtained Java code can also be optimized by Calcite, and the optimized Java code is determined as the target statement. Specifically, the optimization process can be to convert the syntax tree obtained by Antlr4 into a logical execution plan (tree of relational expression), and optimize the logical execution plan according to specific rules. Among them, the specific rules are, for example, heuristic algorithms.

[0068] Exemplarily, the target statement executed in S103 may be a Java code or an optimized Java code. When the target statement is a Java code or an optimized Java code, a Java compiler may be used to compile and run the Java code, such as a Janino compiler.

[0069] Through the above method, the SQL statements input by the user can be converted into target statements that can be supported by the underlying engine, so that developers who are not familiar with complex programming languages ​​​​and rules can also perform machine learning tasks through SQL statements. This can improve the development efficiency of developers who are not familiar with complex programming languages ​​​​and rules, reduce the learning cost of developers who are not familiar with complex programming languages ​​​​and rules, and overcome the limitations of implementing machine learning tasks.

[0070] Figure 3 It is a schematic flowchart of another method for implementing machine learning provided in an embodiment of the present application.

[0071] For example, Figure 3 As shown, the method 300 is to Figure 2 A refinement and extension of method 100.

[0072] Figure 2 S101 in the specific includes Figure 3 S301 and S302 in.

[0073] S301, displaying an editing interface.

[0074] Specifically, the editing interface in the embodiment of the present application may be a WEB editing interface.

[0075] In a possible implementation, the web editing interface can be loaded directly in the browser. The browser requires the user to log in. After logging in, the user can edit the project and code files to which he has permission, and can also open his project permissions to others for sharing.

[0076] S302, obtaining a structured query language SQL statement corresponding to the target machine learning task input through the editing interface.

[0077] In one possible implementation, the user enters a SQL statement corresponding to the target machine learning task on the WEB editing interface, and the WEB editing interface can display the SQL statement entered by the user, and the user can execute the SQL statement by pressing the Enter key. This method is generally called interactive programming. The interactive programming method is adopted in the embodiment of the present application, which makes it more convenient for users to use, because the SQL statement entered by the user does not need to be complicated to save and compile, and the execution result can be obtained immediately after the SQL statement is converted.

[0078] S303: Display the execution result of the target statement on the editing interface.

[0079] In a possible implementation, the execution result of the target statement can be displayed on the WEB editing interface. Optionally, the execution result can be data displayed in a table form or in an image form. The embodiment of the present application does not limit the type of data display.

[0080] In another possible implementation, while displaying data in a table format, users can also select the type of image to be drawn, such as a line chart, a pie chart, etc. It should be understood that the data for drawing often needs to be processed again, and the processing process is still handled by the underlying engine. The WEB front end only obtains the processed data and uses the corresponding JavaScript tool to draw the image, where JavaScript is a scripting language that can be used to create dynamically updated content, control multimedia, and create image animations.

[0081] In another possible implementation, after the user edits or executes the code, if there is a visual result, such as a drawing, when the user exits the browser and reopens the browser again, the result obtained by executing the target statement last time will still be displayed.

[0082] The embodiment of the present application provides a method for implementing machine learning, first obtaining a structured query language SQL statement corresponding to a target machine learning task input through an editing interface, and then converting the SQL statement into a target statement with the same semantics as the SQL statement, which can be supported by the underlying engine; then executing the target statement through the underlying engine to implement the target machine learning task. Through the above method, developers who are not familiar with big data development languages ​​and rules can also perform machine learning tasks through SQL statements, which can reduce the learning cost of developers who are not familiar with big data development languages ​​and rules. In addition, the input SQL statement and the result of executing the target statement can also be displayed on the editing interface. Developers can modify the input SQL statement at any time during the editing of the SQL statement, and do not need to go through complex compilation and saving. After converting the SQL statement, the execution result can be directly obtained, which is more convenient to use.

[0083] Figure 4 It is a structural diagram of a device for implementing machine learning provided in an embodiment of the present application.

[0084] For example, Figure 4 As shown, the device 400 includes:

[0085] The acquisition module 401 is used to obtain a structured query language SQL statement corresponding to the target machine learning task.

[0086] The conversion module 402 is used to convert the SQL statement into a target statement with the same semantics as the SQL statement, and the target statement can be supported by the underlying engine.

[0087] The execution module 403 is used to execute the target statement through the underlying engine to achieve the target machine learning task.

[0088] In a possible implementation, the conversion module 402 is specifically used to: parse the SQL statement according to the preset grammar to obtain the semantics of the SQL statement; and convert the SQL statement into the target statement having the same semantics as the SQL statement according to the semantics of the SQL statement.

[0089] Optionally, the preset grammar is formed in the following manner: based on the SQL grammar of the underlying engine, a machine learning operator is added to form the preset grammar.

[0090] In one possible implementation, the SQL statement is converted into the target statement with the same semantics as the SQL statement, including: when the underlying engine supports the SQL statement, adding an objective function corresponding to the target machine learning task to the SQL statement to form the target statement.

[0091] In another possible implementation, the SQL statement is converted into the target statement with the same semantics as the SQL statement, including: when the underlying engine does not support the SQL statement, converting the SQL statement into a target type of code; wherein the target type of code can be supported by the underlying engine; and forming the target statement according to the target type of code.

[0092] In one possible implementation, the acquisition module 401 is specifically used to: display an editing interface; and obtain the SQL statement corresponding to the target machine learning task input through the editing interface.

[0093] Optionally, the device further includes: a display module, configured to display the execution result of the target statement on the editing interface.

[0094] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0095] For example, Figure 5 As shown, the electronic device 500 includes: a memory 501 and a processor 502, wherein the memory 501 stores an executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform a vehicle control method.

[0096] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be corresponded to, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0097] In the case of dividing each functional module according to each function, the electronic device may include: an acquisition module, a conversion module, an execution module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.

[0098] The electronic device provided in this embodiment is used to execute the above-mentioned method for implementing machine learning, and thus can achieve the same effect as the above-mentioned implementation method.

[0099] In the case of an integrated unit, the electronic device may include a processing module and a storage module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device in executing mutual program codes and data.

[0100] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits disclosed in the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.

[0101] This embodiment also provides a computer-readable storage medium, in which a computer program code is stored. When the computer program code is executed on a computer, the computer executes the above-mentioned related method steps to implement a method for implementing machine learning in the above-mentioned embodiment.

[0102] This embodiment also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement a method for implementing machine learning in the above-mentioned embodiment.

[0103] In addition, the electronic device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute the instructions so that the chip executes one of the methods for implementing machine learning in the above embodiments.

[0104] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

[0105] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0106] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0107] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for implementing machine learning, characterized in that: The method comprises: Obtaining a structured query language SQL statement corresponding to the target machine learning task; Converting the SQL statement into a target statement with the same semantics as the SQL statement, wherein the target statement can be supported by an underlying engine; The target statement is executed by the underlying engine to achieve the target machine learning task.

2. The method according to claim 1, characterized in that: The SQL statement is expressed in a preset grammar, and the converting the SQL statement into a target statement having the same semantics as the SQL statement includes: Parsing the SQL statement according to the preset grammar to obtain the semantics of the SQL statement; According to the semantics of the SQL statement, the SQL statement is converted into the target statement having the same semantics as the SQL statement.

3. The method according to claim 1 or 2, characterized in that: The preset grammar is formed in the following way: Based on the SQL grammar of the underlying engine, machine learning operators are added to form the preset grammar.

4. The method according to claim 1 or 2, wherein converting the SQL statement into a target statement having the same semantics as the SQL statement comprises: When the underlying engine supports the SQL statement, an objective function corresponding to the target machine learning task is added to the SQL statement to form the target statement.

5. The method according to claim 1 or 2, wherein converting the SQL statement into a target statement having the same semantics as the SQL statement comprises: When the underlying engine does not support the SQL statement, convert the SQL statement into a target type of code; wherein the target type of code can be supported by the underlying engine; The target statement is formed according to the code of the target type.

6. The method according to claim 1, characterized in that The step of obtaining a structured query language SQL statement corresponding to the target machine learning task includes: Display the editing interface; Obtain the SQL statement corresponding to the target machine learning task input through the editing interface.

7. The method according to claim 6, characterized in that The method further comprises: The execution result of the target statement is displayed on the editing interface.

8. A device for implementing machine learning, characterized in that: The device comprises: An acquisition module, used to acquire a structured query language SQL statement corresponding to a target machine learning task; A conversion module, used to convert the SQL statement into a target statement with the same semantics as the SQL statement, and the target statement can be supported by the underlying engine; An execution module is used to execute the target statement through the underlying engine to achieve the target machine learning task.

9. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for realizing machine learning based on structured query language statements

    CN113780570A

  • Program statement conversion method, device, equipment and storage medium

    CN114090613A

  • Database query language transformation method, transformation apparatus and database query system

    US20070299836A1

  • Method for Detecting Structured Query Language (SQL) Injection Based on Big Data Algorithm

    US20210336987A1