TW201509166A - Data transmission system and method - Google Patents

Data transmission system and method Download PDF

Info

Publication number
TW201509166A
TW201509166A TW102129865A TW102129865A TW201509166A TW 201509166 A TW201509166 A TW 201509166A TW 102129865 A TW102129865 A TW 102129865A TW 102129865 A TW102129865 A TW 102129865A TW 201509166 A TW201509166 A TW 201509166A
Authority
TW
Taiwan
Prior art keywords
data
bits
transmission
sequence frame
byte
Prior art date
Application number
TW102129865A
Other languages
Chinese (zh)
Other versions
TWI504215B (en
Inventor
Ya-Leei Chien
Yu-Shen Lee
Yu-Kai Lin
Original Assignee
Tatung Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tatung Co filed Critical Tatung Co
Priority to TW102129865A priority Critical patent/TWI504215B/en
Priority to CN201310503986.XA priority patent/CN104426634A/en
Publication of TW201509166A publication Critical patent/TW201509166A/en
Application granted granted Critical
Publication of TWI504215B publication Critical patent/TWI504215B/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0001Systems modifying transmission characteristics according to link quality, e.g. power backoff
    • H04L1/0002Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate

Abstract

A data transmission system and a data transmission method are provided. The data transmission system includes a master device and a slave device. The master device includes a first communication unit used for transmitting a serial frame. The slave device includes a second communication unit and a micro processor. The second communication unit is used for receiving the serial frame, and the micro processor encodes digital data into a response serial frame according to the serial frame. The micro processor transmits the response serial frame having at least one single data string to the master device. The micro processor separates the single data string into at least one low-bit string and at least one high-bit string and encodes the low-bit string and the high-bit string into the response serial frame, when the bit number of the single data string is greater than a single transmission data string bit number.

Description

資料傳輸系統及方法 Data transmission system and method

本發明是有關於一種資料傳輸系統與方法,且特別是有關於一種關於編碼傳輸資料的資料傳輸系統與方法。 The present invention relates to a data transmission system and method, and more particularly to a data transmission system and method for encoding transmission data.

隨著資訊及通信技術的蓬勃發展,以及各類電子裝置的開發與其所配備的各種功能的進步,人們生活上與電子裝置越來越密不可分。常用的電子裝置通常都配備有通訊單元,以供電子裝置透過此通訊單元與其它電子裝置進行訊息溝通或是資料傳遞。像是電子裝置可以透過無線通訊技術來傳遞資料,也可以透過無線通訊技術來進行訊息的溝通。於是,由於資訊相關產業的高度發展,以及人們對資訊產品運算以及傳輸速率的要求日益增加,使得業者不斷致力於各種傳輸介面規格以及多種訊號編碼的開發。 With the rapid development of information and communication technology, as well as the development of various electronic devices and the various functions they are equipped with, people's lives are increasingly inseparable from electronic devices. The commonly used electronic devices are usually equipped with a communication unit for the electronic device to communicate with other electronic devices through the communication unit or to transmit data. For example, an electronic device can transmit data through wireless communication technology, and can also communicate information through wireless communication technology. As a result, due to the high development of information-related industries and the increasing demand for information product computing and transmission rates, the industry is constantly working on various transmission interface specifications and the development of various signal codes.

舉例來說,在將類比訊號轉為數位訊號的過程中,對於不同的類比數位轉換器而言,類比數位轉換器的單筆資料之位元數會因為型號或製造商的不同而有所差異。然而,傳輸用序列埠可傳送的單筆資料位元數不一定會和類比數位轉換器的單筆資料 之位元數相同。一般來說,若類比數位轉換器的單筆資料之位元數超過傳輸用序列埠可傳送的單筆資料位元數的話,則必須將類比數位轉換器的單筆資料切割為兩筆以上的單筆傳輸資料,使得傳資料傳送的次數會與之增加,相當的沒有彈性。因此,如何彈性地編碼傳輸資料,以達到增加傳輸效率的目的,實為本領域技術人員所關心的議題。 For example, in the process of converting an analog signal into a digital signal, the number of bits of a single data of an analog digital converter may vary depending on the model or manufacturer for different analog digital converters. . However, the number of single data bits that can be transmitted by the transmission sequence does not necessarily match the single data of the analog converter. The number of bits is the same. In general, if the number of bits of a single data of an analog digital converter exceeds the number of single data bits that can be transmitted by the transmission sequence, the single data of the analog digital converter must be cut into two or more pieces. The single transmission of data will increase the number of transmissions of data, which is quite inelastic. Therefore, how to flexibly encode the transmission data to achieve the purpose of increasing transmission efficiency is an issue of concern to those skilled in the art.

有鑑於此,本發明提供一種資料傳輸系統與方法,受控端藉由主控端所傳送的序列框來編碼傳輸資料,可進一步提升資料傳輸的速率。 In view of this, the present invention provides a data transmission system and method. The controlled end encodes the transmission data by using a sequence frame transmitted by the main control terminal, which can further improve the data transmission rate.

本發明的提出一種資料傳輸系統,此資料傳輸系統包括主控端與受控端。主控端包括第一通訊單元,用以傳送序列框。受控端包括第二通訊單元以及微處理器。第二通訊單元用以接收序列框,而微處理器依據序列框編碼數位資料為回應序列框。微處理器利用第二通訊單元傳送具有至少一單筆傳輸資料的回應序列框至主控端,其中數位資料由至少一單筆資料所組成。當單筆資料的位元數大於單筆傳輸資料位元數時,微處理器依據單筆傳輸資料位元數切割單筆資料為至少一低位元組與至少一高位元組,且微處理器編碼高位元組與低位元組為回應序列框。 The invention provides a data transmission system, which comprises a main control end and a controlled end. The main control terminal includes a first communication unit for transmitting a sequence frame. The controlled terminal includes a second communication unit and a microprocessor. The second communication unit is configured to receive the sequence frame, and the microprocessor encodes the digital data according to the sequence frame as a response sequence frame. The microprocessor uses the second communication unit to transmit a response sequence frame having at least one single transmission data to the main control terminal, wherein the digital data is composed of at least one single data. When the number of bits of the single data is greater than the number of bits of the single transmission data, the microprocessor cuts the single data into at least one low byte and at least one high byte according to the number of single transmission data bits, and the microprocessor The high byte and the low byte are encoded as a response sequence box.

在本發明之一實施例中,上述的資料傳輸系統,其中微處理器依據單筆傳輸資料位元數合併高位元組為至少一單筆傳輸 資料其中之一,並將低位元組作為至少一單筆傳輸資料其中之一。低位元組的位元數為該單筆傳輸資料位元數,高位元組的位元數為單筆資料的位元數與單筆傳輸資料位元數的差值。 In an embodiment of the present invention, the data transmission system, wherein the microprocessor combines the high-order tuples into at least one single transmission according to the number of single transmission data bits. One of the materials, and the low byte is one of at least one single transmission. The number of bits of the low byte is the number of bits of the single transmitted data, and the number of bits of the high byte is the difference between the number of bits of the single data and the number of bits of the single transmitted data.

在本發明之一實施例中,上述的資料傳輸系統,其中當單筆資料的位元數小於單筆傳輸資料位元數時,微處理器更包括直接編碼單筆資料成回應序列框。 In an embodiment of the present invention, the data transmission system, wherein when the number of bits of the single data is less than the number of single data transmission bits, the microprocessor further comprises directly encoding the single data into a response sequence frame.

在本發明之一實施例中,上述的資料傳輸系統,其中微處理器更包括類比數位轉換器,類比數位轉換器將類比資料轉換為由單筆資料組成的數位資料,其中類比數位轉換器的輸出序列埠的輸出位元數為單筆資料的位元數。 In an embodiment of the present invention, the data transmission system, wherein the microprocessor further comprises an analog digital converter, and the analog digital converter converts the analog data into digital data composed of a single data, wherein the analog digital converter The number of output bits of the output sequence 为 is the number of bits of a single data.

在本發明之一實施例中,上述的資料傳輸系統,其中主控端判斷回應序列框是否正確。若主控端判斷回應序列框正確,主控端利用第一通訊單元傳送結束訊息至受控端,以控制受控端停止傳送回應序列框。 In an embodiment of the present invention, the data transmission system, wherein the main control terminal determines whether the response sequence frame is correct. If the main control terminal determines that the response sequence frame is correct, the main control terminal transmits the end message to the controlled terminal by using the first communication unit to control the controlled terminal to stop transmitting the response sequence frame.

在本發明之一實施例中,上述的資料傳輸系統,其中序列框包括位址欄位、功能碼欄位、單筆資料位元數欄位、總資料量數值欄位以及錯誤檢查碼欄位。 In an embodiment of the present invention, the data transmission system includes a sequence frame, a function code field, a single data bit field, a total data amount value field, and an error check code field. .

從另一觀點來看,本發明提出一種資料傳輸方法,適用於具有主控端與受控端的資料傳輸系統。此資料傳輸方法包括下列步驟。首先,由主控端傳送序列框。之後,由受控端判斷數位資料的至少一單筆資料的位元數是否大於單筆傳輸資料位元數。當單筆資料的位元數大於單筆傳輸資料位元數時,由受控端依據 單筆傳輸資料位元數切割單筆資料為至少一低位元組與至少一高位元組,並編碼高位元組與低位元組的為回應序列框。接著,由受控端傳送具有至少一單筆傳輸資料的回應序列至主控端。 From another point of view, the present invention provides a data transmission method suitable for a data transmission system having a master terminal and a controlled terminal. This data transfer method includes the following steps. First, the sequence box is transmitted by the master. Then, the controlled end judges whether the number of bits of at least one single data of the digital data is greater than the number of single transmission data bits. When the number of bits in a single data is greater than the number of bits in a single transmission, the controlled end is based on The single transmission data bit number cuts the single data into at least one low byte and at least one high byte, and encodes the high byte and the low byte as a response sequence frame. Then, the response sequence with at least one single transmission data is transmitted from the controlled terminal to the main control terminal.

在本發明之一實施例中,上述的資料傳輸方法,其中由受控端依據單筆傳輸資料位元數切割單筆資料為至少一低位元組與至少一高位元組,並編碼高位元組與該低位元組的為回應序列框的步驟包括:依據單筆傳輸資料位元數合併高位元組為單筆傳輸資料其中之一,並將低位元組作為單筆傳輸資料其中之一,其中低位元組的位元數為單筆傳輸資料位元數,高位元組的位元數為單筆資料的位元數單筆傳輸資料位元數的差值。 In an embodiment of the present invention, the data transmission method, wherein the controlled end cuts the single data into at least one low byte and at least one high byte according to the number of single transmitted data bits, and encodes the high byte. The step of responding to the sequence box with the lower byte includes: combining the high byte into one of the single transmission data according to the number of single transmission data bits, and using the low byte as one of the single transmission data, wherein The number of bits in the low byte is the number of bits in a single transmission data, and the number of bits in the high byte is the difference between the number of bits in a single data and the number of bits in a single transmission.

在本發明之一實施例中,上述的資料傳輸方法,在由受控端判斷數位資料的單筆資料的位元數是否大於單筆傳輸資料位元數之後,更包括:當單筆資料的位元數小於單筆傳輸資料位元數時,由受控端直接編碼單筆資料成回應序列框。 In an embodiment of the present invention, the data transmission method, after determining whether the number of bits of the single data of the digital data is greater than the number of single transmission data bits by the controlled terminal, further includes: when the single data is When the number of bits is smaller than the number of bits in a single transmission data, the single data is directly encoded by the controlled terminal into a response sequence frame.

在本發明之一實施例中,上述的資料傳輸方法,在由受控端判斷數位資料的單筆資料的位元數是否大於單筆傳輸資料位元數之前,更包括:由受控端的類比數位轉換器將類比資料轉換為由單筆資料組成的數位資料,其中類比數位轉換器的輸出序列埠的輸出位元數為單筆資料的位元數。 In an embodiment of the present invention, the data transmission method includes: before the number of bits of the single data of the digital data is determined by the controlled end, whether the number of bits of the single data is greater than the number of the single transmitted data bits, and the analogy of the controlled end The digital converter converts the analog data into digital data composed of a single data, wherein the output bit number of the output sequence of the analog digital converter is the number of bits of a single data.

在本發明之一實施例中,上述的資料傳輸方法,更包括:由主控端判斷回應序列框是否正確,若主控端判斷回應序列框正確,由主控端傳送結束訊息至受控端,以控制受控端停止傳送回 應序列框。 In an embodiment of the present invention, the data transmission method further includes: determining, by the main control terminal, whether the response sequence frame is correct, and if the main control terminal determines that the response sequence frame is correct, the host end transmits the end message to the controlled end. To control the controlled end to stop transmitting back Should be in the sequence box.

基於上述,在本發明所提供之資料傳輸系統與方法中,藉由主控端發出序列框,再由受控端透過序列框中的相關訊息來編碼待傳送的數位資料為一個回應序列框,並將帶有數位資料的回應序列框回傳至受控端。其中,若單筆資料的位元數大於單筆傳輸資料位元數,受控端會將單筆資料切割為高位元組與低位元組,並在合併這些高位元組之後,將合併後的高位元組併入至回應序列框中。如此一來,可節省一個回應序列框中的位元組數目,進而提高資料傳輸的效率。 Based on the above, in the data transmission system and method provided by the present invention, the sequence frame is sent by the control terminal, and the digital data to be transmitted is encoded by the controlled terminal through the related information in the sequence frame as a response sequence frame. The response sequence box with digital data is passed back to the controlled end. Wherein, if the number of bits of the single data is greater than the number of bits of the single transmission data, the controlled end cuts the single data into a high byte and a low byte, and after combining the high bytes, the merged The high byte is incorporated into the response sequence box. In this way, the number of bytes in the response sequence frame can be saved, thereby improving the efficiency of data transmission.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.

10、30、50‧‧‧資料傳輸系統 10, 30, 50‧‧‧ data transmission system

100、300、500‧‧‧主控端 100, 300, 500‧‧‧ master

101、301‧‧‧通訊單元 101, 301‧‧‧ communication unit

110、310、510‧‧‧受控端 110, 310, 510‧‧‧ controlled end

111、311‧‧‧通訊單元 111, 311‧‧‧ communication unit

112、312、511‧‧‧微處理器 112, 312, 511‧‧‧ microprocessor

313‧‧‧類比數位轉換器 313‧‧‧ Analog Digital Converter

512‧‧‧藍牙模組 512‧‧‧Bluetooth Module

520‧‧‧生理資訊 520‧‧‧ Physiological information

A‧‧‧序列框 A‧‧‧ sequence box

D‧‧‧回應序列框 D‧‧‧Response sequence box

S210~S240、S410~S470‧‧‧資料傳輸方法的步驟 S210~S240, S410~S470‧‧‧ steps of data transmission method

圖1是依照本發明一實施例所繪示的資料傳輸系統的方塊圖。 FIG. 1 is a block diagram of a data transmission system according to an embodiment of the invention.

圖2是依照本發明一實施例所繪示的資料傳輸方法的流程圖。 2 is a flow chart of a data transmission method according to an embodiment of the invention.

圖3是依照本發明另一實施例所繪示的資料傳輸系統的方塊圖。 FIG. 3 is a block diagram of a data transmission system according to another embodiment of the present invention.

圖4是依照本發明另一實施例所繪示的資料傳輸方法的流程圖。 FIG. 4 is a flowchart of a data transmission method according to another embodiment of the present invention.

圖5是依照本發明又一實施例所繪示之一種應用情境的簡單示意圖。 FIG. 5 is a simplified schematic diagram of an application scenario according to another embodiment of the invention.

一般來說,在主從式的通訊傳輸協定中,主控端會發出帶有動作指令的訊號至受控端,以控制受控端據以執行相對應的功能。本發明及依此特性,在主控端傳送要求資料的序列框至受控端時,藉由特定的序列框格式來告知受控端單筆傳送資料的最大位元數,使得受控端可以據以將傳輸資料切割並重新合併,達到提升傳輸效率的目的。為了使本發明之內容更為明瞭,以下列舉實施例作為本發明確實能夠據以實施的範例。 Generally speaking, in the master-slave communication protocol, the master sends a signal with an action command to the controlled terminal to control the controlled terminal to perform the corresponding function. According to the present invention, when the main control terminal transmits the sequence frame of the required data to the controlled terminal, the specific sequence frame format is used to inform the controlled terminal of the maximum number of bits of the single data, so that the controlled terminal can According to the purpose of cutting and recombining the transmission data, the purpose of improving transmission efficiency is achieved. In order to clarify the content of the present invention, the following examples are given as examples in which the present invention can be implemented.

圖1是依照本發明一實施例所繪示之資料傳輸系統的方塊圖。請參照圖1,資料傳輸系統10包括主控端100以及受控端110其功能分述如下: 1 is a block diagram of a data transmission system in accordance with an embodiment of the invention. Referring to FIG. 1, the data transmission system 10 includes a host 100 and a controlled terminal 110. The functions are as follows:

主控端100包括通訊單元101,用以傳送序列框A。主控端100可為個人數位助理(Personal Digital Assistant,PDA)、智慧型手機、平板電腦、筆記型電腦、超輕薄型筆電(Ultrabook)或桌上型電腦等支援主從式通訊技術的電子裝置,但不限於上述。概括來說,主控端100是主從式通訊架構中的主裝置(Master)。一般來說,主控端100可對其從屬裝置(Slave)發出指令,以命令受控端110回傳其要求的資訊。 The main control terminal 100 includes a communication unit 101 for transmitting the sequence frame A. The main control terminal 100 can be a personal digital assistant (PDA), a smart phone, a tablet computer, a notebook computer, an ultra-thin notebook (Ultrabook) or a desktop computer and the like to support the master-slave communication technology. The device is, but not limited to, the above. In summary, the master 100 is the master in the master-slave communication architecture. In general, the master 100 can issue commands to its slaves to command the controlled terminal 110 to return the information it requires.

另一方面,受控端110包括通訊單元111以及微處理器 112。通訊單元111用以接收序列框A,而微處理器112依據序列框A編碼數位資料為回應序列框D,並利用通訊單元111傳送回應序列框D至主控端100。其中,受控端110可以是與主控端100相同的電子裝置,也可以是與主控端100相異的電子裝置。詳細來說,受控端110是主從式通訊架構中的從屬裝置,只能在主控端100允許時和主控端100進行通訊。 On the other hand, the controlled terminal 110 includes a communication unit 111 and a microprocessor. 112. The communication unit 111 is configured to receive the sequence block A, and the microprocessor 112 encodes the digital data according to the sequence block A as the response sequence block D, and transmits the response sequence block D to the main control terminal 100 by using the communication unit 111. The controlled end 110 may be the same electronic device as the main control terminal 100, or may be an electronic device different from the main control terminal 100. In detail, the controlled terminal 110 is a slave device in the master-slave communication architecture and can only communicate with the master terminal 100 when the master terminal 100 allows.

微處理器112例如是中央處理單元(Central Processing Unit,CPU),或是其他可程式化之微處理器(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)或其他具備運算能力的硬體裝置。 The microprocessor 112 is, for example, a central processing unit (CPU), or other programmable microprocessor (Microprocessor), a digital signal processor (DSP), a programmable controller, and a special processor. Application Specific Integrated Circuits (ASICs), Programmable Logic Devices (PLDs), or other hardware devices with computing power.

在本實施例中,通訊單元101與通訊單元111用以建立無線通訊連線,使得主控端100可經由無線連接至受控端110。其中,無線連線例如是基於IEEE 802.15標準來建立連線,或是基於IEEE 802.11標準來建立連線,但不限於上述。舉例來說,通訊單元101與通訊單元111可為支援無線個人網路連線的藍芽(Bluetooth)無線通訊技術的元件,也可以是支援無線區域網路連線的無線相容認證(Wireless Fidelity,Wi-Fi)通訊技術的元件,本發明對此不限制。 In this embodiment, the communication unit 101 and the communication unit 111 are used to establish a wireless communication connection, so that the host terminal 100 can be connected to the controlled terminal 110 via wireless. The wireless connection is, for example, based on the IEEE 802.15 standard to establish a connection, or based on the IEEE 802.11 standard to establish a connection, but is not limited to the above. For example, the communication unit 101 and the communication unit 111 may be components of a Bluetooth wireless communication technology supporting a wireless personal network connection, or may be a wireless compatible authentication (Wireless Fidelity) supporting a wireless local area network connection. The components of the Wi-Fi communication technology are not limited by the present invention.

換言之,在本實施例中,受控端110支援與主控端100相同的無線通訊技術之電子裝置。舉例來說,若主控端100支援 藍芽(Bluetooth)無線通訊技術,則受控端110可為支援藍芽無線通訊技術的個人數位助理、PDA手機、智慧型手機、觸控式手機、平板電腦、筆記型電腦或超輕薄型筆電(Ultrabook)等。受控端110亦可為藍芽耳機、藍芽滑鼠、藍芽鍵盤等週邊配件。 In other words, in the present embodiment, the controlled terminal 110 supports the same wireless communication technology electronic device as the host 100. For example, if the host 100 supports Bluetooth wireless communication technology, the controlled terminal 110 can be a personal digital assistant supporting Bluetooth wireless communication technology, a PDA mobile phone, a smart phone, a touch mobile phone, a tablet computer, a notebook computer or an ultra-thin pen Electric (Ultrabook) and so on. The controlled end 110 can also be a peripheral accessory such as a Bluetooth headset, a Bluetooth mouse, or a Bluetooth keyboard.

需特別說明的是,本實施例之數位資料由至少一單筆資料所組成。當單筆資料的位元數大於序列框A所定義之單筆傳輸資料位元數時,微處理器112依據單筆傳輸資料位元數切割單筆資料為低位元組與高位元組,且微處理器112編碼高位元組與低位元組為回應序列框D。舉例來說,當單筆資料位元數為12位元且序列框A所定義之單筆傳輸資料位元數為8位元時,微處理器112可以將12位元的單筆資料切割為8位元的低位元組與4位元的高位元組。接著,微處理器112會將8位元的低位元組與4位元的高位元組重新編碼成回應序列框D。 It should be particularly noted that the digital data of the embodiment consists of at least one single piece of data. When the number of bits of the single data is greater than the number of single transmission data bits defined by the sequence frame A, the microprocessor 112 cuts the single data into a low byte and a high byte according to the number of single data transmission bits, and The microprocessor 112 encodes the high byte and the low byte as the response sequence block D. For example, when the number of single data bits is 12 bits and the number of single transmission data bits defined by the sequence box A is 8 bits, the microprocessor 112 can cut the 12-bit single data into A low byte of 8 bits and a high byte of 4 bits. Next, the microprocessor 112 recodes the low byte of the 8-bit and the high byte of the 4-bit into the response sequence block D.

為了進一步詳細說明受控端110如何根據序列框A來編碼產生回應序列框D,以下特舉另一實施例來對本發明進行說明。圖2為依照本發明一實施例繪示的資料傳輸方法的流程圖。本實施例的方法適用於圖1的資料傳輸系統10,以下即搭配圖1中的各構件說明本實施例方法的詳細步驟,請參照圖1與圖2。 To further detail how the controlled terminal 110 encodes the response sequence block D according to the sequence block A, another embodiment will be described below to illustrate the present invention. 2 is a flow chart of a data transmission method according to an embodiment of the invention. The method of this embodiment is applicable to the data transmission system 10 of FIG. 1. Hereinafter, the detailed steps of the method of this embodiment will be described with reference to the components in FIG. 1, please refer to FIG. 1 and FIG.

首先如步驟S210所示,主控端100傳送序列框A。需特別說明的是,本實施例之序列框A可包括位址欄位、功能碼欄位、單筆傳輸資料位元數欄位、總共傳輸資料筆數欄位以及錯誤檢查碼欄位,但本發明並不現於上述。舉例來說,在部分其他實施例 當中,序列框A可以不具有錯誤檢查碼欄位。在本實施例中,序列框A如表1所示,序列框A包括了上述五種欄位。但表1僅為一種示範性實施方式,本發明並不限制於此。 First, as shown in step S210, the master 100 transmits the sequence frame A. It should be noted that the sequence frame A of this embodiment may include a address field, a function code field, a single transmission data bit field, a total transmission data field, and an error check code field, but The present invention is not intended to be described above. For example, in some other embodiments Among them, the sequence box A may not have an error check code field. In the present embodiment, the sequence box A is as shown in Table 1, and the sequence box A includes the above five fields. However, Table 1 is merely an exemplary embodiment, and the present invention is not limited thereto.

請參照表1,位址欄位的內容為受控端位址,位元大小為8位元。受控端位址可以是受控端裝置的裝置編號,其代表了接收指令的裝置。因此,受控端110只會對位址欄位內為其裝置編號的序列框A所有反應。基此,由於不同的受控端具有不同的受控端位址,因此主控端100就可以藉由不同的受控端位址來控制各個不同的受控端。功能碼欄位的內容為動作指令,用以讓主控端100對受控端110下達動作指令,以控制受控端110執行相對應的動作,像是在主控端100傳送了要求發送資料的動作指令之後,受控端110會讀取動作指令並發送資料至主控端100。 Please refer to Table 1. The content of the address field is the controlled end address, and the bit size is 8 bits. The controlled end address may be the device number of the controlled end device, which represents the device that receives the command. Therefore, the controlled terminal 110 will only react to all of the sequence blocks A in the address field whose device number is assigned. Therefore, since different controlled terminals have different controlled end addresses, the master 100 can control different controlled terminals by different controlled end addresses. The content of the function code field is an action instruction for the master terminal 100 to issue an action command to the controlled terminal 110 to control the controlled terminal 110 to perform a corresponding action, such as transmitting the request to send data at the master terminal 100. After the action instruction, the controlled terminal 110 reads the action instruction and sends the data to the host 100.

再者,單筆資料位元數欄位的內容為單筆資料的位元數B,代表了硬體端抓取一次的位元數目,例如是數位類比轉換器輸入埠的位元數或類比數位轉換器的輸出埠的位元數。而總共傳輸資料筆數欄位的內容為總共傳輸資料筆數N,其中B與N皆為大於0的整數。由此可知,總共傳輸資料量會是單筆資料的位元數B與總共傳輸資料筆數N的乘積。錯誤檢查碼欄位的內容為錯誤檢 查碼,通常附加於資料的最後端,可用以確保資料的正確性。 Furthermore, the content of the single data bit field is the number of bits B of the single data, which represents the number of bits that are grabbed once by the hardware end, for example, the number of bits or analog of the input of the digital analog converter. The number of bits in the output of the digital converter. The content of the total number of transmitted data fields is the total number of transmitted data N, where B and N are integers greater than zero. It can be seen that the total amount of transmitted data will be the product of the number of bits B of a single data and the number N of total transmitted data. The content of the error check code field is error detection. Check code, usually attached to the end of the data, can be used to ensure the correctness of the data.

在受控端110藉由通訊單元111接收到序列框A之後,如步驟S220所示,受控端110判斷待傳送的數位資料的至少一單筆資料的位元數是否大於單筆傳輸資料位元數。單筆傳輸資料位元數例如取決於序列埠(serial port)的資料長度,序列埠的規格標準例如是較常見的RS-232、RS-485或RS-422等,在此也不設限。當單筆資料的位元數大於單筆傳輸資料位元數時,如步驟S230所示,由受控端110依據單筆傳輸資料位元數切割單筆資料為至少一低位元組與至少一高位元組,並編碼高位元組與低位元組為回應序列框D。在本實施例中,低位元組的位元數為單筆傳輸資料位元數,高位元組的位元數為單筆資料的位元數與單筆傳輸資料位元數的差值。 After the control unit 110 receives the sequence frame A by the communication unit 111, as shown in step S220, the controlled terminal 110 determines whether the number of bits of at least one single data of the digital data to be transmitted is greater than the single transmission data bit. Yuan. The number of single transmission data bits depends, for example, on the data length of the serial port. The standard specifications of the serial port are, for example, the more common RS-232, RS-485 or RS-422, and are not limited herein. When the number of bits of the single data is greater than the number of bits of the single data transmission, as shown in step S230, the controlled terminal 110 cuts the single data into at least one low byte and at least one according to the number of single data transmission bits. High-order tuples, and encode high-order tuples and low-order tuples in response to sequence box D. In this embodiment, the number of bits of the low byte is the number of single data transmission bits, and the number of bits of the high byte is the difference between the number of bits of the single data and the number of single transmitted data bits.

為了更詳細的說明微處理器112編碼高位元組與低位元組為回應序列框D的實施方式,以下列舉之表2為回應序列框D的一實施方式。在本實施例中,回應序列框D除了包括與序列框A相同的五種欄位之外,更包括至少一單筆傳輸資料,需特別說明的是,於表2所示之實施方式中單筆傳輸資料的資料長度為單筆傳輸資料位元數,且單筆傳輸資料位元數為8位元。但表2僅為一種示範性實施方式,本發明並不限制於此。請參照表2,表2所示的回應序列框D包括與序列框A相同的五種欄位,分別為位址欄位、功能碼欄位、單筆傳輸資料位元數欄位、總共傳輸資料筆數欄位以及錯誤檢查碼欄位。 To illustrate in more detail an embodiment in which the microprocessor 112 encodes the high byte and the low byte as the response sequence block D, Table 2 listed below is an embodiment of the response sequence block D. In this embodiment, the response sequence box D includes at least one single transmission data in addition to the five fields which are the same as the sequence box A. Specifically, in the embodiment shown in Table 2, The data length of the pen transmission data is the number of single transmission data bits, and the number of single transmission data bits is 8 bits. However, Table 2 is merely an exemplary embodiment, and the present invention is not limited thereto. Referring to Table 2, the response sequence box D shown in Table 2 includes the same five fields as the sequence box A, which are the address field, the function code field, the single transmission data bit field, and the total transmission. Data field and error check code field.

此外,受控端110更編碼待傳送的數位資料成為至少一筆的單筆傳輸資料。如表2所示,微處理器112將低位元組作為單筆傳輸資料其中之一,也就是說,各個單筆資料的低位元組即為回應序列框D中8位元的單筆傳輸資料。另一方面,微處理器112依據8位元的單筆傳輸資料位元數合併高位元組為單筆傳輸資料其中之一。舉例來說,假設單筆資料的位元數B為10位元,而由於單筆傳輸資料位元數為8位元。於是,微處理器112將會把10位元的單筆資料切割成8位元的低位元組與2位元的高位元組。此外,由於單筆傳輸資料位元數為8位元,因此微處理器112會合併4個2位元的高位元組成為8位元的單筆傳輸資料其中之一。 In addition, the controlled terminal 110 further encodes the digital data to be transmitted into at least one single transmission data. As shown in Table 2, the microprocessor 112 uses the low byte as one of the single transmission data, that is, the lower byte of each single data is the single transmission data of the 8-bit response in the sequence frame D. . On the other hand, the microprocessor 112 combines the high-order tuple into one of the single-transmission data according to the 8-bit single-transmission data bit number. For example, suppose the bit number B of a single piece of data is 10 bits, and since the number of bits of a single transmission data is 8 bits. Thus, the microprocessor 112 will cut the 10-bit single data into an 8-bit low byte and a 2-bit high byte. In addition, since the number of single transmission data bits is 8 bits, the microprocessor 112 combines four high-order bits of two bits to form one of the 8-bit single-transmission data.

如表2所示,微處理器112會將所有單筆資料低位元組編碼於回應序列框D的前端,再將合併後高位元組排列於回應序列框D的後端。需特別說明的是,雖然表2說明了所有高位元組將位於低位元組之後。但本發明並不限制將所有高位元組排列於 低位元組之後,也可以將高位元組穿插於低位元組之間,以增加本發明之編碼方法的彈性。最後,如步驟S240所示,受控端110傳送具有至少一單筆傳輸資料的回應序列框D至主控端100。如此一來,主控端100就可以藉由序列框A所含的內容,從受控端110取得其要求的資料,並且透過上述的編碼方式而減少單筆傳輸資料的傳送次數。 As shown in Table 2, the microprocessor 112 encodes all the single data low bits in the front end of the response sequence frame D, and arranges the combined high byte in the back end of the response sequence frame D. It should be noted that although Table 2 shows that all high-order bytes will be located after the low-order byte. However, the present invention is not limited to arranging all high-order tuples in After the low byte, the high byte can also be interspersed between the low bytes to increase the flexibility of the encoding method of the present invention. Finally, as shown in step S240, the controlled terminal 110 transmits a response sequence block D having at least one single transmission data to the master terminal 100. In this way, the host 100 can obtain the required data from the controlled terminal 110 by using the content contained in the sequence frame A, and reduce the number of times the single transmission data is transmitted through the above coding method.

值得一提的是,本發明的實現方式不限於上述說明,可以對於實際的需求而酌予變更上述實施例的內容。例如,當單筆資料的位元數小於單筆傳輸資料位元數時,受控端將不需要切割單筆資料。以下則舉本發明之另一實施例來詳細描述資料傳輸方法的步驟。 It is to be noted that the implementation of the present invention is not limited to the above description, and the contents of the above embodiments may be changed as appropriate for actual needs. For example, when the number of bits in a single piece of data is less than the number of bits in a single transmission, the controlled end will not need to cut a single piece of data. Hereinafter, another embodiment of the present invention will be described in detail to describe the steps of the data transmission method.

圖3是依照本發明另一實施例所繪示之資料傳輸系統的方塊圖。資料傳輸系統30包括主控端300與受控端310,且主控端300包括通訊單元301,而受控端310包括通訊單元311與微處理器312。通訊單元301、通訊單元311與微處理器312與圖1所示之通訊單元101、通訊單元111與微處理器112相似,於此不再贅述。與圖1所示之實施例不同的是,本實施例之微處理器312更包括類比數位轉換器313,類比數位轉換器313用以將類比訊號轉換成數位訊號。詳細來說,於本實施例中,類比數位轉換器313的輸出序列埠的輸出位元數為單筆資料的位元數,且類比數位轉換器313將類比資料轉換為由單筆資料組成的數位資料。於是,受控端310將依照序列框A所提供格式內容來編碼類比數位轉換 器313輸出的數位資料,以進一步提供回應序列框D至主控端300。 3 is a block diagram of a data transmission system in accordance with another embodiment of the present invention. The data transmission system 30 includes a master terminal 300 and a controlled terminal 310, and the master terminal 300 includes a communication unit 301, and the controlled terminal 310 includes a communication unit 311 and a microprocessor 312. The communication unit 301, the communication unit 311 and the microprocessor 312 are similar to the communication unit 101, the communication unit 111 and the microprocessor 112 shown in FIG. 1, and will not be described again. Different from the embodiment shown in FIG. 1, the microprocessor 312 of this embodiment further includes an analog-to-digital converter 313 for converting the analog signal into a digital signal. In detail, in the present embodiment, the output bit number of the output sequence 埠 of the analog-to-digital converter 313 is the number of bits of the single data, and the analog digital converter 313 converts the analog data into a single data. Digital data. Thus, the controlled terminal 310 will encode the analog digital conversion according to the format content provided by the sequence block A. The digital data output by the device 313 is further provided with a response sequence block D to the master terminal 300.

圖4為依照本發明另一實施例繪示的資料傳輸方法的流程圖。本實施例的方法適用於圖3的資料傳輸系統30,以下即搭配圖3中的各構件說明本實施例方法的詳細步驟,請參照圖3與圖4。 FIG. 4 is a flowchart of a data transmission method according to another embodiment of the present invention. The method of this embodiment is applicable to the data transmission system 30 of FIG. 3. The detailed steps of the method of this embodiment will be described below with reference to the components in FIG. 3, please refer to FIG. 3 and FIG.

首先,於步驟S410中,主控端300利用通訊單元301傳送序列框A。在受控端310接收序列框A之後,於步驟S420中,受控端310解碼序列框A並確認正確性。詳細來說,受控端310會解碼序列框A以得知序列框A所攜帶的資訊,像是動作指令等。再者,為了避免資料傳輸錯誤,受控端310可藉由序列框A中的錯誤檢查碼來確定序列框A是否正確。舉例來說,若受控端310判斷序列框A發生錯誤的話,受控端310可忽略此發生錯誤的序列框A。其中,錯誤檢查機制例如是總和檢查(checksum)或奇偶檢查(parity check),本發明對此不限制。 First, in step S410, the master terminal 300 transmits the sequence frame A by using the communication unit 301. After the controlled terminal 310 receives the sequence block A, in step S420, the controlled terminal 310 decodes the sequence block A and confirms the correctness. In detail, the controlled terminal 310 decodes the sequence box A to know the information carried in the sequence frame A, such as an action instruction. Moreover, in order to avoid data transmission errors, the controlled terminal 310 can determine whether the sequence frame A is correct by the error check code in the sequence block A. For example, if the controlled terminal 310 determines that the sequence box A has an error, the controlled terminal 310 can ignore the sequence block A in which the error occurred. The error checking mechanism is, for example, a checksum or a parity check, which is not limited by the present invention.

接著,於步驟S430中,受控端310的微處理器312判斷數位資料的至少一單筆資料的位元數是否大於單筆傳輸資料位元數。若判斷為否,於步驟S450中,當單筆資料的位元數小於單筆傳輸資料位元數時,受控端310的微處理器312直接編碼單筆資料成回應序列框D。為了說明單筆資料的位元數小於單筆傳輸資料位元數的情況,以下列舉之表3為回應序列框D的一種實施方式。在本實施例中,表3所示之回應序列框D除了包括與序列框A相同的五種欄位之外,更包括至少一單筆傳輸資料。但表3僅 為一種示範性實施方式,本發明並不限制於此。請參照表3,表3所示的回應序列框D包括與序列框A相同的五種欄位,分別為位址欄位、功能碼欄位、單筆傳輸資料位元數欄位、總共傳輸資料筆數欄位以及錯誤檢查碼欄位。如表3所示,微處理器312直接將單筆資料作為單筆傳輸資料,且資料長度為B位元。 Next, in step S430, the microprocessor 312 of the controlled terminal 310 determines whether the number of bits of at least one single data of the digital data is greater than the number of single transmitted data bits. If the determination is no, in step S450, when the number of bits of the single data is less than the number of single transmission data bits, the microprocessor 312 of the controlled terminal 310 directly encodes the single data into the response sequence frame D. In order to explain the case where the number of bits of a single data is smaller than the number of bits of a single transmission data, Table 3 listed below is an embodiment of the response sequence block D. In this embodiment, the response sequence box D shown in Table 3 includes at least one single transmission material in addition to the five fields identical to the sequence box A. But Table 3 only For an exemplary embodiment, the invention is not limited thereto. Referring to Table 3, the response sequence box D shown in Table 3 includes the same five fields as the sequence box A, which are the address field, the function code field, the single transmission data bit field, and the total transmission. Data field and error check code field. As shown in Table 3, the microprocessor 312 directly transmits a single piece of data as a single piece of data, and the data length is B bits.

當單筆資料的位元數B大於單筆傳輸資料位元數時,接續步驟S440,受控端310的微處理器312依據單筆傳輸資料位元數切割單筆資料為至少一低位元組與至少一高位元組,並編碼高位元組與低位元組為回應序列框D。其中,微處理器312切割單筆資料並編碼高位元組與低位元組為回應序列框D的詳細內容如前述實施例所示,於此不再贅述。 When the number of bits B of the single data is greater than the number of bits of the single transmission data, proceeding to step S440, the microprocessor 312 of the controlled terminal 310 cuts the single data into at least one low byte according to the number of transmitted data bits. With at least one high byte, and encoding the high byte with the low byte as the response sequence box D. The detailed content of the microprocessor 312 cutting a single data and encoding the high byte and the low byte as the response sequence frame D is as shown in the foregoing embodiment, and details are not described herein again.

值得一提的是,假設總共傳輸的資料筆數N=7筆,且單筆資料的位元數B=10位元,即數位資料的總資料長度為7*10=70位元。一般來說,傳統的格式需分別傳送高位元組與低位元組,也就是14筆的單筆傳輸資料。因此總傳送次數需為14次才能將 數位資料透過通用非同步收發傳輸器(Universal Asynchronous Receiver/Transmitter,UART)完整傳送。若應用於型號為4520且內部振盪器的頻率為8MHz的微控制晶片上,其中一個指令需要花費4個指令週期。 It is worth mentioning that, assuming that the total number of data transmitted is N=7, and the number of bits of a single data is B=10 bits, that is, the total data length of the digital data is 7*10=70 bits. In general, the traditional format needs to transmit high-order and low-order tuples respectively, that is, 14 single-transmission data. Therefore, the total number of transfers must be 14 times. Digital data is transmitted completely through the Universal Asynchronous Receiver/Transmitter (UART). If applied to a micro-control chip model 4520 with an internal oscillator frequency of 8 MHz, one of the instructions takes 4 instruction cycles.

傳輸7筆單筆資料所需時間=14*4*(1/8M)=7(微秒) (1)另一方面,就本發明的資料傳輸系統與方法而言,受控端310會將高位元組的部份合併成單筆傳輸資料。也就是說,7筆單筆資料中2位元的高位元組會被合併成2筆單筆傳輸資料。因此,本發明之資料傳輸系統與方法只需要9次的總傳送次數,即9筆單筆傳輸資料,受控端310就可以將7筆10位元的單筆資料完整的傳送完畢,而總傳輸時間如式(2)所示。 Time required to transmit 7 single data = 14 * 4 * (1/8 M) = 7 (microseconds) (1) On the other hand, with respect to the data transmission system and method of the present invention, the controlled terminal 310 will The high-order tuples are combined into a single transmission. That is to say, the 2-bit high-order tuple in the 7-single-bit data will be merged into 2 single-transmission data. Therefore, the data transmission system and method of the present invention only requires 9 total transmission times, that is, 9 single transmission data, and the controlled terminal 310 can completely transfer 7 single 10-digit data, and the total is completed. The transmission time is as shown in equation (2).

傳輸7筆單筆資料所需時間=9*4*(1/8M)=4.5(微秒) (2)接著,式(3)可用來表示於上述應用情境當中,本發明相較於一般傳輸方法之傳送增加效率,式(3)如下所示。 Time required to transmit 7 single data = 9 * 4 * (1/8M) = 4.5 (microseconds) (2) Next, equation (3) can be used to represent the above application scenarios, the present invention is compared to the general transmission The transfer of the method increases the efficiency, and the formula (3) is as follows.

傳送增加效率=[(7-4.5)/7]*100%=35.7% (3) Transmission increase efficiency = [(7-4.5) / 7] * 100% = 35.7% (3)

由此可見,在單筆資料的位元數大於單筆傳輸資料位元數的情形下,透過本發明的資料傳輸方法,可明顯的提高資料傳輸效率。 It can be seen that in the case where the number of bits of a single data is larger than the number of bits of a single transmission data, the data transmission efficiency can be significantly improved by the data transmission method of the present invention.

於步驟S460中,受控端310的通訊單元311傳送具有至少一單筆傳輸資料的回應序列框D至主控端310。於步驟S470中,主控端310解碼回應序列框D,並同樣地確認資料正確性。之後,在主控端300確認資料正確性之後,主控端300傳送結束 訊息至受控端310。簡單來說,主控端300判斷回應序列框D是否正確,若主控端300判斷回應序列框D正確。主控端300利用通訊單元301傳送結束訊息至受控端310,以控制受控端310停止傳送回應序列框D。最後,於步驟S470中,受控端310接收結束訊息,停止傳送回應序列框D。 In step S460, the communication unit 311 of the controlled terminal 310 transmits a response sequence block D having at least one single transmission material to the main control terminal 310. In step S470, the master 310 decodes the response sequence block D and similarly confirms the correctness of the data. After that, after the master terminal 300 confirms the correctness of the data, the master terminal 300 transmits the end. The message is sent to the controlled terminal 310. Briefly, the master terminal 300 determines whether the response sequence frame D is correct, and if the master terminal 300 determines that the response sequence frame D is correct. The master terminal 300 transmits the end message to the controlled terminal 310 by using the communication unit 301 to control the controlled terminal 310 to stop transmitting the response sequence block D. Finally, in step S470, the controlled terminal 310 receives the end message and stops transmitting the response sequence block D.

圖5是依照本發明又一實施例所繪示之一種應用情境的簡單示意圖。如圖5所示,受控端510具有微處理器511以及藍牙模組512,也就是說主控端500也具有藍牙模組以和受控端進行通訊。再者,受控端510可具有用以感測人類生理資訊的感測裝置(未繪示),感測裝置可經由感測而取得生理資訊520,像是人體體溫、呼吸訊號或心跳等生理資訊。一旦主控端500傳送了要求回傳生理資訊的序列框A至受控端510之後,微處理器511會因為執行感測動作而取得生理資訊520,並將類比的生理資訊520轉換為數位資料。之後,微處理器511將依照序列框A所提供的格式內容,編碼數位資料為回應序列框D,並透過藍牙模組512回傳回應序列框D至主控端500。 FIG. 5 is a simplified schematic diagram of an application scenario according to another embodiment of the invention. As shown in FIG. 5, the controlled terminal 510 has a microprocessor 511 and a Bluetooth module 512, that is, the master terminal 500 also has a Bluetooth module to communicate with the controlled terminal. Furthermore, the controlled terminal 510 may have a sensing device (not shown) for sensing human physiological information, and the sensing device may obtain physiological information 520 through sensing, such as body temperature, respiratory signal or heartbeat. News. Once the master 500 transmits the sequence box A to the controlled terminal 510 requesting the return of the physiological information, the microprocessor 511 obtains the physiological information 520 by performing the sensing action, and converts the analog physiological information 520 into digital data. . Then, the microprocessor 511 will encode the digital data according to the format content provided in the sequence box A as the response sequence frame D, and transmit the response sequence block D to the main control terminal 500 through the Bluetooth module 512.

所述主控端500傳送序列框A的操作,以及受控端510編碼數位資料並回傳回應序列框D的動作,可以參照圖1至圖4的相關說明而類推之,故不再贅述。需特別說明的是,除了上述的應用情境,本發明之資料傳輸方法可應用至其他傳輸數位資料的應用情境,像是智慧型數位電錶與電力公司的主機之間的資料傳輸,或是電腦主機與週邊裝置的資料傳輸。 The operation of the sequence block A is transmitted by the master terminal 500, and the action of the control terminal 510 for encoding the digital data and returning the response sequence frame D can be analogized with reference to the related descriptions of FIG. 1 to FIG. 4, and therefore will not be described again. It should be particularly noted that, in addition to the above application scenarios, the data transmission method of the present invention can be applied to other application scenarios for transmitting digital data, such as data transmission between a smart digital electricity meter and a host of a power company, or a computer host. Data transfer with peripheral devices.

綜上所述,本發明之資料傳輸系統與方法藉由重新編碼排列切割後的單筆資料,可節省傳輸資料的傳輸次數,進一步提高資料的傳輸效率。此外,對於不同的類比數位轉換器的解析度而言,可設定不同的資料編碼壓縮參數。如此一來,可彈性的利用這些資料編碼壓縮參數來進行待傳送的資料的壓縮,據此節省受控端回傳回應序列框所需要的位元數。此外,本發明藉由序列框的格式設定,可彈性的應用於一對多的主從式通訊架構上,也增加了資料傳輸時的保密性。 In summary, the data transmission system and method of the present invention can save the transmission times of the transmission data by re-encoding and arranging the single data after cutting, and further improve the data transmission efficiency. In addition, different data encoding compression parameters can be set for the resolution of different analog-to-digital converters. In this way, the data compression parameters can be flexibly used to compress the data to be transmitted, thereby saving the number of bits required by the controlled terminal to return the response sequence frame. In addition, the present invention can be flexibly applied to a one-to-many master-slave communication architecture by the format setting of the sequence frame, and also increases the confidentiality during data transmission.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.

S210~S240‧‧‧資料傳輸方法的步驟 S210~S240‧‧‧Steps for data transmission method

Claims (12)

一種資料傳輸系統,包括:一主控端,包括一第一通訊單元,用以傳送一序列框;以及一受控端,包括:一第二通訊單元,用以接收該序列框;以及一微處理器,依據該序列框編碼一數位資料為一回應序列框,並利用該第二通訊單元傳送具有至少一單筆傳輸資料的該回應序列框至該主控端,其中該數位資料由至少一單筆資料所組成,當該至少一單筆資料的位元數大於一單筆傳輸資料位元數時,該微處理器依據該單筆傳輸資料位元數切割該至少一單筆資料為至少一低位元組與至少一高位元組,且該微處理器編碼該至少一高位元組與該至少一低位元組為該回應序列框。 A data transmission system includes: a main control terminal, including a first communication unit for transmitting a sequence frame; and a controlled terminal, comprising: a second communication unit for receiving the sequence frame; and a micro The processor encodes a digital data into a response sequence frame according to the sequence frame, and uses the second communication unit to transmit the response sequence frame having at least one single transmission data to the control terminal, where the digital data is at least one a single data component, when the number of bits of the at least one single data is greater than a single transmission data bit number, the microprocessor cuts the at least one single data according to the single transmission data bit number to at least a low byte and at least one high byte, and the microprocessor encodes the at least one high byte and the at least one low byte as the response sequence block. 如申請專利範圍第1項所述的資料傳輸系統,其中該微處理器依據該單筆傳輸資料位元數合併該至少一高位元組為該至少一單筆傳輸資料其中之一,並將該至少一低位元組作為該至少一單筆傳輸資料其中之一,其中該至少一低位元組的位元數為該單筆傳輸資料位元數,該至少一高位元組的位元數為單筆資料的位元數與該單筆傳輸資料位元數的差值。 The data transmission system of claim 1, wherein the microprocessor combines the at least one high-order tuple into one of the at least one single transmission data according to the single transmission data bit number, and At least one lower byte as one of the at least one single transmission data, wherein the number of bits of the at least one lower byte is the number of the single transmitted data bits, and the number of the at least one high byte is a single The difference between the number of bits of the pen data and the number of bits of the single transmitted data. 如申請專利範圍第1項所述的資料傳輸系統,其中當該至少一單筆資料的位元數小於該單筆傳輸資料位元數時,該微處理器更包括直接編碼該至少一單筆資料成該回應序列框。 The data transmission system of claim 1, wherein when the number of bits of the at least one single data is less than the number of the single transmission data bits, the microprocessor further comprises directly encoding the at least one single The data is in the response sequence box. 如申請專利範圍第1項所述的資料傳輸系統,其中該微處理器更包括一類比數位轉換器,且該類比數位轉換器將一類比資料轉換為由該至少一單筆資料組成的該數位資料,其中該類比數位轉換器的輸出序列埠的輸出位元數為該單筆資料的位元數。 The data transmission system of claim 1, wherein the microprocessor further comprises an analog-to-digital converter, and the analog-to-digital converter converts an analog data into the digit composed of the at least one single data. Data, wherein the output bit number of the output sequence of the analog converter is the number of bits of the single data. 如申請專利範圍第1項所述的資料傳輸系統,其中該主控端判斷該回應序列框是否正確,若該主控端判斷該回應序列框正確,該主控端利用該第一通訊單元傳送一結束訊息至該受控端,以控制該受控端停止傳送該回應序列框。 The data transmission system of claim 1, wherein the main control terminal determines whether the response sequence frame is correct, and if the main control terminal determines that the response sequence frame is correct, the main control terminal transmits by using the first communication unit. An end message is sent to the controlled end to control the controlled end to stop transmitting the response sequence frame. 如申請專利範圍第1項所述的資料傳輸系統,其中該序列框包括一位址欄位、一功能碼欄位、該單筆資料位元數欄位、一總共傳輸資料筆數欄位以及一錯誤檢查碼欄位。 The data transmission system of claim 1, wherein the sequence frame includes a address field, a function code field, a single data bit field, a total transmission data field, and An error check code field. 一種資料傳輸方法,適用於具有一主控端與一受控端的資料傳輸系統,該資料傳輸方法包括:由該主控端傳送一序列框;由該受控端判斷一數位資料的至少一單筆資料的位元數是否大於一單筆傳輸資料位元數;當該至少一單筆資料的位元數大於該單筆傳輸資料位元數時,由該受控端依據該單筆傳輸資料位元數切割該至少一單筆資料為至少一低位元組與至少一高位元組,並編碼該至少一高位元組與該至少一低位元組的為一回應序列框;以及由該受控端傳送具有至少一單筆傳輸資料的該回應序列至該主控端。 A data transmission method is applicable to a data transmission system having a master terminal and a controlled terminal, the data transmission method includes: transmitting, by the master terminal, a sequence frame; and determining, by the controlled terminal, at least one single digit data Whether the number of bits of the pen data is greater than the number of bits of a single transmission data; when the number of bits of the at least one single piece of data is greater than the number of bits of the single transmission data, the controlled terminal transmits the data according to the single transmission The bit number cuts the at least one single data into at least one low byte and at least one high byte, and encodes the at least one high byte and the at least one low byte as a response sequence frame; and is controlled by the The response sequence of the at least one single transmission data is transmitted to the host. 如申請專利範圍第7項所述的資料傳輸方法,其中由該受控端依據該單筆傳輸資料位元數切割該至少一單筆資料為至少一低位元組與至少一高位元組,並編碼該至少一高位元組與該至少一低位元組的為一回應序列框的步驟包括:依據該單筆傳輸資料位元數合併該至少一高位元組為該至少一單筆傳輸資料其中之一,並將該至少一低位元組作為該至少一單筆傳輸資料其中之一,其中該至少一低位元組的位元數為該至少一單筆傳輸資料位元數,該至少一高位元組的位元數為該至少一單筆資料的位元數與該單筆傳輸資料位元數的差值。 The data transmission method of claim 7, wherein the controlled end cuts the at least one single data into at least one low byte and at least one high byte according to the single transmission data bit number, and The step of encoding the at least one high byte and the at least one low byte as a response sequence frame comprises: combining the at least one high byte according to the single transmitted data bit number into the at least one single transmission data. And using the at least one lower byte as one of the at least one single transmission data, wherein the number of the at least one lower byte is the at least one single transmission data bit, the at least one high bit The number of bits of the group is the difference between the number of bits of the at least one single data and the number of bits of the single transmitted data. 如申請專利範圍第7項所述的資料傳輸方法,在由該受控端判斷該數位資料的該至少一單筆資料的位元數是否大於該單筆傳輸資料位元數之後,更包括:當該至少一單筆資料的位元數小於該單筆傳輸資料位元數時,由該受控端直接編碼該至少一單筆資料成該回應序列框。 The data transmission method of claim 7, wherein after the controlled terminal determines whether the number of bits of the at least one piece of data of the digital data is greater than the number of the single transmission data bits, the method further comprises: When the number of bits of the at least one single data is less than the number of the single transmitted data bits, the controlled terminal directly encodes the at least one single data into the response sequence frame. 如申請專利範圍第7項所述的資料傳輸方法,在由該受控端判斷該數位資料的該至少一單筆資料的位元數是否大於該單筆傳輸資料位元數之前,更包括:由該受控端的一類比數位轉換器將一類比資料轉換為由該至少一單筆資料組成的該數位資料,其中該類比數位轉換器的輸出序列埠的輸出位元數為該單筆資料的位元數。 The data transmission method of claim 7, wherein before the controlled terminal determines whether the number of bits of the at least one piece of data of the digital data is greater than the number of the single transmission data bits, the method further comprises: Converting an analog data to the digital data consisting of the at least one single data by an analog-type digital converter of the controlled end, wherein the output bit number of the output sequence of the analog digital converter is the single data The number of bits. 如申請專利範圍第7項所述的資料傳輸方法,更包括:由該主控端判斷該回應序列框是否正確,若該主控端判斷該 回應序列框正確,由該主控端傳送一結束訊息至該受控端,以控制該受控端停止傳送該回應序列框。 The data transmission method of claim 7, further comprising: determining, by the main control terminal, whether the response sequence frame is correct, if the main control terminal determines The response sequence box is correct, and the terminal transmits an end message to the controlled terminal to control the controlled terminal to stop transmitting the response sequence frame. 如申請專利範圍第7項所述的資料傳輸方法,其中該序列框包括一位址欄位、一功能碼欄位、該單筆資料位元數欄位、一總共傳輸資料筆數欄位以及一錯誤檢查碼欄位。 The data transmission method according to claim 7, wherein the sequence frame includes a address field, a function code field, a single data bit field, a total transmission data field, and An error check code field.
TW102129865A 2013-08-20 2013-08-20 Data transmission system and method TWI504215B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW102129865A TWI504215B (en) 2013-08-20 2013-08-20 Data transmission system and method
CN201310503986.XA CN104426634A (en) 2013-08-20 2013-10-23 Data transmission system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102129865A TWI504215B (en) 2013-08-20 2013-08-20 Data transmission system and method

Publications (2)

Publication Number Publication Date
TW201509166A true TW201509166A (en) 2015-03-01
TWI504215B TWI504215B (en) 2015-10-11

Family

ID=52974671

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102129865A TWI504215B (en) 2013-08-20 2013-08-20 Data transmission system and method

Country Status (2)

Country Link
CN (1) CN104426634A (en)
TW (1) TWI504215B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI685259B (en) * 2019-02-13 2020-02-11 瑞昱半導體股份有限公司 Data communicating and processing method of master device and slave device, and data processing method of slave device
TWI806483B (en) * 2022-03-10 2023-06-21 台達電子工業股份有限公司 Method of transmitting data and command through rs232 serial port

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581140B (en) * 2019-02-19 2022-11-04 瑞昱半导体股份有限公司 Data transmission and processing method and slave device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5758151A (en) * 1994-12-09 1998-05-26 Storage Technology Corporation Serial data storage for multiple access demand
US6263385B1 (en) * 1997-10-20 2001-07-17 Advanced Micro Devices, Inc. PC parallel port structure partitioned between two integrated circuits interconnected by a serial bus
US6208275B1 (en) * 1999-06-01 2001-03-27 William S. Lovell Method and apparatus for digital concatenation
TW588525B (en) * 2002-12-06 2004-05-21 Inventec Appliances Corp Method and system implementing data flow broadcasting on bluetooth equipment
KR100575989B1 (en) * 2004-04-08 2006-05-02 삼성전자주식회사 Segmentation Transmitting Method of Asynchronous Data In Synchronous Ethernet and Data Structure Used In Segmentation Transmitting Method
TW200540607A (en) * 2004-06-01 2005-12-16 Jtek Technology Corp Error check circuit with variable transmission data width
US7518534B2 (en) * 2006-07-28 2009-04-14 Cypress Semiconductor Corporation 8-bit to 10-bit encoding method and apparatus
CN101465712B (en) * 2008-11-04 2011-08-24 浙江大学 Self-adapting regulation method for maximum load of data frame
CN102098131B (en) * 2009-12-15 2014-01-15 航天科工惯性技术有限公司 Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
TWI418991B (en) * 2010-06-03 2013-12-11 Super Talent Electronics Inc Usb-attached-scsi flash-memory system with additional command, status, and control pipes to a smart-storage switch
CN102983884B (en) * 2011-09-05 2016-03-30 国民技术股份有限公司 A kind of method by magnetic channel transmission data
CN102647252B (en) * 2012-03-26 2014-11-19 航天东方红卫星有限公司 Serial communication method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI685259B (en) * 2019-02-13 2020-02-11 瑞昱半導體股份有限公司 Data communicating and processing method of master device and slave device, and data processing method of slave device
US11119959B2 (en) 2019-02-13 2021-09-14 Realtek Semiconductor Corp. Data communication and processing method of master device and slave device
TWI806483B (en) * 2022-03-10 2023-06-21 台達電子工業股份有限公司 Method of transmitting data and command through rs232 serial port

Also Published As

Publication number Publication date
CN104426634A (en) 2015-03-18
TWI504215B (en) 2015-10-11

Similar Documents

Publication Publication Date Title
EP2790361B1 (en) Usb device communication method, device and system
TWI271626B (en) Data transmission method for microprocessors of programmable logic controller
US10521392B2 (en) Slave master-write/read datagram payload extension
WO2019010686A1 (en) Data processing method and data processing apparatus
TWI504215B (en) Data transmission system and method
TW201903620A (en) Slave-to-slave communication in i3c bus topology
US9292411B2 (en) Wireless debugging and updating of firmware
KR20160065206A (en) Camera control interface slave device to slave device communication
WO2018157431A1 (en) Method and device for single-line communication
WO2019072218A1 (en) Method and device for signal conversion, home bus system (hbs) circuit, and user equipment
CN109831409A (en) Data transmission method, device, computer readable storage medium and electronic equipment
TWI461003B (en) Method for decoding data
CN201845275U (en) Main board with expansion function
CN114765761A (en) Audio data transmission method, electronic device and storage medium
CN101163148A (en) Ethernet transmission method of supporting non-standard velocity and corresponding device and access equipment
TW201439778A (en) Communication device and method of configuring data transmission
TWI755692B (en) Dual mode mouse
US9112736B2 (en) Data transfer apparatus, data transfer method, and inter-chip communication system
CN220210468U (en) Transparent transmission device for mobile communication
WO2014029081A1 (en) Compression method and apparatus
US20160285952A1 (en) Conveying data between devices in wireless personal area network
WO2016161581A1 (en) Method and apparatus for acquiring downlink control information, terminal and base station
CN103269386B (en) System and method for wireless communication
WO2014026594A1 (en) Data transmission method and device
CN219420799U (en) Power line router device

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees