RU2515565C1 - Method of updating structured data in relational database management system - Google Patents

Method of updating structured data in relational database management system Download PDF

Info

Publication number
RU2515565C1
RU2515565C1 RU2012145068/08A RU2012145068A RU2515565C1 RU 2515565 C1 RU2515565 C1 RU 2515565C1 RU 2012145068/08 A RU2012145068/08 A RU 2012145068/08A RU 2012145068 A RU2012145068 A RU 2012145068A RU 2515565 C1 RU2515565 C1 RU 2515565C1
Authority
RU
Russia
Prior art keywords
data
updated
database
metadata
format
Prior art date
Application number
RU2012145068/08A
Other languages
Russian (ru)
Other versions
RU2012145068A (en
Inventor
Дмитрий Алексеевич Смотров
Original Assignee
Закрытое акционерное общество Научно-производственное предприятие "Реляционные экспертные системы"
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 Закрытое акционерное общество Научно-производственное предприятие "Реляционные экспертные системы" filed Critical Закрытое акционерное общество Научно-производственное предприятие "Реляционные экспертные системы"
Priority to RU2012145068/08A priority Critical patent/RU2515565C1/en
Publication of RU2012145068A publication Critical patent/RU2012145068A/en
Application granted granted Critical
Publication of RU2515565C1 publication Critical patent/RU2515565C1/en

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

FIELD: physics, computer engineering.
SUBSTANCE: invention relates to computer engineering. The method of updating structured data in a relational database management system involves forming an updated database structure containing metadata and a set of altered data; comparing the structure of the initial and updated database by comparing data and metadata of the structures, and if the structures of the initial and updated databases are identical, the structure comparison result is transformed into a data format of a given structure, which depends on the structure of lines of the initial and updated databases returned by a request, thereby obtaining fragments of metadata in the data format of the given structure; comparing the obtained metadata fragments while forming comparison results; analysing the formed comparison results and selecting the essence - different data lines in the data format of the given structure of the formatted data descriptor fragment, in the updated or initial database, using the selected essence; creating a data file describing difference of data and describing all actions bringing data of the initial database into an updated state, using the formed data file; updating data in the initial database by inverse transformation of data from the data format of the given structure into a request format.
EFFECT: high accuracy and quality of comparing and updating data in relational database management system.
7 cl, 3 dwg

Description

Изобретение относится к вычислительной технике (вычислительным сетям), в частности к способу обновления структурированных данных в системе управления реляционными базами данных (СУРБД), и может быть использовано в СУРБД для управления и обмена обновлениями различных типов данных: текстовых или числовых, или даты, или BLOB - Binary Large Object, представляющий собой специальный тип данных, предназначенный для хранения изображений, аудио и видео, а также компилированного программного кода.The invention relates to computing (computer networks), in particular to a method for updating structured data in a relational database management system (RDBMS), and can be used in a DBMS for managing and exchanging updates for various types of data: text or numeric, or date, or BLOB - Binary Large Object, which is a special data type designed to store images, audio and video, as well as compiled program code.

Модели СУРБД характеризуются простотой формирования структуры данных в системе управления базами данных, удобным для пользователя структурным (табличным) представлением данных.RDBMS models are characterized by the simplicity of forming a data structure in a database management system, and a user-friendly structural (tabular) representation of data.

В процессе проектирования базы данных определяется структура СУРБД (состав таблиц данных, их структура и логические связи). Структура СУРБД определяется составом столбцов, типом данных и размерами столбцов, ключами таблицы.In the database design process, the structure of the RDBMS is determined (the composition of the data tables, their structure and logical relationships). The structure of the RDBMS is determined by the composition of the columns, the type of data and the size of the columns, table keys.

К базовым понятиям модели СУРБД «сущность - связь» относятся: сущности, связи между ними и их атрибуты (свойства).The basic concepts of the RDBMS model “entity - relationship” include: entities, relationships between them and their attributes (properties).

Сущности - это базовые типы данных: численные значения, даты и время, строки и отдельные символы, которые хранятся в СУРБД.Entities are basic data types: numerical values, dates and times, strings, and individual characters that are stored in the RDBMS.

Модель СУРБД ориентирована на организацию данных в виде двумерных реляционных таблиц данных. Каждая реляционная таблица данных представляет собой двумерный массив данных и обладает следующими свойствами:The RDBMS model is focused on organizing data in the form of two-dimensional relational data tables. Each relational data table is a two-dimensional data array and has the following properties:

- каждый элемент двумерного массива - один элемент данных,- each element of a two-dimensional array - one data element,

- все ячейки в столбце двумерного массива (таблицы)- all cells in a column of a two-dimensional array (table)

однородные, то есть все элементы в столбце имеют одинаковый типhomogeneous, i.e. all elements in the column are of the same type

(числовой, символьный и т.д.),(numeric, character, etc.),

- каждый столбец имеет уникальное имя,- each column has a unique name,

- одинаковые строки в таблице отсутствуют,- there are no identical rows in the table,

- порядок следования строк и столбцов может быть произвольным [К.Дж.Дейт. Введение в системы баз данных = Introduction to Database Systems. - 8-е изд. - М.: Вильямс, 2006. - С.1328. - ISBN 0-321-19784], [http:ru.//wikipedia.org/wiki/Реляционная_СУБД].- the order of rows and columns can be arbitrary [K.J.Date. Introduction to Database Systems = Introduction to Database Systems. - 8th ed. - M.: Williams, 2006 .-- P.1328. - ISBN 0-321-19784], [http: ru .// wikipedia.org/wiki/Relational_DBMS].

Пример расположения двумерного массива данных в виде реляционной таблицы данных показан на фиг.1.An example of the location of a two-dimensional data array in the form of a relational data table is shown in figure 1.

За последние десятилетия в связи с развитием вычислительной техники и использованием компьютерных технологий все более актуальной является задача не только хранения большого объема различных данных (различной информации) в базах данных, но и ее обновление и пополнение.Over the past decade, in connection with the development of computer technology and the use of computer technology, the task of not only storing a large amount of various data (various information) in databases, but also updating and replenishing it, is becoming increasingly important.

Известно изобретение по патенту СА 2464927 «Text Joins for Data Cleansing and Integration in a Relational Database Management System», Int. Сд. G06F 17/30; G06F 7/02, дата публикации 21.10.2004 г.(приоритетный документ - заявка US №20030464101 Р от 21.04.2003 г.), которое для обновления структурированных данных (файлов на устройстве) содержит систему для сравнения строк в нескольких отношениях в СУРБД и включает создание набора строк из набора TERS ofcharac, разлагая каждую строку в подмножество лексем, создание не менее двух отношений внутри строки, установление сходства порог отношений, выборку, по меньшей мере, двух отношений, соотнося отношения порог подобия и возвращение всех жетонов, которые отвечают критериям сходства порога).The invention is known by patent CA 2464927 "Text Joins for Data Cleansing and Integration in a Relational Database Management System", Int. Cd G06F 17/30; G06F 7/02, publication date 10/21/2004 (priority document - application US No. 200404641 P dated 04/21/2003), which for updating structured data (files on the device) contains a system for comparing strings in several respects in an RDBMS and includes creating a set of lines from the TERS ofcharac set, decomposing each line into a subset of tokens, creating at least two relations within the line, establishing the relationship threshold similarity, selecting at least two relations, correlating the similarity threshold relations and returning all tokens that meet the criteria cx dstva threshold).

Данный подход позволяет выполнять сравнение строковых данных в таблицах СУРБД, но в связи с усложнением как структурных, так и технологических характеристик систем хранения и обработки данных данный подход к сравнению данных уже нельзя считать оптимальным или достаточным для эффективного сравнения разнородных данных, которые могут храниться в современных системах управления базами данных.This approach allows you to compare string data in RDBMS tables, but due to the complexity of both structural and technological characteristics of data storage and processing systems, this approach to data comparison can no longer be considered optimal or sufficient for efficient comparison of heterogeneous data that can be stored in modern database management systems.

Недостатком этого изобретения является то, что данный подход не позволяет адаптироваться к растущим потребностям систем хранения и обработки данных, в плане возможностей хранения и обработки информации, отличной от текстовой, так как он ориентирован исключительно на обработку текстовой информации, что существенно ограничивает область применения данной технологии для сравнения очень больших объемов разнотипной информации (видео-, аудио- ) и другие цифровые данные, которые сейчас широко используются в связи с распространением web-технологий, и особенно технологий web 2.0.The disadvantage of this invention is that this approach does not allow you to adapt to the growing needs of storage systems and data processing, in terms of storage and processing of information other than text, as it focuses solely on the processing of text information, which significantly limits the scope of this technology to compare very large volumes of diverse information (video, audio) and other digital data that are now widely used in connection with the spread of web-technology Guy, and especially web 2.0 technologies.

Наиболее близким техническим решением (прототипом) к заявляемому изобретению является опубликованная 3 февраля 2005 г. заявка US №2005027717 «Text joins Text joins for data cleansing and integration in a relational database management system», Int. Cl.: G06F 17/30 (приоритетные документы - заявки US №20040828819 от 21.04.2004 г.; US №20030464101Р от 21.04.2003 г.). Это техническое решение представляет собой систему для сравнения строк в нескольких отношениях в СУРБД, включает создание набора строк из набора символов, разлагая каждую строку в подмножество лексем, создание не менее двух отношений внутри строк, устанавливая порог подобия для отношений, выборку, по меньшей мере, двух отношений, соотнося отношения порога подобия и возвращение всех жетонов, которые отвечают критериям сходства порога.The closest technical solution (prototype) to the claimed invention is published on February 3, 2005, application US No.2005027717 "Text joins Text joins for data cleansing and integration in a relational database management system", Int. Cl .: G06F 17/30 (priority documents are applications US No. 2004,02828819 dated April 21, 2004; US No. 20030464101P dated April 21, 2003). This technical solution is a system for comparing strings in several respects in an RDBMS, including creating a set of strings from a character set, decomposing each string into a subset of tokens, creating at least two relationships within the strings, setting a similarity threshold for the relationships, selecting at least two relations, correlating the similarity threshold relations and the return of all tokens that meet the threshold similarity criteria.

Опять же, данный способ позволяет обрабатывать (сравнивать) текстовые данные, хранящиеся в СУРБД. Но текущий вектор развития технологий обработки и хранения данных показывает, что нужно разрабатывать более общие решения, позволяющие производить обработку разнотипных данных на более высоком уровне и с большей эффективностью.Again, this method allows you to process (compare) text data stored in the RDBMS. But the current vector of development of data processing and storage technologies shows that it is necessary to develop more general solutions that allow the processing of heterogeneous data at a higher level and with greater efficiency.

Недостатком этого изобретения является то, что способ описывает обработку только текстовой информации, что уже не соответствует современному уровню техники. Сейчас предъявляются более жесткие и сложные требования к обработке больших объемов разнотипной (разнородной) информации.The disadvantage of this invention is that the method describes the processing of only text information, which no longer corresponds to the current level of technology. Now more stringent and complex requirements are being placed on the processing of large volumes of heterogeneous (heterogeneous) information.

Поэтому задача сравнения и обновления структурированных данных в системе управления реляционными базами данных является по-прежнему актуальной.Therefore, the task of comparing and updating structured data in a relational database management system is still relevant.

Техническая задача, на решение которой направлено заявляемое изобретение, - это повышение точности и качества сравнения и обновления структурированных данных в СУРБД.The technical problem to which the claimed invention is directed is to increase the accuracy and quality of comparing and updating structured data in an RDBMS.

Поставленная техническая задача решается заявляемым способом обновления структурированных данных в системе управления реляционными базами данных, в которых исходную базу данных формируют из строк одинаковой структуры, где каждая строка представлена набором полей с заданными значениями, а совокупность значений одного и того же поля в разных строках образует столбец значений данных и метаданных, каждый из которых имеет свой тип данных, нумеруют по строкам таким образом, что каждая строка получает уникальный номер, и запоминают ее,The stated technical problem is solved by the claimed method of updating structured data in a relational database management system in which the source database is formed from rows of the same structure, where each row is represented by a set of fields with specified values, and a combination of values of the same field in different rows forms a column data values and metadata, each of which has its own data type, are numbered line by line so that each line gets a unique number, and remember it,

согласно изобретению:according to the invention:

формируют структуру обновленной базы данных, содержащую метаданные и набор измененных данных по отношению к исходной базе данных,form the structure of the updated database containing metadata and a set of modified data in relation to the original database,

сравнивают структуры исходной и обновленной баз данных посредством сравнения данных и метаданных структур, используя интерфейс операционной системы, обеспечивающий получение этих данных и метаданных от сервера базы данных,comparing the structures of the original and updated databases by comparing the data and metadata of the structures using the operating system interface that provides this data and metadata from the database server,

если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных не идентичны, то завершают процедуру сравнения;if the comparison results show that the structures of the original and updated databases are not identical, then complete the comparison procedure;

если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных идентичны, то полученный результат сравнения структур трансформируют в формат данных заданной структуры, зависящей от структуры возвращенных запросом строк исходной и обновленной баз данных, получая фрагменты метаданных в формате данных заданной структуры,if the comparison results show that the structures of the source and updated databases are identical, then the result of the comparison of structures is transformed into the data format of the given structure, depending on the structure of the rows returned by the query from the original and updated databases, receiving metadata fragments in the data format of the given structure,

сравнивают полученные фрагменты метаданных в формате данных заданной структуры через интерфейс операционной системы, формируя результаты сравнения,comparing the received fragments of metadata in the data format of a given structure through the operating system interface, forming the comparison results,

анализируют сформированные результаты сравнения и выделяют сущности - отличающиеся строки данных в формате данных заданной структуры отформатированного фрагмента-описателя данных, в обновленной и исходной базах данных,analyze the generated comparison results and distinguish entities - different data rows in the data format of the given structure of the formatted fragment-data descriptor, in the updated and original database,

используя выделенные сущности, формируют файл данных, описывающий различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной,using the selected entities, they form a data file describing the difference in data in the structures of the updated and the original database, the changed data and metadata, data on the data structures and a description of all the actions that must be performed on the data of the updated and the original database to bring the data of the original database data to the updated state,

используя сформированный файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры в формат запросов, определяя тип изменений данных и выполняя обновление данных в исходной базе данных.using the generated data file, the data in the source database is updated by transforming the data back from the data format of the given structure to the query format, determining the type of data changes and updating the data in the source database.

При этом столбец значений данных и метаданных имеет свой тип данных: текстовый или числовой, или тип даты, или BLOB - Binary Large Object, представляющий собой специальный тип данных, предназначенный, например, для хранения изображений, аудио и видео, а также компилированного программного кода.The column of data and metadata values has its own data type: text or numeric, or date type, or BLOB - Binary Large Object, which is a special data type intended, for example, for storing images, audio and video, as well as compiled program code .

Данные и метаданные от сервера базы данных получают посредством интерфейса ODBC - Open Database Connectivity, обеспечивающего доступ к базам данных.Data and metadata from the database server is obtained through the ODBC interface - Open Database Connectivity, which provides access to databases.

Сравнение структур исходной и обновленной баз данных выполняют посредством языка XML.Comparison of the structures of the source and updated databases is performed using the XML language.

В качестве формата данных заданной структуры используют форматAs a data format of a given structure, use the format

XML.XML

В качестве сформированного файла данных для обновления данных в исходной базе данных используют файл формата XML.An XML file is used as a generated data file for updating data in the source database.

Обновление данных в исходной базе данных выполняют посредством обратной трансформации данных из формата данных заданной структуры XML в формат SQL запросов, определяя тип изменений данных типа INSERT, или UPDATE, или DELETE.Updating the data in the source database is performed by reverse transforming the data from the data format of the specified XML structure to the format of SQL queries, determining the type of data changes of the type INSERT, or UPDATE, or DELETE.

Таким образом, повышение точности и качества сравнения и обновления структурированных данных в СУРБД достигается за счет формирования структуры обновленной базы данных, сравнения структур исходной и обновленной баз данных, выделения сущностей (структур и строк) в исходной и обновленной базах данных, сравнения данных в таблицах и строках, формирования файла данных, который описывает различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной, используя сформированный файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры в формат запросов, определяя тип изменений данных.Thus, improving the accuracy and quality of comparing and updating structured data in an RDBMS is achieved by forming the structure of the updated database, comparing the structures of the original and updated databases, highlighting entities (structures and rows) in the original and updated databases, comparing data in tables and lines, the formation of a data file that describes the difference between the data in the structures of the updated and the original database, the changed data and metadata, data on the data structures and a description of all the actions that must be performed on the data of the updated and the original database in order to bring the data of the original database into the updated state, using the generated data file, update the data in the original database by reverse transforming the data from the data format of the given structure to the query format, determining the type of data changes .

Проведенный заявителем патентный и научно-технический поиск не выявил признаки данного изобретения в известном уровне техники.A patent and scientific and technical search carried out by the applicant did not reveal the features of this invention in the prior art.

Далее подробное описание изобретения поясняется примерами выполнения со ссылкой на чертежи.Further, a detailed description of the invention is illustrated by examples with reference to the drawings.

На фиг.1 показан пример расположения двумерного массива данных в виде реляционной таблицы.Figure 1 shows an example of the location of a two-dimensional data array in the form of a relational table.

На фиг.2 в обобщенном виде показан пример осуществления заявляемого изобретения согласно заявляемому изобретению.Figure 2 in a generalized form shows an example implementation of the claimed invention according to the claimed invention.

Фиг.3 иллюстрирует алгоритм сравнения структур, данных и метаданных в исходной и обновленной базах данных, анализ сформированных результатов сравнения, выделения сущностей и формирование файла данных, описывающего различие данных в структурах обновленной и исходной баз данных и описание всех действий, которые следует выполнить над данными, чтобы привести данные исходной базы данных в состояние обновленной (согласно заявляемому изобретению).Figure 3 illustrates an algorithm for comparing structures, data and metadata in the source and updated databases, analysis of the generated comparison results, selection of entities and the formation of a data file that describes the difference in data in the structures of the updated and source databases and a description of all actions that should be performed on the data to bring the data of the original database in the updated state (according to the claimed invention).

Осуществляют изобретение следующим образом.Carry out the invention as follows.

В системе управления реляционными базами данных формируют исходную базу данных из строк одинаковой структуры (фиг.1), где каждая строка представлена набором полей с заданными значениями, а совокупность значений одного и того же поля в разных строках образует столбец значений данных и метаданных, каждый из которых имеет свой тип данных: текстовый или числовой, или тип даты, или BLOB - Binary Large Object, представляющий собой специальный тип данных, предназначенный, например, для хранения изображений, аудио и видео, а также компилированного программного кода. Нумеруют по строкам таким образом, что каждая строка получает уникальный номер, и запоминают ее.In the relational database management system, the initial database is formed from rows of the same structure (Fig. 1), where each row is represented by a set of fields with specified values, and a combination of values of the same field in different rows forms a column of data values and metadata, each of which has its own data type: text or numeric, or date type, or BLOB - Binary Large Object, which is a special data type intended, for example, for storing images, audio and video, as well as compiled software about the code. They are numbered line by line so that each line gets a unique number, and remember it.

Согласно изобретению (фиг.2) формируют структуру обновленной базы данных, содержащую метаданные и набор измененных данных по отношению к исходной базе данных.According to the invention (figure 2) form the structure of the updated database containing metadata and a set of modified data in relation to the original database.

Сравнивают структуры исходной и обновленной баз данных посредством сравнения данных и метаданных структур, используя, например, интерфейс ODBC операционной системы, который обеспечивает получение этих данных и метаданных от сервера базы данных. Если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных не идентичны, то завершают процедуру сравнения. Если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных идентичны, то полученный результат сравнения структур трансформируют в формат данных заданной структуры, зависящей от структуры возвращенных запросом строк исходной и обновленной баз данных, получая фрагменты метаданных в формате данных заданной структуры.The structures of the source and updated databases are compared by comparing the data and the metadata of the structures using, for example, the ODBC interface of the operating system, which provides this data and metadata from the database server. If the comparison revealed that the structures of the original and updated databases are not identical, then complete the comparison procedure. If the comparison results show that the structures of the source and updated databases are identical, then the result of the comparison of structures is transformed into the data format of the given structure, depending on the structure of the rows returned by the query from the original and updated databases, receiving metadata fragments in the data format of the given structure.

Полученный результат сравнения структур баз данных трансформируют в формат данных заданной структуры, например XML, зависящей от структуры возвращенных запросом строк исходной и обновленной баз данных, получая фрагменты метаданных в формате данных XML структуры.The result of comparing database structures is transformed into a data format of a given structure, for example XML, depending on the structure of the rows returned by the query from the source and updated databases, obtaining metadata fragments in the data format of the XML structure.

Сравнивают полученные фрагменты метаданных в формате данных XML структуры через интерфейс операционной системы, формируя результаты сравнения.Compare the received fragments of metadata in the data format XML structure via the operating system interface, forming the comparison results.

Анализируют сформированные результаты сравнения и выделяют сущности - отличающиеся строки данных в формате данных XML структуры, XML-отформатированного фрагмента-описателя данных, в обновленной и исходной базах данных.The generated comparison results are analyzed and entities are distinguished - differing data strings in the data format of the XML structure, XML-formatted fragment-data descriptor, in the updated and original database.

Используя выделенные сущности, формируют XML файл данных, который описывает различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной.Using the selected entities, they form an XML data file that describes the difference between the data in the structures of the updated and the original database, the changed data and metadata, data on the data structures and a description of all the actions that must be performed on the data of the updated and the original database to bring the data The source database is in an updated state.

Используя сформированный XML файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры XML в формат SQL запросов, определяя тип изменений данных типа INSERT или UPDATE, или DELETE.Using the generated XML data file, the data in the source database is updated by transforming the data back from the data format of the given XML structure to the SQL query format, determining the type of data changes of the type INSERT or UPDATE, or DELETE.

Заявляемый способ обновления структурированных данных в системе управления реляционными базами данных реализуется на известных устройствах, используемых в вычислительных сетях (вычислительной технике), и не требует дополнительных существенных аппаратных затрат. К таким известным устройствам относится, например, семейство программно-аппаратных устройств SQL Server 2008 R2, разработанных компанией Microsoft, оптимизированных для баз данных [Майкл Оти. Программно-аппаратные устройства SQL Server 2008 R2. Windows IT Pro №4, 2012]. Для формирования исходных и обновленных баз данных используют программно-аппаратные устройства SQL Server (серверы), данные и метаданные от серверов базы данных получают через интерфейс ODBC, в качестве программных средств используют формат и язык XML.The inventive method for updating structured data in a relational database management system is implemented on known devices used in computer networks (computer technology), and does not require additional significant hardware costs. Such well-known devices include, for example, the SQL Server 2008 R2 family of software and hardware devices developed by Microsoft and optimized for databases [Michael Ooty. Firmware SQL Server 2008 R2. Windows IT Pro No. 4, 2012]. To form the source and updated databases, SQL Server software and hardware devices (servers) are used, data and metadata from database servers are received via the ODBC interface, and the format and language XML are used as software tools.

Рассмотрим пример выполнения заявляемого изобретения, используя для иллюстрации фиг.1, 2 и 3.Consider an example implementation of the claimed invention, using to illustrate figure 1, 2 and 3.

На сервере базы данных №1 (далее - сервер БД №1) формируют исходную базу данных из строк одинаковой структуры (как показано на фиг.1). При этом, например, исходная база данных (далее - исходная БД) содержит данные и метаданные (далее - данные №1, данные №2, данные №4).On the database server No. 1 (hereinafter referred to as the database server No. 1), the initial database is formed from rows of the same structure (as shown in FIG. 1). In this case, for example, the source database (hereinafter referred to as the source database) contains data and metadata (hereinafter referred to as data No. 1, data No. 2, data No. 4).

На сервере БД №1 (фиг.2) формируют структуру обновленной базы данных (далее - обновленная БД), содержащую метаданные и набор измененных данных по отношению к исходной БД (далее - данные №1, данные №4, данные №3).On the database server No. 1 (figure 2) form the structure of the updated database (hereinafter referred to as the updated database) containing metadata and a set of changed data in relation to the original database (hereinafter - data No. 1, data No. 4, data No. 3).

Сравнивают структуры исходной и обновленной БД посредством сравнения данных и метаданных структур, используя, например, интерфейс ODBC операционной системы (Open Database Connectivity), который обеспечивает получение этих данных и метаданных от сервера БД №1.The structures of the original and updated databases are compared by comparing data and metadata of structures using, for example, the ODBC interface of the operating system (Open Database Connectivity), which ensures the receipt of this data and metadata from database server No. 1.

Получают результат сравнения:Get the result of the comparison:

Удалить "2. Данные №2"Delete "2. Data No. 2"

Добавить "3. Данные №3".Add "3. Data No. 3".

Полученный результат сравнения структур БД трансформируют в формат данных заданной структуры XML, зависящей от структуры возвращенных запросом строк исходной и обновленной БД, получая фрагменты метаданных в формате данных XML структуры.The result of comparing the database structures is transformed into the data format of the given XML structure, depending on the structure of the rows returned by the query of the original and updated database, obtaining metadata fragments in the data format of the XML structure.

Сравнивают полученные фрагменты метаданных в формате данных XML структуры через интерфейс операционной системы, формируя результаты сравнения.Compare the received fragments of metadata in the data format XML structure via the operating system interface, forming the comparison results.

Анализируют сформированные результаты сравнения и выделяют сущности - отличающиеся строки данных в формате данных XML структуры, XML-отформатированного фрагмента-описателя данных, в обновленной и исходной базах данных.The generated comparison results are analyzed and entities are distinguished - differing data strings in the data format of the XML structure, XML-formatted fragment-data descriptor, in the updated and original database.

Используя выделенные сущности, формируют XML файл данных, который описывает различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной.Using the selected entities, they form an XML data file that describes the difference between the data in the structures of the updated and the original database, the changed data and metadata, data on the data structures and a description of all the actions that must be performed on the data of the updated and the original database to bring the data The source database is in an updated state.

Используя сформированный XML файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры XML в формат SQL запросов, определяя тип изменений данных типа INSERT и/или UPDATE, и/или DELETE.Using the generated XML data file, the data in the source database is updated by transforming the data back from the data format of the given XML structure to the SQL query format, determining the type of data changes of the INSERT and / or UPDATE and / or DELETE type.

SQL - универсальный компьютерный язык, применяемый для создания, модификации и управления данными в реляционных базах данных.SQL is a universal computer language used to create, modify and manage data in relational databases.

INSERT - позволяет добавить строки в таблицу, заполняя их значениями.INSERT - allows you to add rows to the table, filling them with values.

UPDATE - оператор языка SQL, позволяющий обновить значения данных в заданных столбцах таблицы.UPDATE is an SQL statement that allows you to update data values in specified columns of a table.

Delete - в языках, подобных SQL, DML - операция удаления записей данных из таблицы.Delete - in languages like SQL, DML - the operation of deleting data records from a table.

Сформированный файл данных используют для обновления структурированных данных в других базах данных на других серверах, например на сервере БД №2 (как показано на фиг.2).The generated data file is used to update structured data in other databases on other servers, for example, on the database server No. 2 (as shown in figure 2).

На фиг.3 иллюстративно показан алгоритм сравнения согласно заявляемому изобретению. Посредством интерфейса ODBC операционной системы от сервера БД №1 одновременно поступает управляющий сигнал сравнения на исходную БД и обновленную БД. По этому сигналу сравнивают структуры исходной и обновленной БД посредством сравнения данных и метаданных структур. Получают результат сравнения:Figure 3 illustratively shows a comparison algorithm according to the claimed invention. Using the ODBC interface of the operating system, the control server comparison signal is simultaneously received from the database server No. 1 to the original database and the updated database. This signal compares the structures of the original and updated databases by comparing the data and metadata of the structures. Get the result of the comparison:

- если структуры БД не идентичны, то завершают процедуру сравнения;- if the database structure is not identical, then complete the comparison procedure;

- если структуры БД идентичны, то полученный результат сравнения структур БД трансформируют в формат данных заданной структуры XML, зависящей от структуры возвращенных запросом строк исходной и обновленной БД, получая фрагменты метаданных в формате данных XML структуры.- if the database structures are identical, then the result of comparing the database structures is transformed into the data format of the specified XML structure, depending on the structure of the rows returned by the query from the original and updated database, receiving metadata fragments in the data format of the XML structure.

Сравнивают полученные фрагменты метаданных в формате данных XML структуры через интерфейс операционной системы, формируя результаты сравнения.Compare the received fragments of metadata in the data format XML structure via the operating system interface, forming the comparison results.

Анализируют сформированные результаты сравнения и выделяют сущности - отличающиеся строки данных в формате данных XML структуры, XML-отформатированного фрагмента-описателя данных, в обновленной и исходной базах данных.The generated comparison results are analyzed and entities are distinguished - differing data strings in the data format of the XML structure, XML-formatted fragment-data descriptor, in the updated and original database.

Используя выделенные сущности, формируют XML файл данных, который описывает различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной.Using the selected entities, they form an XML data file that describes the difference between the data in the structures of the updated and the original database, the changed data and metadata, data on the data structures and a description of all the actions that must be performed on the data of the updated and the original database to bring the data The source database is in an updated state.

Используя сформированный XML файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры XML в формат SQL запросов, определяя тип изменений данных типа INSERT или UPDATE, или DELETE.Using the generated XML data file, the data in the source database is updated by transforming the data back from the data format of the given XML structure to the SQL query format, determining the type of data changes of the type INSERT or UPDATE, or DELETE.

Таким образом, заявляемый способ обеспечивает в СУРБД эффективное и качественное управление обновлениями различных типов структурированных данных: текстовых или числовых, или даты, или BLOB, предназначенных для хранения изображений, аудио и видео, а также компилированного программного кода.Thus, the inventive method provides an RDBMS efficient and high-quality management of updates of various types of structured data: text or numeric, or date, or BLOB, designed to store images, audio and video, as well as compiled program code.

Claims (7)

1. Способ обновления структурированных данных в системе управления реляционными базами данных, в которых исходную базу данных формируют из строк одинаковой структуры, где каждая строка представлена набором полей с заданными значениями, а совокупность значений одного и того же поля в разных строках образует столбец значений данных и метаданных, каждый из которых имеет свой тип данных, нумеруют по строкам таким образом, что каждая строка получает уникальный номер, и запоминают ее, отличающийся тем, что формируют структуру обновленной базы данных, содержащую метаданные и набор измененных данных по отношению к исходной базе данных, сравнивают структуры исходной и обновленной баз данных посредством сравнения данных и метаданных структур, используя интерфейс операционной системы, обеспечивающий получение этих данных и метаданных от сервера базы данных, если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных не идентичны, то завершают процедуру сравнения, если по результатам сравнения выявлено, что структуры исходной и обновленной баз данных идентичны, то полученный результат сравнения структур трансформируют в формат данных заданной структуры, зависящей от структуры возвращенных запросом строк исходной и обновленной баз данных, получая фрагменты метаданных в формате данных заданной структуры, сравнивают полученные фрагменты метаданных в формате данных заданной структуры через интерфейс операционной системы, формируя результаты сравнения, анализируют сформированные результаты сравнения и выделяют сущности - отличающиеся строки данных в формате данных заданной структуры отформатированного фрагмента-описателя данных, в обновленной и исходной базах данных, используя выделенные сущности, формируют файл данных, описывающий различие данных в структурах обновленной и исходной баз данных, измененные данные и метаданные, данные о структурах данных и описание всех действий, которые должны быть выполнены над данными обновленной и исходной баз данных, чтобы привести данные исходной базы данных в состояние обновленной, используя сформированный файл данных, выполняют обновление данных в исходной базе данных посредством обратной трансформации данных из формата данных заданной структуры в формат запросов, определяя тип изменений данных.1. A method for updating structured data in a relational database management system in which the source database is formed from rows of the same structure, where each row is represented by a set of fields with specified values, and a combination of values of the same field in different rows forms a column of data values and metadata, each of which has its own data type, is numbered line by line so that each line gets a unique number, and remember it, characterized in that they form the structure of the updated database data containing metadata and a set of modified data with respect to the source database, compare the structures of the source and updated databases by comparing the data and metadata of the structures using the operating system interface, which receives this data and metadata from the database server, if the comparison results reveal that the structures of the original and updated databases are not identical, then complete the comparison procedure, if the comparison shows that the structures of the original and updated databases are identical, then the result of the comparison of structures is transformed into the data format of the specified structure, depending on the structure of the rows returned by the query of the source and updated databases, receiving metadata fragments in the data format of the given structure, the obtained metadata fragments in the data format of the given structure via the operating system interface, forming comparison results, analyze the generated comparison results and highlight the entities - differing data rows in the data format of a given structure In the updated and original databases, using the selected entities, the formatted data descriptor fragment urls form a data file that describes the difference in data in the structures of the updated and original databases, changed data and metadata, data on data structures and a description of all actions that should be performed on the updated and source database data in order to bring the source database data into the updated state, using the generated data file, update the data in the source database by means of the reverse transformation of data from the data format of a given structure to the query format, determining the type of data changes. 2. Способ по п.1, отличающийся тем, что столбец значений данных и метаданных имеет свой тип данных: текстовый или числовой, или тип даты, или BLOB - Binary Large Object, представляющий собой специальный тип данных, предназначенный, например, для хранения изображений, аудио и видео, а также компилированного программного кода.2. The method according to claim 1, characterized in that the column of data and metadata values has its own data type: text or numeric, or date type, or BLOB - Binary Large Object, which is a special data type intended, for example, for storing images , audio and video, as well as compiled code. 3. Способ по п.1, отличающийся тем, что данные и метаданные от сервера базы данных получают посредством интерфейса ODBC - Open Database Connectivity, обеспечивающего доступ к базам данных.3. The method according to claim 1, characterized in that the data and metadata from the database server are obtained through the ODBC interface - Open Database Connectivity, which provides access to databases. 4. Способ по п.1, отличающийся тем, что сравнение структур исходной и обновленной баз данных выполняют посредством языка XML.4. The method according to claim 1, characterized in that the comparison of the structures of the source and updated databases is performed using the XML language. 5. Способ по п.1, отличающийся тем, что в качестве формата данных заданной структуры используют формат XML.5. The method according to claim 1, characterized in that the XML format is used as the data format of the given structure. 6. Способ по п.1, отличающийся тем, что в качестве сформированного файла данных для обновления данных в исходной базе данных используют файл формата XML.6. The method according to claim 1, characterized in that an XML format file is used as the generated data file for updating data in the source database. 7. Способ по п.1, отличающийся тем, что обновление данных в исходной базе данных выполняют посредством обратной трансформации данных из формата данных заданной структуры XML в формат SQL запросов, определяя тип изменений данных типа INSERT или UPDATE, или DELETE. 7. The method according to claim 1, characterized in that the data in the original database is updated by reverse transforming the data from the data format of the given XML structure into the SQL query format, determining the type of data changes of the type INSERT or UPDATE, or DELETE.
RU2012145068/08A 2012-10-22 2012-10-22 Method of updating structured data in relational database management system RU2515565C1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
RU2012145068/08A RU2515565C1 (en) 2012-10-22 2012-10-22 Method of updating structured data in relational database management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
RU2012145068/08A RU2515565C1 (en) 2012-10-22 2012-10-22 Method of updating structured data in relational database management system

Publications (2)

Publication Number Publication Date
RU2012145068A RU2012145068A (en) 2014-04-27
RU2515565C1 true RU2515565C1 (en) 2014-05-10

Family

ID=50515319

Family Applications (1)

Application Number Title Priority Date Filing Date
RU2012145068/08A RU2515565C1 (en) 2012-10-22 2012-10-22 Method of updating structured data in relational database management system

Country Status (1)

Country Link
RU (1) RU2515565C1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2666287C1 (en) * 2017-03-31 2018-09-06 Александр Олегович Попов Method of development, storage and use of compiled to the binary representation of programs in database tables

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106682005A (en) 2015-11-05 2017-05-17 华为技术有限公司 Method for determining database hot page and device
CN112579562A (en) * 2020-11-04 2021-03-30 国网辽宁省电力有限公司电力科学研究院 New energy data modeling and checking method and system based on cloud platform
CN117632963B (en) * 2023-11-29 2024-09-17 数翊科技(北京)有限公司 Method and system for building table and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2253894C1 (en) * 2003-12-22 2005-06-10 Григорьев Евгений Александрович Relation databases object-oriented control system
US7031956B1 (en) * 2000-02-16 2006-04-18 Verizon Laboratories Inc. System and method for synchronizing and/or updating an existing relational database with supplemental XML data
RU2421798C2 (en) * 2005-02-28 2011-06-20 Майкрософт Корпорейшн Data model for object-relation data
EP2008206B1 (en) * 2006-03-23 2011-10-12 Microsoft Corporation Mapping architecture with incremental view maintenance

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7031956B1 (en) * 2000-02-16 2006-04-18 Verizon Laboratories Inc. System and method for synchronizing and/or updating an existing relational database with supplemental XML data
RU2253894C1 (en) * 2003-12-22 2005-06-10 Григорьев Евгений Александрович Relation databases object-oriented control system
RU2421798C2 (en) * 2005-02-28 2011-06-20 Майкрософт Корпорейшн Data model for object-relation data
EP2008206B1 (en) * 2006-03-23 2011-10-12 Microsoft Corporation Mapping architecture with incremental view maintenance

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
RU2666287C1 (en) * 2017-03-31 2018-09-06 Александр Олегович Попов Method of development, storage and use of compiled to the binary representation of programs in database tables
WO2018182454A1 (en) * 2017-03-31 2018-10-04 Александр Олегович ПОПОВ Method for developing, storing, and using programs compiled in database tables in binary representation

Also Published As

Publication number Publication date
RU2012145068A (en) 2014-04-27

Similar Documents

Publication Publication Date Title
Widom Trio: A system for integrated management of data, accuracy, and lineage
Abedjan et al. Data profiling: A tutorial
US9244974B2 (en) Optimization of database queries including grouped aggregation functions
US11436225B2 (en) Database hierarchy-independent data drilling
US9785725B2 (en) Method and system for visualizing relational data as RDF graphs with interactive response time
US20090112799A1 (en) Database Statistics for Optimization of Database Queries Containing User-Defined Functions
US20070083573A1 (en) Reduction of join operations when archiving related database tables
US20180165327A1 (en) Avoiding index-navigation deadlocks in database systems
US20090112792A1 (en) Generating Statistics for Optimizing Database Queries Containing User-Defined Functions
Khan et al. Predictive performance comparison analysis of relational & NoSQL graph databases
RU2515565C1 (en) Method of updating structured data in relational database management system
Guo et al. Efficient indexing and query processing of model-view sensor data in the cloud
KR20200094074A (en) Method, apparatus, device and storage medium for managing index
Mohammed et al. Clinical data warehouse issues and challenges
Sreemathy et al. Data validation in ETL using TALEND
US11163801B2 (en) Execution of queries in relational databases
Ioannou et al. Query analytics over probabilistic databases with unmerged duplicates
CN115809268B (en) Adaptive query method and device based on fragment index
Valduriez Principles of distributed data management in 2020?
US20160379148A1 (en) System and Methods for Interest-Driven Business Intelligence Systems with Enhanced Data Pipelines
Offia et al. A theoritical exploration of data management and integration in organisation sectors
CN104537047A (en) Garment basic sample plate retrieval system based on Lucene
KR100984976B1 (en) The integrating and searching method of alien 2-dimension table
Silva et al. Logical big data integration and near real-time data analytics
US20140136274A1 (en) Providing multiple level process intelligence and the ability to transition between levels