RU2620996C1 - Input string searching method in the search tree with indexing, used in the string tree construction - Google Patents
Input string searching method in the search tree with indexing, used in the string tree construction Download PDFInfo
- Publication number
- RU2620996C1 RU2620996C1 RU2016105560A RU2016105560A RU2620996C1 RU 2620996 C1 RU2620996 C1 RU 2620996C1 RU 2016105560 A RU2016105560 A RU 2016105560A RU 2016105560 A RU2016105560 A RU 2016105560A RU 2620996 C1 RU2620996 C1 RU 2620996C1
- Authority
- RU
- Russia
- Prior art keywords
- tree
- search
- node
- substring
- string
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2246—Trees, e.g. B+trees
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
- G06F16/316—Indexing structures
- G06F16/322—Trees
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Область техникиTechnical field
Изобретение относится к решениям для поиска информации по дереву, а более конкретно к способам поиска входной строки в дереве поиска, содержащем маски.The invention relates to solutions for finding information in a tree, and more particularly to methods for finding an input string in a search tree containing masks.
Уровень техникиState of the art
В настоящее время одним из способов защиты вычислительного устройства является контроль действий программного обеспечения (ПО) приложением безопасности (например, антивирусным приложением) при обращении к объектам (например, к файлам) по различным путям (англ. path). При этом пути могут быть локальными (обращение к локальным каталогам и папкам), реестровыми (обращение к реестру операционной системы), сетевыми (доступ к другим вычислительным устройствам или ресурсам сети интернет). Также следует отметить, что синтаксис путей может изменяться в зависимости от типа операционной системы и типа файловой системы.Currently, one of the ways to protect a computing device is to control the actions of software (software) by a security application (for example, an anti-virus application) when accessing objects (for example, files) in various ways (English path). In this case, the paths can be local (access to local directories and folders), registry (access to the registry of the operating system), network (access to other computing devices or Internet resources). It should also be noted that the path syntax may vary depending on the type of operating system and type of file system.
Антивирусное приложение, например, может анализировать пути, по которым обращается программа, и принимать решение о небезопасности тех или иных действий программы. Но обычно анализ является трудоемкой задачей, так как любые методы анализа требуют расчетов, а возможности аппаратных ресурсов вычислительного устройства, на котором установлено антивирусное приложение, ограничены. В связи с этим можно задавать список разрешенных (или запрещенных) путей. При обращении программы по определенному пути необходимо определить, разрешено ли данное действие. Для этого антивирусное приложение может искать путь, по которому обращается программа, в списке разрешенных (или запрещенных) путей.An anti-virus application, for example, can analyze the ways in which a program accesses and make decisions about the insecurity of certain program actions. But usually analysis is a time-consuming task, since any analysis methods require calculations, and the hardware resources of the computing device on which the antivirus application is installed are limited. In this regard, you can specify a list of allowed (or forbidden) paths. When accessing the program in a certain way, it is necessary to determine whether this action is allowed. To do this, the antivirus application can search for the path that the program accesses in the list of allowed (or forbidden) paths.
Так как пути в общем случае представляют собой строки, количество разрешенных путей может быть достаточно большим, а приложение может обращаться к сотням и даже тысячам путей, поиск по списку разрешенных путей может выполняться долгое время. Кроме того, пути могут содержать «маски» - специальные символы или последовательности символов, которые используются для описания схожих путей. Процессорное время, затраченное на поиск, может быть значительным. Для ускорения поиска пути нужно использовать не наборы строк (существующих путей), а другие структуры данных, например деревья.Since paths are generally strings, the number of allowed paths can be quite large, and the application can access hundreds or even thousands of paths, searching the list of allowed paths can take a long time. In addition, paths may contain “masks” - special characters or sequences of characters that are used to describe similar paths. The processor time spent searching can be significant. To speed up the search for the path, you need to use not data sets of lines (existing paths), but other data structures, such as trees.
Сама задача поиска по дереву не нова. Так, публикация US 7403494 описывает поиск по дереву, причем для каждого узла дерева генерируется ключ, который используется для ускорения перенаправления портов в сетевых устройствах.The tree search task itself is not new. So, publication US 7403494 describes a tree search, and a key is generated for each tree node, which is used to accelerate port forwarding in network devices.
Публикация US 8880507 описывает систему поиска IP-адресов, использующую дерево, в узлах которого содержатся подстроки.Publication US 8880507 describes an IP address lookup system using a tree whose nodes contain substrings.
Публикация US 8572126 описывает поиск по троичному дереву, в котором могут использоваться регулярные выражения.Publication US 8572126 describes a search in a ternary tree in which regular expressions can be used.
Существующие системы и способы не решают задачу поиска различных путей по дереву. Предлагаемый способ выполняет поиск входной строки по дереву, узлы которого могут содержать маски.Existing systems and methods do not solve the problem of finding various paths in a tree. The proposed method searches for an input string in a tree whose nodes may contain masks.
Сущность изобретенияSUMMARY OF THE INVENTION
Технический результат настоящего изобретения заключается в повышении производительности поиска по дереву по сравнению с известными способами поиска по дереву, узлы которого содержат подстроки, путем сравнения подстрок входящей строки с подстроками только в тех узлах дерева, индексы в которых совпадают с индексами в таблице индексации для входящей строки, что уменьшает количество выполняемых операций сравнения подстрок.The technical result of the present invention is to increase the search performance of a tree compared to the known methods of searching a tree, the nodes of which contain substrings, by comparing substrings of the incoming string with substrings only in those nodes of the tree whose indices coincide with the indexes in the index table for the incoming string , which reduces the number of substring comparison operations performed.
Согласно одному из вариантов реализации предоставляется способ поиска входной строки в дереве поиска, в котором: создают словарь символов с помощью средства создания дерева, определяющий множество символов, которое используется при поиске, при этом словарь содержит по меньшей мере: символы алфавита; маски, которыми являются по меньшей мере символ замены одного символа и символ обобщения, заменяющий произвольное число символов в строке; создают дерево поиска с помощью средства создания дерева, при этом: набор строк, используемых для создания дерева, включает в себя по меньшей мере одну строку, содержащую маски и символы алфавита; в узлах (node) дерева сохраняются подстроки (substring) каждой строки, входящей в набор строк, при этом: в отдельный узел дерева поиска сохраняется подстрока, являющаяся префиксом входящей в набор строк строки, содержащая символы до маски; узел, в который сохраняется последняя подстрока входящей в набор строк строки, является конечным; в узлах дерева сохраняются индексы каждой строки, входящей в набор строк, при этом: индексом пути является номер строки в наборе строк; в одном узле хранится по меньшей мере один индекс строки; выполняют индексацию дерева поиска с помощью средства создания дерева, создавая таблицу индексации, содержащую символы и набор индексов строк, входящих в набор строк, при этом: в таблице индексации используются символы из словаря символов; из подстроки, хранящейся в каждом конечном узле, выделяют последний символ, при этом выделенный символ может являться символом алфавита или маской; для каждого выделенного последнего символа в таблицу индексации добавляется набор индексов строк, хранящийся в конечном узле; определяют множество индексов строк с помощью средства поиска, которое будет использовано при поиске входной строки по дереву поиска, при этом: выделяют последний символ входящей строки, которую необходимо найти в дереве поиска; из таблицы индексации выбирают набор индексов строк дерева поиска для поиска упомянутого символа, добавленный на этапе ранее; из таблицы индексации выбирают набор индексов строк, добавленный на этапе ранее для масок; объединяют выбранные наборы индексов строк во множество индексов строк; выполняют поиск входной строки в дереве поиска с помощью средства поиска, при этом: из входящей строки последовательно выделяют подстроку, начиная с первого символа; сравнивают выделенную подстроку с подстроками, хранящимися в узлах дерева поиска, при этом сначала определяют, входит ли по меньшей мере один индекс строки, хранящийся в сравниваемом узле, во множество индексов строк, определенное на этапе ранее, затем сравнивают значение выделенной подстроки и подстроки, сохраненной в узле.According to one embodiment, a method is provided for searching for an input string in a search tree, in which: a dictionary of characters is created using a tree creation tool defining a plurality of characters used in the search, the dictionary comprising at least: alphabetical characters; masks, which are at least one character replacement symbol and a generalization symbol replacing an arbitrary number of characters in a string; creating a search tree using the tree creation tool, wherein: the set of lines used to create the tree includes at least one line containing masks and alphabetical characters; in the nodes of the tree, substring of each line in the set of strings is saved, while: in a separate node of the search tree, a substring is stored, which is the prefix of the line in the set of lines containing characters before the mask; the node to which the last substring of the line in the rowset is stored is the terminal; in the nodes of the tree, the indices of each row in the rowset are stored, with: the path index is the row number in the rowset; at least one row index is stored in one node; perform indexing of the search tree using the tree creation tool, creating an indexing table containing the characters and a set of indexes of the strings included in the set of strings, while: the characters from the character dictionary are used in the indexing table; the last character is extracted from the substring stored in each end node, while the selected character can be an alphabet character or a mask; for each last character selected, a set of row indices stored in the final node is added to the indexing table; determine the set of row indices using the search tool that will be used when searching for the input line in the search tree, in this case: select the last character of the input line to be found in the search tree; from the indexing table, a set of search tree row indexes is selected to search for the symbol, added in a step earlier; from the indexing table, a set of row indices is added, which was added at the stage earlier for masks; Combine selected sets of row indices into multiple row indices they search for the input line in the search tree using the search tool, while: from the input line, a substring is sequentially selected starting from the first character; comparing the selected substring with the substrings stored in the nodes of the search tree, first determining whether at least one row index stored in the compared node is included in the plurality of row indices determined in the previous step, then comparing the value of the selected substring and the substring stored in the node.
Согласно одному из частных вариантов реализации предоставляется способ, в котором словарь символов дополнительно содержит цифры.According to one particular embodiment, a method is provided in which the character dictionary further comprises numbers.
Согласно другому частному варианту реализации предоставляется способ, в котором словарь символов дополнительно содержит знаки препинания.According to another particular embodiment, a method is provided in which the character dictionary further comprises punctuation marks.
Согласно еще одному частному варианту реализации предоставляется способ, в котором конечный узел дерева имеет по меньшей мере один дочерний узел.According to yet another particular embodiment, a method is provided in which an end node of a tree has at least one child node.
Краткое описание чертежейBrief Description of the Drawings
Дополнительные цели, признаки и преимущества настоящего изобретения будут очевидными из прочтения последующего описания осуществления изобретения со ссылкой на прилагаемые чертежи, на которых:Additional objectives, features and advantages of the present invention will be apparent from reading the following description of an embodiment of the invention with reference to the accompanying drawings, in which:
Фиг. 1 изображает пример работы программного обеспечения на компьютере.FIG. 1 shows an example of how the software works on a computer.
Фиг. 2А изображает способ поиска входной строки в дереве поиска, содержащем маски.FIG. 2A depicts a method for searching an input string in a search tree containing masks.
Фиг. 2Б отображает структуру дерева поиска.FIG. 2B displays the structure of the search tree.
Фиг. 2В отображает структуру дерева поиска после индексации.FIG. 2B shows the structure of the search tree after indexing.
Фиг. 3 представляет пример компьютерной системы общего назначения, на которой может быть реализовано настоящее изобретение.FIG. 3 is an example of a general purpose computer system on which the present invention may be implemented.
Описание вариантов осуществления изобретенияDescription of Embodiments
Объекты и признаки настоящего изобретения, способы для достижения этих объектов и признаков станут очевидными посредством отсылки к примерным вариантам осуществления. Однако настоящее изобретение не ограничивается примерными вариантами осуществления, раскрытыми ниже, оно может воплощаться в различных видах. Сущность, приведенная в описании, является ничем иным, как конкретными деталями, обеспеченными для помощи специалисту в области техники в исчерпывающем понимании изобретения, и настоящее изобретение определяется только в объеме приложенной формулы.The objects and features of the present invention, methods for achieving these objects and features will become apparent by reference to exemplary embodiments. However, the present invention is not limited to the exemplary embodiments disclosed below, it can be embodied in various forms. The essence described in the description is nothing more than the specific details provided to assist the specialist in the field of technology in a comprehensive understanding of the invention, and the present invention is defined only in the scope of the attached claims.
Фиг. 1 изображает пример работы приложений на вычислительном устройстве.FIG. 1 shows an example of the operation of applications on a computing device.
В общем случае вычислительное устройство работает под управлением операционной системы 110. Приложения 120 обращаются к различным файлам, веткам реестра, путям в локальной сети. Для вычислительных устройств могут быть определены политики безопасности 170, в соответствии с которыми каждое приложение имеет свой определенный набор путей, по которым приложению разрешен доступ. Приложение безопасности (например, антивирусное приложение) 160 может наблюдать за другими приложениями 120 и сравнивать пути, к которым обращаются приложения, а при возникновении нарушений политик безопасности приложениями 120 блокировать доступ этих приложений 120 к ресурсам по неразрешенным политиками путям. В общем случае приложение безопасности 160 выполняет наблюдение за активностью других приложений и блокирует их доступ с использованием перехвата вызовов API-функций. Например, приложение безопасности 160 может перехватывать вызовы API-функций приложением 120, определять параметры перехваченного вызова, которые в свою очередь могут содержать пути, и сравнивать параметры с политиками безопасности 170.In general, the computing device is running an
В частном случае количество путей, контролируемых приложением безопасности 160, может быть достаточно большим. Также политики безопасности могут содержать как правила, содержащие только разрешенные пути, так и правила, содержащие запрещенные пути. Пути могут представлять собой:In the particular case, the number of paths controlled by the
- локальные пути к файлам и каталогам 130 (в зависимости от типа устройства и операционной системы формат путей может отличаться);- local paths to files and directories 130 (depending on the type of device and operating system, the format of the paths may vary);
- пути к веткам реестра 140;- paths to
- пути в локальной сети 150;- paths in the
- адреса ресурсов в сети интернет 155;- addresses of resources on the Internet 155;
- пути к определенным сервисам и серверам (например, строка связи с базой данных 165 на SQL-сервере);- paths to certain services and servers (for example, a connection string with
- любые другие пути и адреса, которые можно представить в виде форматированной строки.- any other paths and addresses that can be represented as a formatted string.
Пути, разрешенные или запрещенные для приложения, могут быть описаны в базе данных, которую использует приложение безопасности 180. Зачастую множество путей содержит пути из одного каталога, которые могут быть описаны с помощью масок. В общем случае маска - это строка, с помощью которой может быть описано множество похожих строк. В общем случае маски описываются с помощью специальных символов (спецсимволов), например, «?» (маска произвольного одиночного символа) и «*» (маска произвольного числа произвольных символов). Описание с помощью масок сокращает общее количество путей, контролируемых приложением безопасности 160, например, пути «C:\Windows\System\Drivers» и «D:\Windows\System32\Drivers» могут быть описаны с помощью маски «?:\Windows\System*\Drivers». Однако количество контролируемых (разрешенных или запрещенных) путей даже в случае использования масок может быть значительным. При линейном последовательном поиске сравнение пути, к которому обращается приложение, со всеми разрешенными (запрещенными) путями занимает значительное время, так как является последовательным сравнением строк друг с другом. При этом возможно замедление работы как отдельного приложения 120, так и приложения безопасности 160 или операционной системы 110 в целом. При выполнении ресурсоемких задач, например, при математических расчетах или обработке запросов к базе данных, на вычислительном устройстве (например, компьютере или сервере) замедление недопустимо, необходимо решение для быстрого поиска пути, по которому обращается приложение, во множестве разрешенных путей.Paths allowed or denied for the application can be described in the database that the
Проблема быстрого поиска пути, описанная выше, может быть решена с помощью дерева поиска, содержащего маски путей, которое будет использоваться приложением безопасности 160 для поиска пути, к которому обращается приложение 120, среди разрешенных или запрещенных путей.The quick path search problem described above can be solved by using a search tree containing path masks that will be used by the
Фиг. 2А изображает способ поиска пути по дереву поиска, содержащему маски путей.FIG. 2A depicts a method for searching a path through a search tree containing path masks.
Тип дерева поиска - не бинарное, каждый узел (англ. node) может иметь более одного потомка или не иметь потомков вообще. Дерево поиска представляет собой дерево, где подстроки, входящие в состав пути, располагаются в узлах дерева 220. Кроме того, в одном из вариантов реализации узлы одного уровня, у которых одинаковый родительский узел, могут быть связаны между собой в виде направленного списка (узел дерева содержит указатель на другой узел).The type of the search tree is not binary, each node (English node) can have more than one descendant or have no descendants at all. The search tree is a tree where the substrings included in the path are located in the nodes of the
На начальном этапе 201 средство создания дерева 291 создает словарь символов. Словарь символов содержит символы и спецсимволы, которые могут быть использованы средством создания дерева 291 при создании дерева. Например, в качестве символов используются только английские символы в верхнем регистре. Кроме того, в качестве спецсимволов могут использоваться упомянутые символы «?» и «*». Расположение спецсимволов в строке адреса произвольное, количество спецсимволов не ограничено. В общем случае запрещается использовать комбинации из рядом расположенных спецсимволов (то есть нельзя указать «*?», «?*» или «**»).At an
В одном из вариантов реализации для каждого символа в словаре средство создания дерева 291 добавляет индекс - числовое значение. Например, элементы словаря, состоящего из английских символов в верхнем регистре, цифр и спецсимволов, имеют индексы от «0» до «36» (26 индексов добавляются для букв алфавита, 10 индексов для цифр, индекс «36» добавляется для спецсимволов).In one embodiment, for each character in the dictionary, the tree builder 291 adds an index — a numerical value. For example, elements of a dictionary consisting of English uppercase characters, numbers and special characters have indices from “0” to “36” (26 indices are added for letters of the alphabet, 10 indices for numbers, index “36” is added for special characters).
Пример дерева поиска 220, построенного на этапе 202 средством создания дерева 291 для набора путей:An example of a
отображен на Фиг. 2Б.shown in FIG. 2B.
При построении дерева поиска 220 средство создания дерева 291 сохраняет (помещает) в узлы дерева поиска 220 подстроки (англ. substring), состоящие из символов словаря, при этом каждая строка из набора путей разделяется на подстроки. В общем случае реализации настоящего изобретения из каждой строки из набора путей выделяется и помещается в отдельный узел дерева поиска 220 подстрока, являющаяся префиксом строки из набора путей, содержащая символы до спецсимвола («?» или «*»). В одном из вариантов реализации спецсимвол «?» также помещается в отдельный узел дерева поиска 220. Оставшаяся подстрока (оставшаяся часть строки из набора путей) также (по вышеуказанным правилам) разделяется на подстроки, если содержит другие спецсимволы, в ином случае помещается в отдельный узел дерева поиска 220. В случае, если строка из набора путей содержит подстроку, которая содержится в подстроке одного из узлов дерева поиска 220, подстрока этого узла разделяется на две подстроки, при этом первая подстрока сохраняется в этом узле дерева поиска 220, а вторая - в дочернем. Узел дерева поиска 220, в который помещается последняя подстрока входящей в набор путей строки, является конечным, но может содержать потомков. Конечные узлы дерева поиска 222 отмечены на Фиг. 2Б с помощью утолщенных контурных линий.When constructing the
При построении дерева поиска средство построения дерева 291 сохраняет в узле дерева индекс пути из набора путей, подстрока которого хранится в этом узле. При этом индекс пути - это в общем случае номер строки в наборе путей, по которому строится дерево поиска. В одном узле может храниться более одного индекса пути. Индексы путей, хранящиеся в узлах дерева поиска 220, указаны на Фиг. 2Б в квадратных скобках. Так, например, узел «\REGISTRY\MACHINE\S» хранит индексы путей с [1] по [9], так как указанная подстрока содержится в каждом пути из набора путей.When constructing a search tree, the tree builder 291 stores in the tree node a path index from a set of paths whose substring is stored in this node. Moreover, the path index is, in general, the line number in the set of paths along which the search tree is built. A single node can store more than one path index. The path indices stored in the nodes of the
На этапе 203 средство построения дерева 291 выполняет индексацию дерева поиска 222, которое после индексации имеет структуру, отображенную на Фиг. 2В. Средство построения дерева с использованием словаря символов строит таблицу индексации. В каждом конечном узле средство построения дерева 291 выбирает последний символ подстроки узла, и в таблице индексации сохраняет индексы путей, которые содержат подстроку, хранящуюся в данном конечном узле.At
В результате таблица индексации в одном из вариантов реализации выглядит так (сам символ, набор индексов путей):As a result, the indexing table in one embodiment looks like this (the symbol itself, a set of path indices):
На этапе 204 средство поиска 292 определяет множество индексов узлов, которые будут использованы при поиске входной строки по дереву поиска 222. Для этого по таблице индексации для последнего символа строки, которую надо найти, определяется набор индексов путей, по которым необходимо выполнить поиск. Так, например, в строке «REGISTRY\MACHINE\SYSTEM\CONTROLSET001NUM\ROOT\LEGACY_KLP» последним символом является «Р», поэтому согласно таблице индексации при поиске необходимо использовать пути [2], [5] дерева поиска 222. Кроме того, так как дерево поиска 222 содержит произвольный символ в конечном узле, индексы путей, ведущие к нему, тоже учитываются средством поиска 292, то есть при поиске необходимо также использовать пути [3], [4]. Средство поиска 292 объединяет наборы индексов путей во множество индексов путей, в результате чего определяет, что при поиске упомянутой строки выполнять сравнение нужно только в узлах, содержащих подстроки путей [2], [5], [3], [4].At
На этапе 205 средство поиска 292 выполняет поиск входной строки в дереве поиска 222. Происходит сравнение входной строки с подстроками, хранящимися в узлах дерева поиска 222, при этом сначала определяется, содержит ли узел индекс пути, входящий во множество индексов путей, определенное на этапе 204, затем подстрока узла ищется во входной строке. В настоящее время существует множество способов быстрого поиска подстроки в строке, существуют также способы, которые выполняют упомянутый поиск с использованием масок. Рассмотрение этих способов выходит за рамки настоящего изобретения. Если подстрока из узла дерева поиска 222 содержится во входной строке и находится в начале входной строки (является префиксом входной строки), то часть входной строки, эквивалентная подстроке из узла дерева поиска 222, удаляется из входной строки, и поиск продолжается. Оставшаяся часть входной строки (подстрока) сравнивается с дочерними узлами упомянутого узла дерева, подстрока которого содержалась во входной строке. Как и ранее, сначала определяется, содержит ли узел индекс пути, входящий во множество индексов путей, определенное на этапе 204, затем подстрока узла ищется в оставшейся части входной строки. Таким образом, ветвления дерева, которые образованы узлами, содержащими индексы путей, не указанные в таблице индексации, не используются для поиска средством поиска 292.At
Так, в примере, рассмотренном выше, поиск упомянутой входной строки «REGISTRY\MACHINE\SYSTEM\CONTROLSET001\ENUM\ROOT\LEGACY_KLP» выполняется с использованием узлов дерева поиска 222, хранящих индексы путей [2], [5], [3], [4]. Самый верхний узел дерева поиска 222 хранит индексы путей с [1] по [9], подстрока «\REGISTRY\MACHINE\S», содержащаяся в нем, является частью упомянутой входной строки. Эта часть строки удаляется из входной строки, поиск продолжается для строки «YSTEM\CONTROLSET001\ENUM\ROOT\LEGACY_KLP», с которой сравнивается подстрока «OFTWARE\» узла дерева поиска 222, хранящего индексы пути [4], [5], [6], [7], [8]. Индексы пути [4], [5] включены в таблицу индексации, это означает, что в дочерних узлах ветвлений дерева поиска 222 существует подстрока, заканчивающаяся на символ «Р» или содержащая маску. Однако подстрока узла «OFTWARE\» не является частью строки, для которой продолжается поиск. Поиск не продолжается с использованием дочерних узлов данного узла, а продолжается с использованием узла «YSTEM\CONTROLSET», который хранит индексы путей [0], [1], [2], [3], при этом путь [2] также входит в определенное ранее множество индексов путей. Так как строка «YSTEM\CONTROLSET» является частью строки поиска, строка поиска принимает вид «001\ENUM\ROOT\LEGACY_KLP», и поиск продолжается с использованием дочерних узлов данного узла. Дочерний узел только один, содержит среди индексов индексы пути [2], [3], которые включены в таблицу индексации. Так как подстрока этого узла имеет вид «*\» (то есть содержит маску), используются упомянутые способы поиска подстроки с использованием масок. Так, в результате такого поиска подстрока «001\» эквивалентна подстроке «*\». Входная строка принимает вид «ENUM\ROOT\LEGACY_KLP», и поиск продолжается. Узел «SERVICES\KL» не содержит индекс пути, входящий в определенное ранее множество индексов путей, поэтому поиск с использованием данного узла не производится. Узел с индексом «ENUM\ROOT\LEGACY_KL» содержит индексы путей [2], [3], входящие в определенное ранее множество индексов путей, подстрока «ENUM\ROOT\LEGACY_KL» узла является частью строки для поиска. В результате строка для поиска принимает вид «Р». В определенное ранее множество индексов путей узлов не входит узел «IF», но входят узлы «ОР» и «?», поэтому происходит поиск подстроки узла «ОР» в строке поиска. Поиск не успешен, далее происходит поиск подстроки узла «?» в строке поиска. Так как подстрока этого узла имеет вид «?» (то есть содержит маску), используются упомянутые способы поиска подстроки с использованием масок. Так, в результате такого поиска подстрока «Р» эквивалентна подстроке «?». Таким образом, упомянутая входная строка найдена средством поиска 292 в дереве поиска 222, то есть описана подстроками и масками, хранящимися в узлах дерева поиска 222.So, in the example discussed above, the search for the mentioned input string “REGISTRY \ MACHINE \ SYSTEM \ CONTROLSET001 \ ENUM \ ROOT \ LEGACY_KLP" is performed using nodes of the
Функциональность средства построения дерева 291 и средства поиска 292 может быть реализована исключительно аппаратными средствами, а также в виде комбинации, где часть функциональности реализована программными средствами, а часть - аппаратными. В некоторых вариантах реализации программная часть функциональности упомянутых средств может быть исполнена на процессоре компьютера общего назначения (пример изображен на Фиг. 3).The functionality of the tree builder 291 and the search tool 292 can be implemented exclusively in hardware, as well as in the form of a combination, where some of the functionality is implemented by software and some by hardware. In some embodiments, the software part of the functionality of the said tools can be executed on a general-purpose computer processor (an example is shown in Fig. 3).
Фиг. 3 представляет пример компьютерной системы общего назначения, персональный компьютер или сервер 20, содержащий центральный процессор 21, системную память 22 и системную шину 23, которая содержит разные системные компоненты, в том числе память, связанную с центральным процессором 21. Системная шина 23 реализована, как любая известная из уровня техники шинная структура, содержащая в свою очередь память шины или контроллер памяти шины, периферийную шину и локальную шину, которая способна взаимодействовать с любой другой шинной архитектурой. Системная память содержит постоянное запоминающее устройство (ПЗУ) 24, память с произвольным доступом (ОЗУ) 25. Основная система ввода/вывода (BIOS) 26 содержит основные процедуры, которые обеспечивают передачу информации между элементами персонального компьютера 20, например, в момент загрузки операционной системы с использованием ПЗУ 24.FIG. 3 represents an example of a general purpose computer system, a personal computer or
Персональный компьютер 20 в свою очередь содержит жесткий диск 27 для чтения и записи данных, привод магнитных дисков 28 для чтения и записи на сменные магнитные диски 29 и оптический привод 30 для чтения и записи на сменные оптические диски 31, такие как CD-ROM, DVD-ROM и иные оптические носители информации. Жесткий диск 27, привод магнитных дисков 28, оптический привод 30 соединены с системной шиной 23 через интерфейс жесткого диска 32, интерфейс магнитных дисков 33 и интерфейс оптического привода 34 соответственно. Приводы и соответствующие компьютерные носители информации представляют собой энергонезависимые средства хранения компьютерных инструкций, структур данных, программных модулей и прочих данных персонального компьютера 20.The
Настоящее описание раскрывает реализацию системы, которая использует жесткий диск 27, сменный магнитный диск 29 и сменный оптический диск 31, но следует понимать, что возможно применение иных типов компьютерных носителей информации 56, которые способны хранить данные в доступной для чтения компьютером форме (твердотельные накопители, флеш карты памяти, цифровые диски, память с произвольным доступом (ОЗУ) и т.п.), которые подключены к системной шине 23 через контроллер 55.The present description discloses an implementation of a system that uses a
Компьютер 20 имеет файловую систему 36, где хранится записанная операционная система 35, а также дополнительные программные приложения 37, другие программные модули 38 и данные программ 39. Пользователь имеет возможность вводить команды и информацию в персональный компьютер 20 посредством устройств ввода (клавиатуры 40, манипулятора «мышь» 42). Могут использоваться другие устройства ввода (не отображены): микрофон, джойстик, игровая консоль, сканнер и т.п. Подобные устройства ввода по своему обычаю подключают к компьютерной системе 20 через последовательный порт 46, который в свою очередь подсоединен к системной шине, но могут быть подключены иным способом, например, при помощи параллельного порта, игрового порта или универсальной последовательной шины (USB). Монитор 47 или иной тип устройства отображения также подсоединен к системной шине 23 через интерфейс, такой как видеоадаптер 48. В дополнение к монитору 47, персональный компьютер может быть оснащен другими периферийными устройствами вывода (не отображены), например колонками, принтером и т.п.
Персональный компьютер 20 способен работать в сетевом окружении, при этом используется сетевое соединение с другим или несколькими удаленными компьютерами 49. Удаленный компьютер (или компьютеры) 49 являются такими же персональными компьютерами или серверами, которые имеют большинство или все упомянутые элементы, отмеченные ранее при описании существа персонального компьютера 20, представленного на Фиг. 3. В вычислительной сети могут присутствовать также и другие устройства, например маршрутизаторы, сетевые станции, пиринговые устройства или иные сетевые узлы.The
Сетевые соединения могут образовывать локальную вычислительную сеть (LAN) 50 и глобальную вычислительную сеть (WAN). Такие сети применяются в корпоративных компьютерных сетях, внутренних сетях компаний и, как правило, имеют доступ к сети Интернет. В LAN- или WAN-сетях персональный компьютер 20 подключен к локальной сети 50 через сетевой адаптер или сетевой интерфейс 51. При использовании сетей персональный компьютер 20 может использовать модем 54 или иные средства обеспечения связи с глобальной вычислительной сетью, такой как Интернет. Модем 54, который является внутренним или внешним устройством, подключен к системной шине 23 посредством последовательного порта 46. Следует уточнить, что сетевые соединения являются лишь примерными и не обязаны отображать точную конфигурацию сети, т.е. в действительности существуют иные способы установления соединения техническими средствами связи одного компьютера с другим.Network connections can form a local area network (LAN) 50 and a wide area network (WAN). Such networks are used in corporate computer networks, internal networks of companies and, as a rule, have access to the Internet. In LAN or WAN networks, the
В заключение следует отметить, что приведенные в описании сведения являются примерами, которые не ограничивают объем настоящего изобретения, определенного формулой. Специалисту в данной области становится понятным, что могут существовать и другие варианты осуществления настоящего изобретения, согласующиеся с сущностью и объемом настоящего изобретения.In conclusion, it should be noted that the information provided in the description are examples that do not limit the scope of the present invention defined by the claims. One skilled in the art will recognize that there may be other embodiments of the present invention consistent with the spirit and scope of the present invention.
Claims (27)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2016105560A RU2620996C1 (en) | 2016-02-18 | 2016-02-18 | Input string searching method in the search tree with indexing, used in the string tree construction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
RU2016105560A RU2620996C1 (en) | 2016-02-18 | 2016-02-18 | Input string searching method in the search tree with indexing, used in the string tree construction |
Publications (1)
Publication Number | Publication Date |
---|---|
RU2620996C1 true RU2620996C1 (en) | 2017-05-30 |
Family
ID=59032054
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
RU2016105560A RU2620996C1 (en) | 2016-02-18 | 2016-02-18 | Input string searching method in the search tree with indexing, used in the string tree construction |
Country Status (1)
Country | Link |
---|---|
RU (1) | RU2620996C1 (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6047283A (en) * | 1998-02-26 | 2000-04-04 | Sap Aktiengesellschaft | Fast string searching and indexing using a search tree having a plurality of linked nodes |
RU2190295C2 (en) * | 1996-07-24 | 2002-09-27 | Юнисиз Корпорейшн | Data compaction and decompaction system with direct catalog updating alternating with string search |
US6614789B1 (en) * | 1999-12-29 | 2003-09-02 | Nasser Yazdani | Method of and apparatus for matching strings of different lengths |
US6662184B1 (en) * | 1999-09-23 | 2003-12-09 | International Business Machines Corporation | Lock-free wild card search data structure and method |
US20140236995A1 (en) * | 2011-09-30 | 2014-08-21 | Harman Becker Automotive Systems Gmbh | Method of generating search trees and navigation device |
-
2016
- 2016-02-18 RU RU2016105560A patent/RU2620996C1/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
RU2190295C2 (en) * | 1996-07-24 | 2002-09-27 | Юнисиз Корпорейшн | Data compaction and decompaction system with direct catalog updating alternating with string search |
US6047283A (en) * | 1998-02-26 | 2000-04-04 | Sap Aktiengesellschaft | Fast string searching and indexing using a search tree having a plurality of linked nodes |
US6662184B1 (en) * | 1999-09-23 | 2003-12-09 | International Business Machines Corporation | Lock-free wild card search data structure and method |
US6614789B1 (en) * | 1999-12-29 | 2003-09-02 | Nasser Yazdani | Method of and apparatus for matching strings of different lengths |
US20140236995A1 (en) * | 2011-09-30 | 2014-08-21 | Harman Becker Automotive Systems Gmbh | Method of generating search trees and navigation device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3602382B1 (en) | Configurable annotations for privacy-sensitive user content | |
US10102253B2 (en) | Minimizing index maintenance costs for database storage regions using hybrid zone maps and indices | |
JP4698738B2 (en) | Multi-segment string search | |
US7562087B2 (en) | Method and system for processing directory operations | |
US11249992B2 (en) | Parsing of user queries in a remote network management platform using extended context-free grammar rules | |
US8321843B2 (en) | Automatic analysis of an application's run-time settings | |
RU2523112C1 (en) | System and method of selecting optimum type of antiviral verification when accessing file | |
AU2021201815B2 (en) | Improved parsing of user queries in a remote network management platform using linguistic matching | |
US11637864B2 (en) | Hardening of cloud security policies | |
JP2018113034A (en) | Binary search of byte sequences using inverted indices | |
RU2622629C2 (en) | Method of searching for the road by tree | |
JP4237813B2 (en) | Structured document management system | |
JP2015530021A (en) | Using primary and secondary connection connection tables | |
US20130159316A1 (en) | Disappearing index for more efficient processing of a database query | |
RU2620996C1 (en) | Input string searching method in the search tree with indexing, used in the string tree construction | |
RU2623882C1 (en) | Method for searching inlet line in search tree with indexing of search tree nodes | |
RU2587424C1 (en) | Method of controlling applications | |
JP7173165B2 (en) | History management device, history management method and program | |
RU2660643C1 (en) | System and method of detecting the harmful cil-file | |
RU2584505C2 (en) | System and method for filtering files to control applications | |
JP7424393B2 (en) | Estimation system, estimation method and estimation program | |
JP4304226B2 (en) | Structured document management system, structured document management method and program | |
KR101900813B1 (en) | Apparatus and method for dynamic control-flow analysis for prescribing control-flow with Inputs generated from grammar | |
CN115733699A (en) | Method and system for processing black and white list of domain name, electronic equipment and storage medium | |
CN114861216A (en) | SQL injection detection method, equipment and storage medium based on AC automaton |