% document %\begin{comment} \maketitle %\include{./agradecimentos} %% opcional %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % RESUMO %% obrigatório \begin{resumo} %% insira seu resumo abaixo \hypertarget{estilo:resumo}{} % Nota de autor % Este documento reflete o resultado de um longo processo de amadurecimento de uma proposta de definição de um sistema de identificação de itens de informação. This document reflects the result of a long maturation process of a definition of an identification system of information items. % A idéia original, concebida em 1995, procura aproveitar a própria infra-estrutura já existente, oferecida pela Internet. The original idea, conceived in 1995, seeks to harness the own existing infrastructure offered by Internet. % Desde a sua concepção, a realização dessa idéia foi sendo, aos poucos, aperfeiçoada. Deste processo todo, resultou esta proposta, que já se encontra amplamente testada numa plataforma computacional chamada de UR\textsl{Lib}. A plataforma UR\textsl{Lib} é aquela adotada pelo INPE para hospedar sua Memória Científica. Since its conception, the realization of this idea was being gradually improved. This whole process has resulted in this proposal, which has been largely tested in a computational platform called UR\textsl{Lib}. The UR\textsl{Lib} platform is the one adopted by INPE to host its Scientific Memory. % Vale mencionar que, embora esta idéia tenha sido primariamente concebida para identificar itens de informação, no caso, sob um caráter normalizado, o sistema de identificação a ela associado, tal como definido neste documento, pode vir a ser também utilizado para identificar qualquer outro item ou objeto, portanto, também de forma normalizada, em princípio. It is worth mentioning that although this idea has been primarily designed to identify information items, in the case, under a standard character, the identification system associated with it, as defined in this document, could also be used to identify any item or object, so, also in a standardized way, in principle. % O documento original que deu origem a esta Norma que está sendo recomendada possui o título: ``Identificador com base na Internet (IBI): Sistema de identificação''. Ele foi publicado pelo INPE na forma de relatório de pesquisa, sob o código de identificação: iconet.com.br/banon/2009/09.09.22.01-RPQ. Ele está acessível a partir de apontamento no endereço URL: . % The original document that gave rise to this standard that is being recommended has the title: ``Identificador com base na Internet (IBI): Sistema de identificação'' (Internet based Identifier (IBI): Identification system). It was published by INPE in the form of research report, under the identification code: iconet.com.br/banon/2009/09.09.22.01-RPQ. It is accessible from pointing at the URL: . The present document is the traduction of the technical report RTC-10-a (2$^\mathrm{nd}$ edition) entitled: ``Sistema para geração de IBI'', which is accessible from pointing at the URL: . The present document is the traduction of a technical report \cite{ComissaodeEA:2015:SiGeIB} which has been derived from another more complete technical report \cite{Banon:2011:SiId}. It contributes to solve the problem of citability via good linking \cite{SmitHoeGia:2011:AvDiDa}. \copyright\ CE 08:010.70/ABNT, INPE/MCT, São José dos Campos, SP, Brazil - May, 2015. \end{resumo} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ABSTRACT %% obrigatório \begin{abstract} %% insira abaixo seu abstract \selectlanguage{english} %% para os documentos em Português com abstract.tex em Inglês \hypertarget{estilo:abstract}{} This standard presents a procedure that leads to the creation of two versions of a global identifier, which is intended, in a long term, to consistently and compactly identify and to provide a convenient access to various kinds of information items (documents, maps, images, etc.), which are typically stored in collections, as found in digital repositories, in archives, or elsewhere. The practical deployment of this global identifier conveniently and essentially solely requires, at no additional cost, the widely, already available infrastructure of the Internet. This global identifier can be used in combination with information storage systems, which deal with collections and which, in this way, may enable remarkable simplicity in the processes dedicated to the creation of copies in different collections, also including simplicity in the migration of information items among such collections. In particular, a variety of convenient applications of a global identifier of this nature in space data and information systems are envisioned. \selectlanguage{portuguese} %% para os documentos em Português com abstract.tex em Inglês \end{abstract} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \includeListaFiguras %% obrigatório caso haja mais de 3 figuras, gerado automaticamente \includeListaTabelas %% obrigatório caso haja mais de 3 tabelas, gerado automaticamente \includeSumario %% obrigatório, gerado automaticamente %\include{./docs/abreviaturasesiglas} %% opcional, mas recomendado com mais de três%% para tese ou dissertação atualize o arquivo siglaseabreviaturas.tex e tire o comentário desta linha %\include{./docs/simbolos} %% opcional, mas recomendado com mais de três%% para tese ou dissertação atualize o arquivo simbolos.tex e tire o comentário desta linha %\end{comment} \inicioIntroducao %% não altere este comando %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% O corpo do texto começo aqui \hypertarget{estilo:capitulo}{} %% uso para este manual \chapter{Introduction} \label{chap:introducao} % Esta norma apresenta duas formas em que um identificador global pode ser criado para identificar e prover acesso consistente e perene a diversos tipos de itens de informação (documentos, mapas, imagens, etc.) armazenados em acervos como os encontrados em repositórios digitais, em arquivos, ou em outras entidades de informação. This standard presents two forms in which a global identifier can be created to identify and provide consistent and enduring access to various types of information items (documents, maps, images, etc.) stored in collections like those found in digital repositories, archives, or other information entities. % A implantação desse identificador global requer, de uma forma indireta, infra-estrutura já existente e facilmente disponível da Internet. Portanto, sem custo adicional, quanto a este aspecto. The implementation of this global identifier requires, in a roundabout way, the existing and readily available Internet infrastructure. Therefore, without additional cost, in this regard. % Esse identificador global pode ser utilizado em associação com o processo de armazenamento de informação em acervos. O que também torna simples a criação de cópias em acervos distintos, incluindo a própria migração de itens de informação entre tais acervos. This global identifier can be used in association with the information storage process in collections. What also makes it simple to create copies in separate collections, including the information item migration itself between such collections. % As diversas aplicações de um identificador global desta natureza são também de particular interesse para uso em sistemas de dados espaciais e de informação. The various applications of a global identifier of this nature are also of particular interest for use in spatial data and information systems. \chapter{Scope} % Esta norma descreve e permite criar um sistema de identificação com base na Internet que associa a cada item de informação a ser identificado, um rótulo que pode ser utilizado como identificador desse item. As regras para a construção de duas formas de apresentação do mencionado rótulo são também apresentadas neste documento. This standard describes and allows to create an identification system based on the Internet that associates to each item of information to be identified, a label that can be used as an identifier for that item. The rules for the construction of two presentation forms of the mentioned label are also presented herein. \chapter{Rationale} % Parte-se do princípio que os hipervínculos (\textsl{hyperlinks}) ou simplesmente vínculos ou ponteiros, elementos essenciais na navegação entre itens de informação (documentos, mapas, imagens, etc.) atualmente disponíveis na Internet devem ter o seu funcionamento preservado e disponível, por longo prazo. It is assumed that hyperlinks or simply links or pointers, essential elements in the navigation between information items (documents, maps, images, etc.) currently available on the Internet should have its operation preserved and available for long term. % A solução para se poder garantir longa vida na preservação de ponteiros, portanto, com persistência e durabilidade, implica no uso de um sistema de identificação global. The solution in order to guarantee long life in preserving pointers, so with persistence and durability, implies the use of a global identification system. % O sistema de endereçamento físico de um item de informação na Web por meio de uma URL (\textsl{Uniform Resource Locator}) não é um sistema de identificação persistente, pois, com o tempo, um determinado item de informação pode mudar de localização, fazendo com que a associação: ``item de informação'' $\mapsto$ URL, não possua caráter de longa durabilidade, portanto que possa vir a não ser essencialmente permanente. The physical addressing system for an information item on the web by means of a URL (Uniform Resource Locator) is not a persistent identification system, because with time, the location of an information item can change, hence the association: ``information item'' $\mapsto$ URL, do not have a long-lasting character, so that it may not be essentially permanent. % Uma vez escolhido um sistema de identificação, tal que, por meio dele possam ser atribuídos rótulos à itens de informação, a questão da construção de ponteiros persistentes pode vir a ser solucionada com o uso de um sistema de resolução (ou, sistema ``resolvedor''), que deve ter o propósito básico de redirecionar cada URL, agora contendo apenas o identificador de um item de informação, para a URL que, efetivamente, contém o seu endereço físico. Once an identification system has been chosen, in such a way that labels can be assigned to information items, the issue of the construction of persistent pointers might be solved using a resolution system, which must have the basic purpose of redirecting each URL, now containing just the identifier of an information item, to the URL which effectively contains its physical address. \chapter{Terms and definitions} \label{chap:termimologia} % Para os efeitos deste documento, aplicam-se os seguintes termos e definições. For the purposes of this document, the following terms and definitions apply. % \textbf{IBI}: sigla para ``Identificador com Base na Internet''. Qualquer \textbf{rótulo} gerado pelo \textbf{sistema para geração de IBI}. \textbf{IBI}: acronym for ``Internet Based Identifier''. Any \textbf{label} generated by the \textbf{system for IBI generation}. % \textbf{IBI de um item}: \textbf{rótulo} atribuido à um \textbf{item} pelo \textbf{sistema para geração de IBI} utilizando o endereçamento por nome de domínio ou IP. \textbf {IBI of an item}: \textbf{label} assigned to an \textbf{item} by the \textbf{system for IBI generation} using the addressing by domain name or IP. % \textbf{IBIp de um item}: \textbf{rótulo} atribuido à um \textbf{item} pelo \textbf{sistema para geração de IBI} utilizando o endereçamento por IP. \textbf{IBIp of an item}: \textbf{label} assigned to an \textbf{item} by the \textbf{system for IBI generation} using addressing by IP. % \textbf{Identificador de um item}: \textbf{rótulo} atribuido à um \textbf{item} por um \textbf{sistema de identificação}. \textbf{Identifier of an item}: \textbf{label} assigned to an \textbf{item} by a \textbf{identification system}. % \textbf{Subsistema de identificação}: qualquer \textbf{sistema de identificação} restrito a um subconjunto de \textbf{itens}. \textbf{Identification subsystem}: any \textbf{identification system} restricted to a subset of \textbf{items}. % \textbf{Sistema de identificação}: qualquer função injetora entre um conjunto de \textbf{itens} e um conjunto de \textbf{rótulos}, associando a cada \textbf{item} o \textbf{identificador desse item}. \textbf{Identification system}: any injective function from a set of \textbf{items} and a set of \textbf{labels}, associating to each \textbf{item} the \textbf{identifier of that item}. % \textbf{Sistema de identificação em dois níveis}: qualquer \textbf{sistema de identificação} associando um \textbf{item} à um \textbf{rótulo} obtido a partir de um par de \textbf{rótulos}, o primeiro identificando o \textbf{subsistema de identificação} responsável pela identificação do \textbf{item}, e o segundo sendo o \textbf{rótulo} atribuido ao \textbf{item} por esse \textbf{subsistema de identificação}. \textbf{Identification system on two levels}: any \textbf{identification system} associating an \textbf{item} to a \textbf{label} obtained from a pair of \textbf{labels}, the first identifying the \textbf{identification subsystem} responsible for identifying the \textbf{item}, and the second being the \textbf{label} assigned to the \textbf{item} by this \textbf{identification subsystem}. % \textbf{Instalador}: função entre um conjunto de \textbf{subsistemas de identificação} e um conjunto de pares de cadeia de caracteres informando o nome ou IP do computador, e a porta de acesso, onde foi instalado o \textbf{gerador de rótulo} utilizado por um determinado \textbf{subsistema de identificação}. \textbf{Installer}: function from a set of \textbf{identification subsystems} and a set of string pairs telling the computer name or IP, and the access door, where the \textbf{label generator} used by a particular \textbf{identification subsystem} was installed. % \textbf{Item de informação}: qualquer \textbf{item} consistindo exclusivamente em dados digitais, isto é quaisquer dados digitais a serem identificados. Por exemplo: documentos, mapas, imagens, etc. no formato digital. \textbf{Information item}: any \textbf{item} consisting exclusively of digital data, i.e., any digital data to be identified. For example, documents, maps, images, etc. in digital format. % \textbf{Item}: qualquer objeto a ser identificado. \textbf{Item}: any object to be identified. % \textbf{Rótulo}: qualquer cadeia finita de caracteres escolhidos dentro de um alfabeto finito, utilizada como \textbf{identificador de um item}. \textbf{Label}: any finite string chosen within a finite alphabet, used as \textbf {identifier of an item}. % \textbf{Gerador de rótulo}: função injetora utilizada por um \textbf{sistema de identificação} para gerar o \textbf{identificador de um item}. \textbf{Label generator}: injective function used by an \textbf{identification system} to generate the \textbf{identifier of an item}. % \textbf{Nome do repositório uniforme de um item}: \textbf{Identificador de um item} podendo ser utilizado para armazená-lo digitalmente em um sistema de arquivos, caso este seja um \textbf{Item de informação}. \textbf{Rótulo} atribuido à um \textbf{item} pelo \textbf{sistema para geração de IBI} utilizando o endereçamento por nome de domínio. \textbf{Name of the uniform repository of an item}: \textbf {identifier of an item} that can be used to store it digitally in a file system, whenever it is an \textbf{information item}. \textbf{Label} assigned to an \textbf{item} by \textbf{system for IBI generation} using the addressing by domain name. % \textbf{Distribuidor espacial}: função entre um conjunto de \textbf{itens} e um conjunto de \textbf{subsistemas de identificação}, distribuindo cada \textbf{item} à um determinado \textbf{subsistema de identificação} tornando esse \textbf{subsistema de identificação} responsável pela identificação desse \textbf{item}. \textbf {Spatial distributor}: function between a set of \textbf{items} and a set of \textbf {identification subsystems}, distributing each \textbf{item} to a given \textbf{identification subsystem}, making this \textbf{identification subsystem} responsible for identifying this \textbf{item}. % \textbf{Sistema para geração de IBI}: qualquer dos dois \textbf{sistemas de identificação em dois níveis} objeto desta norma. \textbf{System for IBI generation}: any of the two \textbf{identifications system on two levels} object of this standard. % \textbf{Distribuidor temporal}: função entre um conjunto de \textbf{itens} e um conjunto de datas, expressas em fração de segundo, distribuindo cada \textbf{item} num espaço temporal. \textbf{Temporal distributor}: function from a set of \textbf{items} and a set of dates expressed in a fraction of a second, distributing each \textbf{item} along a timeline. \chapter{Description of the system for IBI generation} \label{chap:descricao} % Nesta norma, os \textbf{itens} (objetos a serem identificados) são considerados formando conjuntos. Por exemplo, um conjunto de pastas. In this standard, the \textbf{items} (objects to be identified) are considered forming sets. For example, a set of folders. % Por sua vez, os \textbf{rótulos} utilizados para identificar os \textbf{itens}, são considerados formando conjuntos finitos ou enumeráveis. Por exemplo, o conjunto das cadeias de no máximo 255 caracteres alfanuméricos, ou ainda o conjunto dos inteiros representando datas expressas em segundo. In turn, the \textbf{labels} used to identify the \textbf{items} are considered forming finite or countable sets. For example, all the strings of a maximum of 255 alphanumeric characters, or integers of the set representing dates expressed in seconds. % Por ser uma função injetora, um \textbf{sistema de identificação} associa, de forma permanente, cada \textbf{item} à um único \textbf{rótulo}, de maneira que, \textbf{itens} distintos sejam associados à \textbf{rótulos} distintos. For being an injective function, an \textbf{identification system} associates, on a permanent basis, each \textbf{item} to a single \textbf{label}, so that, separate \textbf {items} are associated to separate \textbf{labels}. % Pela restrição dos conjuntos de \textbf{rótulos} serem finitos (respectivamente, enumeráveis), e pela propriedade de \textbf{sistema de identificação} ser injetor, os conjuntos dos \textbf{itens} devem ser necessariamente finitos (respectivamente, enumeráveis). By the restriction that the sets of \textbf{labels} are finite (respectively, countable), and by the property that an \textbf{identification system} is injective, the \textbf{item} set must necessarily be finite (respectively, countable). % O \textbf{sistema de identificação}, objeto deste relatório, consiste em quatro principais componentes: um conjunto de \textbf{subsistemas de identificação}, um \textbf{distribuidor espacial} de \textbf{itens}, um \textbf{sistema de identificação} dos \textbf{subsistemas de identificação} e um \textbf{gerador de rótulo}. Juntos eles formam um \textbf{sistema de identificação em dois níveis} descrito detalhadamente a seguir. The \textbf {identification system}, object of this report, consists of four main components: a set of \textbf{identification subsystems}, a \textbf{spatial distributor} of \textbf{items}, an \textbf{identification system} of \textbf{identification subsystems} and a \textbf{label generator}. Together they form an \textbf{identification system on two levels} described in detail below. \begin{description} % \item[] Seja $I$ o conjunto dos \textbf{itens} a serem identificados. \item[] Let $I$ be the set of \textbf{items} to be identified. % \item[] Seja $S$ o conjunto dos \textbf{subsistemas de identificação}. \item[] Let $S$ be the set of \textbf{identification subsystems}. % \item[] Seja $R_1$ um conjunto finito de \textbf{rótulos}. \item[] Let $R_1$ be a finite set of \textbf{labels}. % \item[] Seja $R_2$ um conjunto enumerável de \textbf{rótulos}. \item[] Let $R_2$ be a countable set of \textbf{labels}. % \item[] Seja $R$ um conjunto enumerável de \textbf{rótulos}. \item[] Let $R$ be a countable set of \textbf{labels}. % \item[] Seja $f: S \rightarrow R_1$ o \textbf{sistema de identificação} dos \textbf{subsistemas de identificação}. \item[] Let $f: S \rightarrow R_1$ be the \textbf{identification system} of the \textbf{identification subsystems}. % \item[] Seja $g: I \rightarrow S$ o \textbf{distribuidor espacial} definindo qual é o \textbf{subsistema de identificação} responsável pela identificação de cada \textbf{item}. Assim, para todo $s \in S$, o subconjunto dos \textbf{itens} que estão sob a responsabilidade do \textbf{subsistema de identificação} $s$ é $g^*(s)$, a fibra de $s$ através de $g$ (ver definição de fibra no Apêndice \ref{apendiceA}). \item[] Let $g: I \rightarrow S$ be the \textbf{spatial distributor} defining which \textbf{identification subsystem} is responsible for the identification of each \textbf{item}. Hence, for any $s \in S$, the set of \textbf{items} under the responsability of the \textbf{identification subsystem} $s$ is $g^*(s)$, the fiber of $s$ under $g$ (see the fiber definition in Appendix \ref{apendiceA}). % \item[] Seja, para todo $i \in I$, $g(i) : g^*(g(i)) \rightarrow R_2$, o \textbf{subsistema de identificação} responsável pela identificação do \textbf{item} $i$, no escopo desse subsistema. \item[] Let, for any $i \in I$, $g(i) : g^*(g(i)) \rightarrow R_2$, be the \textbf{identification subsystem} responsible for the identification of the \textbf{item} $i$, within the scope of this subsystem. % \item[] Seja $h: I \rightarrow R_1 \times R_2$ a função definida por: % \begin{equation*} % h(i) \triangleq (f(g(i)), g(i)(i)), \qquad \text{para todo $i \in I$}. % \end{equation*} % \item[] Seja $c: R_1 \times R_2 \rightarrow R$ o \textbf{gerador de rótulo} concatenando de forma reversível (i.e., $c$ é injetor) os rotulos provenientes de $R_1$ e $R_2$ % . \item[] Let $h: I \rightarrow R_1 \times R_2$ be the function defined by: \begin{equation*} h(i) \triangleq (f(g(i)), g(i)(i)), \qquad \text{for any $i \in I$}. \end{equation*} \item[] Let $c: R_1 \times R_2 \rightarrow R$ be the \textbf{label generator} concatenating reversibly (i.e., $c$ is injective) the labels from $R_1$ and $R_2$ . \end{description} % Um \textbf{sistema de identificação em dois níveis} é a função $s: I \rightarrow R$ definida como a composição de $h$ e $c$, i.e., por: $s \triangleq c \circ h$. An \textbf{identification system on two levels} is the functin $s: I \rightarrow R$ defined as the composition of $h$ and $c$, i.e., by: $s \triangleq c \circ h$. % Dado um \textbf{item} $i$ em $I$, um \textbf{sistema de identificação em dois níveis} atribui à $i$ o \textbf{rótulo} gerado por $c$ a partir do par $(f(g(i)), g(i)(i))$ constituido, de um lado, pelo \textbf{rótulo} $f(g(i))$ atribuido pelo \textbf{sistema de identificação} $f$ ao \textbf{subsistema de identificação} $g(i)$ (reponsável pela identificação de $i$ dentro do escopo $g^*(g(i))$), e, de outro lado, pelo \textbf{rótulo} $g(i)(i)$ atribuido pelo \textbf{subsistema de identificação} $g(i)$ ao \textbf{item} $i$. Given an \textbf{item} $i$ in $I$, an \textbf{identification system on two levels} assigns to $i$ the \textbf{label} generated by $c$ from the pair $(f(g(i)), g(i)(i))$ consisting, on one hand, by the \textbf{label} $f(g(i))$ assigned by the \textbf{identification system} $f$ to the \textbf{identification subsytem} $g(i)$ (reponsible by the identification of $i$ within the scope $g^*(g(i))$), and, on the other hand, by the \textbf{label} $g(i)(i)$ assigned by the \textbf{identification subsystem} $g(i)$ to the \textbf{item} $i$. % Os dois tipos de \textbf{sistema para geração de IBI}, objeto desta norma, são casos particulares de um \textbf{sistema de identificação em dois níveis} cujos componentes aparecem na Figura~\ref{fig:sistemaidentificacao}. The two types of \textbf {system for IBI generation}, object of this standard, are particular cases of a \textbf {identification system on two levels} whose components are shown in Figure~\ref{fig:sistemaidentificacao}. \begin{figure}[ht] \centering \includegraphics[width=1.0\hsize,trim=0 0 20 20,clip]{identificationSystem.pdf} % \caption{Sistema para geração de IBI} \caption{System for IBI generation} \label{fig:sistemaidentificacao} \end{figure} % Na Figura~\ref{fig:sistemaidentificacao}, cada bloco representa uma função, por exemplo $g$ (indicada por uma setinha acima do bloco), com sua entrada (ao lado esquerdo), por exemplo $i$, e sua saída (ao lado direito), por exemplo $g(i)$. In Figure~\ref{fig:sistemaidentificacao}, each box represents a function, for example $g$ (indicated by a small arrow above the box), with its input (on the left side), for example $i$, and its output (on the right side), for example $g(i)$. % Enquanto $g(i)(i)$, o \textbf{identificador do item} $i$, fornecido pelo \textbf{subsistema de identificação} $g(i)$, tem validade apenas dentro do escopo $g^*(g(i))$ desse subsistema, $s(i)$, o \textbf{identificador desse item}, fornecido pelo \textbf{sistema de identificação em dois níveis} $s$, tem validade dentro do escopo global $I$. While $g(i)(i)$, the \textbf{identifier of an item} $i$, provided by the \textbf{identification subsystem} $g(i)$, is valid only within the scope $g^*(g(i))$ of this subsystem, $s(i)$, the \textbf{identifier of this item}, provided by the \textbf{identification system on two levels} $s$, is valid within the overall scope $I$. % O \textbf{identificador de um item} será obtido como resultado de uma solicitação a um servidor responsável por um determinado \textbf{subsistema de identificação}, hospedado exclusivamente em um computador possuindo nome de domínio (\textsl{fully qualified domain name}). Nesse contexto, cada um dos \textbf{subsistemas de identificação} é identificado globalmente por um nome de dóminio ou um IP (\textsl{Internet Protocol}) na Internet (e uma porta), permitindo assim construir, de forma simples, o prefixo. The \textbf{identifier of an item} will be obtained as a result of a request to a server responsible for a certain \textbf{identification subsystem}, hosted exclusively on a computer having a fully qualified domain names. In this context, each of the \textbf{identification subsystems} is identified globally by a domain name or an IP (Internet Protocol) on the Internet (and a port), allowing to build in this way, simply, the prefix. % O sufixo, fornecido por um \textbf{subsistema de identificação}, segue uma regra comum a todos os subsistemas, e é construído com base na data e hora da associação do \textbf{item} ao \textbf{rótulo}. The suffix, provided by an \textbf{identification subsystem}, follows a common rule to all subsystems, and is built based on the date and time of the association of the \textbf{item} to the \textbf{label}. % O \textbf{rótulo} $s(i)$ atribuido ao \textbf{item} $i$ pelo \textbf{sistema de identificação em dois níveis} $s$ é chamado, nesta norma, de ``Identificador com Base na Internet'' ou \textbf{IBI}, e $s(i)$ é o \textbf{IBI do item} $i$. The \textbf{label} $s(i)$ assigned to the \textbf{item} $i$ by the \textbf{identification system on two levels} $s$ is called, in this standard, of ``Internet Based Identifier'' or \textbf{IBI}, and $s(i)$ is the \textbf{IBI of the item} $i$. % Nesta norma, dois tipos de prefixo herdado da Internet são considerados. In this standard, two types of prefix inherited from Internet are considered. % O primeiro tipo consiste em construir o \textbf{identificador de um subsistema de identificação}, isto é, o prefixo, com base no nome de domínio do computador\footnote{O nome de domínio pode se referir eventualmente ao nome de domínio de um computador virtual (\textsl{virtual host}).} que hospeda o servidor responsável por esse subsistema, assim como a porta de acesso a esse servidor. The first type consist of building the \textbf{identifier of an identification subsystem}, i.e., the prefix, based on the computer's domain name\footnote{The domain name may eventually refer to the domain name of a virtual computer (virtual host).} hosting the server responsible for this subsystem, as well as the port of access to that server. % No segundo tipo, o prefixo é obtido com base no IP do computador, no lugar do nome de domínio. In the second type, the prefix is obtained based on the computer's IP, instead of the domain name. % Os exemplos reais a seguir antecipam alguns dos detalhes sobre a formação dos identificadores que serão dados nos dois próximos capítulos. The following real examples anticipate some of the details on the identifier formation that will be given in the next two chapters. % Exemplo 1 \begin{example}[identifier based on the domain name] \label{example:nomededominio} % A associação de um \textbf{item} com um sufixo, ocorrida em 16 de fevereiro de 2009 às 17 horas 46 minutos\footnote{Data e hora expressas em Tempo Universal Coordenado (em inglês: \textsl{Coordinated Universal Time} (UTC)).}, resultou no sufixo: The association of an \textbf {item} to a suffix, which occurred on February 16, 2009 at 17 hours 46 minutes\footnote{Date and time expressed in Coordinated Universal Time (UTC).} resulted in the suffix: \begin{center}\texttt{2009/02.16.17.46}\end{center} % O servidor emitindo esse sufixo era hospedado em um computador com nome de domínio \texttt{mtc-m18.sid.inpe.br}, e acessível a partir da porta \texttt{80}, levando ao uso do prefixo: The server issuing this suffix was hosted on a computer with domain name \texttt{mtc-m18.sid.inpe.br}, and accessible from the port \texttt{80}, leading to the use of the prefix: \begin{center}\texttt{sid.inpe.br/mtc-m18@80}\end{center} % Desta forma, o \textbf{identificador para o item} passou a ser: In this way, the \textbf{identifier for the item} became: \begin{center}\texttt{sid.inpe.br/mtc-m18@80/2009/02.16.17.46}\end{center} \qed \end{example} % Observa-se, que mesmo que o nome de domínio \texttt{mtc-m18.sid.inpe.br} do Exemplo \ref{example:nomededominio} passe a ser abandonado ou muda de dono, isto não inviabiliza o \textbf{identificador criado para esse item}. O importante, apenas, é que esses dados eram pertinente no contexto da Internet na data e hora da associação entre o \textbf{item} e seu \textbf{rótulo}. Esta observação vale também para o segundo exemplo a seguir ilustrando a formação de um identificador com base no IP. It can be observed that even if the domain name \texttt{mtc-m18.sid.inpe.br} of Example \ref{example:nomededominio} turns to be abandoned or changes hands, this does not preclude the use of the \textbf{identifier created for that item}. The important thing is that these data were relevant in the context of the Internet on the date and time of the association between the \textbf{item} and its \textbf{label}. The same also applies to the second following example that illustrates the formation of an identifier based on the IP. % Exemplo 2 \begin{example}[identifier based on the IP] \label{example:IP} % A associação de um \textbf{item} com um sufixo, ocorrida na segunda 1234806360 em \textsl{POSIX time} (correspondendo a data de 16 de fevereiro de 2009 às 17 horas 46 minutos), resultou no sufixo opaco: The association of an \textbf {item} to a suffix, which occurred on the second 1234806360 in POSIX time (corresponding to date of February 16, 2009 at 17 hours 46 minutes) resulted in the opaque suffix: \begin{center}\texttt{34PGRBS}\end{center} % O servidor emitindo esse sufixo era hospedado em um computador com IP \texttt{150.163.34.243}, e acessível a partir da porta \texttt{800}, levando ao uso do prefixo opaco: The server issuing this suffix was hosted on an computer with IP \texttt{150.163.34.243}, and accessible from the port \texttt{800}, leading to the use of the opaque prefix: \begin{center}\texttt{8JMKD3MGP8W}\end{center} % Desta forma, o \textbf{identificador para o item} passou a ser: In this way, the \textbf{identifier for the item} became: \begin{center}\texttt{8JMKD3MGP8W/34PGRBS}\end{center} \qed \end{example} % Os dois tipos de \textbf{sistemas de identificação em dois níveis} são apresentados a seguir em detalhe. No primeiro, o \textbf{identificador de um item}, exibindo o nome de domíno, é chamado de \textbf{nome de repositório uniforme do item}. No segundo tipo, o \textbf{identificador de um item}, construido com base no IP, é chamado de \textbf{IBIp do item}. The two types of \textbf{identification systems on two levels} are presented below in detail. At first, the \textbf{identifier of an item}, displaying the domain name, is called \textbf{name of the uniform repository of that item}. In the second type, the \textbf{identifier of an item}, built based on the IP, is called \textbf{item IBIp}. % \chapter{Regras de construção do rótulo com base no nome de domínio} \chapter{Label construction rules based on domain name} \label{chap:repositoriouniforme} % No \textbf{sistema de identificação em dois níveis} apresentado neste capítulo, o \textbf{identificador de um item} é chamado também de \textbf{nome do repositório uniforme do item} porque ele pode ser utilizado para definir uma sequência de quatro diretórios servindo para armazenar, num sistema de arquivos, o \textbf{item} sendo identificado, caso este seja do tipo \textbf{item de informação}. In the \textbf{identification system on two levels} presented in this chapter, the \textbf{identifier of an item} is also called \textbf{name of the uniform repository of that item} because it can be used to define a four directories sequence serving to store in a file system, the \textbf{item} being identified, if it is of the type \textbf{information item}. % Os repositórios são chamados de uniforme porque, por meio destes, qualquer \textbf{item de informação} pode ser armazenado em qualquer sistema de arquivos, debaixo de um mesmo diretório, sem conflito de nome quando considerados outros \textbf{itens de informação}, facilitando assim o depósito de cópias em sistema de arquivos distintos e ainda a migração de \textbf{itens de informação} entre os mesmos. The repositories are called uniform because, through them, any \textbf{information item} can be stored on any file system, under a same directory without name conflict when considering other \textbf{information items}, thus facilitating the storage of copies in different file systems and still the migration of \textbf{information items} between them. % No \textbf{nome do repositório uniforme de um item}, o prefixo e o sufixo são separados por \verb!"/"! e cada um é, por sua vez, subdividida em duas partes separadas também por \verb!"/"!. Assim, os \textbf{rótulos} são constituidos de quatro partes, que podem se tornar uma sequência de quatro diretórios. In the \textbf{name of the uniform repository of an item}, the prefix and the suffix are separated by \verb!"/"! and each is in turn subdivided into two parts also separated by \verb!"/"!. Thus, the \textbf{labels} are constituted of four parts, which can become a sequence of four directories. % Como anunciado, as duas partes do prefixo são construidas a partir de um nome de domínio de computador (\textsl{hostname}) e eventualmente de um número de porta. As announced, the two parts of the prefix are built from a computer's domain name (hostname) and possibly a port number. % Quanto ao sufixo, as duas partes são construidas a partir de uma informação de data e hora expressa em Tempo Universal Coordenado (em inglês \textsl{Coordinated Universal Time} (UTC)). Regarding the suffix, the two parts are constructed from a date and time information expressed in Coordinated Universal Time (UTC). % Assim, as quatro partes do \textbf{nome do repositório uniforme de um item} são formadas por, nesta ordem: Thus, the four parts of the \textbf{name of the uniform repository of an item} are formed by, in this order: \begin{enumerate} % \item um nome de subdomínio, \item a subdomain name, % \item uma palavra\footnote{Um nome de domínio é constituido de palavras separadas por pontos.} de domínio, e eventualmente um número de porta, separados por \verb!"."! ou por \verb!"@"!, \item a domain word\footnote{A domain name consists of words separated by dots.}, and eventually a port number, separated by \verb!"."! or by \verb!"@"!, % \item um ano e \item a year and % \item um mês, dia, hora, minuto, e eventualmente segundo\footnote{ou fração de segundo.}, separados por \verb!"."!. \item a month, day, hour, minute, and eventually second\footnote{or fraction of a second.}, separated by \verb!"."!. \end{enumerate} % Estas quatro partes são reconhecíveis no Exemplo \ref{example:nomededominio} do capítulo anterior, onde o \textbf{nome do repositório uniforme do item} era: These four parts are recognizable in Example \ref{example:nomededominio} of the previous chapter, where the \textbf{name of the uniform repository of the item} was: \begin{center}\texttt{sid.inpe.br/mtc-m18@80/2009/02.16.17.46}\end{center} % Para definir precisamente a sintaxe do \textbf{nome do repositório uniforme de um item}, nesta norma, usa-se uma gramática BNF -- \textsl{Backus Normal Form} ou \textsl{Backus-Naur Form} -- (aumentada) \cite{Crocker:1982:StFoAR, CrockerOver:2008:AuBNSy} com a seguinte alteração: \verb!"|"! é utilizado para alternativas no lugar de \verb!"/"!. To precisely define the syntax of the \textbf{name of the uniform repository of an item}, this standard uses a BNF grammar -- Backus Normal Form or Backus-Naur Form -- (augmented) \cite{Crocker:1982:StFoAR, CrockerOver:2008:AuBNSy} with the following change: \verb!"|"! is used for alternatives in place of \verb!"/"!. % A sintaxe da parte relativa ao prefixo incorpora as regras próprias à formação de ``nome de domínio'' (\textsl{domain name}) como definidas na Seção 3.1 intitulada \textsl{Name space specifications and terminology} por \citeonline{Mockapetris:1987:CoFa}, e de ``nome de domínio de um computador'' (\textsl{hostname}) como definidas na Seção 3.2.2 intitulada \textsl{Server-based Naming Authority} por \citeonline{BernersFielIrviMasi:1998:UnReId}. The syntax of the part relating to the prefix incorporates the rules relative to the formation of ``domain name'' as defined in Section 3.1 entitled ``Name space specifications and terminology'' by \citeonline {Mockapetris:1987:CoFa}, and ``hostname'' as defined in Section 3.2.2 entitled ``Server-based Naming Authority'' by \citeonline{BernersFielIrviMasi:1998:UnReId}. % A Tabela \ref{table:regraspararepositoriouniforme} contém as regras para a formação do \textbf{nome do repositório uniforme de um item}. Table \ref{table:regraspararepositoriouniforme} contains the rules for the formation of the \textbf{name of the uniform repository of an item}. %\clearpage \begin{table}[h] \renewcommand{\baselinestretch}{0.9} \small \caption{Rule defining the formation of the \textbf{name of the uniform repository of an item}} \label{table:regraspararepositoriouniforme} \begin{tabular}{rcl} \verb!repository! & \verb!=! & \verb!prefix "/" suffix! \\ & & \verb! ; ex: sid.inpe.br/mtc-m19/2010/08.25.12.38! \\ \verb!prefix! & \verb!=! & \verb!subdomain "/" word [("." | "@") port]! \\ & & \verb! ; ex: sid.inpe.br/mtc-m19! \\ \verb!subdomain! & \verb!=! & \verb!*(word ".") last-word ["."]; ex: dpi.inpe.br! \\ \verb!word! & \verb!=! & \verb!ALPHANUM | (ALPHANUM *(ALPHANUM | "-") ALPHANUM); ex: sid! \\ \verb!ALPHANUM! & \verb!=! & \verb!ALPHA | DIGIT! \\ \verb!ALPHA! & \verb!=! & \verb!LOWALPHA | UPALPHA! \\ \verb!LOWALPHA! & \verb!=! & \verb!"a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |! \\ & & \verb!"j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |! \\ & & \verb!"s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"! \\ \verb!UPALPHA! & \verb!=! & \verb!"A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |! \\ & & \verb!"J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |! \\ & & \verb!"S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"! \\ \verb!DIGIT! & \verb!=! & \verb!"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" |! \\ & & \verb!"9"! \\ \verb!last-word! & \verb!=! & \verb!ALPHA | (ALPHA *(ALPHANUM | "-") ALPHANUM); ex: br! \\ \verb!port! & \verb!=! & \verb!1*DIGIT; ex: 80! \\ \verb!suffix! & \verb!=! & \verb!year "/" month "." day "." hour "." minute ["." second]! \\ & & \verb! ; ex: 2010/08.25.12.38! \\ \verb!year! & \verb!=! & \verb!4*DIGIT; ex: 2010! \\ \verb!month! & \verb!=! & \verb!2DIGIT; ex: 08! \\ \verb!dia! & \verb!=! & \verb!2DIGIT; ex: 25! \\ \verb!hour! & \verb!=! & \verb!2DIGIT; ex: 12! \\ \verb!minute! & \verb!=! & \verb!2DIGIT; ex: 38! \\ %\verb!second! & \verb!=! & \verb!2DIGIT! \\ \verb!second! & \verb!=! & \verb!integer ["." fraction]! \\ \verb!integer! & \verb!=! & \verb!2DIGIT! \\ \verb!fraction! & \verb!=! & \verb!1*DIGIT! \\ \end{tabular} \renewcommand{\baselinestretch}{1} \normalsize \end{table} % Ao acrescentar a \texttt{porta} à \texttt{palavra} no \texttt{prefixo}, o separador pode ser o símbolo \verb!"."! ou o símbolo \verb!"@"!. Recomenda-se usar apenas o símbolo \verb!"."!. O uso do símbolo \verb!"@"! era necessário em implementações do \textbf{IBI} anteriores a agosto de 2010. O inconveniente desse símbolo é que ele induza certos aplicativos a interpretar o \textbf{identificador de um item} como um endereço de \textsl{e-mail}. By adding the \texttt{port} to the \texttt{word} in the \texttt{prefix}, the separator can be symbols \verb!"."! or \verb!"@"!. It is recommended to use just the symbol \verb!"."!. The use of symbol \verb!"@"! was necessary for the deployments of the \textbf{IBI} prior to August 2010. The drawback of this symbol is that it induces certain applications to interpret the \textbf{identifier of an item} as an e-mail address. % A regra \verb!subdomínio! é denotada \verb!hostname! em \citeonline{BernersFielIrviMasi:1998:UnReId}. The rule \verb!subdomain! is denoted \verb!hostname! in \citeonline{BernersFielIrviMasi:1998:UnReId}. % O nome de domínio de um computador sendo insensível a maiúscula e minúscula, esta propriedade se estende ao \textbf{nome do repositório uniforme de um item}. Assim, \texttt{sid.inpe.br/mtc-m18@80/2009/02.16.17.46} e \texttt{sid.INPE.br/MTC-m18@80/2009/02.16.17.46} são equivalentes. Na prática, recomenda-se utilizar apenas lettras minúsculas na geração do prefixo. The domain name of a computer being insensitive to upper and lower case, this property extends to the \textbf{name of the uniform repository of an item}. Thus, \texttt{sid.inpe.br/mtc-m18@80/2009/02.16.17.46} and \texttt{sid.INPE.br/MTC-m18@80/2009/02.16.17.46} are equivalent. In practice, it is recommended to use only lower case in the prefix generation. % Além das regras sintáticas da Tabela \ref{table:regraspararepositoriouniforme}, o \textbf{nome do repositório uniforme de um item} deve verificar as regras semânticas definidas por meio dos Algoritmos \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} e \ref{algorithm:montarnomederepositoriodeumitem}. Por sua vez, por construção, o Algoritmo \ref{algorithm:montarnomederepositoriodeumitem} gera um \textbf{rótulo} que verifica as regras sintáticas da Tabela \ref{table:regraspararepositoriouniforme}. In addition to the syntactic rules of Table \ref{table:regraspararepositoriouniforme}, the \textbf{name of the uniform repository of an item} must satisfy the semantic rules defined by Algorithms \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} and \ref{algorithm:montarnomederepositoriodeumitem}. In turn, by construction, Algorithm \ref{algorithm:montarnomederepositoriodeumitem} generates a \textbf{label} that satisfies the syntactic rules of Table \ref{table:regraspararepositoriouniforme}. % O Algoritmo \ref{algorithm:montarprefixodonomederepositoriodeumitem} é a descrição do \textbf{gerador de rótulo} denotado $a$ na Figura~\ref{fig:sistemaidentificacao} e utilizado pelo \textbf{sistema de identificação} $f$ para a identificação dos \textbf{subsistemas de identificação}. Algorithm \ref{algorithm:montarprefixodonomederepositoriodeumitem} is the description of the \textbf{label generator} denoted $a$ in Figura~\ref{fig:sistemaidentificacao} and used by the \textbf{identification system} $f$ for the identification of the \textbf{identification subsystems}. % O Algoritmo \ref{algorithm:montarsufixodonomederepositoriodeumitem} é a descrição do \textbf{gerador de rótulo} denotado $b$ na Figura~\ref{fig:sistemaidentificacao} e utilizado por qualquer \textbf{subsistema de identificação}. Algorithm \ref{algorithm:montarsufixodonomederepositoriodeumitem} is the description of the \textbf{label generator} denoted $b$ in Figura~\ref{fig:sistemaidentificacao} and used by any \textbf{identification subsystem}. % O Algoritmo \ref{algorithm:montarnomederepositoriodeumitem} é a descrição do \textbf{gerador de rótulo} denotado $c$ na Figura~\ref{fig:sistemaidentificacao} e utilizado pelo \textbf{sistema de identificação em dois níveis} $s$. Algorithm \ref{algorithm:montarnomederepositoriodeumitem} is the description of the \textbf{label generator} denoted $c$ in Figura~\ref{fig:sistemaidentificacao} and used by the \textbf{identification system on two levels} $s$. % O \textbf{sistema de identificação em dois níveis} funciona de forma distribuída, um servidor para cada \textbf{subsistema de identificação}. Os servidores estão hospedados em computadores possuindo nomes de domínio, e o acesso aos servidores sendo feito via portas. The \textbf{identification system on two levels} works in a distributed manner, a server for each \textbf{identification subsystem}. The servers are hosted on computers having domain names, and the access to the servers being done via ports. % Ao receber uma solicitação de identificação de um \textbf{item} $i$, o servidor responsável pelo \textbf{subsistema de identificação} $g(i)$ executa os Algoritmos \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} e \ref{algorithm:montarnomederepositoriodeumitem} e retorna o \textbf{identificador do item}. Upon receiving a request for identification of an \textbf{item} $i$, the server responsible for the \textbf{identification subsystem} $g(i)$ executes Algorithms \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} and \ref{algorithm:montarnomederepositoriodeumitem} and returns the \textbf{identifier of the item}. \clearpage \begin{nicealgo}{algorithm:montarprefixodonomederepositoriodeumitem} % \naTITLE{\textsc{MontarPrefixoDoNomeDeRepositórioDeUmItem}.} \naTITLE{\textsc{MountPrefixOfNameOfRepositoryOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{computer}} \textnormal{(}string representing the domain name (in lower case) of the computer (possibly virtual) hosting the server responsible for the identification subsystem{)},} \naCONTINUE{\textnormal{\texttt{port}} \textnormal{(}decimal integer representing the port number to access the server responsible for the identification subsystem\textnormal{)}.} \naOUTPUT{\textnormal{\texttt{prefix}} \textnormal{(}string\textnormal{)}.} \naAUX{\textnormal{\texttt{part}} \textnormal{(}integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{aux}} \textnormal{(}string\textnormal{)},} \naCONTINUE{\textnormal{\texttt{subdomain}} \textnormal{(}string\textnormal{)},} \naCONTINUE{\textnormal{\texttt{first-word}} \textnormal{(}string\textnormal{)},} \naCONTINUE{\textnormal{\texttt{word-port}} \textnormal{(}string\textnormal{)},} \naCONTINUE{\textnormal{\texttt{c}} \textnormal{(}character\textnormal{)}.} \naBODY \na{$\texttt{aux} \mget \texttt{computer}$} \na{$\texttt{part} \mget 2$} \naBEGIN{\naWHILE $\texttt{aux} \neq \texttt{\textquotedbl\textquotedbl}$, \naDO} \na{$\texttt{c} \mget \textsc{LeaveQueue}(\texttt{aux})$} \naBEGIN{\naIF $\texttt{c} = \texttt{\textquotedbl.\textquotedbl}$ \naTHEN} \naENDN{1}{$\texttt{parte} \mget 1$} \naBEGIN{\naELSE} \naBEGIN{\naIF $\texttt{parte} = 1$ \naTHEN} \naENDN{1}{$\textsc{EnterQueue}(\texttt{subdomain}, \texttt{c})$} \naBEGIN{\naELSE} \naENDN{3}{$\textsc{EnterQueue}(\texttt{first-word}, \texttt{c})$} \naBEGIN{\naIF $\texttt{port} = 80$ \naTHEN} \naENDN{1}{$\texttt{word-port} \mget \texttt{first-word}$} \naBEGIN{\naELSE} \naENDN{1}{$\texttt{word-port} \mget \textsc{Concatenate}(\texttt{first-word}, \texttt{\textquotedbl.\textquotedbl}, \texttt{port})$} \na{$\texttt{prefix} \mget \textsc{Concatenate}(\texttt{subdomain}, \texttt{\textquotedbl/\textquotedbl}, \texttt{word-port})$} \end{nicealgo} \clearpage \begin{nicealgo}{algorithm:montarsufixodonomederepositoriodeumitem} % \naTITLE{\textsc{MontarSufixoDoNomeDeRepositórioDeUmItem}.} \naTITLE{\textsc{MountSuffixOfNameOfRepositoryOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{date}} \textnormal{(}decimal rational obtained from output of Algorithm~\ref{algorithm:criardataparamontarsufixodoibideumitem}: \textsc{CreateDateToMountSuffixOfIBIOfAnItem}\textnormal{)},} \naOUTPUT{\textnormal{\texttt{suffix}} \textnormal{(}string\textnormal{)}.} \naAUX{\textnormal{\texttt{year}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{month}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{day}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{hour}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{minute}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{second}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{fraction-of-a-second}} \textnormal{(}decimal integer\textnormal{)}.} \naBODY \na{$\texttt{year} \mget \textsc{Extract}(\texttt{date}, \mathrm{year})$} \na{$\texttt{month} \mget \textsc{Extract}(\texttt{date}, \text{month})$} \na{$\texttt{day} \mget \textsc{Extract}(\texttt{date}, \mathrm{day})$} \na{$\texttt{hour} \mget \textsc{Extract}(\texttt{date}, \mathrm{hour})$} \na{$\texttt{minute} \mget \textsc{Extract}(\texttt{date}, \mathrm{minute})$} \na{$\texttt{second} \mget \textsc{Extract}(\texttt{date}, \mathrm{second})$} \na{$\texttt{fraction-of-a-second} \mget \textsc{Extract}(\texttt{date}, \text{fraction-of-a-second})$} \na{$\texttt{suffix} \mget \textsc{Concatenate}(\texttt{year}, \texttt{\textquotedbl/\textquotedbl}, \texttt{month}, \texttt{\textquotedbl.\textquotedbl}, \texttt{day}, \texttt{\textquotedbl.\textquotedbl}, \texttt{hour}, \texttt{\textquotedbl.\textquotedbl}, \texttt{minute})$} \naBEGIN{\naIF $\texttt{fraction-of-a-second} = \texttt{\textquotedbl0\textquotedbl}$ \naTHEN} \naBEGIN{\naIF $\texttt{second} \neq \texttt{\textquotedbl00\textquotedbl}$ \naTHEN} \naENDN{2}{$\texttt{suffix} \mget \textsc{Concatenate}(\texttt{suffix}, \texttt{\textquotedbl.\textquotedbl}, \texttt{second})$} \na{\naELSE $\texttt{suffix} \mget \textsc{Concatenate}(\texttt{suffix}, \texttt{\textquotedbl.\textquotedbl}, \texttt{second}, \texttt{\textquotedbl.\textquotedbl}, \texttt{fraction-of-a-second})$} \end{nicealgo} \clearpage \begin{nicealgo}{algorithm:montarnomederepositoriodeumitem} % \naTITLE{\textsc{MontarNomeDeRepositórioDeUmItem}.} \naTITLE{\textsc{MountNameOfRepositoryOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{prefix}} \textnormal{(}string obtained from output of Algorithm 1: \textsc{MountPrefixOfNameOfRepositoryOfAnItem}\textnormal{)},} \naCONTINUE{\textnormal{\texttt{suffix}} \textnormal{(}string obtained from output of Algorithm 2: \textsc{MountSuffixOfNameOfRepositoryOfAnItem}\textnormal{)}.} \naOUTPUT{\textnormal{\texttt{repositório}} \textnormal{(}string\textnormal{)}.} \naBODY \na{$\texttt{repositório} \mget \textsc{Concatenate}(\texttt{prefix}, \texttt{\textquotedbl/\textquotedbl}, \texttt{suffix})$} \end{nicealgo} % Os algoritmos apresentados acima usam as segintes rotinas. The algorithms presented above use the following routines. % A rotina \textsc{Concatenar} concatena as cadeias de caracteres informadas no seus argumentos. Routine \textsc{Concatenate} concatenate the strings informed in its arguments. % A rotina \textsc{EntrarFila} concatena a direita da cadeia de caracteres informada no primeiro argumento, mais o caractere informado no segundo argumento. Routine \textsc{EnterQueue} add on the right side of the string informed in the first argument, one more character, the one informed in the second argument. % A rotina \textsc{SairFila} retira o primeiro caractere da cadeia de caracteres informada no seu argumento, e retorna esse caractere. Routine \textsc{LeaveQueue} takes the first character of the string informed its argument, and returns this character. % A rotina \textsc{Extrair} retorna, no formato compatível com as regras da Tabela \ref{table:regraspararepositoriouniforme}, o número decimal referente a unidade informada no segundo argumento, quando a data em segundo ou fração de segundo, informada no primeiro argumento, é convertida para o Tempo Universal Coordenado (em inglês: \textsl{Coordinated Universal Time} (UTC)). Routine \textsc{Extract} returns, in the format compatible with the rules of Table \ref{table:regraspararepositoriouniforme}, the decimal number of the unit informed in the second argument, when the date in second or fraction of a second, informed in the first argument, is converted to Coordinated Universal Time (UTC). % Utiliza-se o padrão UTC de forma a permitir a continuação do funcionamento do \textbf{sistema de identificação em dois níveis} mesmo em caso de entrada/saída do horário de verão ou de troca de computadores situados em longitudes distintas, e referentes a um mesmo \textbf{subsistema de identificação}. The time standard UTC is used in order to allow the continued operation of \textbf{identification system on two levels} even in case of entering/leaving Daylight saving time or exchanging of computers at different longitudes, and running a same \textbf{identification subsystem}. % O Algoritmo \ref{algorithm:montarprefixodonomederepositoriodeumitem} separa a primeira palavra do nome de domínio\footnote{Um nome de domínio é constituido de palavras separadas por pontos.} do computador (eventualmente virtual) do subdomínio sem esta palavra, dividindo assim o prefixo em duas partes, a primeira parte contendo o subdomínio, e a segunda, a primeira palavra. Algorithm \ref{algorithm:montarprefixodonomederepositoriodeumitem} separates the first word of the domain name \footnote{A domain name consists of words separated by dots.} of the computer (possibly virtual) from the subdomain without this word, thus dividing the prefix into two parts, the first part containing the subdomain, and the second, the first word. % Pelo Algoritmo \ref{algorithm:montarprefixodonomederepositoriodeumitem}, verifica-se, que quando o número de porta é 80, este é omitido na segunda parte do prefixo. Como a porta 80 é a porta geralmente utilizada pelos servidores HTTP que rodam os scripts CGI que implementam os Algoritmos \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} e \ref{algorithm:montarnomederepositoriodeumitem}, o prefixo dos \textbf{nomes de repositório uniforme de um item} fica assim geralmente mais curto. According to Algorithm \ref{algorithm:montarprefixodonomederepositoriodeumitem}, when the port number is 80, it is omitted in the second part of the prefix. As port 80 is the port usually used by HTTP servers running the CGI scripts that implement the algorithms \ref{algorithm:montarprefixodonomederepositoriodeumitem}, \ref{algorithm:montarsufixodonomederepositoriodeumitem} and \ref{algorithm:montarnomederepositoriodeumitem}, the prefix of the \textbf{names of the uniform repository of an item} is, in this way, usually shorter. % O Algoritmo \ref{algorithm:montarsufixodonomederepositoriodeumitem} gera um \textbf{rótulo} (sufixo) com base no valor da \texttt{data} fornecido pelo \textbf{distribuidor temporal} (ver saída \texttt{data-para-sufixo} do Algoritmo \ref{algorithm:criardataparamontarsufixodoibideumitem}). Algorithm \ref{algorithm:montarsufixodonomederepositoriodeumitem} generates a \textbf{label} (suffix) based on the value of the \texttt{date} provided by the \textbf{temporal distributor} (see output \texttt{date-for-suffix} of Algorithm \ref{algorithm:criardataparamontarsufixodoibideumitem}). % No caso de necessitar de uma resposta mais rápida do \textbf{subsistema de identificação}, basta escolher uma granularidade $r$ menor. No entanto, a possibilidade de atender as solicitações de identificação por meio de um grande número de \textbf{subsistemas de identificação} (lembrando que a granularidade do prefixo é extremamente fina) constitui uma outra solução para minimizar o problema de uma alta frequência de solicitações. In case a faster response from the \textbf{identification subsystem} is needed, a smaller granularity $r$ can be chosen. However, the possibility to meet identification requests by using a large number of \textbf{identificaton subsystems} (remembering that the prefix granularity is extremely thin) is another solution to mitigate the problem of a high frequency of requests. % O Algoritmo \ref{algorithm:montarnomederepositoriodeumitem} concatena o prefixo e o sufixo e interpõe entre estes o símbolo \verb!"/"!. A presença, nesta posição, de um símbolo que não pertence aos alfabetos usados na geração do prefixo e do sufixo, torna a concatenação reversível, pois com sua presença é possível reconhecer, sem ambiguidade, o prefixo do sufixo após a concatenação. Algorithm \ref{algorithm:montarnomederepositoriodeumitem} concatenates the prefix and suffix and interposed between them the symbol \verb!"/"!. The presence, in this position, of a symbol that does not belong to the alphabets used in generating the prefix and suffix, makes the concatenation reversible because, with its presence, it is possible to recognize unambiguously, the suffix and prefix after the concatenation. % Para o correto funcionamento, as entradas do Algoritmo \ref{algorithm:montarprefixodonomederepositoriodeumitem} devem ser: o nome de domínio do computador (\textsl{hostname}) ou do computador virtual (\textsl{virtual host}) que hospeda o servidor responsável pelo \textbf{subsistema de identificação}, e a porta que dá acesso a esse servidor. For the correct operation, the inputs of Algorithm \ref{algorithm:montarprefixodonomederepositoriodeumitem} should be: the domain name (hostname) of the computer or virtual computer (virtual host) that hosts the server responsible for \textbf{identification subsystem}, and the port which gives access to that server. % O par formado pelo nome de domínio (em minúsculo) do computador e a porta de acesso referentes ao \textbf{subsistema de identificação} $g(i)$ é interpretado, na Figura~\ref{fig:sistemaidentificacao} como a saída, em $C^2$, do chamado \textbf{instalador} $e$, recebendo como entrada, em $S$, o \textbf{subsistema de identificação} $g(i)$. The pair formed by the domain name (in lower case) of the computer and the access port for the \textbf{identification subsystem} $g(i)$ is interpreted in Figure~\ref{fig:sistemaidentificacao} as the output, in $C^2$, of the so-called \textbf{installer} $e$, receiving as input, in $S$, the \textbf{identification subsystem} $g(i)$. % O nome de domínio do computador (\textsl{hostname}) pode ser obtido, por exemplo, por meio do comando \texttt{nslookup}. The computer's domain name (hostname) can be obtained, for example, through the \texttt{nslookup} command. % Quanto ao Algoritmo \ref{algorithm:montarsufixodonomederepositoriodeumitem}, a entrada deve ser a data $t(i)$, interpretada, na Figura~\ref{fig:sistemaidentificacao} como a saída, em $T_r$, de um \textbf{distribuidor temporal}, recebendo como entrada, em $g^*(g(i))$, o próprio \textbf{item} $i$. As regards Algorithm \ref{algorithm:montarsufixodonomederepositoriodeumitem}, the input should be the date $t(i)$, interpreted in Figura~\ref{fig:sistemaidentificacao} as the output, in $T_r$, of a \textbf{temporal distributor}, receiving as input, in $g^*(g(i))$, the \textbf{item} $i$ itself. % Para todo $i \in I$, o papel do \textbf{distribuidor temporal} utilizado pelo \textbf{subsistema de identificação} $g(i)$ é distribuir numa grade $T_r$, com granularidade de $r$ segundos, as solicitações de identificações referentes aos \textbf{itens} do conjunto $g^*(g(i))$. For any $i \in I$, the role of the \textbf{temporal distributor} used by the \textbf{identification subsystem} $g(i)$ is to distribute within the grid $T_r$, with granularity of $r$ seconds, the identification requests related to the \textbf{items} of the set $g^*(g(i))$. % O \textbf{distribuidor temporal} é descrito detalhadamente a seguir, onde $I'$ representa o domínio $g^*(g(i))$ de um determinado \textbf{subsistema de identificação} $g(i)$. The \textbf{temporal distributor} is described in detail below, where $I'$ represents the domain $g^*(g(i))$ of a given \textbf{identification subsystem} $g(i)$. \begin{description} % \item[] Seja $I'$ um conjunto de \textbf{itens}. \item[] Let $I'$ be a set of \textbf{items}. % \item[] Seja $\mathbb{Q}^+$ o conjunto dos racionais positivos. \item[] Let $\mathbb{Q}^+$ be the set of positive rational numbers. % \item[] Seja $\mathbb{R}^+$ o conjunto dos reais positivos. \item[] Let $\mathbb{R}^+$ be the set of positive real numbers. % \item[] Seja $G \triangleq \{60, 1, 1/10, 1/100, ...\}$ o subconjunto de racionais, definindo as possíveis granularidades temporais: minuto, segundo e frações de segundo. \item[] Let $G \triangleq \{60, 1, 1/10, 1/100, ...\}$ be the subset of rational numbers, defining the possible temporal granularities: minute, seconds and fractions of a second. % \item[] Seja $t_i \in \mathbb{R}^+$ a data, expressa em fração de segundo\footnote{Mais precisamente em \textsl{Unix time} ou \textsl{POSIX time}.}, da solicitação de identificação do \textbf{item} $i \in I'$ (supõe-se que $i \mapsto t_i$ é injetora). \item[] Let $t_i \in \mathbb{R}^+$ be the date, expressed in fraction of a second\footnote{More precisely in Unix or POSIX time.}, of the request of the identification of the \textbf{item} $i \in I'$ (it is assumed that $i \mapsto t_i$ is injective). % \item[] Seja $[i] \in \{1, 2, ..., |I'|\}$ o valor indicando que o \textbf{item} $i \in I'$ foi o $[i]^\text{ésimo}$ \textbf{item} a solicitar uma identificação, i.e., $[i]$ é dado por: \item[] Let $[i] \in \{1, 2, ..., |I'|\}$ be the value indicating that the \textbf{item} $i \in I'$ was the $[i]^\text{th}$ \textbf{item} to request an identification, i.e., $[i]$ is given by: % \begin{equation*} % [i] \triangleq \sum\limits_{j \in I'} \left\{ \hspace{-1mm}\begin{array}{l} % 1 \quad\text{se}\quad t_j \le t_i,\\ % 0 \quad\text{caso contrário}, % \end{array} % \right. % \qquad \text{para todo $i \in I'$.} % \end{equation*} \begin{equation*} [i] \triangleq \sum\limits_{j \in I'} \left\{ \hspace{-1mm}\begin{array}{l} 1 \quad\text{if}\quad t_j \le t_i,\\ 0 \quad\text{otherwise}, \end{array} \right. \qquad \text{for any $i \in I'$.} \end{equation*} % \item[] Seja $]k[ \in I'$ o valor indicando que o $k^\text{ésimo}$ \textbf{item} a solicitar uma identificação é o \textbf{item} $]k[$, i.e., $]k[$ é dado por: \item[] Let $]k[ \in I'$ be the value indicating that the $k^\text{th}$ \textbf{item} to request an identification is the \textbf{item} $]k[$, i.e., $]k[$ is given by: % \begin{equation*} % ]k[ \: \triangleq i \; \Leftrightarrow \; k = [i], \qquad \text{para todo $k \in \{1, 2, ..., |I'|\}$ e $i \in I'$.} % \end{equation*} \begin{equation*} ]k[ \: \triangleq i \; \Leftrightarrow \; k = [i], \qquad \text{for any $k \in \{1, 2, ..., |I'|\}$ and $i \in I'$.} \end{equation*} % \item[] Seja $t^{(r)} \in \mathbb{Q}^+$ a data $t$ arredondada em $r$ segundos, i.e, $t^{(r)}$ é dado por: \item[] Let $t^{(r)} \in \mathbb{Q}^+$ be the date $t$ rounded in $r$ seconds, i.e, $t^{(r)}$ is given by: % \begin{equation*} % t^{(r)} \triangleq r\mathrm{int}(t/r), \qquad \text{para todo $t \in \mathbb{R}^+$ e $r \in G$.} % \end{equation*} \begin{equation*} t^{(r)} \triangleq r\mathrm{int}(t/r), \qquad \text{for any $t \in \mathbb{R}^+$ and $r \in G$.} \end{equation*} % \item[] Seja $T_r = \{t^{(r)} : t \in \mathbb{R}^+\}$ o conjunto das datas arredondadas em $r$ segundos, sendo $r \in G$. \item[] Let $T_r = \{t^{(r)} : t \in \mathbb{R}^+\}$ be the set of dates rounded in $r$ seconds, being $r \in G$. % \item[] Seja $t'_i \in T_r$, com $r \in G$ e $i \in I'$, a data, arredondada em $r$ segundos, dada por: \item[] Let $t'_i \in T_r$, with $r \in G$ and $i \in I'$, the date, rounded in $r$ seconds, given by: % \[ % t'_i \triangleq \left\{ \hspace{-1mm} % \begin{array}{l l} % {t_i}^{(r)} & \quad \text{se $[i] = 1$},\\ % \max(t(][i] - 1[) + r, {t_i}^{(r)}) & \quad \text{se $[i] = 2, ..., |I'|$.}\\ % \end{array} \right. % \] \[ t'_i \triangleq \left\{ \hspace{-1mm} \begin{array}{l l} {t_i}^{(r)} & \quad \text{if $[i] = 1$},\\ \max(t(][i] - 1[) + r, {t_i}^{(r)}) & \quad \text{if $[i] = 2, ..., |I'|$.}\\ \end{array} \right. \] % Na expressão acima, $t(][i] - 1[)$ é a data fornecida pelo \textbf{distribuidor temporal} referente ao \textbf{item} $][i] - 1[$ imediatamente anterior ao \textbf{item} $i$, considerando as datas de solicitação de identificação. A data $t'_i$ será considerada a data na qual o \textbf{distribuidor temporal} fornece sua resposta $t(i)$ usada na geração do \textbf{rótulo} utilizado na identificação do \textbf{item} $i$. Em outros termos, $t'_i$ será considerada a data de geração do \textbf{rótulo} do \textbf{item} $i$, enquanto $t(i)$ é a data utilizada pelo \textbf{gerador de rótulo} $b$ para montar o sufixo do identificador de $i$. In the above expression, $t(][i] - 1[)$ is the date provided by the \textbf{temporal distributor} referring to the \textbf{item} $][i] - 1[$ immediately preceding the \textbf{item} $i$, considering the identification request dates. The date $t'_i$ will be considered the date on which the \textbf{temporal distributor} provides its answer $t(i)$ used in the generation of the \textbf{label} used to identify the \textbf{item} $i$. In other words, $t'_i$ will be considered the date of generation of the \textbf{label} of the \textbf{item} $i$, while $t(i)$ is the date used by the \textbf{label generator} $b$ to mount the suffix of the identifier of $i$. % \item[] Seja $t'(i) \in {T_r}^2$, com $r \in G$ e $i \in I'$, o par de datas, arredondadas em $r$ segundos, dado por: \item[] Let $t'(i) \in {T_r}^2$, with $r \in G$ and $i \in I'$, be the pair of dates, rounded in $r$ seconds, given by: % \[ % t'(i) \triangleq \left\{ \hspace{-1mm} % \begin{array}{l l} % (t'_i, t'_i - r) & \quad \text{se $[i] = 1$},\\ % (t'_i, t(][i] - 1[)) & \quad \text{se $[i] = 2, ..., |I'|$.}\\ % \end{array} \right. % \] \[ t'(i) \triangleq \left\{ \hspace{-1mm} \begin{array}{l l} (t'_i, t'_i - r) & \quad \text{if $[i] = 1$},\\ (t'_i, t(][i] - 1[)) & \quad \text{if $[i] = 2, ..., |I'|$.}\\ \end{array} \right. \] % O mapeamento $i \mapsto t'(i)$ define uma função $t'$ de $I'$ em ${T_r}^2$. The mapping $i \mapsto t'(i)$ defines a function $t'$ from $I'$ to ${T_r}^2$. % \item[] Seja $r_{(t, s)} \in G$, com $t > s$, a maior granularidade $r$ tal que a data $t$ arredondada em $r$ segundos, seja maior do que a data $s$, i.e., $r_{(t,s)}$ é dado por: \item[] Let $r_{(t, s)} \in G$, with $t > s$, be the greater granularity $r$ such that the date $t$ rounded in $r$ seconds, is greater than the date $s$, i.e., $r_{(t,s)}$ is given by: % \begin{equation*} % r_{(t, s)} \: \triangleq \max(\{r \in G : t^{(r)} > s\}), \qquad \text{para todo $t$ e $s \in \mathbb{R}^+$ tal que $t > s$.} % \end{equation*} \begin{equation*} r_{(t, s)} \: \triangleq \max(\{r \in G : t^{(r)} > s\}), \qquad \text{for any $t$ and $s \in \mathbb{R}^+$ such that $t > s$.} \end{equation*} % Nota-se que $r_{(t, t - r)} = r$ para todo $t \in \mathbb{R}^+$ e $r \in G$. Note that $r_{(t, t - r)} = r$ for any $t \in \mathbb{R}^+$ and $r \in G$. % \item[] Seja $t(i) \in T_{r_{t(i)}} \subset T_r$, com $r \in G$, a data $t'_i$ arredondada em $r_{t'(i)}$ segundos: \item[] Let $t(i) \in T_{r_{t(i)}} \subset T_r$, with $r \in G$, be the date $t'_i$ rounded in $r_{t'(i)}$ seconds: % \begin{equation*} % t(i) \triangleq {t'_i}^{(r_{t'(i)})}, \qquad \text{para todo $i \in I'$.} % \end{equation*} \begin{equation*} t(i) \triangleq {t'_i}^{(r_{t'(i)})}, \qquad \text{for any $i \in I'$.} \end{equation*} % Nota-se que, para todo $r \in G$, $t(]1[) = {t'_{]1[}}^{(r)}$, e que $r_{t(i)} \leq r$, $T_{r_{t(i)}} \subset T_r$ e $t(][i] - 1[) < t(i) \leq t'_i$, para todo $i \in I'$ tal que $[i] > 1$. Note that, for any $r \in G$, $t(]1[) = {t'_{]1[}}^{(r)}$, and that $r_{t(i)} \leq r$, $T_{r_{t(i)}} \subset T_r$ and $t(][i] - 1[) < t(i) \leq t'_i$, for any $i \in I'$ tal que $[i] > 1$. \end{description} % Um \textbf{distribuidor temporal}, com granularidade $r \in G$, é a função $t: I' \rightarrow T_r$ tal que $i \mapsto t(i)$. A \textbf{temporal distributor}, with granularity $r \in G$, is the function $t: I' \rightarrow T_r$ such that $i \mapsto t(i)$. % A Tabela~\ref{table:exemplodisttribuidortemporal} contém os dados de um exemplo de funcionamento de um \textbf{distribuidor temporal} com granularidade de um segundo ($r = 1$). Table~\ref{table:exemplodisttribuidortemporal} contains the data of a working example of a \textbf{temporal distributor} with granularity of one second ($r = 1$). \begin{table}[H] \renewcommand{\baselinestretch}{1.3} % \footnotesize \scriptsize \centering % \caption{Exemplificação do funcionamento de um \textbf{distribuidor temporal} com granularidade de um segundo.} \caption{Exemplification of running a \textbf{temporal distributor} with granularity of one second} \label{table:exemplodisttribuidortemporal} \begin{tabular}{cr@{,}lclrcl} \footnotesize $i$ & \multicolumn{2}{c}{\footnotesize $t_i$ (seconds)} & \footnotesize $[i]$ & \multicolumn{1}{c}{\footnotesize $t'(i)$} & \footnotesize $r_{t'(i)}$ & \footnotesize $t(i)$ & \multicolumn{1}{c}{\footnotesize suffix}\\ \hline \texttt{d} & 1287587646&394023 & 1 & (1287587646, 1287587645) & 1 & 1287587646 & 2010/10.20.15.14.06 \\ \texttt{b} & 1287588012&2930 & 2 & (1287588012, 1287587646) & 60 & 1287588000 & 2010/10.20.15.20 \\ \texttt{a} & 1287588115&186234 & 3 & (1287588115, 1287588000) & 60 & 1287588060 & 2010/10.20.15.21 \\ \texttt{c} & 1287588115&3462 & 4 & (1287588115, 1287588060) & 1 & 1287588115 & 2010/10.20.15.21.55 \\ \texttt{g} & 1287588115&99623 & 5 & (1287588116, 1287588115) & 1 & 1287588116 & 2010/10.20.15.21.56 \\ \texttt{f} & 1287588116&72 & 6 & (1287588117, 1287588116) & 1 & 1287588117 & 2010/10.20.15.21.57 \\ \texttt{e} & 1287588539&788342 & 7 & (1287588539, 1287588117) & 60 & 1287588480 & 2010/10.20.15.28 \\ \hline \end{tabular} \end{table} % Na Tabela~\ref{table:exemplodisttribuidortemporal}, as linhas foram ordenadas por datas crescentes de solicitação de identificação (coluna $t_i$). Os valores de $[i]$ indicam a ordem das solicitações. Observa-se, por exemplo, que o \textbf{item} \texttt{g}, apesar de ter solicitado sua identificação numa data anterior à 1287588116 segundos, recebeu como data $t(i)$, a ser usada na geração do \textbf{rótulo}, o valor de 1287588116 segundos. Isto ocorreu porque os \textbf{itens} \texttt{a}, \texttt{c} e \texttt{g} fizeram, os três, a solicitação de identificação dentro do periodo de um segundo. Consequentemente, o \textbf{item} \texttt{g} terá que aguardar que os \textbf{itens} \texttt{a} e \texttt{c} recebam primeiro suas identificações para receber a sua. Esse ``atraso'' está se repercutindo para o próximo \textbf{item} \texttt{f} que fez sua solicitação de identificação apenas no segundo seguinte (1287588116) ao do \textbf{item} \texttt{g} (1287588115). In Table~\ref{table:exemplodisttribuidortemporal}, the lines were sorted by increasing dates of identification request (column $t_i$). The values of $[i]$ indicate the order of requests. It is observed, for example, that the \textbf{item} \texttt{g}, despite having requested his identification on a date prior to 1287588116 seconds, received as date $t(i)$, to be used in generating the \textbf{label}, the value 1287588116 seconds. This occurred because the \textbf{items} \texttt{a}, \texttt{c} e \texttt{g} did, the three, the identification request within one second period. Consequently, the \textbf{item} \texttt{g} will have to wait for the \textbf{items} \texttt{a} e \texttt{c} first receiving their identification in order to receive its. This ``delay'' is spreading to the next \textbf{item} \texttt{f} who made his identification request just the next second (1287588116) to that of \textbf{item} \texttt{g} (1287588115). % Na prática, o \textbf{distribuidor temporal} poderá ser implementado usando, por exemplo, os conceitos de sala de espera e de temporizador, de forma a associar a cada \textbf{item} $i$ uma data de solicitação de identificação $t_i$ (data do começo do atendimento após o aguardo na sala de espera) e transformar esta na data $t(i)$, numa grade temporal com granularidade $r$, para geração do \textbf{rótulo}. In practice, the \textbf{temporal distributor} may be implemented using, for example, the concepts of waiting room and timer, in order to associate to each \textbf{item} $i$ a date of identification request $t_i$ (date of the beginnning of the service after waiting in the waiting room) and to turn it the date $t(i)$ within a temporal grid of granularity $r$, for generating the \textbf{label}. % Nesse caso, os \textbf{itens} a serem identificados por um determinado \textbf{subsistema de identificação} entram numa sala de espera. Quando o servidor responsável pelo \textbf{subsistema de identificação} está pronto para identificar um novo \textbf{item}, um dos \textbf{itens} na sala de espera é sorteado. O instante do sorteio torna-se a data de solicitação de identificação do item sorteado. In this case, the \textbf{items} to be identified by a given \textbf{identification subsystem} enters a waiting room. When the server responsible for \textbf{identification subsystem} is ready to identify a new \textbf{item}, one of the \textbf{items} in the waiting room is drawn. The moment of the draw becomes the date of the drawn item identification request. % O Algoritmo \ref{algorithm:criardataparamontarsufixodoibideumitem} mostra como criar, na prática, a data $t(i)$ utilizada, pelo \textbf{gerador de rótulo} $b$, para montar o sufixo do identificador de um \textbf{item} $i \in I'$. Algorithm \ref{algorithm:criardataparamontarsufixodoibideumitem} shows how to create, in practice, the date $t(i)$ used, by the \textbf{label generator} $b$, to mount the suffix of the identifier of an \textbf{item} $i \in I'$. % Para criar a data $t(i)$, esse algoritmo tem que ser executado na data $t_i$ (data da solicitação de identificação), e receber essa data $t_i$ como entrada. To create the date $t(i)$, this algorithm has to be executed at the time $t_i$ (date of the request identification), and receive this date $t_i$ as input. % No Algoritmo \ref{algorithm:criardataparamontarsufixodoibideumitem} a entrada, denotada \texttt{data-corrente}, corresponde à data $t_i$, e a saída, denotada \texttt{data-para-sufixo}, corresponde à data $t(i)$. In Algorithm \ref{algorithm:criardataparamontarsufixodoibideumitem} the input, denoted \texttt{current-date}, is the date $t_i$, and the output, denoted \texttt{date-for-suffix}, is the date $t(i)$. \clearpage \begin{nicealgo}{algorithm:criardataparamontarsufixodoibideumitem} % \naTITLE{\textsc{CriarDataParaMontarSufixoDoIBIDeUmItem}.} \naTITLE{\textsc{CreateDateToMountSuffixOfIBIOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{current-date}} \textnormal{(}decimal rational representing the request date of an identification, i.e., the date of running the algorithm itself\textnormal{)}.} \naOUTPUT{\textnormal{\texttt{date-for-suffix}} \textnormal{(}decimal rational\textnormal{)}.} \naGLOBAL{\textnormal{\texttt{last-date-for-suffix}} \textnormal{(}decimal rational representing the date created for the suffix on the previous run the algorithm itself\textnormal{)},} \naCONTINUE{\textnormal{\texttt{r}} \textnormal{(}decimal rational representing the temporal granularity\textnormal{)}.} \naAUX{\textnormal{\texttt{rounded-date}} \textnormal{(}decimal rational\textnormal{)},} \naCONTINUE{\textnormal{\texttt{creation-date}} \textnormal{(}decimal rational\textnormal{)},} \naCONTINUE{\textnormal{\texttt{delay}} \textnormal{(}decimal rational\textnormal{)},} \naCONTINUE{\textnormal{\texttt{s}} \textnormal{(}decimal rational\textnormal{)},} \naCONTINUE{\textnormal{\texttt{t}} \textnormal{(}decimal rational\textnormal{)},} \naCONTINUE{\textnormal{\texttt{short-date}} \textnormal{(}decimal rational\textnormal{)}.} \naBODY \na{$\texttt{rounded-date} \mget \texttt{r} * \textsc{Int}(\texttt{current-date}/\texttt{r})$} \naBEGIN{\naIF $\texttt{last-date-for-suffix} \textnormal{ doesn't exist }$ \naTHEN} \naENDN{1}{$\texttt{last-date-for-suffix} \mget \texttt{rounded-date} - \texttt{r}$} \na{$\texttt{last-date-for-suffix} \mget \texttt{r} * \textsc{Int}(\texttt{last-date-for-suffix}/\texttt{r})$} \na{$\texttt{creation-date} \mget \textsc{Max}(\texttt{last-date-for-suffix} + \texttt{r}, \texttt{rounded-date})$} \na{$\texttt{delay} \mget \texttt{creation-date} - \texttt{current-date}$} \na{\naIF $\texttt{delay} > 0$ \naTHEN $\textsc{Wait}(\texttt{delay})$} \na{$\texttt{short-date} \mget \texttt{creation-date}$} \na{$\texttt{s} \mget \texttt{r}$} \naBEGIN{\naWHILE $\texttt{last-date-for-suffix} < \texttt{short-date}$ \naDO} \na{$\texttt{s} \mget 10 * \texttt{s}$} \na{\naIF $\texttt{s} = 10$ \naTHEN $\texttt{s} \mget 60$} \na{$\texttt{t} \mget \texttt{short-date}$} \na{\naIF $\texttt{s} > 60$ \naTHEN \naBREAK} \naENDN{1}{$\texttt{short-date} \mget \texttt{s} * \textsc{Int}(\texttt{creation-date}/\texttt{s})$} \na{$\texttt{date-for-suffix} \mget \texttt{t}$} \na{$\texttt{last-date-for-suffix} \mget \texttt{t}$} \end{nicealgo} % A variável global \texttt{última-data-para-sufixo} tem o papel de uma memória que preserva o último valor de \texttt{data-para-sufixo} a ser reaproveitado na criação do próximo sufixo. Caso a variável \texttt{última-data-para-sufixo} não exista (por exemplo, na primeira solicitação de identificação), seu valor será escolhido igual à data corrente arredondada em $r$ segundos (\texttt{data-arredondada}), menos a granularidade corrente $r$ (Linhas 2 e 3). The global variable \texttt{last-date-for-suffix} has the role of a memory that retains the last value of \texttt{date-for-suffix} to be reused in creating the next suffix. If the variable \texttt{last-date-for-suffix} does not exist (for example, on the first identification request), its value is chosen equal to the current date rounded in $r$ seconds (\texttt{rounded-date}) , minus the current granularity $r$ (Lines 2 and 3). % A variável global \texttt{r} define a granularidade temporal a ser usada na criação do sufixo. Seu valor pode ser $60$ (para a granularidade de um minuto), $1$ (para segundo) ou $0,1$ (para décimo de segundos), $0,01$(para centésimo de segundos), $0,001$ (para milésimo de segundos), ... The global variable \texttt{r} defines the temporal granularity to be used for the suffix creation. Its value may be $60$ (for the granularity of one minute), $1$ (for second) or $0.1$ (for tenths of seconds) $0.01$ (for hundredth of seconds), $0.001$ (for thousandth of seconds), ... % O valor de \texttt{r} pode ser alterado externamente ao algoritmo, de forma a atender novas condições de uso do \textbf{subsistema de identificação}. The value of \texttt{r} can be changed externally to the algorithm to meet the new conditions of use of the \textbf{identification subsystem}. % Na Linha 1, a \texttt{data-corrente} é arredondada em $r$ segundos por meio da rotina \textsc{Int} que retorna a parte inteira do valor racional do seu argumento. On Line 1, the \texttt{current-date} is rounded in $r$ seconds through the routine \textsc{Int} which returns the integer part of the rational value of its argument. % A Linha 4 serve para reformatar o valor da variável \texttt{última-data-para-sufixo}, caso tenha havido uma mudança no valor da granularidade $r$ entre duas criações sucessivas de sufixo. Line 4 is to reformat the value of the variable \texttt{last-data-for-suffix} where there has been a change in the amount of $r$ granularity between two successive suffix creations. % Na Linha 5, a \texttt{data-de-criação} é calculada por meio da rotina \textsc{Max} que retorna o maior do seus dois argumentos. Essa variável auxiliar corresponde à data $t'_i$. Para essa data ser a data de criação do sufixo, uma temporização é introduzida na Linha 7, por meio da rotina \textsc{Esperar} que espera pelo tempo especificado na variável \texttt{atraso}, toda vez que a \texttt{data-de-criação} calculada for maior que a \texttt{data-corrente}. In Line 5, the \texttt{creation-date} is calculated by the routine \textsc{Max} which returns the greater its two arguments. This auxiliary variable is the date $t'_i$. For that date to be the date of the suffix creation, a delay is introduced in Line 7, through the routine \textsc{Wait} waiting for the time specified in the variable \texttt{delay}, every time that the calculated \texttt{creation-date} is greater than the \texttt{current-date}. % As Linhas 8 a 16 servem para o cálculo da saída \texttt{data-para-sufixo} que pode ser uma data menor que a \texttt{data-de-criação} caso uma versão mais ``curta'' dessa data seja compatível com a \texttt{última-data-para-sufixo}. Lines 8 to 16 are used to compute the output \texttt{date-for-suffix} that may be a lesser date than the \texttt{creation-date} if a shorter version of that date is compatible with \texttt{last-data-for-suffix}. % \chapter{Regras de construção do rótulo com base no IP} \chapter{Label construction rules based on IP} % No \textbf{sistema de identificação em dois níveis} apresentado neste capítulo, o \textbf{identificador de um item} é opaco, construido com base no IP, e chamado \textbf{IBIp daquele item}. In the \textbf{identification system on two levels} presented in this chapter, the \textbf{identifier of an item} is opaque, built based on IP, and called \textbf{IBIp of that item}. % No \textbf{IBIp de um item}, o prefixo e o sufixo são também separados por \verb!"/"!. In the \textbf{IBIp of an item}, the prefix and suffix are also separated by \verb!"/"!. % Como anunciado, o prefixo é construido a partir da informação de um IP de computador e eventualmente de um número de porta. Quanto ao sufixo, este é construido a partir de uma informação de data e hora como no capítulo anterior. A opacidade é obtida codificando estas informações. As announced, the prefix is built based on the information of a computer IP and possibly a port number. Regarding the suffix, it is constructed from a date and time information as in the previous chapter. The opacity is obtained by encoding this information. % A concatenação do prefixo e do sufixo são reconhecível no Exemplo \ref{example:IP} do Capítulo \ref{chap:descricao}, onde o \textbf{IBIp do item} era: The concatenation of the prefix and suffix are recognizable in Example \ref{example:IP} of Chapter \ref{chap:descricao} where the \textbf{IBIp of the item} was: \begin{center}\texttt{8JMKD3MGP8W/34PGRBS}\end{center} % A Tabela \ref{table:regrasparaibip} contém as regras para a formação do \textbf{IBIp de um item}. Table \ref{table:regrasparaibip} contains the rules for the formation of the \textbf{IBIp of an item}. %\clearpage \begin{table}[h] \renewcommand{\baselinestretch}{0.9} \small % \caption{Regras definindo a formação do \textbf{IBIp de um item}} \caption{Rules defining the formation of the \textbf{IBIp of an item}} \label{table:regrasparaibip} \begin{tabular}{rcl} % 0 1 I O V Y Z are not used \verb!IBIp! & \verb!=! & \verb!word "/" word; ex: 8JMKD3MGP7W/385N5PE! \\ \verb!word! & \verb!=! & \verb!1*ALFANUM; ex: 385N5PE! \\ \verb!ALPHANUM! & \verb!=! & \verb!ALPHA | DIGIT! \\ \verb!ALPHA! & \verb!=! & \verb!LOWALPHA | UPALPHA! \\ \verb!LOWALPHA! & \verb!=! & \verb!"a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" |! \\ & & \verb!"j" | "k" | "l" | "m" | "n" | "p" | "q" | "r" |! \\ & & \verb!"s" | "t" | "u" | "w" | "x"! \\ \verb!UPALPHA! & \verb!=! & \verb!"A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" |! \\ & & \verb!"J" | "K" | "L" | "M" | "N" | "P" | "Q" | "R" |! \\ & & \verb!"S" | "T" | "U" | "W" | "X"! \\ \verb!DIGIT! & \verb!=! & \verb!"2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"! \\ \end{tabular} \renewcommand{\baselinestretch}{1} \normalsize \end{table} % Pela Tabela \ref{table:regrasparaibip}, observa-se que os caracteres \verb!"0"!, \verb!"O"!, \verb!"1"!, \verb!"I"!, \verb!"V"!, \verb!"Y"! e \verb!"Z"! foram excluidos. Os cinco primeiros para eliminar possíveis dúvidas na leitura desses caracteres quando se faz uso de certos fontes. Os dois últimos foram reservados caso se faz necessário definir no futuro um sistema de identificação sensível a maiúscula e minúscula. From Table \ref{table:regrasparaibip}, it is observed that the characters \verb!"0"!, \verb!"O"!, \verb!"1"!, \verb!"I"!, \verb!"V"!, \verb!"Y"! e \verb!"Z"! were excluded. The first five to remove any doubt in the reading of these characters when one makes use of certain fonts. The last two were reserved if it is necessary to define in the future a case sensitive identification system. % Como no caso do \textbf{nome do repositório uniforme de um item} do capítulo anterior, o \textbf{IBIp de um item} é insensível a maiúscula e minúscula. Assim \texttt{8JMKD3MGP8W/34PGRBS} e \texttt{8jmkd3mgp8w/34pgrbs} são equivalentes. Na prática, recomenda-se utilizar apenas lettras maiúsculas na geração do \textbf{rótulo}. As with the \textbf{name of the uniform repository of an item} of the previous chapter, the \textbf{IBIp of an item} is case insensitive. So \texttt{8JMKD3MGP8W/34PGRBS} and \texttt{8jmkd3mgp8w/34pgrbs} are equivalent. In practice, it is recommended to use only uppper case characters for the \textbf{label} generation. % Além das regras sintáticas da Tabela \ref{table:regrasparaibip}, um \textbf{IBIp de um item} deve verificar as regras semânticas definidas por meio dos Algoritmos \ref{algorithm:montarprefixodoibipdeumitem}, \ref{algorithm:montarsufixodoibipdeumitem} e \ref{algorithm:montaribipdeumitem}. Por sua vez, por construção, o Algoritmo \ref{algorithm:montaribipdeumitem} gera um \textbf{rótulo} que verifica as regras sintáticas da Tabela \ref{table:regrasparaibip}. In addition to the syntactic rules of Table \ref{table:regrasparaibip}, an \textbf{IBIp of an item} must satisfy the semantic rules defined by the algorithms \ref{algorithm:montarprefixodoibipdeumitem}, \ref{algorithm:montarsufixodoibipdeumitem} and \ref{algorithm:montaribipdeumitem}. In turn, by construction, Algorithm \ref{algorithm:montaribipdeumitem} generates a \textbf{label} that satisfies the syntax rules of Table \ref{table:regrasparaibip}. % O Algoritmo \ref{algorithm:montarprefixodoibipdeumitem}, é a descrição do \textbf{gerador de rótulo} denotado $a$ na Figura~\ref{fig:sistemaidentificacao} e utilizado pelo \textbf{sistema de identificação} $f$ para a identificação dos \textbf{subsistemas de identificação}. Algorithm \ref{algorithm:montarprefixodoibipdeumitem} is the description of the \textbf{label generator} denoted $a$ in Figure~\ref{fig:sistemaidentificacao} and used by the \textbf{identification system} $f$ for the identification of the \textbf{identification subsystems}. % O Algoritmo \ref{algorithm:montarsufixodoibipdeumitem}, é a descrição do \textbf{gerador de rótulo} denotado $b$ na Figura~\ref{fig:sistemaidentificacao} e utilizado por qualquer \textbf{subsistema de identificação}. Algorithm \ref{algorithm:montarsufixodoibipdeumitem} is the description of the \textbf{label generator} denoted $b$ in Figure~\ref{fig:sistemaidentificacao} and used by any \textbf{identification subsystems}. % O Algoritmo \ref{algorithm:montaribipdeumitem} é a descrição do \textbf{gerador de rótulo}, denotado $c$ na Figura~\ref{fig:sistemaidentificacao}, utilizado pelo \textbf{sistema para geração de IBI} $s$. Algorithm \ref{algorithm:montaribipdeumitem} is the description of the \textbf{label generator} denoted $c$ in Figure~\ref{fig:sistemaidentificacao} and used by the \textbf{system for IBI generation} $s$. \clearpage \begin{nicealgo}{algorithm:montarprefixodoibipdeumitem} % \naTITLE{\textsc{MontarPrefixoDoIBIpDeUmItem}.} \naTITLE{\textsc{MountPrefixOfIBIpOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{IP}} \textnormal{(}string representing the IP of the computer hosting the server responsible for the identification subsystem\textnormal{)},} \naCONTINUE{\textnormal{\texttt{port}} \textnormal{(}decimal integer representing the port number to access the server responsible for the identification subsystem\textnormal{)}.} \naOUTPUT{\textnormal{\texttt{prefix}} \textnormal{(}string\textnormal{)}.} \naGLOBAL{\textnormal{\texttt{decim-to-IBIp}} \textnormal{(}conversion Table \ref{table:decimalparaibip} from decimal to IBIp\textnormal{)},} \naCONTINUE{\textnormal{\texttt{decim-to-IPv4}} \textnormal{(}conversion Table \ref{table:decimalparaipv4} from decimal to IPv4\textnormal{)},} \naCONTINUE{\textnormal{\texttt{decim-to-IPv6}} \textnormal{(}conversion Table \ref{table:decimalparaipv6} from decimal to IPv6\textnormal{)}.} \naAUX{\textnormal{\texttt{decim-coded-IP}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{coded-IP}} \textnormal{(}string\textnormal{)},} \naCONTINUE{\textnormal{\texttt{coded-port}} \textnormal{(}string\textnormal{)}.} \naBODY \naBEGIN{\naIF $\texttt{port} = 800$ \naTHEN} \naENDN{1}{$\texttt{coded-port} \mget \texttt{\textquotedbl\textquotedbl}$} \naBEGIN{\naELSE} \naENDN{1}{$\texttt{coded-port} \mget \textsc{ConvertFromDecimal}(\texttt{port}, \texttt{decim-to-IBIp})$} \naBEGIN{\naIF $\texttt{\textquotedbl.\textquotedbl} \in \texttt{IP}$ \naTHEN} \na{$\texttt{decim-coded-IP} \mget \textsc{ConvertToDecimal}(\texttt{IP}, \texttt{decim-to-IPv4})$} \na{$\texttt{coded-IP} \mget \textsc{ConverterDeDecimal}(\texttt{decim-coded-IP}, \texttt{decim-to-IBIp})$} \naENDN{1}{$\texttt{prefix} \mget \textsc{Concatenate}(\texttt{coded-IP}, \texttt{\textquotedbl W\textquotedbl}, \texttt{coded-port})$} \naBEGIN{\naELSE} \na{$\texttt{decim-coded-IP} \mget \textsc{ConvertToDecimal}(\texttt{IP}, \texttt{decim-to-IPv6})$} \na{$\texttt{coded-IP} \mget \textsc{ConvertFromDecimal}(\texttt{decim-coded-IP}, \texttt{decim-to-IBIp})$} \naENDN{1}{$\texttt{prefix} \mget \textsc{Concatenate}(\texttt{coded-IP}, \texttt{\textquotedbl X\textquotedbl}, \texttt{coded-port})$} \end{nicealgo} \clearpage \begin{nicealgo}{algorithm:montarsufixodoibipdeumitem} % \naTITLE{\textsc{MontarSufixoDoIBIpDeUmItem}.} \naTITLE{\textsc{MountSuffixOfIBIpOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{date}} \textnormal{(}decimal rational obtained from output of Algorithm~\ref{algorithm:criardataparamontarsufixodoibideumitem}: \textsc{CreateDateToMountSuffixOfIBIOfAnItem}\textnormal{)},} \naOUTPUT{\textnormal{\texttt{suffix}} \textnormal{(}string\textnormal{)}.} \naGLOBAL{\textnormal{\texttt{decim-to-IBIp}} \textnormal{(}conversion Table \ref{table:decimalparaibip} form decimal to IBIp\textnormal{)}.} \naAUX{\textnormal{\texttt{integer-part}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{second}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{fraction}} \textnormal{(}decimal integer\textnormal{)},} \naCONTINUE{\textnormal{\texttt{coded-fraction}} \textnormal{(}string\textnormal{)}.} \naBODY \na{$\texttt{integer-part} \mget \textsc{Int}(\texttt{date})$} \na{$\texttt{second} \mget \texttt{integer-part} - 807235200$} \na{$\texttt{fraction} \mget \texttt{date} - \texttt{integer-part}$} \na{$\texttt{suffix} \mget \textsc{ConvertFromDecimal}(\texttt{second}, \texttt{decim-to-IBIp})$} \naBEGIN{\naIF $\texttt{fraction} \neq 0$ \naTHEN} \na{$\texttt{coded-fraction} \mget \textsc{ConvertFromDecimal}(\texttt{fraction}, \texttt{decim-to-IBIp})$} \naENDN{1}{$\texttt{suffix} \mget \textsc{Concatenate}(\texttt{suffix}, \texttt{\textquotedbl W\textquotedbl}, \texttt{coded-fraction})$} \end{nicealgo} \begin{nicealgo}{algorithm:montaribipdeumitem} % \naTITLE{\textsc{MontarIBIpDeUmItem}.} \naTITLE{\textsc{MountIBIpOfAnItem}.} \naPREAMBLE \naINPUT{\textnormal{\texttt{prefix}} \textnormal{(}string obtained from output of Algorithm~\ref{algorithm:montarprefixodoibipdeumitem}: \textsc{MountPrefixOfIBIpOfAnItem}\textnormal{)},} \naCONTINUE{\textnormal{\texttt{suffix}} \textnormal{(}string obtained from output of Algorithm~\ref{algorithm:montarsufixodoibipdeumitem}: \textsc{MountSuffixOfIBIpOfAnItem}\textnormal{)}.} \naOUTPUT{\textnormal{\texttt{IBIp}} \textnormal{(}IBIp of an item\textnormal{)}.} \naBODY \na{$\texttt{IBIp} \mget \textsc{Concatenate}(\texttt{prefix}, \texttt{\textquotedbl/\textquotedbl}, \texttt{suffix})$} \end{nicealgo} % Os algoritmos apresentados acima usam as segintes rotinas. The algorithms presented above use the following routines. % http://www.tutorialspoint.com/computer_logical_organization/number_system_conversion.htm % A rotina \textsc{ConverterParaDecimal} converte, de um determinado sistema de numeração para o sistema de numeração decimal, a cadeia de caracteres, informada no primeiro argumento, em um número inteiro decimal, conforme à tabela informada no segundo argumento. Esta conversão utiliza a tabela inversa da tabela informada. Routine \textsc{ConvertToDecimal} converts, from a specific numbering system to the decimal numbering system, the string, informed in the first argument, to a decimal integer, according to the table reported in the second argument. This conversion uses the inverse table of the specified table. % Alguns exemplos de utilização da rotina \textsc{ConverterParaDecimal} são apresentados na Tabela~\ref{table:exemplosconverterparadecimal}. Some examples of use of routine \textsc{ConvertToDecimal} are shown in Table~\ref{table:exemplosconverterparadecimal}. \begin{table} \renewcommand{\baselinestretch}{1.2} \small \centering % \caption{Exemplos de conversão utilizando a rotina \textsc{ConverterParaDecimal}} \caption{Examples of conversion using Routine \textsc{ConvertToDecimal}} \label{table:exemplosconverterparadecimal} \begin{tabular}{ccc} \multicolumn{1}{c}{IP} & \multicolumn{1}{c}{table} & \multicolumn{1}{c}{output} \\ \hline 150.163.2.174 & \texttt{decim-to-IPv4} & 4588904456580 \\ 2001:252:0:1::2008:6 & \texttt{decim-to-IPv6} & 478239719325051908572237 \\ \hline \end{tabular} \end{table} % A rotina \textsc{ConverterDeDecimal} converte, do sistema de numeração decimal para um outro sistema de numeração, o número inteiro decimal, informado no primeiro argumento, em uma cadeia de caracteres, conforme à tabela informada no segundo argumento. Routine \textsc{ConvertFromDecimal} converts, from the decimal number system to another number system, the decimal integer, informed in the first argument, to a string, according to the table reported in the second argument. % Alguns exemplos de utilização da rotina \textsc{ConverterDeDecimal} são apresentados na Tabela~\ref{table:exemplosconverterdedecimal} Some examples of use of routine \textsc{ConvertFromDecimal} are shown in Table~\ref{table:exemplosconverterdedecimal}. \begin{table}[h] \renewcommand{\baselinestretch}{1.2} \small \centering % \caption{Exemplos de conversão utilizando a rotina \textsc{ConverterDeDecimal}} \caption{Examples of conversion using Routine \textsc{ConvertFromDecimal}} \label{table:exemplosconverterdedecimal} \begin{tabular}{ccc} \multicolumn{1}{c}{decimal} & \multicolumn{1}{c}{table} & \multicolumn{1}{c}{output} \\ \hline 1 & \texttt{decim-to-IBIp} & 3 \\ 19050 & \texttt{decim-to-IBIp} & U5H \\ 480992662 & \texttt{decim-to-IBIp} & 38G3TS3 \\ 4588904456580 & \texttt{decim-to-IBIp} & J8LNKAN8P \\ 478239719325051908572237 & \texttt{decim-to-IBIp} & 7URMDHLL9SSN2D89M \\ \hline \end{tabular} \end{table} % A entrada do Algoritmo \ref{algorithm:montarprefixodoibipdeumitem} é a mesma que do Algoritmo \ref{algorithm:montarprefixodonomederepositoriodeumitem}. The input of Algorithm \ref{algorithm:montarprefixodoibipdeumitem} is the same as that of Algorithm~\ref{algorithm:montarprefixodonomederepositoriodeumitem}. % Nas Linhas 1 a 4 do Algoritmo~\ref{algorithm:montarprefixodoibipdeumitem}, testa-se se o número de porta é 800, nesse caso não há conversão desse número e usa-se uma cadeia vazia, caso contrário o número de porta é codificado usando a Tabela \ref{table:decimalparaibip}. In Lines 1 to 4 of Algorithm~\ref{algorithm:montarprefixodoibipdeumitem}, the port number is tested to see if it is equal to 800, in this case there is no conversion of this number and an empty string is returned, otherwise the port number is encoded using Table \ref{table:decimalparaibip}. % Diferentemente do capítulo anterior, não se considera o número de porta 80, porque pode existir mais de um computador virtual (\textsl{virtual host}) usando a mesma porta 80. Em testes desta norma para um sistema de identificação, foram utilizados números de porta como 800 e 802, para o acesso aos scripts que implementam os \textbf{geradores de rótulo} utilizados pelos \textbf{sistemas de identificação em dois níveis} hospedados em computadores virtuais distintos, mas dentro um mesmo computador real, portanto, associado ao mesmo IP. Para o caso em que existe apenas um único computador virtual, foi adotado o número de porta 800. Desta forma, toda vez que se utiliza o número de porta 800, o prefixo do \textbf{IBIp de um item} torna-se mais curto. Unlike the previous chapter, the port number 80 is not considered because more than one virtual host may exist using the same port 80. In tests of this standard for an identification system, port numbers like 800 and 802 were used for accessing the scripts that implement the \textbf{label generators} used by the \textbf{identification systems on two levels} hosted on different virtual hosts, but within the same real computer, so associated with same IP. For the case where there is only one virtual host, the port number 800 was adopted. In this way, each time the port number 800 is used, the prefix of the \textbf{IBIp of an item} becomes shorter. % Na Linha 5 do Algoritmo~\ref{algorithm:montarprefixodoibipdeumitem} testa-se o tipo de IP. Caso o IP for do tipo IPv4, Linha 8, na concatenação utiliza-se o caractere \texttt{\textquotedbl W\textquotedbl} para separar o IP codificado, do número de porta codificado. Caso o IP for do tipo IPv6, na Linha 12 utiliza-se o caractere \texttt{\textquotedbl X\textquotedbl} para esse propósito. In Line 5 of Algorithm~\ref{algorithm:montarprefixodoibipdeumitem} the type of IP is tested. If the IP is of type IPv4, Line 8, the character \texttt{\textquotedbl W\textquotedbl} is used in the concatenation to separate the encoded IP from the encoded port number. If the IP is of type IPv6, on Line 12 the character \texttt{\textquotedbl X\textquotedbl} is used for this purpose. % Como os caracteres \texttt{\textquotedbl W\textquotedbl} e \texttt{\textquotedbl X\textquotedbl} não fazem parte dos grafemas da Tabela~\ref{table:decimalparaibip} é possível, caso seja necessário, decodificar o prefixo do \textbf{IBIp de um item}. Because the characters \texttt{\textquotedbl W\textquotedbl} and \texttt{\textquotedbl X\textquotedbl} are not part of the graphemes of Table~\ref{table:decimalparaibip}, it is possible, if necessary, to decode the prefix of the \textbf{IBIp of an item}. % Para codificar um IP, considera-se que seu valor representa um número dentro de um determinado sistema de numeração. A codificação, consiste então em converter a representação no sistema original para uma nova representação num outro sistema de numeração, denotado aqui IBIp. Como existem dois tipos de IP: IPv4 e IPv6, considera-se dois sistemas de numeração originais, denotados, respectivamente, IPv4 e IPv6. To encode an IP, it is considered that its value represents a number within a specific numbering system. The encoding consist then to convert the representation in the original system to a representation in another numbering system, denoted here IBIp. As there are two types of IP: IPv4 and IPv6, it is considered two original numbering systems, denoted respectively IPv4 and IPv6. % A conversão de um IP de um desse dois sistemas de numeração para o sistema IBIp, é feita no Algoritmo~\ref{algorithm:montarprefixodoibipdeumitem}, recorrendo a sua representação no sistema decimal. The conversion of an IP of one of those two numbering systems to the IBIp system is made in Algorithm~\ref{algorithm:montarprefixodoibipdeumitem}, using their representation in the decimal system. % Assim, para converter uma representação no sistema IPv4 (respectivamente, IPv6) para sua representação no sistema IBIp, é feito primeiro a conversão da representação no sistema IPv4 (respectivamente, IPv6) para sua representação no sistema decimal com base na tabela inversa da Tabela~\ref{table:decimalparaipv4} (respectivamente, \ref{table:decimalparaipv6}) e em seguida a conversão da sua representação no sistema decimal para sua representação no sistema IBIp com base na Tabela~\ref{table:decimalparaibip}. Thus, to convert a representation in the IPv4 (respectively IPv6) system to its representation in the IBIp system, first the conversion of the representation in the IPv4 (respectively IPv6) system to its representation in the decimal system based on the inverse table of Table~\ref{table:decimalparaipv4} (respectively, \ref{table:decimalparaipv6}) is made, and then the conversion of its representation in the decimal system to its representation in the IBIp system based on Table~\ref{table:decimalparaibip}. % A entrada do Algoritmo \ref{algorithm:montarsufixodoibipdeumitem} é a mesma que do Algoritmo \ref{algorithm:montarsufixodonomederepositoriodeumitem}. The input of Algorithm \ref{algorithm:montarsufixodoibipdeumitem} is the same as that of Algorithm \ref{algorithm:montarsufixodonomederepositoriodeumitem}. % Na Linha 2, o Algoritmo \ref{algorithm:montarsufixodoibipdeumitem} calcula a diferença em segundos entre a variável \texttt{parte-inteira} e a constante: 807235200. Esta constante é o número de segundos (em \textsl{Unix time}) corresponde à data 19950801T000000Z (data no formato ISO 8601) de início do mês durante o qual ocorreu a geração do primeiro \textbf{rótulo}, seguindo esta norma. Esse modo operante, permite gerar \textbf{rótulos} mais curtos, desde que obtidos como resultado da conversão de números menores. In Line 2, Algorithm \ref{algorithm:montarsufixodoibipdeumitem} calculates the difference in seconds between the variable \texttt{integer-part} and the constant: 807235200. This constant is the number of seconds (in Unix time) corresponding to the date 19950801T000000Z (date in ISO 8601 format) of the beginning of the month during which the first generation of a \textbf{label} was made following this standard. This operating mode, allow to generate shorter \textbf{labels}, since obtained as the result of the conversion of smaller numbers. % Na linha 7, utiliza-se o caractere \texttt{\textquotedbl W\textquotedbl} para separar a parte inteira codificada da parte fracionária codificada. Como o caractere \texttt{\textquotedbl W\textquotedbl} não faz parte dos grafemas da Tabela~\ref{table:decimalparaibip} é possível, caso seja necessário, decodificar o sufixo do \textbf{IBIp de um item}. In Line 7, the character \texttt{\textquotedbl W\textquotedbl} is used to separate the coded integer part from the fractional coded part. Because the character \texttt{\textquotedbl W\textquotedbl} is not part of the graphemes of Table~\ref{table:decimalparaibip}, it is possible, if necessary, to decode the prefix of the \textbf{IBIp of an item}. \begin{table} \renewcommand{\baselinestretch}{1.2} \small \centering % \caption{Tabela de conversão de decimal para IPv4} \caption{Conversion table from decimal to IPv4} \label{table:decimalparaipv4} \begin{tabular}{rc} \multicolumn{1}{c}{decimal} & \multicolumn{1}{c}{IPv4} \\ \hline 0\hspace{5mm} & 0 \\ 1\hspace{5mm} & 1 \\ 2\hspace{5mm} & 2 \\ 3\hspace{5mm} & 3 \\ 4\hspace{5mm} & 4 \\ 5\hspace{5mm} & 5 \\ 6\hspace{5mm} & 6 \\ 7\hspace{5mm} & 7 \\ 8\hspace{5mm} & 8 \\ 9\hspace{5mm} & 9 \\ 10\hspace{5mm} & . \\ \hline \end{tabular} \end{table} \begin{table} \renewcommand{\baselinestretch}{1.2} \small \centering % \caption{Tabela de conversão de decimal para IPv6} \caption{Conversion table from decimal to IPv6} \label{table:decimalparaipv6} \begin{tabular}{rc} \multicolumn{1}{c}{decimal} & \multicolumn{1}{c}{IPv6} \\ \hline 0\hspace{5mm} & 0 \\ 1\hspace{5mm} & 1 \\ 2\hspace{5mm} & 2 \\ 3\hspace{5mm} & 3 \\ 4\hspace{5mm} & 4 \\ 5\hspace{5mm} & 5 \\ 6\hspace{5mm} & 6 \\ 7\hspace{5mm} & 7 \\ 8\hspace{5mm} & 8 \\ 9\hspace{5mm} & 9 \\ 10\hspace{5mm} & a \\ 11\hspace{5mm} & b \\ 12\hspace{5mm} & c \\ 13\hspace{5mm} & d \\ 14\hspace{5mm} & e \\ 15\hspace{5mm} & f \\ 16\hspace{5mm} & : \\ \hline \end{tabular} \end{table} \begin{table} \renewcommand{\baselinestretch}{1.2} \small \centering % \caption{Tabela de conversão de decimal para IBIp} \caption{Conversion table from decimal to IBIp} \label{table:decimalparaibip} \begin{tabular}{rc} \multicolumn{1}{c}{decimal} & \multicolumn{1}{c}{IBIp} \\ \hline 0\hspace{5mm} & 2 \\ 1\hspace{5mm} & 3 \\ 2\hspace{5mm} & 4 \\ 3\hspace{5mm} & 5 \\ 4\hspace{5mm} & 6 \\ 5\hspace{5mm} & 7 \\ 6\hspace{5mm} & 8 \\ 7\hspace{5mm} & 9 \\ 8\hspace{5mm} & A \\ 9\hspace{5mm} & B \\ 10\hspace{5mm} & C \\ 11\hspace{5mm} & D \\ 12\hspace{5mm} & E \\ 13\hspace{5mm} & F \\ 14\hspace{5mm} & G \\ 15\hspace{5mm} & H \\ 16\hspace{5mm} & J \\ 17\hspace{5mm} & K \\ 18\hspace{5mm} & L \\ 19\hspace{5mm} & M \\ 20\hspace{5mm} & N \\ 21\hspace{5mm} & P \\ 22\hspace{5mm} & Q \\ 23\hspace{5mm} & R \\ 24\hspace{5mm} & S \\ 25\hspace{5mm} & T \\ 26\hspace{5mm} & U \\ \hline \end{tabular} \end{table} \clearpage \bibliography{./reference} \hypertarget{references}{} \inicioApendice %\include{./docs/apendice1} %% insira apendices tal qual capítulos acima %\hypertarget{estilo:apendice1}{} %% uso para este Guia %Este apêndice foi criado apenas para indicar como construir um apêndice no estilo, não existia no original da tese. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \chapter{APÊNDICE A - DEFINIÇÃO DE FIBRA} \chapter{APPENDIX A - FIBER DEFINITION} \label{apendiceA} % Sejam $X$ e $Y$ dois conjuntos não vazios, e $f$ uma função de $X$ em $Y$. Let $X$ and $Y$ two non-empty sets, and $f$ a mapping from $X$ to $Y$. \begin{comment} A \textsl{imagem de um subconjunto $A$ de $X$ através de $f$}, é o subconjunto de $Y$ denotado por $f(A)$ e dado por: \begin{equation*} f(A) \triangleq \{f(x): x \in A\}, \qquad \text{para todo $A \subset X$}. \end{equation*} A \textsl{imagem inversa de um subconjunto $B$ de $Y$ através de $f$}, é o subconjunto de $X$ denotado por $f^{-1}(B)$ e dado por: \begin{equation*} f^{-1}(B) \triangleq \{x \in X : f(x) \in B\}, \qquad \text{para todo $B \subset Y$}. \end{equation*} A \textsl{fibra de $y$ através de $f$} é o subconjunto de $X$ denotado por $f^*(y)$ e dado por: \begin{equation*} f^*(y) \triangleq f^{-1}(\{y\}), \qquad \text{para todo $y \in f(X)$}. \end{equation*} \end{comment} The \textsl{image of a subset $A$ of $X$ through $f$}, is the subset of $Y$ denoted by $f(A)$ and given by: \begin{equation*} f(A) \triangleq \{f(x): x \in A\}, \qquad \text{for any $A \subset X$}. \end{equation*} The \textsl{inverse image of a subset $B$ of $Y$ through $f$}, is the subset of $X$ denoted by $f^{-1}(B)$ and given by: \begin{equation*} f^{-1}(B) \triangleq \{x \in X : f(x) \in B\}, \qquad \text{for any $B \subset Y$}. \end{equation*} The \textsl{fiber of $y$ through $f$} is the subset of $X$ denoted by $f^*(y)$ and given by: \begin{equation*} f^*(y) \triangleq f^{-1}(\{y\}), \qquad \text{for any $y \in f(X)$}. \end{equation*}