Abstract:
A code-reading apparatus determines the type of data in recorded code data and carries out appropriate processes depending on the determined type of data. The code-reading apparatus comprises an imaging unit  7  for photographing encoded data. The encoded data comprises a header portion and a body portion, the body portion including encoded ring tone data, the header portion including a data identifier D indicating the type of data in the body portion. The apparatus further comprises a data identifier unit  19   a  for identifying the type of the encoded data photographed by the imaging unit  7  based on the data identifier D, and control units  13  and  19  for reading the encoded data depending on the identified data type and for reproducing the ring tone data that has been read.

Description:
BACKGROUND OF THE INVENTION  
         [0001]    1. Field of the Invention  
           [0002]    The present invention relates to a code structure and code reading terminal.  
           [0003]    2. Background Art  
           [0004]    Many cellular phones are equipped with a function to allow the user to choose and register a desired ring tone such as a melody. In order to register a ring tone, the user can manually carry out certain key operations on their cell phone. Alternatively, if the phone is capable of accessing the Internet, the user can access a certain service site from which ring tone data can be downloaded.  
           [0005]    JP Patent Publication (Kokai) No. 2002-125008 A discloses a method of registering ring tone data by rendering cellular phone ring tone data into a two-dimensional code that is then printed and read by a camera.  
           [0006]    Sometimes data other than ring tone data is required to be recorded in the two-dimensional code. In such a case, it is necessary to appropriately separate the ring tone data from other data in the recorded data. For example, if a different kind of data, such as text data, is encoded in the two-dimensional code together with the ring tone data for cellular phone, a reader might mistake the text data for ring tone data. It would then handle the subsequent processes accordingly, resulting in the malfunctioning of the cellular phone.  
           [0007]    There is also the need to protect ring tone data recorded in a two-dimensional code by making it difficult for conventional code readers to read the data and thus allowing only specific users or devices to do so.  
         SUMMARY OF THE INVENTION  
         [0008]    It is therefore an object of the invention to provide a technique for separating ring tone data, for example, from other data in recorded data. It is another object to protect two-dimensionally encoded data.  
           [0009]    In one aspect, the invention provides an encoded data structure comprising a body portion containing information content and a header portion having a function of indexing the body portion. The header portion includes a data identifier for identifying the type of data in the body portion. By using this data structure, the type of encoded data in the body portion can be determined based on the header portion.  
           [0010]    The header portion preferably comprises an encryption identifier indicating whether or not the data in the body portion is encrypted. The identification using the encryption identifier allows the subsequent processes to be carried out properly.  
           [0011]    In another aspect, the invention provides a code-reading terminal. The code-reading terminal includes an imaging unit for photographing encoded data comprising a header portion and a body portion, the header portion including a data identifier indicating the type of data in the body portion. It also includes a data identifying unit for identifying the type of encoded data photographed by the imaging unit on the basis of the data identifier. The terminal further includes a control unit for reading the encoded data depending on the data type identified by the data identifying unit, and for reproducing the data that has been read.  
           [0012]    The code-reading terminal, which comprises the data identifying unit for identifying the type of encoded data photographed by the imaging unit based on the data identifier, can determine the type of encoded data.  
           [0013]    Preferably, whether the encoded data is encrypted or not is determined. If encrypted, the data is reproduced after decrypting it.  
           [0014]    Preferably, the data type is identified by the data identifying unit when the encoded data is read. Then, appropriate processes are automatically carried out, whereby encrypted data is then decrypted and reproduced while displaying other data. This way, the user can process content data without having to pay attention to the presence or absence of encryption. 
       
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0015]    [0015]FIG. 1 shows an example of a two-dimensional code-reading terminal according to an embodiment of the invention. FIG. 1(A) shows a front face of the terminal. FIG. 1(B) shows a back face of the terminal.  
         [0016]    [0016]FIG. 2 shows a functional block diagram of the two-dimensional code-reading terminal according to the embodiment.  
         [0017]    [0017]FIG. 3 shows an example of the data structure of the two-dimensional code according to the embodiment.  
         [0018]    [0018]FIG. 4 shows a flowchart of the processes starting with the reading of a code up to the reproduction of a ring tone on the two-dimensional code-reading terminal according to the embodiment.  
         [0019]    [0019]FIG. 5 shows display screens during various processes carried out on the two-dimensional code-reading terminal according to the embodiment. FIG. 5(A) shows an example of the screen for the selection of a normal camera mode or a bar-code (reading) mode. FIG. 5(B) shows an example of the screen for the selection of a one-dimensional or two-dimensional bar code.  
         [0020]    [0020]FIG. 6 shows display screens during various processes carried out on the two-dimensional code-reading terminal according to the embodiment. FIG. 6(A) shows how the two-dimensional bar code expands beyond the display region. FIG. 6(B) shows the two-dimensional bar code located within the display region.  
         [0021]    [0021]FIG. 7 shows display screens during various processes carried out on the two-dimensional code-reading terminal according to the embodiment. FIG. 7(A) shows how the two-dimensional bar code on the display screen is shaded. FIG. 7(B) shows how the influence of the shade is reduced by turning on a light.  
         [0022]    [0022]FIG. 8 shows a flowchart of the process of reading a code in the two-dimensional code-reading terminal according to the embodiment.  
     
    
     DESCRIPTION OF PREFERRED EMBODIMENTS  
       [0023]    This application is based on the Japanese patent application 2002-206736, filed on Jul. 16th  2002 , all the contents of which is incorporated in this application by reference.  
         [0024]    The code-reading technique according to an embodiment of the invention will be hereafter described by referring to the drawings. FIG. 1 shows a cellular phone (portable terminal) equipped with an imaging function (camera) that forms a part of the code-reading function. FIG. 1(A) shows a liquid crystal display (LCD) side (front surface) of the cellular phone. FIG. 1(B) shows a camera side (back surface) of the phone. FIG. 2 shows a functional block diagram of the cellular phone of FIG. 1. FIG. 3 shows an example of the data structure used in the code-reading technique according to the embodiment. FIG. 4 shows a flowchart of the processes including the processing of data read by the code-reading technique according to the embodiment, and the reproduction of a melody. FIGS.  5 (A) and (B), FIGS.  6 (A) and (B), and FIGS.  7 (A) and (B) show examples of the cellular phone screen during the code-reading operation using the code-reading technique of the embodiment. FIG. 8 shows a specific example of the processes involved in the code-reading operation.  
         [0025]    As shown in FIG. 1(A), a key input portion  3  with a variety of input keys and an LCD portion  5  are mounted on the front surface of a cellular phone  1 . On the back surface of the cellular phone  1 , a camera (imaging unit)  7 , such as a CCD camera, and a light  10  (such as an LED or other illuminating device) are mounted, as shown in FIG. 1(B).  
         [0026]    Referring to FIG. 2, the cellular phone  1  includes an antenna  11 , an RF (radio frequency) circuit  12 , a signal processing unit  13 , a CPU  19  for controlling them, and a memory  18 . It also includes a microphone  15 , an A/D converter  14  for converting voice data entered via the microphone into digital data, a D/A converter  16  for converting a digital signal from the signal processing unit  13  into an analog signal, and a speaker  17  (including a ring tone reproduction unit) for outputting a signal from the D/A converter  16 . The LCD  5  (display unit), the camera unit  7  (imaging unit), and the key input unit  3  together form a user interface.  
         [0027]    The CPU  19  has a data identifying function  19   a  for identifying the type of data that is obtained by reading a code. The memory  18  includes a ring tone data storage region  18   a  for storing ring tone data.  
         [0028]    Now referring to FIG. 3, the data structure in the present embodiment is divided into a header portion and a body portion. The header portion has, starting from the head, a data identifier region D (2 bytes long), a maker identifying code region M (2 bytes long), a format number region F (1 byte long), an encryption identifier region C 1  (1 byte long), an encryption version region C 2  (1 byte long), a region S (2 bytes long) indicating the length (N) of the title, and a region T (N bytes long) indicating information about the title of a ring tone, for example. In the body region, content data regarding the implementation of ring tones, for example, is stored. The data identifier D is determined by a prior arrangement such that it takes a specific value (such as 0×00 or 0×FF) that does not exist in normal text documents. Thus, in a reading process, the information content of the body portion can be determined to be that of ring tone data, for example, if its data identifier indicates a predetermined value.  
         [0029]    Referring to FIGS.  4  to  8 , the sequence of processes from a two-dimensional code-reading process to a ring tone reproduction process will be described.  
         [0030]    In FIG. 5(A), the LCD  5  displays a screen prompting the selection of a normal camera mode  5   a  or a bar-code mode  5   b  (the setting of the bar-code reading mode in step S 31  in FIG. 8). As the user selects the bar-code mode  5   b , the screen is changed so as to prompt the selection of a one-dimensional bar code  5   c  or a two-dimensional bar code  5   d , as shown in FIG. 5(B). If the two-dimensional bar code mode including ring tone data is selected (the step of selecting the code type in step S 32  in FIG. 8), the cellular phone is now ready to read the two-dimensional bar code including ring tone data. In the case of the one-dimensional code, the camera and display settings are given a predetermined value (set value 1). In the case of two-dimensional code, another predetermined value (set value 2) is employed. For example, in the case of one-dimensional code, the photographed range is 640 in length×480 in width, and the display is set so that it displays this camera image in equal size. In the case of two-dimensional code, the photographed range is 320 in length×240 in width, and the display is set so that it displays twice the size of this camera image both in length and width. In addition, camera settings common to the one- and two-dimensional codes include the emphasis of edge components and contrast.  
         [0031]    The camera is now ready for event capture, and it switches processes depending on individual events. A light ON/OFF operation event concerns the switching on or off of the light in response to the user pushing a light ON or OFF button (step S 45 ).  
         [0032]    A read start operation event takes place when the user pushes a read start button in order to start the reading of the bar code, whereupon a flag indicating the start of reading is set. A mark indicating the position of the camera can be displayed on the LCD, and the mark may be eliminated once a reading has started. A frame capture event takes place after the camera has read one frame of an image. Initially, the image that has been read according to the settings is displayed on the LCD (step S 36 ). The position of the camera may be simultaneously displayed on the LCD. In step S 39 , it is determined whether the reading has been successful. If the read start flag is set, a code-reading process is initiated (step S 38 ). If it is determined that the reading has been unsuccessful in step S 39 , the routine returns to the event read step S 35 . If it is determined that the code reading has been successful in step S 39 , a read data process is carried out (step S 40 ), and the reading result is appropriately presented to the user according to the type of the read data. Then, the code-reading process comes to an end (step S 41 ).  
         [0033]    For example, before the start of reading, the display can be made smoothly at a high frame rate because the code-reading process has not been initiated. Prior to reading, the user can easily operate the unit to bring the code on the screen while looking at the screen. When the code is located on the screen, the user starts the reading start operation, and then the result of reading is displayed. In operation, the read start operation is not initiated as long as the two-dimensional code is not completely on the screen (imageable region), as shown in FIG. 6(A), as the code is partly out of screen (photographed region), which prevents the reading of the code. Once it is confirmed that the two-dimensional code is on the screen (imageable region), as shown in FIG. 6(B), the code is within screen (photographed region), the read start operation is initiated, followed by the reading of the code.  
         [0034]    Reading might be hampered if the two-dimensional code is shaded during the reading operation, as shown in FIG. 7(A). In such a case, the light  10  (FIG. 1(B)) can be turned on, as shown in FIG. 7(B), so that the influence of the shade can be diminished and the probability of successful reading can be increased.  
         [0035]    Referring to FIG. 4, the procedure of read data processes will be described. First, in step S 3 , the data identifier is analyzed by the data identifying function  19   a  of the CPU  19 . If the data identifier is “00” or “ff” for example, the data is determined not to be text data, and then the header following the data identifier is read (step S 11 ). It is then determined in step S 15  whether or not the header is correct. If the header is determined to be incorrect in step S 15 , the process is terminated (step S 29 ). If it is determined to be correct in step S 15 , whether or not the body portion is encrypted is determined in step S 17  on the basis of the encryption identifier C 1 . If the body portion is determined to be encrypted, a decryption process is carried out in step S 21  by referring to the information C 2  concerning encryption version. If the body portion is determined not to be encrypted in step S 17 , the process goes on to step S 23  without decryption. In step S 23 , the title is displayed, and the ring tone is reproduced in step S 25 . The process comes to an end in step S 27 . If the data identifier does not have a prescribed value such as “00” or “ff” in step S 3 , the data is determined to be text data. The text data is then displayed in step S 7 , and a confirmation note is reproduced in step S 8 , thereby indicating to the user the completion of reading. The process comes to an end in step S 9 .  
         [0036]    By these processes, the ring tone data, for example, and other data in the recorded two-dimensional code can be successfully separated. Further, the two-dimensionally encoded data can be protected by encryption.  
         [0037]    By deciding in advance that encrypted data is content data, whether given data is content data or not can be determined based on the presence of encryption.  
         [0038]    While the invention has been described with reference to a preferred embodiment thereof, it will be understood by those skilled in the art that many variations, modifications or improvements thereof are possible.  
         [0039]    For example, while in the above described embodiment the ring tone code employed a two-dimensional bar code, content other than ring tone may be two-dimensionally encoded. It is also possible to use codes other than two-dimensional bar codes.  
         [0040]    Thus, in accordance with the code-reading technique of the invention, ring tone data and other data in recorded data can be appropriately separated.