WO2019223153A1 - 海量数据结构化方法、装置、计算机设备及存储介质 - Google Patents
海量数据结构化方法、装置、计算机设备及存储介质 Download PDFInfo
- Publication number
- WO2019223153A1 WO2019223153A1 PCT/CN2018/102468 CN2018102468W WO2019223153A1 WO 2019223153 A1 WO2019223153 A1 WO 2019223153A1 CN 2018102468 W CN2018102468 W CN 2018102468W WO 2019223153 A1 WO2019223153 A1 WO 2019223153A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- cluster
- data
- unstructured data
- clustering
- clusters
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
Definitions
- the present application relates to the technical field of data structuring, and in particular, to a method, an apparatus, a computer device, and a storage medium for mass data structuring.
- the training of deep learning needs to rely on a large amount of labeled data or structured data, but turning unstructured data into structured data requires a large amount of labor costs to manually structure the data through manual transformation. As a result, it is inefficient to obtain the training data required for deep learning.
- This application provides a method, device, computer equipment, and storage medium for mass data structuring, which aims to solve the need to invest a large amount of labor costs to convert unstructured data into structured data in the prior art through manual conversion.
- Data structured processing leads to the problem of low efficiency in obtaining training data required for deep learning.
- the present application provides a method for structuring massive data, which includes: clustering unstructured data to obtain a clustering result corresponding to a preset number of clustering clusters, and setting a clustering result corresponding to each cluster.
- clustering unstructured data to obtain a clustering result corresponding to a preset number of clustering clusters, and setting a clustering result corresponding to each cluster.
- One-to-one corresponding ID numbers of the clusters an unstructured data is obtained from the clusters of each cluster in the clustering result, and the obtained unstructured data is correspondingly converted into regular expressions;
- the unstructured data included in the cluster are transformed according to the regular expression corresponding to the cluster to obtain structured data.
- the present application provides a mass data structured device, which includes: a clustering unit configured to cluster unstructured data to obtain a clustering result corresponding to a preset number of clustered clusters, and Set an ID number that corresponds to each cluster's clusters; a regular expression acquisition unit is used to obtain an unstructured data in the clusters of each cluster in the clustering result, and the obtained unstructured
- the structured data is correspondingly converted into regular expressions; the data structure unit is used to transform the unstructured data included in the clusters of each cluster according to the regular expressions corresponding to the clusters to obtain structured data.
- the present application further provides a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor.
- the processor is implemented when the computer program is executed.
- the present application further provides a storage medium, wherein the storage medium stores a computer program, the computer program includes program instructions, and the program instructions, when executed by a processor, cause the processor to execute the application
- the massive data structure method according to any one of the provided.
- the application provides a method, a device, a computer device, and a storage medium for structuring massive data.
- This method implements a clustering algorithm to cluster a large amount of unstructured data.
- Each cluster correspondingly generates a regular expression and applies it to all the data in the cluster.
- the massive unstructured data can be quickly converted into structured data. , Can quickly meet the needs of training data required for deep learning.
- FIG. 1 is a schematic flowchart of a method for structuring massive data according to an embodiment of the present application
- FIG. 2 is another schematic flowchart of a method for structuring massive data according to an embodiment of the present application
- FIG. 3 is a schematic diagram of a sub-flow of a method for structuring massive data according to an embodiment of the present application
- FIG. 4 is a schematic diagram of another sub-flow of a method for structuring massive data provided by an embodiment of the present application.
- FIG. 5 is a schematic diagram of another sub-flow of a method for structuring massive data provided by an embodiment of the present application.
- FIG. 6 is a schematic block diagram of a mass data structured device according to an embodiment of the present application.
- FIG. 7 is another schematic block diagram of a mass data structured device according to an embodiment of the present application.
- FIG. 8 is a schematic block diagram of subunits of a mass data structured device according to an embodiment of the present application.
- FIG. 9 is a schematic block diagram of another subunit of a mass data structured device according to an embodiment of the present application.
- FIG. 10 is a schematic block diagram of another subunit of a mass data structured device according to an embodiment of the present application.
- FIG. 11 is a schematic block diagram of a computer device according to an embodiment of the present application.
- FIG. 1 is a schematic flowchart of a method for structuring massive data provided by an embodiment of the present application. This method is applied to terminals such as desktop computers, laptop computers, and tablet computers. As shown in FIG. 1, the method includes steps S101 to S103.
- the clustering of the unstructured data is to classify the unstructured data having the same or similar characteristics into one category.
- regular expressions can be generated for each cluster in a more targeted manner to achieve subsequent data structured processing.
- the one-to-one correspondence of the ID numbers of the clusters of each cluster is for subsequent establishment of a data table according to the ID numbers to store the generated structured data.
- the step S101 includes:
- the k-means algorithm is used for clustering the unstructured data, as follows:
- the specific calculation method is to take the arithmetic mean of the respective dimensions of all unstructured data in each cluster, for example, each unstructured data has Three dimensions, namely the product code, brand, and model, are used to calculate the clustering centers of these three dimensions for each cluster. An unstructured data that meets the arithmetic mean of the three dimensions is selected as the new clustering center. , Reselect the better clustering center in the cluster data.
- step 14 Repeat step 14) until the clustering result no longer changes, and obtain a clustering result corresponding to a preset number of clustering clusters.
- ID numbers are set for each final clustering result one by one, so that a large amount of unstructured data can be quickly grouped.
- an unstructured data when an unstructured data is obtained in the clusters of each cluster in the clustering result, an unstructured data may be obtained randomly from each cluster, or the cluster may be directly selected
- the unstructured data corresponding to the clustering center of the cluster for example, the clusters of k clusters need to select one from each cluster, and select a total of k unstructured data).
- the selected k unstructured data are converted into regular expressions.
- the step S102 includes:
- the corresponding regular expression can be generated according to ABC ⁇ bABC ⁇ b; the corresponding regular expression can be generated according to ABC123 ⁇ bABc ⁇ b ⁇ d ⁇ 3 ⁇ ; the corresponding regular expression is generated according to ABC123- ⁇ bABC ⁇ b ⁇ d ⁇ 3 ⁇ -; Generate corresponding regular expression according to ABC123-1 ⁇ bABC ⁇ b ⁇ d ⁇ 3 ⁇ - ⁇ d; Generate corresponding regular expression according to ABC123-1- ⁇ bABC ⁇ b ⁇ d ⁇ 3 ⁇ - ⁇ d-; Generate the corresponding regular expression according to ABC121-1-1-1 ⁇ bABC ⁇ b ⁇ d ⁇ 3 ⁇ - ⁇ d- ⁇ d; Generate the corresponding regular expression according to ABC-1 ⁇ bABC ⁇ b- ⁇ d.
- the example above includes the following steps:
- the characters in unstructured data are classified by character type (such as numeric characters into the first category, alphabetic characters into the second category, and symbolic characters into the third category) through automatic recognition.
- character type such as numeric characters into the first category, alphabetic characters into the second category, and symbolic characters into the third category
- the last 1 in 121 is separated from the first-, the first-is separated from the first 1 after it, and the first-is the first 1 and the following
- the two-are separated, the second-is separated from the last digit 1, that is, the following paragraphs ABC, 121,-, 1,-, 1 are obtained after dividing according to the character type;
- the unstructured data included in the cluster of each cluster is transformed according to the regular expression corresponding to the cluster to obtain structured data.
- the unstructured data selected in each cluster since the unstructured data selected in each cluster generates a corresponding regular expression, the remaining unstructured data in each cluster is transformed according to the regular expression to generate Structured data.
- the unstructured data listed in the above example matches a regular expression, it can be standardized to structured data correspondingly, and its format is as follows:
- the step S103 includes:
- the unstructured data corresponding to the cluster cluster can be based on the regular expression corresponding to the cluster cluster.
- the multiple regular expressions included in the formula are matched and transformed in sections to obtain multiple initial transformation results corresponding to each unstructured data.
- it is the same as the process of forming regular expressions by concatenating sub-regular expressions.
- multiple initial transformation results corresponding to the same unstructured data are processed by concatenation to obtain the structured structure corresponding to the unstructured data. data. By means of segmented conversion, you can ensure more accurate conversion results.
- multiple initial transformation results corresponding to the same unstructured data are concatenated to obtain the structured data corresponding to the unstructured data.
- the multiple initial transformation results corresponding to the same unstructured data are obtained.
- a newline character is added at the end and then concatenated to obtain structured data corresponding to the unstructured data.
- the method further includes:
- the step S104 includes:
- N data tables are correspondingly created, and each data table is correspondingly established according to the ID number of one of the clusters;
- the selected structured data is as follows:
- $ ⁇ x_n, y_n> $ is a training sample
- $ y_n $ is a training target
- $ x_n $ is a normalized bag of features.
- the matrix parameter A is a look-up table based on the word, that is, A is the embedding vector of the word.
- the mathematical meaning of $ Ax_n $ matrix operation is to find the word's embedding vector and add or average them to get the hidden vector.
- the matrix parameter B is a parameter of the function f.
- the function f is a multi-classification problem, so $ f (BAx_n) $ is a multi-class linear function. The optimization goal is to make the likelihood of this multi-classification problem as large as possible.
- this method implements a clustering algorithm to cluster a large amount of unstructured data.
- Each cluster corresponds to a regular expression and is applied to all the data in the cluster.
- the large amount of unstructured data can be quickly transformed into a structure.
- Data can quickly meet the needs of training data required for deep learning.
- the embodiment of the present application further provides a mass data structuring device, and the mass data structuring device is configured to execute any embodiment of the foregoing mass data structuring method.
- FIG. 6, is a schematic block diagram of a mass data structured device provided by an embodiment of the present application.
- the mass data structured device 100 may be configured in a terminal such as a desktop computer, a tablet computer, a laptop computer, or the like.
- the mass data structuring device 100 includes a clustering unit 101, a regular expression obtaining unit 102, and a data structuring unit 103.
- the clustering unit 101 is configured to cluster unstructured data to obtain a clustering result corresponding to a preset number of clustering clusters, and set ID numbers corresponding to the clusters of each cluster one to one.
- the clustering unit 101 includes:
- An initial center selection unit 1011 is configured to select the same number of unstructured data as a preset number of clustered clusters among a plurality of unstructured data, and use the selected unstructured data as an initial cluster of each cluster Center; an initial clustering unit 1012, configured to divide a plurality of unstructured data to obtain an initial clustering result according to the dissimilar values of the multiple unstructured data and each initial clustering center; a clustering center adjustment unit 1013 Is used to obtain the adjusted cluster center of each cluster according to the initial clustering result; the cluster adjustment unit 1014 is used to divide multiple unstructured data according to the adjusted cluster center until the clustering result remains The same number of times is more than the preset number, and a clustering result corresponding to the preset number of clusters is obtained.
- the regular expression obtaining unit 102 is configured to obtain an unstructured data in the clustering of each cluster in the clustering result, and correspondingly convert the obtained unstructured data into a regular expression.
- the regular expression obtaining unit 102 includes:
- a character string dividing unit 1021 is configured to divide the obtained unstructured data corresponding to the clusters of each cluster one-to-one according to a character type, and obtain a division result corresponding to the obtained unstructured data one-to-one; , Each division result includes multiple substrings;
- a segment generation unit 1022 configured to generate a plurality of sub-regular expressions corresponding to each division result according to the substring included in each division result;
- a concatenation unit 1023 is configured to concatenate a plurality of corresponding sub-regular expressions in the same division result to obtain a regular expression corresponding to the division result.
- the data structure unit 103 is configured to transform unstructured data included in a cluster of each cluster according to a regular expression corresponding to the cluster to obtain structured data.
- the data structure unit 103 includes:
- An initial transformation result obtaining unit configured to obtain multiple sub-regular expressions included in the regular expression corresponding to the cluster of each cluster, and to combine the unstructured data included in the cluster of each cluster with the cluster The corresponding multiple regular expressions are transformed to obtain multiple initial transformation results corresponding to each unstructured data;
- the initial transformation result concatenation unit is configured to concatenate multiple initial transformation results corresponding to the same unstructured data to obtain structured data corresponding to the unstructured data.
- a newline character is added to the tail of multiple initial conversion results corresponding to the same unstructured data, and then the concatenation is performed to obtain the structure corresponding to the unstructured data. Data.
- the mass data structured device 100 further includes:
- a classification storage unit 104 is configured to fill each structured data in a cluster of each cluster into a data table corresponding to the cluster according to a text classification algorithm for storage.
- the classification storage unit 104 includes:
- the table creation unit 1041 is configured to establish a data table one by one according to the ID number of the cluster of each cluster;
- a field establishing unit 1042 is configured to correspond to the fields of the data table based on the fields of the structured data selected in the cluster of each cluster;
- a classification filling unit 1043 is configured to fill structured data included in a cluster of each cluster into corresponding fields of a data table corresponding to the cluster according to a Fasttext text classification algorithm.
- the device implements a clustering algorithm to cluster a large amount of unstructured data.
- Each cluster corresponds to a regular expression and is applied to all the data of the cluster, so that the large amount of unstructured data can be quickly transformed into a structure.
- Data can quickly meet the needs of training data required for deep learning.
- the above-mentioned massive data structured device can be implemented in the form of a computer program, which can be run on a computer device as shown in FIG. 11.
- the computer device 500 may be a terminal.
- the terminal may be an electronic device such as a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and the like.
- the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501.
- the memory may include a non-volatile storage medium 503 and an internal memory 504.
- the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
- the computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can execute a mass data structure method.
- the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
- the internal memory 504 provides an environment for running the computer program 5032 in the non-volatile storage medium 503.
- the processor 502 can execute a mass data structure method.
- the network interface 505 is used for network communication, such as sending assigned tasks.
- the structure shown in FIG. 11 is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer equipment 500 to which the scheme of the present application is applied.
- the specific computer equipment 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
- the processor 502 is configured to run a computer program 5032 stored in a memory to implement the following function: cluster unstructured data to obtain a clustering result corresponding to a preset number of clustering clusters, and set ID numbers corresponding to the clusters of each cluster one by one; obtain an unstructured data from the clusters of each cluster in the clustering result, and correspondingly transform the obtained unstructured data into regular expressions; The unstructured data included in the cluster of each cluster is transformed according to the regular expression corresponding to the cluster to obtain structured data.
- the processor 502 further performs the following operation: each structured data in the cluster of each cluster is filled into a data table corresponding to the cluster according to a text classification algorithm for storage.
- the processor 502 further performs the following operation: selecting the same number of unstructured data from the plurality of unstructured data as the preset number of cluster clusters, and using the selected unstructured data as each A cluster of initial clustering centers; based on the dissimilar values of multiple unstructured data and each initial clustering center, divide multiple unstructured data to obtain the initial clustering result; according to the initial clustering result, obtain each A cluster of adjusted cluster centers; according to the adjusted cluster centers, a plurality of unstructured data is divided until the clustering result remains the same number of times more than a preset number of times, to obtain a preset number of clusters Corresponding clustering results.
- the processor 502 further performs the following operations: dividing the obtained unstructured data corresponding to the clusters of each cluster one-to-one according to the character type, and obtaining one-to-one with the obtained unstructured data Corresponding division results; where each division result includes multiple substrings; according to the substrings included in each division result, multiple subregular expressions corresponding to each division result are generated; Multiple sub-regular expressions are concatenated to obtain the regular expression corresponding to the division result.
- the processor 502 further performs the following operations: one-to-one correspondence to establish a data table according to the ID number of the cluster of each cluster; according to the field of the structured data selected in the cluster of each cluster, A field corresponding to the data table; the structured data included in the cluster of each cluster is filled into the corresponding field of the data table corresponding to the cluster according to the Fasttext text classification algorithm.
- the processor 502 further performs the following operations: acquiring multiple sub-regular expressions included in the regular expression corresponding to the clusters of each cluster, and unstructured clusters included in the clusters of each cluster The data are transformed with multiple sub-regular expressions corresponding to the cluster, and multiple initial transformation results corresponding to each unstructured data are obtained; multiple initial transformation results corresponding to the same unstructured data are concatenated to obtain Structured data corresponding to the unstructured data.
- the processor 502 further performs the following operation: adding a newline to the tail of multiple initial conversion results corresponding to the same unstructured data, and then concatenating to obtain the structured data corresponding to the unstructured data. .
- the embodiment of the computer device shown in FIG. 11 does not constitute a limitation on the specific configuration of the computer device.
- the computer device may include more or fewer components than shown in the figure. Either some parts are combined or different parts are arranged.
- the computer device may include only a memory and a processor. In such an embodiment, the structure and function of the memory and the processor are the same as those in the embodiment shown in FIG.
- the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor, or the processor may be any conventional processor.
- a storage medium may be a computer-readable storage medium.
- the storage medium stores a computer program, where the computer program includes program instructions. When the program instructions are executed by the processor, the method for structuring massive data in the embodiment of the present application is implemented.
- the storage medium may be an internal storage unit of the foregoing device, such as a hard disk or a memory of the device.
- the storage medium may also be an external storage device of the device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory card provided on the device. (Flash Card), etc.
- the storage medium may further include both an internal storage unit of the device and an external storage device.
- each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit.
- the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请实施例公开了一种海量数据结构化方法、装置、计算机设备及存储介质。该方法包括:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。该方法实现由聚类算法将海量的非结构化数据做聚类,每个簇对应生成一个正则表达式并应用到该簇的所有数据,这样海量非结构化数据都能快速转化为结构化数据,能快速的满足深度学习所需训练数据的需求。
Description
本申请要求于2018年5月25日提交中国专利局、申请号为201810515743.0、申请名称为“海量数据结构化方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及数据结构化技术领域,尤其涉及一种海量数据结构化方法、装置、计算机设备及存储介质。
目前,深度学习的训练需要依靠大量标注好的数据或结构化数据,但是将非结构化数据变成结构化数据需要投入大量的人力成本以通过手动转化的方式来进行数据结构化处理,这就导致获取深度学习所需训练数据的效率低下。
发明内容
本申请提供了一种海量数据结构化方法、装置、计算机设备及存储介质,旨在解决现有技术中将非结构化数据变成结构化数据需要投入大量的人力成本以通过手动转化的方式来进行数据结构化处理,导致获取深度学习所需训练数据的效率低下的问题。
第一方面,本申请提供了一种海量数据结构化方法,其包括:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
第二方面,本申请提供了一种海量数据结构化装置,其包括:聚类单元,用于将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;正则表达式获取单元,用于在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转 化为正则表达式;数据结构化单元,用于将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
第三方面,本申请又提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现本申请提供的任一项所述的海量数据结构化方法。
第四方面,本申请还提供了一种存储介质,其中所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行本申请提供的任一项所述的海量数据结构化方法。
本申请提供一种海量数据结构化方法、装置、计算机设备及存储介质。该方法实现由聚类算法将海量的非结构化数据做聚类,每个簇对应生成一个正则表达式并应用到该簇的所有数据,这样海量非结构化数据都能快速转化为结构化数据,能快速的满足深度学习所需训练数据的需求。
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种海量数据结构化方法的示意流程图;
图2为本申请实施例提供的一种海量数据结构化方法的另一示意流程图;
图3是本申请实施例提供的一种海量数据结构化方法的子流程示意图;
图4为本申请实施例提供的一种海量数据结构化方法的另一子流程示意图;
图5为本申请实施例提供的一种海量数据结构化方法的另一子流程示意图;
图6为本申请实施例提供的一种海量数据结构化装置的示意性框图;
图7为本申请实施例提供的一种海量数据结构化装置的另一示意性框图;
图8为本申请实施例提供的一种海量数据结构化装置的子单元示意性框图;
图9为本申请实施例提供的一种海量数据结构化装置的另一子单元示意性框图;
图10为本申请实施例提供的一种海量数据结构化装置的另一子单元示意性框图;
图11为本申请实施例提供的一种计算机设备的示意性框图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
请参阅图1,图1是本申请实施例提供的一种海量数据结构化方法的示意流程图。该方法应用于台式电脑、手提电脑、平板电脑等终端中。如图1所示,该方法包括步骤S101~S103。
S101、将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号。
在本实施例中,对非结构化数据进行聚类,是为了将具有相同或相似特征的非结构化数据归为一类。通过聚类进行分类后,能更加具有针对性的对每一聚类生成正则表达式,以实现后续的数据结构化处理。而且,对每一簇的聚类一一对应的ID编号是为了后续根据该ID编号对应建数据表格以存储所生成的结构化数据。
在一实施例中,如图3所示,所述步骤S101包括:
S1011、在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;
S1012、根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;
S1013、根据初始聚类结果,获取每一簇的调整后聚类中心;
S1014、根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
在本实施例中,对非结构化数据进行聚类时采用k-means算法进行,具体如下:
11)从n个非结构化数据中任意选取k个非结构化数据,并作为k个簇的初始聚类中心;其中,非结构化数据的初始总个数为n,从其中任意选择k个数据(k<n,k是用户指定的参数,即所期望的簇的个数,也即预设的聚类簇数), 将初始选择的k个数据作为初始聚类中心。
12)分别计算剩下的非结构化数据到k个簇初始聚类中心的相异度,将剩下的非结构化数据分别划归到相异度最低的簇,得到初始聚类结果;即是剩下的每一非结构化数据选择距其距离最近的初始聚类中心,并与该初始聚类中心归为一类;这样就以初始选择的初始聚类中心将海量的非结构化数据划分为k簇,每一簇数据都有一个初始聚类中心。
13)根据初始聚类结果,重新计算k个簇各自的聚类中心;具体计算方法是取每一簇中所有非结构化数据的各自维度的算术平均数,例如每一的非结构化数据具有3个维度,分别是商品编码,品牌,型号,就针对每一簇分别计算这三个维度的聚类中心,选择一个三个维度都符合算数平均值的非结构化数据作为新的聚类中心,重新选择该簇数据中更优的聚类中心。
14)将n个非结构化数据中全部元素按照新的中心重新聚类;
15)重复第14)步,直到聚类结果不再变化,得到与预设的聚类簇数对应的聚类结果。
在完成了聚类分类之后,再对每一最终聚类结果一一设置ID编号,即可实现快速的将海量的非结构化数据进行分组。
S102、在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式。
在本实施例中,在聚类结果中每一簇的聚类中均获取一非结构化数据时,可以是随机从每一簇聚类中获取一非结构化数据,也可以直接选择该簇聚类的聚类中心所对应的非结构化数据(例如k个簇的聚类则需要从每一簇聚类中都选择一个,一共选择k个非结构化数据)。完成对每一簇的聚类中均获取一非结构化数据时,则将所选中的k个非结构化数据均转化为正则表达式。
在一实施例中,如图4所示,所述步骤S102包括:
S1021、将所获取的与每一簇的聚类一一对应的非结构化数据根据字符类型进行划分,得到与所获取的非结构化数据一一对应的划分结果;其中,每一划分结果均包括多个子字符串;
S1022、根据每一划分结果所包括子字符串,生成与每一划分结果对应的多个子正则表达式;
S1023、将同一划分结果内对应的多个子正则表达式串接,得到该划分结果 对应的正则表达式。
例如,有一非结构化的初始数据如下:
8471701000固态硬盘品牌:Crucial|型号:CT1024M550SSD1|容量:1TB无缓存|无转速|用于计算机,非移动硬盘,接口类型:SATA III,传输速率:6Gbps
将非结构化的数据进行字符串进行划分后,再对每个字符串依次生成子正则表达式,将子正则表达式串接,得到与与该非结构化的数据对应的正则表达式;
例如,可以根据ABC生成对应的正则表达式\bABC\b;可以根据ABC123生成对应的正则表达式\bABc\b\d{3};根据ABC123-生成对应的正则表达式\bABC\b\d{3}-;根据ABC123-1生成对应的正则表达式\bABC\b\d{3}-\d;根据ABC123-1-生成对应的正则表达式\bABC\b\d{3}-\d-;根据ABC121-1-1生成对应的正则表达式\bABC\b\d{3}-\d-\d;根据ABC-1生成对应的正则表达式\bABC\b-\d。
上述举例的示例,包括以下步骤:
21)通过自动识别将非结构化的数据中的字符以字符类型(如数字类字符划为第一类、字母类字符划为第二类、符号类字符划分为第三类)将该示例划分为多段字符串;例如,将ABC121-1-1进行划分时,A、B、C是三个字母,C后面是1则是数字,此时作自动划分时则在C和1之间划分开;同样的,121中最后一位的1和第一个-之间划分开,第一个-与之后的第一个1之间划分开,第一个-与之后的第一个1与第二个-之间划分开,第二个-与最后一位1之间划分开,即按字符类型进行划分后得到了以下几段ABC、121、-、1、-、1;
22)选取非结构化数据划分得到的多段字符串中的每一段,并对应生成正则表达式。
通过上述转化,使得每一簇的聚类均得到一个正则表达式,通过该正则表达式的替换、检索等功能,将非结构化数据转化为结构化数据,实现了对海量的非结构化数据批量转化处理,提高了转化效率。
S103、将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
在本实施例中,由于每一聚类中被选出的非结构化数据都生成了对应的正则表达式,再根据正则表达式将每一聚类中剩余的非结构化数据进行转化,生 成结构化数据。例如上述示例中所列举的非结构化数据与正则表达式匹配后,即可对应标准化为结构化数据,其格式如下:
商品名称:固态硬盘
商品编码:8471701000
品牌:Crucial
型号:CT1024M550SSD1
用途:用于计算机
功能:存储器功能
容量:1TB。
通过正则表达式将海量的非结构化数据转化为结构化数据,提供数据规范化效率,节约开发时间。
在一实施例中,所述步骤S103包括:
获取每一簇的聚类所对应的正则表达式所包括的多个子正则表达式,将每一簇的聚类中所包括的非结构化数据均与该聚类对应的多个子正则表达式进行转化,得到与每一非结构化数据对应的多个初始转化结果;
将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据。
在本实施例中,由于每一簇的聚类所对应的正则表达式均是包括多个子正则表达式,故该簇聚类对应的非结构化数据均可以根据该簇聚类对应的正则表达式所包括多个子正则表达式分段进行匹配和转化,得到与每一非结构化数据对应的多个初始转化结果。此时,再与由子正则表达式串接形成正则表达式过程一样,同样通过串接的方式将同一非结构化数据对应的多个初始转化结果进行处理,得到该非结构化数据对应的结构化数据。通过分段转化的方式,能确保转化结果更加准确。
在一实施例中,将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据中,是将同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,得到该非结构化数据对应的结构化数据。
在本实施例中,通过对同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,使得在后续的存储阶段,更容易的识别结构化数 据的字段,一一对应建立数据表格的字段。
在一实施例中,如图2所示,所述步骤S103之后,还包括:
S104、将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
在一实施例中,如图5所示,所述步骤S104包括:
S1041、根据每一簇的聚类的ID编号,一一对应建立数据表格;
S1042、根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;
S1043、将每一簇的聚类中所包括结构化数据根据Fasttext文本分类算法填充至该聚类对应的数据表格的对应字段中。
在本实施例中,由于将非结构化的数据通过正则表达式转化后,需填充至数据库中的数据表格中进行存储,具体可以如下:
41)根据每一聚类的ID编号对应建立数据表格;
例如有N个聚类的ID编号,则对应建立N个数据表格,每一数据表格是相应的根据其中一个聚类的ID编号建立;
42)根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;
例如,在ID编号为1的聚类中,选定的结构化数据如:
商品名称:固态硬盘
商品编码:8471701000
品牌:Crucial
型号:CT1024M550SSD1
用途:用于计算机
功能:存储器功能
容量:1TB。
则在ID编号为1对应的数据表格中建立商品名称、商品编码、品牌、型号、用途、功能、容量的字段。
43)将聚类的ID编号所对应的每一条结构化数据按Fasttext文本分类算法填充至数据表格的对应字段中;
其中,Fasttext文本分类算法的模型如下:
其中,$<x_n,y_n>$是一条训练样本,$y_n$是训练目标,$x_n$是normalized bag of features。矩阵参数A是基于word的look-up table,也就是A是词的embedding向量。$Ax_n$矩阵运算的数学意义是将word的embedding向量找到后相加或者取平均,得到hidden向量。矩阵参数B是函数f的参数,函数f是一个多分类问题,所以$f(BAx_n)$是一个多分类的线性函数。优化目标是使的这个多分类问题的似然越大越好。
也即,通过Fasttext文本分类算法可以将每一结构化数据所包括的多个字段的数据对应填充至数据表中的对应字段中。
可见,该方法实现由聚类算法将海量的非结构化数据做聚类,每个簇对应生成一个正则表达式并应用到该簇的所有数据,这样海量非结构化数据都能快速转化为结构化数据,能快速的满足深度学习所需训练数据的需求。
本申请实施例还提供一种海量数据结构化装置,该海量数据结构化装置用于执行前述海量数据结构化方法的任一实施例。具体地,请参阅图6,图6是本申请实施例提供的一种海量数据结构化装置的示意性框图。海量数据结构化装置100可以配置于台式电脑、平板电脑、手提电脑、等终端中。
如图6所示,海量数据结构化装置100包括聚类单元101、正则表达式获取单元102、数据结构化单元103。
聚类单元101,用于将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号。
在一实施例中,如图8所示,所述聚类单元101包括:
初始中心选择单元1011,用于在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;初始聚类单元1012,用于根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;聚类中心调整单元1013,用于根据初始聚类结果,获取每一簇的调整后聚类中心;聚类调整单元1014,用于根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
正则表达式获取单元102,用于在聚类结果中每一簇的聚类中均获取一非结 构化数据,并将所获取的非结构化数据对应转化为正则表达式。
在一实施例中,如图9所示,所述正则表达式获取单元102包括:
字符串划分单元1021,用于将所获取的与每一簇的聚类一一对应的非结构化数据根据字符类型进行划分,得到与所获取的非结构化数据一一对应的划分结果;其中,每一划分结果均包括多个子字符串;
分段生成单元1022,用于根据每一划分结果所包括子字符串,生成与每一划分结果对应的多个子正则表达式;
串接单元1023,用于将同一划分结果内对应的多个子正则表达式串接,得到该划分结果对应的正则表达式。
数据结构化单元103,用于将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
在一实施例中,所述数据结构化单元103包括:
初始转化结果获取单元,用于获取每一簇的聚类所对应的正则表达式所包括的多个子正则表达式,将每一簇的聚类中所包括的非结构化数据均与该聚类对应的多个子正则表达式进行转化,得到与每一非结构化数据对应的多个初始转化结果;
初始转化结果串接单元,用于将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据。
在一实施例中,在初始转化结果串接单元中,是将同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,得到该非结构化数据对应的结构化数据。
在一实施例中,如图7所示,所述海量数据结构化装置100,还包括:
分类存储单元104,用于将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
在一实施例中,如图10所示,所述分类存储单元104包括:
表格建立单元1041,用于根据每一簇的聚类的ID编号,一一对应建立数据表格;
字段建立单元1042,用于根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;
分类填充单元1043,用于将每一簇的聚类中所包括结构化数据根据Fasttext 文本分类算法填充至该聚类对应的数据表格的对应字段中。
可见,该装置实现由聚类算法将海量的非结构化数据做聚类,每个簇对应生成一个正则表达式并应用到该簇的所有数据,这样海量非结构化数据都能快速转化为结构化数据,能快速的满足深度学习所需训练数据的需求。
上述海量数据结构化装置可以实现为一种计算机程序的形式,该计算机程序可以在如图11所示的计算机设备上运行。
请参阅图11,图11是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500设备可以是终端。该终端可以是平板电脑、笔记本电脑、台式电脑、个人数字助理等电子设备。
参阅图11,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032包括程序指令,该程序指令被执行时,可使得处理器502执行一种海量数据结构化方法。
该处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种海量数据结构化方法。
该网络接口505用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现如下功能:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
在一实施例中,处理器502还执行如下操作:将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
在一实施例中,处理器502还执行如下操作:在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;根据初始聚类结果,获取每一簇的调整后聚类中心;根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
在一实施例中,处理器502还执行如下操作:将所获取的与每一簇的聚类一一对应的非结构化数据根据字符类型进行划分,得到与所获取的非结构化数据一一对应的划分结果;其中,每一划分结果均包括多个子字符串;根据每一划分结果所包括子字符串,生成与每一划分结果对应的多个子正则表达式;将同一划分结果内对应的多个子正则表达式串接,得到该划分结果对应的正则表达式。
在一实施例中,处理器502还执行如下操作:根据每一簇的聚类的ID编号,一一对应建立数据表格;根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;将每一簇的聚类中所包括结构化数据根据Fasttext文本分类算法填充至该聚类对应的数据表格的对应字段中。
在一实施例中,处理器502还执行如下操作:获取每一簇的聚类所对应的正则表达式所包括的多个子正则表达式,将每一簇的聚类中所包括的非结构化数据均与该聚类对应的多个子正则表达式进行转化,得到与每一非结构化数据对应的多个初始转化结果;将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据。
在一实施例中,处理器502还执行如下操作:将同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,得到该非结构化数据对应的结构化数据。
本领域技术人员可以理解,图11中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实 施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图11所示实施例一致,在此不再赘述。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
在本申请的另一实施例中提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序,其中计算机程序包括程序指令。该程序指令被处理器执行时实现本申请实施例的海量数据结构化方法。
所述存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存。所述存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储介质还可以既包括所述设备的内部存储单元也包括外部存储设备。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。
Claims (20)
- 一种海量数据结构化方法,其特征在于,包括:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
- 根据权利要求1所述的海量数据结构化方法,其特征在于,所述将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据之后,还包括:将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
- 根据权利要求1所述的海量数据结构化方法,其特征在于,所述将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,包括:在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;根据初始聚类结果,获取每一簇的调整后聚类中心;根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
- 根据权利要求1所述的海量数据结构化方法,其特征在于,所述将所获取的非结构化数据对应转化为正则表达式,包括:将所获取的与每一簇的聚类一一对应的非结构化数据根据字符类型进行划分,得到与所获取的非结构化数据一一对应的划分结果;其中,每一划分结果均包括多个子字符串;根据每一划分结果所包括子字符串,生成与每一划分结果对应的多个子正则表达式;将同一划分结果内对应的多个子正则表达式串接,得到该划分结果对应的正则表达式。
- 根据权利要求2所述海量数据结构化方法,其特征在于,所述将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储,包括:根据每一簇的聚类的ID编号,一一对应建立数据表格;根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;将每一簇的聚类中所包括结构化数据根据Fasttext文本分类算法填充至该聚类对应的数据表格的对应字段中。
- 根据权利要求4所述海量数据结构化方法,其特征在于,所述将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据,包括:获取每一簇的聚类所对应的正则表达式所包括的多个子正则表达式,将每一簇的聚类中所包括的非结构化数据均与该聚类对应的多个子正则表达式进行转化,得到与每一非结构化数据对应的多个初始转化结果;将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据。
- 根据权利要求6所述海量数据结构化方法,其特征在于,所述将同一非结构化数据对应的初始转化结果进行串接,得到该非结构化数据对应的结构化数据,包括:将同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,得到该非结构化数据对应的结构化数据。
- 一种海量数据结构化装置,其特征在于,包括:聚类单元,用于将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;正则表达式获取单元,用于在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;数据结构化单元,用于将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
- 根据权利要求8所述海量数据结构化装置,其特征在于,还包括:分类存储单元,用于将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
- 根据权利要求8所述海量数据结构化装置,其特征在于,所述聚类单元包括:初始中心选择单元,用于在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;初始聚类单元,用于根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;聚类中心调整单元,用于根据初始聚类结果,获取每一簇的调整后聚类中心;聚类调整单元,用于根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
- 根据权利要求8所述海量数据结构化装置,其特征在于,所述正则表达式获取单元包括:字符串划分单元,用于将所获取的与每一簇的聚类一一对应的非结构化数据根据字符类型进行划分,得到与所获取的非结构化数据一一对应的划分结果;其中,每一划分结果均包括多个子字符串;分段生成单元,用于根据每一划分结果所包括子字符串,生成与每一划分结果对应的多个子正则表达式;串接单元,用于将同一划分结果内对应的多个子正则表达式串接,得到该划分结果对应的正则表达式。
- 根据权利要求9所述海量数据结构化装置,其特征在于,所述分类存储单元包括:表格建立单元,用于根据每一簇的聚类的ID编号,一一对应建立数据表格;字段建立单元,用于根据每一簇的聚类中所选定结构化数据的字段,一一对应建立数据表格的字段;分类填充单元,用于将每一簇的聚类中所包括结构化数据根据Fasttext文本分类算法填充至该聚类对应的数据表格的对应字段中。
- 根据权利要求11所述海量数据结构化装置,其特征在于,所述数据结构化单元包括:初始转化结果获取单元,用于获取每一簇的聚类所对应的正则表达式所包括的多个子正则表达式,将每一簇的聚类中所包括的非结构化数据均与该聚类对应的多个子正则表达式进行转化,得到与每一非结构化数据对应的多个初始转化结果;初始转化结果串接单元,用于将同一非结构化数据对应的多个初始转化结果进行串接,得到该非结构化数据对应的结构化数据。
- 根据权利要求13所述海量数据结构化装置,其特征在于,所述初始转化结果串接单元中,是将同一非结构化数据对应的多个初始转化结果尾部均增加一转行符后再进行串接,得到该非结构化数据对应的结构化数据。
- 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下步骤:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
- 根据权利要求15所述的计算机设备,其特征在于,所述将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据之后,还包括:将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
- 根据权利要求15所述的计算机设备,其特征在于,所述将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,包括:在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据 进行划分,得到初始聚类结果;根据初始聚类结果,获取每一簇的调整后聚类中心;根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
- 一种存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行以下操作:将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,并设置与每一簇的聚类一一对应的ID编号;在聚类结果中每一簇的聚类中均获取一非结构化数据,并将所获取的非结构化数据对应转化为正则表达式;将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据。
- 根据权利要求18所述的存储介质,其特征在于,所述将每一簇的聚类中所包括的非结构化数据均根据该聚类对应的正则表达式进行转化,得到结构化数据之后,还包括:将每一簇的聚类中的每一结构化数据根据文本分类算法填充至该聚类对应的数据表格中进行存储。
- 根据权利要求18所述的存储介质,其特征在于,所述将非结构化数据进行聚类,得到与预设的聚类簇数对应的聚类结果,包括:在多个非结构化数据中选取与预设的聚类簇数相同个数的非结构化数据,将所选取的非结构化数据作为每一簇的初始聚类中心;根据多个非结构化数据与各初始聚类中心的相异值,将多个非结构化数据进行划分,得到初始聚类结果;根据初始聚类结果,获取每一簇的调整后聚类中心;根据调整后聚类中心,将多个非结构化数据进行划分,直至聚类结果保持相同的次数多于预设的次数,得到与预设的聚类簇数对应的聚类结果。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810515743.0 | 2018-05-25 | ||
| CN201810515743.0A CN108717461B (zh) | 2018-05-25 | 2018-05-25 | 海量数据结构化方法、装置、计算机设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019223153A1 true WO2019223153A1 (zh) | 2019-11-28 |
Family
ID=63900343
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/102468 Ceased WO2019223153A1 (zh) | 2018-05-25 | 2018-08-27 | 海量数据结构化方法、装置、计算机设备及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108717461B (zh) |
| WO (1) | WO2019223153A1 (zh) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109961086B (zh) * | 2019-01-28 | 2024-05-31 | 平安科技(深圳)有限公司 | 基于聚类和sse的异常点比例优化方法及装置 |
| CN110472031A (zh) * | 2019-08-13 | 2019-11-19 | 北京知道创宇信息技术股份有限公司 | 一种正则表达式获得方法、装置、电子设备及存储介质 |
| CN110909160A (zh) * | 2019-10-11 | 2020-03-24 | 平安科技(深圳)有限公司 | 正则表达式生成方法、服务器及计算机可读存储介质 |
| CN111177504A (zh) * | 2019-12-27 | 2020-05-19 | 深圳市元征科技股份有限公司 | 一种数据处理方法、装置及存储介质 |
| CN111339052A (zh) * | 2020-02-28 | 2020-06-26 | 中国银联股份有限公司 | 一种非结构化日志数据处理方法及装置 |
| CN115840904B (zh) * | 2021-11-30 | 2025-12-19 | 北京航空航天大学 | 基于卷积神经网络的盾构机故障类型构建及故障诊断方法 |
| CN117076454B (zh) * | 2023-08-21 | 2024-03-12 | 广州地铁集团有限公司 | 一种工程质量验收表单数据结构化存储方法及系统 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102346766A (zh) * | 2011-09-20 | 2012-02-08 | 北京邮电大学 | 基于极大团发现的网络热点话题检测方法及装置 |
| CN102567405A (zh) * | 2010-12-31 | 2012-07-11 | 北京安码科技有限公司 | 一种基于改进的文本空间向量表示的热点发现方法 |
| CN104881424A (zh) * | 2015-03-13 | 2015-09-02 | 国家电网公司 | 一种基于正则表达式的电力大数据采集、存储及分析方法 |
| CN105574156A (zh) * | 2015-12-16 | 2016-05-11 | 华为技术有限公司 | 文本聚类方法、装置及计算设备 |
| CN106055608A (zh) * | 2016-05-25 | 2016-10-26 | 北京百度网讯科技有限公司 | 自动采集和分析交换机日志的方法和装置 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20130085069A (ko) * | 2012-01-18 | 2013-07-29 | 삼성전자주식회사 | 엔-그램 인덱스 기반의 다차원 문자열 질의 처리 장치 및 방법 |
| CN105022740A (zh) * | 2014-04-23 | 2015-11-04 | 苏州易维迅信息科技有限公司 | 非结构化数据的处理方法和装置 |
| CN105049247B (zh) * | 2015-07-06 | 2019-04-26 | 中国科学院信息工程研究所 | 一种网络安全日志模板抽取方法及装置 |
| CN107622093A (zh) * | 2017-08-29 | 2018-01-23 | 苏州优圣美智能系统有限公司 | 一种从非结构化数据提取结构化数据的系统 |
-
2018
- 2018-05-25 CN CN201810515743.0A patent/CN108717461B/zh active Active
- 2018-08-27 WO PCT/CN2018/102468 patent/WO2019223153A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102567405A (zh) * | 2010-12-31 | 2012-07-11 | 北京安码科技有限公司 | 一种基于改进的文本空间向量表示的热点发现方法 |
| CN102346766A (zh) * | 2011-09-20 | 2012-02-08 | 北京邮电大学 | 基于极大团发现的网络热点话题检测方法及装置 |
| CN104881424A (zh) * | 2015-03-13 | 2015-09-02 | 国家电网公司 | 一种基于正则表达式的电力大数据采集、存储及分析方法 |
| CN105574156A (zh) * | 2015-12-16 | 2016-05-11 | 华为技术有限公司 | 文本聚类方法、装置及计算设备 |
| CN106055608A (zh) * | 2016-05-25 | 2016-10-26 | 北京百度网讯科技有限公司 | 自动采集和分析交换机日志的方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108717461B (zh) | 2021-03-26 |
| CN108717461A (zh) | 2018-10-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019223153A1 (zh) | 海量数据结构化方法、装置、计算机设备及存储介质 | |
| CN111868710B (zh) | 搜索大规模非结构化数据的随机提取森林索引结构 | |
| CN111949648B (zh) | 内存缓存数据系统和数据索引方法 | |
| CN112084366A (zh) | 用于检索图像的方法、装置、设备以及存储介质 | |
| CN104572685B (zh) | 数据排序方法 | |
| CN109697641A (zh) | 计算商品相似度的方法和装置 | |
| CN111950279A (zh) | 实体关系的处理方法、装置、设备及计算机可读存储介质 | |
| US11200466B2 (en) | Machine learning classifiers | |
| CN107679022A (zh) | 生僻字处理方法及其系统 | |
| CN101685502A (zh) | 模式匹配方法及装置 | |
| CN108694205B (zh) | 匹配目标字段的方法、装置 | |
| CN110532425A (zh) | 视频数据分布式存储方法、装置、计算机设备及存储介质 | |
| CN104090865B (zh) | 文本相似度计算方法及装置 | |
| WO2019080412A1 (zh) | 数据服务方法、电子装置及存储介质 | |
| CN109815475B (zh) | 文本匹配方法、装置、计算设备及系统 | |
| CN113326416A (zh) | 检索数据的方法、向客户端发送检索数据的方法及装置 | |
| WO2025139305A1 (zh) | 数据查找方法、装置、电子设备及存储介质 | |
| CN109783816B (zh) | 短文本聚类方法及终端设备 | |
| CN111782812A (zh) | K-Means文本聚类方法、装置及终端设备 | |
| WO2017157038A1 (zh) | 数据处理的方法、装置和设备 | |
| CN115344506B (zh) | 内存地址的映射方法、内存访问方法和装置、芯片、设备 | |
| CN105653713B (zh) | 一种确定设备识别码存在的方法及装置 | |
| CN116389090A (zh) | 数据加密、解密的方法、装置、电子设备和存储介质 | |
| CN116303831A (zh) | 数据处理方法和装置、计算机可读存储介质和电子设备 | |
| CN114254009A (zh) | 数据处理方法、装置、计算机设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18920048 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18920048 Country of ref document: EP Kind code of ref document: A1 |
