Data storage method and device

文档序号:1087056 发布日期:2020-10-20 浏览:4次 中文

阅读说明:本技术 一种存储数据的方法及装置 (Data storage method and device ) 是由 冯智超 于 2020-07-17 设计创作,主要内容包括:本发明提供了一种存储数据的方法及装置,其中,该存储数据的方法包括:针对待存储半结构化数据集中的每条半结构化数据,依据该半结构化数据包含的字段,对该字段包含的内容进行编码,得到编码字段内容;分别以各字段为列构建数据库表,将半结构化数据对应的各编码字段内容存储至数据库表中该半结构化数据对应的行列,每条半结构化数据对应数据库表中的一行;将构建的数据库表存储至关系型数据库。可以提高数据的挖掘价值。(The invention provides a method and a device for storing data, wherein the method for storing data comprises the following steps: for each piece of semi-structured data in a semi-structured data set to be stored, coding the content contained in the field according to the field contained in the semi-structured data to obtain the content of the coded field; respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table; and storing the constructed database table to a relational database. The mining value of the data can be improved.)

1. A method of storing data, comprising:

for each piece of semi-structured data in a semi-structured data set to be stored, coding the content contained in the field according to the field contained in the semi-structured data to obtain the content of the coded field;

respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table;

and storing the constructed database table to a relational database.

2. The method of claim 1, wherein storing each encoded field corresponding to the semi-structured data into a database table for a row and a column corresponding to the semi-structured data comprises:

newly adding rows corresponding to the semi-structured data in the database table;

in a new added line, positioning a column where a field corresponding to the content of the coded field of the semi-structured data is located, and filling the content of the coded field into the positioned column in the new added line.

3. The method according to claim 1 or 2, characterized in that the method further comprises:

receiving a statistical analysis request, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request, wherein the relational database is a clickhouse database;

calling an array connection instruction, and expanding the content of the coded field into a plurality of rows according to separators contained in the content of the coded field in each row aiming at each row in the target row, wherein the content corresponding to each separator is one row;

and calling an application program interface statistical instruction to perform statistics on the contents in the expanded columns.

4. The method according to claim 1 or 2, characterized in that the method further comprises:

setting an incremental table, carrying out left association on a structured query statement statistical analysis request and the incremental table, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the structured query statement statistical analysis request, wherein the relational database is an AnalyticDB database;

calling an API split _ part function, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column;

and counting the contents in the expanded columns based on the associated increment table.

5. An apparatus for storing data, comprising:

the encoding module is used for encoding the content contained in each piece of semi-structured data in the semi-structured data set to be stored according to the field contained in the semi-structured data to obtain the content of the encoded field;

the writing module is used for respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table;

and the storage module is used for storing the constructed database table to the relational database.

6. The apparatus of claim 5, wherein the write module comprises:

the row processing unit is used for respectively constructing a database table by taking each field as a column, and newly adding rows corresponding to the semi-structured data in the database table;

and the positioning writing unit is used for positioning the column where the field corresponding to the coded field content of the semi-structured data is located in the new added row and filling the coded field content into the positioned column in the new added row.

7. The apparatus of claim 5 or 6, further comprising:

the system comprises a first statistical analysis module, a second statistical analysis module and a third statistical analysis module, wherein the first statistical analysis module is used for receiving a statistical analysis request, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request, and the relational database is a clickhouse database; calling an array connection instruction, and expanding the content of the coded field into a plurality of rows according to separators contained in the content of the coded field in each row aiming at each row in the target row, wherein the content corresponding to each separator is one row; and calling an application program interface statistical instruction to perform statistics on the contents in the expanded columns.

8. The apparatus of claim 5 or 6, further comprising:

the second statistical analysis module is used for setting an incremental table, performing left association on the statistical analysis request of the structured query statement and the incremental table, and acquiring a target column matched with the statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request of the structured query statement, wherein the relational database is an AnalyticDB database; calling an API split _ part function, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column; and counting the contents in the expanded columns based on the associated increment table.

9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the method of storing data according to any one of claims 1 to 4.

10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of storing data according to any one of claims 1 to 4.

Technical Field

The invention relates to the technical field of data storage, in particular to a method and a device for storing data.

Background

With the rapid development of communication technology and internet, the data volume of each industry shows geometric progression increase. Data has become an important asset for an enterprise or company, and since a relational database has a logical expression that can implement data using a two-dimensional table structure and can perform data using a Structured Query Language (SQL) syntax, it is very efficient and convenient. Therefore, the raw data is collected through big data technology, the structured data is extracted from the raw data, the extracted structured data is stored in a relational analysis database, and data mining is performed based on the analysis database, so that the development and layout of enterprises or companies are guided, or references are provided for the development of the enterprises or companies. However, since the structured data has a small proportion in the mass data (the collected original data), the amount of data stored in the analysis database available for analysis and mining is small, and the data mining value is reduced.

Disclosure of Invention

In view of the above, the present invention provides a method and an apparatus for storing data to improve the mining value of data.

In a first aspect, an embodiment of the present invention provides a method for storing data, including:

for each piece of semi-structured data in a semi-structured data set to be stored, coding the content contained in the field according to the field contained in the semi-structured data to obtain the content of the coded field;

respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table;

and storing the constructed database table to a relational database.

With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the storing, to a database table, contents of each encoding field corresponding to semi-structured data to a row and a column corresponding to the semi-structured data includes:

newly adding rows corresponding to the semi-structured data in the database table;

in a new added line, positioning a column where a field corresponding to the content of the coded field of the semi-structured data is located, and filling the content of the coded field into the positioned column in the new added line.

With reference to the first aspect or the first possible implementation manner of the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the method further includes:

receiving a statistical analysis request, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request, wherein the relational database is a clickhouse database;

calling an array connection instruction, and expanding the content of the coded field into a plurality of rows according to separators contained in the content of the coded field in each row aiming at each row in the target row, wherein the content corresponding to each separator is one row;

and calling an application program interface statistical instruction to perform statistics on the contents in the expanded columns.

With reference to the first aspect or the first possible implementation manner of the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the method further includes:

setting an incremental table, carrying out left association on a structured query statement statistical analysis request and the incremental table, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the structured query statement statistical analysis request, wherein the relational database is an AnalyticDB database;

calling an API split _ part function, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column;

and counting the contents in the expanded columns based on the associated increment table.

In a second aspect, an embodiment of the present invention further provides an apparatus for storing data, including:

the encoding module is used for encoding the content contained in each piece of semi-structured data in the semi-structured data set to be stored according to the field contained in the semi-structured data to obtain the content of the encoded field;

the writing module is used for respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table;

and the storage module is used for storing the constructed database table to the relational database.

With reference to the second aspect, an embodiment of the present invention provides a first possible implementation manner of the second aspect, where the writing module includes:

the row processing unit is used for respectively constructing a database table by taking each field as a column, and newly adding rows corresponding to the semi-structured data in the database table;

and the positioning writing unit is used for positioning the column where the field corresponding to the coded field content of the semi-structured data is located in the new added row and filling the coded field content into the positioned column in the new added row.

With reference to the second aspect or the first possible implementation manner of the second aspect, an embodiment of the present invention provides a second possible implementation manner of the second aspect, where the method further includes:

the system comprises a first statistical analysis module, a second statistical analysis module and a third statistical analysis module, wherein the first statistical analysis module is used for receiving a statistical analysis request, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request, and the relational database is a clickhouse database; calling an array connection instruction, and expanding the content of the coded field into a plurality of rows according to separators contained in the content of the coded field in each row aiming at each row in the target row, wherein the content corresponding to each separator is one row; and calling an application program interface statistical instruction to perform statistics on the contents in the expanded columns.

With reference to the second aspect or the first possible implementation manner of the second aspect, an embodiment of the present invention provides a third possible implementation manner of the second aspect, where the method further includes:

the second statistical analysis module is used for setting an incremental table, performing left association on the statistical analysis request of the structured query statement and the incremental table, and acquiring a target column matched with the statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request of the structured query statement, wherein the relational database is an AnalyticDB database; calling an API split _ part function, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column; and counting the contents in the expanded columns based on the associated increment table.

In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.

In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, performs the steps of the method described above.

According to the method and the device for storing data, provided by the embodiment of the invention, aiming at each piece of semi-structured data in a semi-structured data set to be stored, according to the field contained in the semi-structured data, the content contained in the field is coded to obtain the content of the coded field; respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table; and storing the constructed database table to a relational database. In this way, by extracting the fields contained in the semi-structured data, encoding a plurality of contents contained in the fields, and filling the fields into the rows and columns corresponding to the fields, the semi-structured data is expressed by a database two-dimensional logic table and can be stored in a relational database, the data volume stored in the analysis database is effectively expanded, the data volume which can be used for analysis and mining in the analysis database is increased, and the mining value of the data is effectively improved.

In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.

FIG. 1 is a flow chart illustrating a method for storing data according to an embodiment of the present invention;

FIG. 2 is a schematic diagram illustrating an apparatus for storing data according to an embodiment of the present invention;

fig. 3 is a schematic structural diagram of a computer device 300 according to an embodiment of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.

The embodiment of the invention provides a method and a device for storing data, which are described by embodiments below.

Unstructured data cannot be represented in a database two-dimensional logical table, such as an office document, text, a picture, a report, an image, an audio video, and the like, as opposed to structured data stored in an analytical database, such as a relational database. The office document, the text, the report form and the like are text data with identifiable modes (such as marks), and the text data are called semi-structured data, so that the semi-structured data with the identifiable modes are encoded to form a database two-dimensional logic table and can be stored in an analysis database in the embodiment of the invention, so that the data volume stored in the analysis database is effectively expanded, more semi-structured data mining samples can be provided during data mining, more semi-structured data participate in data mining, and the data mining value is improved.

Fig. 1 is a schematic flow chart illustrating a method for storing data according to an embodiment of the present invention. As shown in fig. 1, the method includes:

step 101, aiming at each piece of semi-structured data in a semi-structured data set to be stored, encoding the content contained in the field according to the field contained in the semi-structured data to obtain the content of the encoded field;

in embodiments of the present invention, the semi-structured data includes, but is not limited to: office documents, texts, reports. As an alternative embodiment, taking semi-structured data as a piece of project annual profit information data as an example, it is assumed that the project annual profit information data includes an array field and a basic Hash (Hash) field, where the content included in the array field is a list of names of employees participating in a project, and the content included in the basic Hash field is the turnover of different cities, and the unit is ten thousand. The employee names list is illustrated as follows:

[ 'pony', 'small beauty', 'small day' ]

Examples of turnover in different cities are as follows:

{ 'Beijing': 14, 'Shanghai': 24, 'Xian': 33}

In the embodiment of the invention, the content of the coding field obtained by coding the employee name list is as follows:

"pony horse; the product is small and beautiful; xiaotian'

The contents of the coding fields obtained by coding the turnover of different cities are as follows:

'Beijing: 14, Shanghai: 24 and Xian: 33'

102, respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table;

in the embodiment of the invention, the annual income information data of the project is taken as an example, the data comprises array fields and basic hash fields, the constructed database table comprises 2 columns, and the column names are identified by the fields. In the embodiment of the present invention, field _1 represents an array field, and field _2 represents a basic hash field.

In this embodiment of the present invention, as an optional embodiment, storing each encoded field content corresponding to semi-structured data in a database table to a row and a column corresponding to the semi-structured data includes:

a11, adding new rows corresponding to semi-structured data in the database table;

and A12, in a new additional line, positioning a column where a field corresponding to the content of the encoding field of the semi-structured data is positioned, and filling the content of the encoding field into the positioned column in the new additional line.

In the embodiment of the invention, for each piece of semi-structured data, the encoding field content corresponding to the array field is filled into the array field column in the row corresponding to the semi-structured data in the database table, and the encoding field content corresponding to the basic hash field is filled into the basic hash field column in the row corresponding to the semi-structured data in the database table. In this way, a plurality of contents corresponding to the field are encoded to form an integral encoded field content, and the integral encoded field content has the characteristic of structured data, so that the purpose of storing in the relational database is realized.

In the embodiment of the present invention, after the content of each encoding field corresponding to the semi-structured data is stored in the row and column corresponding to the semi-structured data in the database table, the obtained database table is shown in table 1.

TABLE 1

field_1 field_2
"pony horse; the product is small and beautiful; xiaotian' 'Beijing: 14, Shanghai: 24 and Xian: 33'

In the embodiment of the present invention, it is assumed that the semi-structured data set to be stored includes two pieces of semi-structured data, the other piece of project annual revenue information data also includes an array field and a basic hash field, and the content included in the array field is an employee name list, which is exemplified as follows:

[ 'pony', 'smallpox', 'plum' ]

The content of the coding field obtained by coding the employee name list is as follows:

"pony horse; in small days; small plum "

The content contained in the basic hash field is the turnover of different cities, the unit is ten thousand, and the example is as follows:

{ ' Beijing ': 14, ' Shenzhen ': 21, ' xi ' an ': 13}

The contents of the coding fields obtained by coding the turnover of different cities are as follows:

'Beijing: 14, Shenzhen: 21, Xian: 13'

The resulting database table is shown in table 2.

TABLE 2

field_1 field_2
"pony horse; the product is small and beautiful; xiaotian' 'Beijing: 14, Shanghai: 24 and Xian: 33'
"pony horse; in small days; small plum " ' Beijing: 14, Shenzhen: 21, Xian:13’

In this embodiment of the present invention, as an optional embodiment, each piece of semi-structured data included in the semi-structured data set to be stored may include different fields. If the semi-structured data contains a field in the database table, filling the coded field content corresponding to the field into the column corresponding to the field of the row where the semi-structured data is located.

And 103, storing the constructed database table to a relational database.

According to the method for storing data, aiming at each piece of semi-structured data in a semi-structured data set to be stored, according to fields contained in the semi-structured data, the content contained in the fields is coded to obtain the content of coded fields; respectively constructing a database table by taking each field as a column, storing each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, wherein each piece of semi-structured data corresponds to one row in the database table; and storing the constructed database table to a relational database. In this way, by extracting the fields contained in the semi-structured data, encoding a plurality of contents contained in the fields, and filling the fields into the rows and columns corresponding to the fields, the semi-structured data is expressed by a database two-dimensional logic table and is converted into structured data, the structured data can be stored in a relational database with very high performance, the data volume stored in an analysis database is effectively expanded, the data volume which can be used for analysis and mining in the analysis database is increased, the mining value of the data is effectively improved, and the performance in the aspect of real-time online analysis is improved; meanwhile, the semi-structured data is stored in the relational database with very high performance, so that the query performance of the semi-structured data can be improved.

In this embodiment of the present invention, as an optional embodiment, the method further includes:

a21, receiving a statistical analysis request, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the statistical analysis request, wherein the relational database is a clickhouse database;

a22, calling an array connection instruction, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column;

and A23, calling an application program interface counting instruction to count the contents in the expanded column.

In the embodiment of the invention, after the semi-structured data is coded and stored in the relational database, the analysis of the data is completed by utilizing the SQL grammar and the API provided by the relational database.

In the embodiment of the present invention, taking the statistics of the number of items participated by an individual as an example, the statistical keyword in the statistical analysis request may be an array field name, and by query matching, the field _1 column in table 2 may be obtained as a target column matching the statistical keyword. In row "pony" in target column; the product is small and beautiful; for example, the small day, the content of the coded field is 'small horse'; the product is small and beautiful; the small day "was spread into 3 columns.

In the embodiment of the present invention, the program code segment for implementing the statistical analysis is as follows:

select choice as name,count(*)from entries ARRAY JOIN splitByChar(';',field_1)as choice

in the embodiment of the present invention, for the case of performing statistical analysis according to the urban statistical turnover, the corresponding program code segments are as follows:

select city,sum(num)as turnover form(select substring(choice,1,position(choice,':'))as city,toUInt32(substring(choice,position(choice,':')))as num from entries ARRAY JOIN splitByChar(',',field_1)as choice)group bycity

in this embodiment, as another optional embodiment, the method further includes:

a31, setting an incremental table, performing left association on a structured query statement statistical analysis request and the incremental table, and acquiring a target column matched with a statistical keyword from a relational database according to the statistical keyword contained in the structured query statement statistical analysis request, wherein the relational database is an AnalyticDB database;

in the embodiment of the present invention, the increment table (increment _ table) is set as shown in table 3.

TABLE 3

Figure BDA0002589972190000101

Figure BDA0002589972190000111

A32, calling an API split _ part function, and expanding the content of the coding field into a plurality of columns according to separators contained in the content of the coding field in each row in the target column, wherein the content corresponding to each separator is one column;

a33, counting the contents in the expanded column based on the associated increment table.

In the embodiment of the invention, an incremental table is used for association, the expansion of a row of data (coding field content) to a plurality of rows of data (content) is completed, an API split _ part function is used for data decomposition, and a sum function is used for statistics.

In the embodiment of the present invention, the program code segment for implementing the statistical analysis is as follows:

with T2 as(select split_part(a.field_1,';',b.subindex)as choice,1ascount from entries as a join incre_table as b on b.subindex<(length(a.field_1)-length(replace(a.field_1,';',”))+1))select choice,COUNT(*)FROM T2 GROUP BYchoice;

in the embodiment of the present invention, for the case of performing statistical analysis according to the urban statistical turnover, the corresponding program code segments are as follows:

with T2 as(select split_part(a.field_1,',',b.subindex)as choice,1ascount from entries as a join incre_table as b on b.subindex<(length(a.field_1)-length(replace(a.field_1,',',”))+1))select split_part(a.field_1,':',1)ascity,sum(split_part(a.field_1,':',2))as turnover FROM T2 GROUP BY split_part(a.field_1,',',1)as name

in the embodiment of the present invention, the statistical analysis results for the number of the items participating in the statistical individuals are shown in table 4.

TABLE 4

name count(*)
Small horse 2
Xiaomei (beautiful) 1
Small sky 2
Plum 1

In the embodiment of the present invention, statistical analysis is performed according to the urban statistical turnover, and the statistical analysis result is shown in table 5.

TABLE 5

city Turnover (Wan)
Beijing 28
Shanghai province 24
Shenzhen (Shenzhen medicine) 21
Xian (medicine for curing acute and chronic hepatitis) 46

Fig. 2 is a schematic structural diagram of an apparatus for storing data according to an embodiment of the present invention. As shown in fig. 2, the apparatus includes:

the encoding module 201 is configured to encode, according to a field included in each piece of semi-structured data in a semi-structured data set to be stored, content included in the field according to the semi-structured data, so as to obtain encoded field content;

in embodiments of the present invention, the semi-structured data includes, but is not limited to: office documents, texts, reports.

The writing module 202 is configured to respectively construct a database table by using each field as a column, store each coded field content corresponding to the semi-structured data to a row and a column corresponding to the semi-structured data in the database table, where each semi-structured data corresponds to one row in the database table;

in this embodiment of the present invention, as an optional embodiment, the writing module 202 includes:

a row processing unit (not shown in the figure) for respectively constructing a database table by using each field as a column, and adding a row corresponding to the semi-structured data in the database table;

and the positioning writing unit is used for positioning the column where the field corresponding to the coded field content of the semi-structured data is located in the new added row and filling the coded field content into the positioned column in the new added row.

In the embodiment of the invention, for each piece of semi-structured data, the encoding field content corresponding to the array field is filled into the array field column in the row corresponding to the semi-structured data in the database table, and the encoding field content corresponding to the basic hash field is filled into the basic hash field column in the row corresponding to the semi-structured data in the database table.

And the storage module 203 is used for storing the constructed database table to a relational database.

In this embodiment of the present invention, as an optional embodiment, the apparatus further includes:

a first statistical analysis module (not shown in the figure), configured to receive a statistical analysis request, and obtain, according to a statistical keyword included in the statistical analysis request, a target column matching the statistical keyword from a relational database, where the relational database is a clickhouse database; calling an array connection instruction, and expanding the content of the coded field into a plurality of rows according to separators contained in the content of the coded field in each row aiming at each row in the target row, wherein the content corresponding to each separator is one row; and calling an application program interface statistical instruction to perform statistics on the contents in the expanded columns.

In this embodiment, as another optional embodiment, the apparatus further includes:

a second statistical analysis module (not shown in the figure), configured to set an incremental table, perform left association on the statistical analysis request of the structured query statement and the incremental table, and obtain a target column matching the statistical keyword from a relational database according to the statistical keyword included in the statistical analysis request of the structured query statement, where the relational database is an AnalyticDB database; calling an API split _ part function, and expanding the content of the coded field into a plurality of columns according to separators contained in the content of the coded field in each row of the target column, wherein the content corresponding to each separator is one column; and counting the contents in the expanded columns based on the associated increment table.

As shown in fig. 3, an embodiment of the present application provides a computer device 300 for executing the method for storing data in fig. 1, the device includes a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor 302, wherein the processor 302 implements the steps of the method for storing data when executing the computer program.

Specifically, the memory 301 and the processor 302 can be general-purpose memory and processor, and are not limited to specific examples, and the processor 302 can execute the method for storing data when executing the computer program stored in the memory 301.

Corresponding to the method for storing data in fig. 1, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the steps of the method for storing data.

In particular, the storage medium can be a general-purpose storage medium, such as a removable disk, a hard disk, etc., and the computer program on the storage medium can be executed when being executed to perform the above-mentioned method for storing data.

In the embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways. The above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and there may be other divisions in actual implementation, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of systems or units through some communication interfaces, and may be in an electrical, mechanical or other form.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.

The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.

It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.

Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于大数据的信息收集分析系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!