【正文】
cle (and the receiving cycle) to 16 indicated as Slot 0 to Slot 15 in Fig2 and thus the period per one cycle is 4ms.The transmitter begins with idle state at Slot 0. During Slot 2 and 4, the stored 16bit sensor data sampled in the previous operating cycle is encrypted using the preassigned key A and key B respectively, resulting in two sets of 16bit encrypted data. Each key is 64bit long and is selected in a pseudorandom fashion from the total of 16 unique keys. The resulting RC5encrypted data is subsequently arranged into four collections of 8bit data before being transmitted along with the associated key numbers (015) to the receiving controller at Slot 3, 5, 9 and 11. shows the data frame for each transmission slot, starting with a start bit followed by the (high or low byte) 8bit encrypted data, (high or low byte) 2bit key number and ending with a stop bit. The data transfer rate is 100 kbits/sec. To facilitate synchronisation between the two ends, a synchronising data is generated during ,Slot 6. Upon pleting the transmission cycle, the sync data is forwarded to the receivingend controller during Slot 15 to align the start of the next decryption operation in the receiving end with that in the transmitting encl. The detailed synchronisation operation will be discussed in the next section. From , it can be seen that the remaining of the slots, although not actively used for the main operation, they are assigned to fill up the cycle, either to release dummy data (during Slot 1, 7 and 13) or remain idle (during Slot 10, 12 and 14). This helps camouflage the otherwise repeating pattern of oneplete transmission frame to a large extent, with a consequent benefit to improved security.At the decryption controller, after the synchronising data has been detected, its internal timer will be enabled to generate 16 interrupts every 250us to output to the taximeter the decrypted data pulses that has been stored in a designated 16bit buffer in the previous cycle. Again at this receiving end, the interval between each interrupt is denoted as “Slot” and there are 16 slots per one receiving cycle as depicted in detail in . The four 8bit blocks of data arriving at Slot 3, 5, 9 and 11 (coincides with those slots at the transmission end) are stored. The data is subsequently decrypted, during Slot 13 and Slot 14, using the extracted key A and key B (by mapping the key numbers acpanying the encrypted data to the same 16 predetermined unique key table). At Slot 15, the resulting two decrypted 16bit binary data are then pared and only when they are identical that the data be released to the designated 16bit buffer for subsequent transfer to the taximeter in the next cycle. However, if the data matching is denied, logic “0” will be set for the entire buffer to freeze the fare. At the end of Slot 15, the interrupt is disabled until the synchronising signal from the transmitter is detected and the whole receiving cycle repeats.4. SYNCHRONISATIONDue to the inevitable small discrepancy between the clock time base at the two. ends, the smart sensor system necessitates a periodic synchronisation to prevent missing of the transmitted data. As explained in the last section, this is achieved by enabling the transmitter to send an agreed data pattern to initiate the receiving operation in the receiver for every operating cycle. In the system, the pattern of the synchronising data is 10bit long and its slot frame is similar to that in . For each plete transmission operation, a different set of the synchronising data is assured for the sake of security and this is achieved by generating the data from the resulting 2x16bit encrypted data at every operating cycle, using a single predetermined algorithm assigned to both ends. It is important to note that, for the receiver to start its operation, the detected synchronising signal from the transmitter must agree with that generated locally from the received encrypted data (during Slot 12). If this is failed by any means, the receiver will enable the line control () thereby shorting to ground the whole transmission cable and hence the line status input at the transmitter Consequently, the controllers at both ends maintain their idle states for 4ms (one plete operating cycle).After the interval, the synchronisation process (at Slot 15 in Fig. 2 and Fig. 4) is repeated until the corrected data is detected and the main operating cycle resumes.5. EXPERIMENTAL RESULTS OF THE SYSTEM PROTOTYPEThe described smart taximeter sensor has been implemented and tested to demonstrate the practical utilisation of such system for taxis operating within Bangkok metropolitan area. The realtime intelligent sensor system has been implemented using a pair of small and inexpensive microcontrollers, PIC1 6F84 [7], from the microchip pany. They are clocked at 8MHz for both the encryption and decryption ends with a few external ponents. The controller for encryption is attached on to the existing unskilled sensor where the decryption controller is ,simply installed right inside the taximeter to maintain minimum modification to the entire system. Fig 6(a). shows the measured waveforms for a plete operating cycle of the system. Note that the cycle occupies a time period of 4ms. Without the indicated vertical traces, it is virtually impossible to identify the starting and ending of one transmission cycle and this provides system robustness to possible codebreaking attack With no interference introduced into the transmission cable, the tested random data at both ends exactly matches to each other, as illustrated in Fig. 6(b). Also notice from the figure that there exists a latency of 8ms in the data transmission but this is not an issue since the fare processing relies on the number of ining pulses over a certain time interval. Moreover, the latency in the pulse reconstruction and hence in the fare calculation is only a fraction of a second, thus making it