CN117971908A - Method and device for entering lake in real time by data, electronic equipment and storage medium - Google Patents

Method and device for entering lake in real time by data, electronic equipment and storage medium Download PDF

Info

Publication number
CN117971908A
CN117971908A CN202311603231.7A CN202311603231A CN117971908A CN 117971908 A CN117971908 A CN 117971908A CN 202311603231 A CN202311603231 A CN 202311603231A CN 117971908 A CN117971908 A CN 117971908A
Authority
CN
China
Prior art keywords
data
preset
decision tree
interface
lake
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311603231.7A
Other languages
Chinese (zh)
Inventor
陈阳
邓晟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Merchants Finance Technology Co Ltd
Original Assignee
China Merchants Finance Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Merchants Finance Technology Co Ltd filed Critical China Merchants Finance Technology Co Ltd
Priority to CN202311603231.7A priority Critical patent/CN117971908A/en
Publication of CN117971908A publication Critical patent/CN117971908A/en
Pending legal-status Critical Current

Links

Abstract

The invention relates to a data storage technology, and discloses a method and a device for entering a lake in real time by data, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a CDC event file in a database log by using an analysis tool, writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a log processing application to obtain real-time queue data; carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a blank decision tree; converting the structured data into SQL sentences by utilizing SQL language rules, and determining the interface types corresponding to the SQL sentences through a neural network model; and the API interface corresponding to the maximum matching degree between the computing interface type and the API interface of the preset data lake is the optimal transmission interface, and SQL sentences are transmitted into an interactive application layer of the preset data lake through the API interface. The invention can solve the problem of data updating errors and larger data updating delay when data is put into the lake.

Description

Method and device for entering lake in real time by data, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a method and apparatus for real-time data entering a lake, an electronic device, and a computer readable storage medium.
Background
With the arrival of big data age, massive data wait for processing, in order to promote the real-time and high efficiency of data storage, a mode capable of automatically transmitting and storing data in real time is needed, and the analyzed message data is transferred into a real-time queue by analyzing a database log, so that the real-time entering of the data is realized.
Existing traditional data entry into lakes is performed using an offline approach, typically supporting t+1 or daytime batch synchronization. In actual operation, the time consumption of the data entering the lake is large, and the JDBC query interface is used to burden a source system when entering the lake, so that data updating errors are easy to cause, and the data updating delay is large.
Disclosure of Invention
The invention provides a method and a device for entering a lake in real time by data and a computer readable storage medium, and mainly aims to solve the problems of data updating errors and larger data updating delay when the data enters the lake.
In order to achieve the above object, the present invention provides a method for entering a lake in real time by data, comprising:
Optionally, acquiring a preset database log, and acquiring a CDC event file in the database log by using a preset analysis tool;
writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
Carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a preset blank decision tree;
The structured data is converted into SQL sentences by utilizing SQL language rules, and the interface types corresponding to the SQL sentences are determined by a preset neural network model;
calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting SQL sentences into the interactive application layer of the preset data lake through the API interface.
Optionally, the acquiring, by using a preset parsing tool, the CDC event file in the database log includes:
connecting the parsing tool into a database;
Analyzing the database log in the database by utilizing the analysis tool to obtain an analysis log;
and transmitting the CDC event file in the analysis log to a storage end through an analysis tool.
Optionally, the determining, by using a preset blank decision tree, the SQL language rule corresponding to the structured data includes:
adding rule processing to the blank decision tree to obtain a rule decision tree;
Acquiring preset input data and corresponding training rules, and performing optimization training on the rule decision tree to obtain a standard decision tree;
and determining SQL language rules corresponding to the structured data by using the standard decision tree.
Optionally, the adding rule processing to the blank decision tree to obtain a rule decision tree includes:
adding a decision tree on the basis of the blank decision tree to obtain an added decision tree;
inputting the pre-acquired data set to be processed into the adding decision tree to obtain a predicted value set;
Calculating an objective function value of the adding decision tree according to the predicted value set;
And when the objective function value is greater than or equal to a preset optimization threshold, executing an adding decision tree operation, and outputting the current adding decision tree as a rule decision tree when the objective function value is smaller than the optimization threshold.
Optionally, the obtaining preset input data and the corresponding training rules perform optimization training on the rule decision tree to obtain a standard decision tree, including:
obtaining a prediction rule corresponding to the input data by using a rule decision tree;
Calculating an error value between the prediction rule and the training rule;
And carrying out parameter adjustment on the rule decision tree according to the error value until the error value is in a preset error value range, so as to obtain a standard decision tree.
Optionally, the determining, by a preset neural network model, the interface type corresponding to the SQL statement includes:
coding the SQL sentence to obtain an SQL matrix;
convoluting and pooling the SQL matrix to obtain low-dimensional characteristic information of the SQL matrix;
Mapping the low-dimensional characteristic information to a pre-constructed high-dimensional space to obtain high-dimensional characteristic information;
And screening the high-dimensional characteristic information by using a preset activation function to obtain the interface type.
Optionally, the calculating the matching degree between the interface type and the API interface of the preset data lake includes:
performing table coding on the interface type and the API interface to obtain type coordinates and interface coordinates;
and calculating the similarity between the type coordinates and the interface coordinates by using the following matching degree calculation formula:
Wherein S is the calculated similarity between the type coordinate and the interface coordinate, x 1 is the abscissa of the type coordinate, y 1 is the ordinate of the type coordinate, x 2 is the abscissa of the interface coordinate, and y 2 is the ordinate of the interface coordinate;
and determining the similarity as the matching degree of the interface type and the API interface of the preset data lake.
In order to solve the above problems, the present invention further provides a data real-time lake entering device, the device comprising:
And a data acquisition module: the method comprises the steps of acquiring a preset database log, acquiring a CDC event file in the database log by using a preset analysis tool, writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
And a data processing module: the method comprises the steps of carrying out structuring treatment on real-time queue data to obtain structured data, determining SQL language rules corresponding to the structured data by using a preset blank decision tree, converting the structured data into SQL sentences by using the SQL language rules, and determining interface types corresponding to the SQL sentences by using a preset neural network model;
data entry module: and the interactive application layer is used for calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting the SQL sentence into the interactive application layer of the preset data lake through the API interface.
In order to solve the above-mentioned problems, the present invention also provides an electronic apparatus including:
At least one processor;
and a memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data real-time lake-entering method described above.
In order to solve the above-mentioned problems, the present invention also provides a computer-readable storage medium having stored therein at least one computer program that is executed by a processor in an electronic device to implement the above-mentioned data real-time lake entering method.
According to the invention, the SQL statement is transmitted into the interactive application layer of the preset data lake through the API interface, namely, the data is transmitted into the lake, so that the whole data architecture for real-time transmission into the lake is completed, the accuracy and the high efficiency of data transportation are ensured, and the real-time transmission of the data into the lake becomes feasible.
Drawings
FIG. 1 is a flow chart of a method for real-time data entry into a lake according to an embodiment of the present invention;
FIG. 2 is a detailed flow chart of one of the steps in the method for real-time data entry into a lake according to an embodiment of the present invention;
FIG. 3 is a detailed flow chart of another step in the method for real-time data entry into a lake according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a real-time data entry device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the method for real-time data lake entering according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The embodiment of the application provides a method for entering a lake in real time by data. The execution subject of the data real-time lake entering method comprises at least one of a server, a terminal and the like which can be configured to execute the method provided by the embodiment of the application. In other words, the data real-time lake entering method may be performed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The service end includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
Referring to fig. 1, a flow chart of a method for real-time data entering a lake according to an embodiment of the invention is shown. In this embodiment, the method for real-time data entering a lake includes:
S1, acquiring a preset database log, and acquiring a CDC event file in the database log by using a preset analysis tool;
In the embodiment of the invention, the database log is a record of the change of the database, any operation of the database can be recorded, the recorded result is stored in an independent file, and the log has very comprehensive record for each transaction process.
In the embodiment of the invention, the CDC event file actually provides history modification information for the user table by capturing the fact that the data operation language is modified and modified data, and the CDC event file can extract the data operation language and the modified data in a copy mode in an upstream data system.
In the embodiment of the present invention, referring to fig. 2, acquiring a CDC event file in a database log by using a preset parsing tool includes:
S21, connecting the analysis tool into a database;
s22, analyzing the database logs in the database by utilizing an analysis tool to obtain analysis logs;
S23, transmitting the CDC event file in the analysis log to a storage end through an analysis tool.
In an embodiment of the present invention, the parsing tool includes, but is not limited to, a Python-based verification-free parser, which can be used to parse SQL files.
In detail, acquiring the CDC event file can capture all data changes so as to acquire a more complete database file, and meanwhile, the CDC event delay rate is low, so that the burden of a CPU can be avoided, and the old record state and more metadata can be captured.
S2, writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
In the embodiment of the invention, the CDC event file is written into the message queue to obtain CDC log data, and the CDC event file is sent to the message queue in a mail sending mode.
In detail, writing the CDC event file into the message queue can accelerate the data transmission speed, reduce the waiting time, and enable the data to be transmitted efficiently.
In the embodiment of the invention, the preset log processing application is utilized to subscribe CDC log data to obtain real-time queue data, the queue channel corresponding to the preset message queue is obtained, the log processing application is utilized to search the CDC log data and the queue channel, and when the queue channel matched with the CDC log data is queried, the queue channel is subscribed.
In detail, the search of CDC log data and queue channels by using the log processing application is actually to find subscription conditions corresponding to the queue channels, and when the CDC log data and the queue channels are successfully matched, the corresponding data subscription can be completed.
S3, carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a preset blank decision tree;
In the embodiment of the invention, the structured data is also called row data, is data logically expressed and realized by a two-dimensional table structure, strictly follows the data format and length specification, and is mainly stored and managed through a relational database.
Because real-time queue data is complicated and difficult to calculate, the data needs to be structured, so that the data is clearer, the data after the structured processing is convenient to calculate, and the data processing efficiency is improved.
In the embodiment of the invention, the real-time queue data is subjected to structuring processing to obtain structured data, the real-time queue data is subjected to word segmentation to obtain queue data word segmentation, the queue data word segmentation is filled into a preset blank two-dimensional table, and the two-dimensional table is determined to be the structured data.
In the embodiment of the present invention, referring to fig. 3, determining an SQL language rule corresponding to structured data by using a preset blank decision tree includes:
s31, adding rule processing to the blank decision tree to obtain a rule decision tree;
s32, acquiring preset input data and corresponding training rules, and performing optimization training on the rule decision tree to obtain a standard decision tree;
s33, determining SQL language rules corresponding to the structured data by using a standard decision tree.
In detail, the adding rule processing to the blank decision tree to obtain a rule decision tree includes:
adding a decision tree on the basis of the blank decision tree to obtain an added decision tree;
inputting the pre-acquired data set to be processed into the adding decision tree to obtain a predicted value set;
Calculating an objective function value of the adding decision tree according to the predicted value set;
And when the objective function value is greater than or equal to a preset optimization threshold, executing an adding decision tree operation, and outputting the current adding decision tree as a rule decision tree when the objective function value is smaller than the optimization threshold.
In detail, the embodiment of the invention compares the objective function value with the optimization threshold, and when the objective function value is greater than or equal to the preset optimization threshold, the prediction capability of the adding decision tree is not strong enough, so that the adding decision tree operation needs to be executed again, when the objective function value is smaller than the optimization threshold, the current adding decision tree is better in prediction effect, and the current adding decision tree is output as a rule decision tree.
Specifically, the obtaining preset input data and the corresponding training rules to optimize and train the rule decision tree to obtain a standard decision tree includes:
obtaining a prediction rule corresponding to the input data by using a rule decision tree;
Calculating an error value between the prediction rule and the training rule;
And carrying out parameter adjustment on the rule decision tree according to the error value until the error value is in a preset error value range, so as to obtain a standard decision tree.
Further, according to the predicted value set, the embodiment of the invention calculates the objective function value of the adding decision tree by adopting the following method, which comprises the following steps:
wherein object m is the objective function value in adding the decision tree, m is the tree of the decision tree, For the error value between the preset true value set and the predicted value set, t i is the true value set,/>For the predicted value set, Ω (f i) is a penalty function, w j is the weight of leaf nodes in the adding decision tree, M is the number of leaf nodes in the adding decision tree, γ, T and λ are fixed parameters, i is the i-th non-leaf node in the adding decision tree, n is the number of non-leaf nodes in the adding decision tree, and j is the j-th leaf node in the adding decision tree.
In detail, calculating an error value between the prediction rule and the training rule includes:
calculating an error value between the prediction rule and the training rule using the following error calculation formula:
wherein L (y, y p) is the error value, For the prediction rule, y i is the training rule and u is the number of decision trees.
In detail, the decision tree judgment capability can be improved by optimizing and training the rule decision tree, the classification level of the decision tree is improved, the standard decision tree after optimization is more accurate in classification, the efficiency is higher, the processing time of data is reduced, and the real-time transmission of the data is realized.
S4, converting the structured data into SQL sentences by using SQL language rules, and determining interface types corresponding to the SQL sentences through a preset neural network model;
Because SQL statements require fixed language rules, it is necessary to translate structured data according to different language rules. Thus, the SQL language rule is determined to be able to convert the structured data into a corresponding interface type using the SQL language rule.
In the embodiment of the present invention, the determining, by a preset neural network model, the interface type corresponding to the SQL statement includes:
coding the SQL sentence to obtain an SQL matrix;
convoluting and pooling the SQL matrix to obtain low-dimensional characteristic information of the SQL matrix;
Mapping the low-dimensional characteristic information to a pre-constructed high-dimensional space to obtain high-dimensional characteristic information;
And screening the high-dimensional characteristic information by using a preset activation function to obtain the interface type.
Specifically, the low-dimensional feature information can be mapped to a pre-constructed high-dimensional space by using a preset mapping function, wherein the mapping function comprises Gaussian Radial Basis Function functions, gaussian functions and the like in a MATLAB library.
For example, if the low-dimensional feature information is a point in a two-dimensional plane, a mapping function may be used to calculate two-dimensional coordinates of the point in the two-dimensional plane, so as to convert the two-dimensional coordinates into three-dimensional coordinates, and the calculated three-dimensional coordinates are used to map the point to a pre-constructed three-dimensional space, so as to obtain high-dimensional feature information of the low-dimensional feature information.
In detail, convolution and pooling are carried out on the SQL matrix to obtain low-dimensional characteristic information of the SQL matrix, which comprises the following steps:
presetting convolution kernels with different sizes, and carrying out convolution on the log matrixes one by the convolution kernels to obtain a convolution matrix;
And pooling the convolution matrix by using a maximum value or minimum value method according to a preset pooling window to obtain the low-dimensional characteristic information of the log data.
In detail, there is a preset size difference between convolution kernels of different sizes, for example, a certain matrix of convolution kernel positions 3*3, and the preset convolution kernel size difference is 3, and then the sizes of the convolution kernels are 3*3 and 6*6 respectively. The dimension difference is set to ensure that the dimension reduction operation is performed to the greatest extent on the premise of retaining the maximum characteristic of the obtained convolution matrix.
In the embodiment of the invention, the convolution matrix is pooled by using a maximum value or minimum value method according to a preset pooling window, and the numerical characteristics of the convolution matrix cannot be determined, so that whether the pooling is performed by using the maximum value or the minimum value method cannot be determined. For example, in the convolution matrix, the preset pooling window is a 5*5 matrix window, if the number of larger values is far greater than the number of smaller values in the matrix window of the convolution matrix, a minimum pooling method is selected, all values in the pooling window are replaced by the minimum values in the pooling window, and then the next pooling window is analyzed until all values in the convolution matrix pool are subjected to pooling operation.
S5, calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting SQL sentences into the interactive application layer of the preset data lake through the API interface.
In the embodiment of the present invention, the interactive application layer, also referred to as the application layer, is the highest layer of the open system. The application layer is directly connected with the application program to provide common network application services.
Additionally, the API interface is actually a few predefined functions through which the intercommunication between computer software is achieved. Its main function is to provide a general set of functions. In the embodiment of the invention, the interactive connection between the application layer and the application layer is realized by using an API interface.
In the embodiment of the invention, calculating the matching degree of the interface type and the API interface of the preset data lake comprises the following steps:
performing table coding on the interface type and the API interface to obtain type coordinates and interface coordinates;
and calculating the similarity between the type coordinates and the interface coordinates by using the following matching degree calculation formula:
Wherein S is the calculated similarity between the type coordinate and the interface coordinate, x 1 is the abscissa of the type coordinate, y 1 is the ordinate of the type coordinate, x 2 is the abscissa of the interface coordinate, and y 2 is the ordinate of the interface coordinate;
and determining the similarity as the matching degree of the interface type and the API interface of the preset data lake.
Specifically, different interface types correspond to different API interfaces, and four major classes of traditional API interface remote procedure call, standard query language, file transmission and information delivery are adopted. The matching degree between the interface type and the API interface is calculated to screen different API interfaces according to the interface type, so that efficient and accurate data transmission can be realized.
In detail, the SQL statement is transmitted into the interactive application layer of the preset data lake through the API interface to enter the data into the lake, so that the whole data architecture for entering the lake in real time is completed, the accuracy and the high efficiency of data transportation are ensured, and the data entering the lake in real time becomes feasible.
FIG. 4 is a functional block diagram of a real-time data entry device according to an embodiment of the present invention.
The data real-time lake entering device 100 according to the present invention may be installed in an electronic apparatus. Depending on the functions implemented, the data real-time lake-entering device 100 may include a data acquisition module 101, a data processing module 102, and a data lake-entering module 103. The module of the invention, which may also be referred to as a unit, refers to a series of computer program segments, which are stored in the memory of the electronic device, capable of being executed by the processor of the electronic device and of performing a fixed function.
In the present embodiment, the functions concerning the respective modules/units are as follows:
The data acquisition module 101: the method comprises the steps of acquiring a preset database log, acquiring a CDC event file in the database log by using a preset analysis tool, writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
The data processing module 102: the method comprises the steps of carrying out structuring treatment on real-time queue data to obtain structured data, determining SQL language rules corresponding to the structured data by using a preset blank decision tree, converting the structured data into SQL sentences by using the SQL language rules, and determining interface types corresponding to the SQL sentences by using a preset neural network model;
The data lake-entry module 103: and the interactive application layer is used for calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting the SQL sentence into the interactive application layer of the preset data lake through the API interface.
In detail, each module in the data real-time lake entering device 100 in the embodiment of the present invention adopts the same technical means as the data real-time lake entering method described in fig. 1 to 3, and can produce the same technical effects, which are not described herein.
Fig. 5 is a schematic structural diagram of an electronic device for implementing a method for real-time data entering a lake according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program stored in the memory 11 and executable on the processor 10, such as a data real-time lake-entering program.
The processor 10 may be formed by an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be formed by a plurality of integrated circuits packaged with the same function or different functions, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules stored in the memory 11 (for example, executing a data real-time lake entering program, etc.), and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, a removable hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, such as a mobile hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in an electronic device and various data, such as codes of a real-time data entering program, etc., but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. The bus is arranged to enable a connection communication between the memory 11 and at least one processor 10 etc.
The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), or alternatively a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface.
Only an electronic device having components is shown, and it will be understood by those skilled in the art that the structures shown in the figures do not limit the electronic device, and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power source (such as a battery) for supplying power to the respective components, and preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management, and the like are implemented through the power management device. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device may further include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described herein.
It should be understood that the embodiments described are for illustrative purposes only and are not limited to this configuration in the scope of the patent application.
The real-time data entering program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, which when run in the processor 10, can implement:
Acquiring a preset database log, and acquiring a CDC event file in the database log by using a preset analysis tool;
writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
Carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a preset blank decision tree;
The structured data is converted into SQL sentences by utilizing SQL language rules, and the interface types corresponding to the SQL sentences are determined by a preset neural network model;
calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting SQL sentences into the interactive application layer of the preset data lake through the API interface.
In particular, the specific implementation method of the above instructions by the processor 10 may refer to the description of the relevant steps in the corresponding embodiment of the drawings, which is not repeated herein.
Further, the modules/units integrated in the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. The computer readable storage medium may be volatile or nonvolatile. For example, the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer readable storage medium storing a computer program which, when executed by a processor of an electronic device, can implement:
Acquiring a preset database log, and acquiring a CDC event file in the database log by using a preset analysis tool;
writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
Carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a preset blank decision tree;
The structured data is converted into SQL sentences by utilizing SQL language rules, and the interface types corresponding to the SQL sentences are determined by a preset neural network model;
calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting SQL sentences into the interactive application layer of the preset data lake through the API interface.
In the several embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The blockchain (Blockchain), essentially a de-centralized database, is a string of data blocks that are generated in association using cryptographic methods, each of which contains information from a batch of network transactions for verifying the validity (anti-counterfeit) of its information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the system claims can also be implemented by means of software or hardware by means of one unit or means. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (10)

1. A method for real-time data entry into a lake, the method comprising:
Acquiring a preset database log, and acquiring a CDC event file in the database log by using a preset analysis tool;
writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
Carrying out structuring treatment on the real-time queue data to obtain structured data, and determining SQL language rules corresponding to the structured data by using a preset blank decision tree;
The structured data is converted into SQL sentences by utilizing SQL language rules, and the interface types corresponding to the SQL sentences are determined by a preset neural network model;
calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting SQL sentences into the interactive application layer of the preset data lake through the API interface.
2. The method for real-time data entry into a lake of claim 1, wherein the acquiring the CDC event file in the database log by using a preset parsing tool comprises:
connecting the parsing tool into a database;
Analyzing the database log in the database by utilizing the analysis tool to obtain an analysis log;
and transmitting the CDC event file in the analysis log to a storage end through an analysis tool.
3. The method for real-time data lake-entering according to claim 1, wherein the determining the SQL language rule corresponding to the structured data by using a preset blank decision tree comprises:
adding rule processing to the blank decision tree to obtain a rule decision tree;
Acquiring preset input data and corresponding training rules, and performing optimization training on the rule decision tree to obtain a standard decision tree;
and determining SQL language rules corresponding to the structured data by using the standard decision tree.
4. The method for real-time data lake-entering of claim 3, wherein the adding rule processing to the blank decision tree to obtain a rule decision tree comprises:
adding a decision tree on the basis of the blank decision tree to obtain an added decision tree;
inputting the pre-acquired data set to be processed into the adding decision tree to obtain a predicted value set;
Calculating an objective function value of the adding decision tree according to the predicted value set;
And when the objective function value is greater than or equal to a preset optimization threshold, executing an adding decision tree operation, and outputting the current adding decision tree as a rule decision tree when the objective function value is smaller than the optimization threshold.
5. The method for real-time data lake-entering as claimed in claim 3, wherein said obtaining preset input data and corresponding training rules to optimize the rule decision tree to obtain a standard decision tree comprises:
obtaining a prediction rule corresponding to the input data by using a rule decision tree;
Calculating an error value between the prediction rule and the training rule;
And carrying out parameter adjustment on the rule decision tree according to the error value until the error value is in a preset error value range, so as to obtain a standard decision tree.
6. The method for real-time data lake-entering according to claim 1, wherein the determining the interface type corresponding to the SQL statement through the preset neural network model comprises:
coding the SQL sentence to obtain an SQL matrix;
convoluting and pooling the SQL matrix to obtain low-dimensional characteristic information of the SQL matrix;
Mapping the low-dimensional characteristic information to a pre-constructed high-dimensional space to obtain high-dimensional characteristic information;
And screening the high-dimensional characteristic information by using a preset activation function to obtain the interface type.
7. The method for real-time data lake-entering according to claim 1, wherein the calculating the matching degree between the interface type and the API interface of the preset data lake comprises:
performing table coding on the interface type and the API interface to obtain type coordinates and interface coordinates;
and calculating the similarity between the type coordinates and the interface coordinates by using the following matching degree calculation formula:
Wherein S is the calculated similarity between the type coordinate and the interface coordinate, x 1 is the abscissa of the type coordinate, y 1 is the ordinate of the type coordinate, x 2 is the abscissa of the interface coordinate, and y 2 is the ordinate of the interface coordinate;
and determining the similarity as the matching degree of the interface type and the API interface of the preset data lake.
8. A data real-time lake entering device, the device comprising:
And a data acquisition module: the method comprises the steps of acquiring a preset database log, acquiring a CDC event file in the database log by using a preset analysis tool, writing the CDC event file into a message queue to obtain CDC log data, and subscribing the CDC log data by using a preset log processing application to obtain real-time queue data;
And a data processing module: the method comprises the steps of carrying out structuring treatment on real-time queue data to obtain structured data, determining SQL language rules corresponding to the structured data by using a preset blank decision tree, converting the structured data into SQL sentences by using the SQL language rules, and determining interface types corresponding to the SQL sentences by using a preset neural network model;
data entry module: and the interactive application layer is used for calculating the matching degree of the interface type and the API interface of the preset data lake, selecting the API interface corresponding to the maximum matching degree as the optimal transmission interface, and transmitting the SQL sentence into the interactive application layer of the preset data lake through the API interface.
9. An electronic device, the electronic device comprising:
At least one processor;
and a memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data real-time lake-entry method of any one of claims 1 to 7.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method of real-time data entry as claimed in any one of claims 1 to 7.
CN202311603231.7A 2023-11-27 2023-11-27 Method and device for entering lake in real time by data, electronic equipment and storage medium Pending CN117971908A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311603231.7A CN117971908A (en) 2023-11-27 2023-11-27 Method and device for entering lake in real time by data, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311603231.7A CN117971908A (en) 2023-11-27 2023-11-27 Method and device for entering lake in real time by data, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117971908A true CN117971908A (en) 2024-05-03

Family

ID=90860151

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311603231.7A Pending CN117971908A (en) 2023-11-27 2023-11-27 Method and device for entering lake in real time by data, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117971908A (en)

Similar Documents

Publication Publication Date Title
WO2022048363A1 (en) Website classification method and apparatus, computer device, and storage medium
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
CN114398557B (en) Information recommendation method and device based on double images, electronic equipment and storage medium
CN112231417A (en) Data classification method and device, electronic equipment and storage medium
CN112507663A (en) Text-based judgment question generation method and device, electronic equipment and storage medium
CN115238670B (en) Information text extraction method, device, equipment and storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN111768096A (en) Rating method and device based on algorithm model, electronic equipment and storage medium
CN117155771B (en) Equipment cluster fault tracing method and device based on industrial Internet of things
CN114220536A (en) Disease analysis method, device, equipment and storage medium based on machine learning
CN111930963B (en) Knowledge graph generation method and device, electronic equipment and storage medium
CN113157739A (en) Cross-modal retrieval method and device, electronic equipment and storage medium
WO2023178979A1 (en) Question labeling method and apparatus, electronic device and storage medium
CN116578696A (en) Text abstract generation method, device, equipment and storage medium
CN116662488A (en) Service document retrieval method, device, equipment and storage medium
CN115409041A (en) Unstructured data extraction method, device, equipment and storage medium
CN113419951B (en) Artificial intelligent model optimization method and device, electronic equipment and storage medium
CN114385815A (en) News screening method, device, equipment and storage medium based on business requirements
CN117971908A (en) Method and device for entering lake in real time by data, electronic equipment and storage medium
CN114610854A (en) Intelligent question and answer method, device, equipment and storage medium
CN111444159A (en) Actuarial data processing method, actuarial data processing device, electronic equipment and storage medium
CN112328960B (en) Optimization method and device for data operation, electronic equipment and storage medium
CN113704616B (en) Information pushing method and device, electronic equipment and readable storage medium
CN114185617B (en) Service call interface configuration method, device, equipment and storage medium
CN112214556B (en) Label generation method, label generation device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication