201215001 六、發明說明: 【發明所屬之技術領域】 [0001] 本發明涉及抄表系統,尤其涉及一種電錶及其通訊中繼 方法。 【先前彳支:術】 [0002] 由於電力線作為通訊載體通訊時,無須鋪設訊號電緵, 減少建設投資,所以藉由電力線進行自動抄表得到了廣 泛的應用。對於藉由電力線進行自動抄表而言,通訊中 繼方法至關重要,直接影響通訊的距離與穩定性。 [0003] 然而,傳統的電力線通訊中繼方法需要全部或局部的人 工摸查網路拓撲,人工輸入網路拓撲,人工選擇中繼表 位置,所以通訊距離不長,穩定性差且不靈活,當新增 電錶、出現故障電錶或改變網路拓撲時,都需要重新對 抄表系統進行調試。 【發明内容】 [0004] 鑒於以上内容,有必要提供一種電錶,可藉由隨機中繼 方式自動抄表,不僅智慧靈活,且通訊距離長,穩定性 好。 [0005] 此外,還有必要提供一種通訊中繼方法,可藉由隨機中 繼方式自動抄表,不僅智慧靈活,且通訊距離長,穩定 性好。 [0006] 本發明實施方式中提供的電錶,藉由電力線連接於集線 器以及其它電錶,該集線器經由該電力線發送多個請求 訊框至該電錶及其它電錶以查詢該電錶及其它電錶的用 099131345 表單編號A0101 第4頁/共35頁 0992054922-0 201215001 電量’該電錶及其它電錶經由該電力線回送多個回應訊 框至該集線器以回報該電錶及其它電錄的用電量。該電 鎮包括記憶體、通訊模組、訊框判斷模組及處理器。記 憶體用於存儲接收仔列與發送符列,分別用於存放該電 錶已接收與將發送的通訊訊框。通訊模組用於從該電力 線接收新通訊訊框’該新通訊訊框包括該集線器所發送 的請求訊框、其它電錶所轉發的請求訊框或其它電錶所 回送的回應訊框。訊框判斷模組用於判斷該接收仵列中 是否有與該新通訊訊框相同的通訊訊框,並當該接收仔 〇 列中沒有與該新通訊訊框相同的邊訊訊框時判斷該新通 訊訊框是否為查詢該電錶的用電量啲請求訊框。處理器 用於執行該通訊模組及該訊框判斷模組。其中,該通訊 模組還用於當該接收佇列中沒有與該新通訊訊框相同的 通訊訊框時藉由該記憶體將該新通訊說輪放入該接收佇 列。該通訊模組還用於當該新通訊訊框是查詢該電錶的 用電量的請求訊框時產生該新通訊訊框的*回應訊框, 藉由該記憶體將該新回應訊框放八該發送佇列,並以廣 ϋ 播方式回送該新回應訊框至該集線器以回報該電錶的用 電量。該通訊模組還用於當該新通訊訊框不是查詢該電 錶的用電量的請求訊框時,藉由该記憶體將該新通訊訊 框放入該發送佇列並以廣播方式轉發該新通訊訊框。 [0007] 優選地’該通訊訊框包括訊框識别號 '訊框類型、訊框 源地址及訊框目的地址,該訊椎識別號用於識別所述通 訊訊框,所述訊框類型用於表明所述通訊訊框為請求訊 框或回應訊框’該訊框源地址為雇生該通訊訊框的裝置 099131345 表單編號Α0101 第5頁/共35頁 0992054922-0 201215001 [0008] [0009] [0010] [0011] [0012] 099131345 的地址’該訊框目的地址為該通訊訊框的目的裝置的地 址’其中’該通訊訊框與該通訊訊框的回應訊框的訊框 識別號相同’訊框類型分別為請求訊框與回應訊框,訊 框源地址與訊框目的地址交換。 優選地’該接收佇列包括訊框識別號欄位、訊框類型攔 位及訊框源地址攔位,分別用於記錄所接收的通訊訊框 的訊框識別號、訊框類型及訊框源地址。 優選地,該發送佇列包括訊框識別號攔位、訊框類型襴 位及訊框目的地址欄位,分別用於記錄所發送的通訊訊 框的訊框識別號、訊框類型及訊框目的地址。 優選地,該訊框判斷模組藉由判斷該新通訊訊框的目的 地址是否為該電料地址來·料軌訊框是否為查 詢該電錶的用電量的請求訊框,當該新通訊訊框的目: 地址是該電錶的地址時判定該新通訊訊框是查詢該電錄 :用電量的請求訊框’並當該新通訊訊框的目的地址不 是該電錶的地址_定賴舰崎錢㈣該電錶的 用電量的請求訊框。 優選地’該通訊模組還用於根據衝突避讓演算法等到該 電力線的通道空閒時以廣播方式回送該新回應訊框至該 集線器。 «地,該訊框判斷模組還用於判斷該新通訊訊框的類 型是否為請求練’該通訊餘翻於當該新通訊訊框 的類型不是請求訊框時根據衝突避讓演算法等到該電力 線的通道空閒時以廣播方式轉發該新通訊訊框。 表單編號A0101 第6頁/共35頁 201215001 10013]優選地,該通訊模組還用於當該新通訊訊框的類型是請 求訊框時判斷該接收佇列中是否有該新通訊訊框的回應 汛框,當該接收佇列中沒有該新通訊訊框的回應訊框時 根據衝突避讓演算法等到該電力線的通道空間時以廣播 方式轉發該新通訊訊框。 Ο Ο 為查詢該電錶的用電量的請求訊框;若該新通訊訊框是 查詢該電錶的用電量的請求訊框,則產生該新通訊訊框 的新回應訊框,將該新回應訊框放入該發送佇列,並以 廣播方式回送該新回應訊框至該集線器以回報該電錶的 用電量;或若該新通訊訊框不是查詢該電錶的用電量的 請求訊框,則將該新通訊訊框放入該發送符列,以廣播 方式轉發該新通訊訊框。 [0014]本發明實施方式中提供的通訊中繼方法,應用於電錶中 ,該電錶藉由電力線連接於集線器以及其它電錶,該集 線器經由該電力線發送多個請求訊框至該電錶及其它電 錶以查詢該電錶及其它電錶的用電量,該電錶及其它電 錶經由該電力線回送多個回應訊框至該集線器以回報該 電錶及其它電錶的用電量。該通訊中繼方法包括:提供 接收佇列與發送佇列’分別用於存放該電錶已接收與將 發送的通訊訊框;從該電力線接收新通訊訊框,該新通 訊訊框包括該集線器所發送的請求訊植、其它電錶所轉 發的請求訊框或其它電錶所回送,的回應訊準;判斷該接 收佇列中是否有與該新通訊‘訊框相同的通訊訊框;若該 接收佇列中沒有與第新通訊訊框相同的通訊訊框,則將 該新通訊訊框放入該接收佇列;判斷該新通訊訊框是否 099131345 表單編號A0101 第7頁/共35頁 0992054922-0 201215001 [0015] 優選地,該通訊訊框包括訊框識別號、訊框類型、訊框 源地址及訊框目的地址,該訊框識別號用於識別該通訊 訊框,該訊框類型用於表明該通訊訊框為請求訊框或回 應訊框,該訊框源地址為產生該通訊訊框的裝置的地址 ’該訊框目的地址為該通訊訊框的目的裝置的地址,其 中,該通訊訊框與其回應訊框的訊框識別號相同,訊框 類型分別為請求訊框與回應訊框,訊框源地址與訊框目 的地址交換。 [0016] 優選地,該接收仔列包括m框識別號攔位、訊框類型襴 ......... .. 位及訊框源地址欄位,分嫌甩嫌記錄所接收的通訊訊框 的訊框識別號、訊框類型及訊框源地址。 [0017] 優選地,該發送仔列包括訊框識別號攔位、訊框類型欄 位及訊框目的地址攔位,分別用於記錄所發送的通訊訊 框的訊框識別號、訊框類型及訊框目的地址。 [0018] 優選地,該判斷該新通訊訊_是〖否__為,查詢該電錶的用電 量的請求訊框的步驟包括:判斷該新通訊訊框的目的地 址是否為該電鎮的地址;若該新通訊訊框的目的地址是 該電錶的地址,則判定該新通訊訊框是查詢該電錶的用 電量的請求訊框;或若該新通訊訊框的目的地址不是該 電錶的地址,則判定該新通訊訊框不是查詢該電錶的用 電量的請求訊框。 [0019] 優選地,該產生該新通訊訊框的新回應訊框,將該新回 應訊框放入該發送仔列,並以廣播方式回送該新回應訊 框至該集線器以回報該電錶的用電量的步驟包括:產生 099131345 表單編號A0101 第8頁/共35頁 0992054922-0 201215001 [0020] Ο [0021]201215001 VI. Description of the Invention: [Technical Field] [0001] The present invention relates to a meter reading system, and more particularly to an electric meter and a communication relay method thereof. [Previous sputum: surgery] [0002] Since the power line is used as a communication carrier for communication, there is no need to lay signal signals and reduce construction investment. Therefore, automatic meter reading by power lines has been widely used. For automatic meter reading by power line, the communication relay method is very important, which directly affects the distance and stability of communication. [0003] However, the traditional power line communication relay method requires all or part of the manual to inspect the network topology, manually input the network topology, manually select the relay table position, so the communication distance is not long, the stability is poor and inflexible, when When you add a meter, a faulty meter, or change the network topology, you need to re-calibrate the meter reading system. SUMMARY OF THE INVENTION [0004] In view of the above, it is necessary to provide an electric meter, which can be automatically read by a random relay method, which is not only intelligent and flexible, but also has a long communication distance and good stability. [0005] In addition, it is also necessary to provide a communication relay method, which can automatically read meter by random relay mode, which is not only intelligent and flexible, but also has a long communication distance and good stability. An electric meter provided in an embodiment of the present invention is connected to a hub and other electric meters by a power line, and the hub sends a plurality of request frames to the electric meter and other electric meters via the power line to query the electric form and other electric meters for the 099131345 form. No. A0101 Page 4 of 35 Page 0992054922-0 201215001 Power 'The meter and other meters send back a number of response frames to the hub via the power line to report the power consumption of the meter and other records. The town includes a memory, a communication module, a frame judgment module, and a processor. The memory is used to store the receiving queue and the sending column, respectively, for storing the communication frame that the meter has received and will send. The communication module is configured to receive a new communication frame from the power line. The new communication frame includes a request frame sent by the hub, a request frame forwarded by another power meter, or a response frame sent by another power meter. The frame judging module is configured to determine whether there is a communication frame in the receiving queue that is identical to the new communication frame, and determine when there is no side frame in the receiving queue that is the same as the new communication frame Whether the new communication frame is a power inquiry request frame for querying the electricity meter. The processor is configured to execute the communication module and the frame judgment module. The communication module is further configured to insert the new communication wheel into the receiving queue by using the memory when the receiving frame does not have the same communication frame as the new communication frame. The communication module is further configured to generate a *response frame of the new communication frame when the new communication frame is a request frame for querying the power consumption of the electricity meter, and the new response frame is placed by the memory Eight, the queue is sent, and the new response frame is sent back to the hub in a wide broadcast manner to report the power consumption of the meter. The communication module is further configured to: when the new communication frame is not a request frame for querying the power consumption of the electricity meter, insert the new communication frame into the sending queue by the memory and forward the broadcast message by the memory New communication frame. [0007] Preferably, the communication frame includes a frame identification number, a frame source address, and a frame destination address. The frame identification number is used to identify the communication frame, and the frame type is used. Indicates that the communication frame is a request frame or a response frame. The source address of the frame is the device for hiring the communication frame. 099131345 Form No. 1010101 Page 5/35 pages 0992054922-0 201215001 [0008] [0009 [0012] [0012] [0012] The address of 099131345 'the destination address of the frame is the address of the destination device of the communication frame 'where the message frame and the frame identification number of the response frame of the communication frame The same frame type is the request frame and the response frame, and the source address of the frame is exchanged with the destination address of the frame. Preferably, the receiving queue includes a frame identification number field, a frame type blocking position, and a frame source address blocking, respectively, for recording the frame identification number, the frame type and the frame of the received communication frame. source address. Preferably, the sending queue includes a frame identification number block, a frame type clamp, and a frame destination address field, respectively, for recording the frame identification number, the frame type and the frame of the sent communication frame. Destination address. Preferably, the frame determining module determines whether the destination address of the new communication frame is the material address, whether the track frame is a request frame for querying the power consumption of the meter, and the new communication The purpose of the frame: When the address is the address of the meter, it is determined that the new communication frame is to query the record: the request frame for power consumption' and when the destination address of the new communication frame is not the address of the meter _ Shipsaki money (four) request frame for the electricity consumption of the meter. Preferably, the communication module is further configured to broadcast the new response frame to the hub in a broadcast manner according to the collision avoidance algorithm and the like when the channel of the power line is idle. «The ground, the frame judgment module is further configured to determine whether the type of the new communication frame is a request for training. The communication is turned over when the type of the new communication frame is not a request frame, etc. according to the conflict avoidance algorithm. The new communication frame is broadcasted when the channel of the power line is idle. Form No. A0101 Page 6 / Total 35 pages 201215001 10013] Preferably, the communication module is further configured to determine whether the new communication frame is included in the receiving queue when the type of the new communication frame is a request frame In response to the frame, when the response frame of the new frame is not in the receiving queue, the new frame is broadcasted in a broadcast manner according to the collision avoidance algorithm waiting for the channel space of the power line. Ο Ο is a request frame for querying the electricity consumption of the meter; if the new communication frame is a request frame for querying the electricity consumption of the meter, a new response frame of the new communication frame is generated, the new message box is generated The response frame is placed in the sending queue, and the new response frame is broadcasted back to the hub to report the power consumption of the meter; or if the new communication frame is not a request for querying the power consumption of the meter In the box, the new communication frame is placed in the sender column, and the new communication frame is broadcasted. The communication relay method provided in the embodiment of the present invention is applied to an electric meter, which is connected to a hub and other electric meters by a power line, and the hub sends a plurality of request frames to the electric meter and other electric meters via the power line. Query the power consumption of the meter and other meters, and the meter and other meters send back a plurality of response frames to the hub via the power line to report the power consumption of the meter and other meters. The communication relay method includes: providing a receiving queue and a sending queue respectively for storing a communication frame that the meter has received and will send; receiving a new communication frame from the power line, the new communication frame including the hub The response message sent by the request message, the request frame forwarded by other meters, or other meter returns; determine whether there is a communication frame in the receiving queue that is the same as the new message frame; If there is no communication frame in the column with the same new communication frame, the new communication frame is placed in the receiving queue; whether the new communication frame is 099131345, form number A0101, page 7 / total 35 pages 0992054922-0 201215001 [0015] Preferably, the communication frame includes a frame identification number, a frame type, a frame source address, and a frame destination address, wherein the frame identification number is used to identify the communication frame, and the frame type is used for Indicates that the communication frame is a request frame or a response frame, and the source address of the frame is the address of the device that generates the communication frame. The destination address of the frame is the address of the destination device of the communication frame, where Its inquiry response communication frame information block of the same block ID information, frame type information are requested information exchange with the frame address information response frame, the frame source address information frame information purposes. [0016] Preferably, the receiving queue includes an m-frame identification number block, a frame type 襕....., and a frame source address field, which are received by the suspected record. Frame ID, frame type and frame source address of the frame. [0017] Preferably, the sending queue includes a frame identification number block, a frame type field, and a frame destination address block, respectively, for recording the frame identification number and the frame type of the sent communication frame. The destination address of the frame. [0018] Preferably, the step of determining that the new communication message is "No__", the request frame for querying the power consumption of the electricity meter comprises: determining whether the destination address of the new communication frame is the electricity town Address; if the destination address of the new communication frame is the address of the meter, it is determined that the new communication frame is a request frame for querying the power consumption of the electricity meter; or if the destination address of the new communication frame is not the electricity meter The address determines that the new communication frame is not a request frame for querying the power consumption of the meter. [0019] Preferably, the new response frame for generating the new communication frame inserts the new response frame into the sending queue, and broadcasts the new response frame to the hub to report the meter. The steps of power consumption include: generating 099131345 Form No. A0101 Page 8 / Total 35 Page 0992054922-0 201215001 [0020] 002 [0021]
該新通訊訊框的新回應訊框;將該新回應訊框放入該發 送佇列,並設置該新回應訊框的標誌為待發送;根據衝 突避讓演算法等待第一避讓時間;判斷該電力線的通道 是否空閒;若該電力線的通道空閒,則以廣播方式回送 該新回應訊框至該集線器;及當收到該新回應訊框時, 在該發送佇列中設置該新回應訊框的標誌為已發送。 優選地,該將該新通訊訊框放入該發送佇列,以廣播方 式轉發該新通訊訊框的步驟包括:判斷該新通訊訊框的 類型是否為請求訊框;若該新通訊訊框的類型不是請求 訊框,則根據衝突避讓演算法等待第二避讓時間;判斷 該電力線的通道是否空閒;及若該電力線的通道空閒, 則將該新通訊訊框放入該發送佇列,以廣播方式轉發該 新通訊訊框。 優選地,該將該新通訊訊框放入該發送佇列,以廣播方 式轉發該新通訊訊框的步驟還包括:若該通訊訊框的類 型是請求訊框,則判斷該接收佇列中是否有該新通訊訊 框的回應訊框;若該接收佇列中沒有該新通訊訊框的回 應訊框,則根據衝突避讓演算法計算第三避讓時間並判 斷該第三避讓時間是否到達;若該第三避讓時間未到達 ,則繼續判斷該接收佇列中是否有該新通訊訊框的回應 訊框;若該第三避讓時間已到達,則判斷該電力線的通 道是否空閒;及若該電力線的通道空閒,則將該新通訊 訊框放入該發送佇列,以廣播方式轉發該新通訊訊框。 藉由以下對具體實施方式詳細的描述結合附圖,將可輕 易的瞭解上述内容及此項發明之諸多優點。 099131345 表單編號Α0101 第9頁/共35頁 0992054922-0 [0022] 201215001 【實施方式】 剛®ι為本發明祕(Meter)2〇一實施方式的環境圖。在 本實施方式中,抄表系統丨〇〇包括集線器(c〇ncentrat— or) 10及多個電銀20。集線器1〇與多個電錶2〇彼此之間 都疋,差由電力線4 〇相互連接與通訊。集線器丨〇經由電力 ‘4〇發送多個請求訊框至多個電錶20以查詢多個電錶2〇 的用電ϊ,多個電錶2〇經由電力線4G回送多個回應訊框 至集線器10以回報多個電錶20的用電量。在本實施方式 中,請求訊框與回應訊框統稱為通訊訊框,每一通訊訊 框包括訊框識別號、訊類型、訊框源地址及訊框目的 地址訊框識別號用於識別通訊訊框,訊柩類型用於表 明通訊訊框為請求訊框或回應訊框’訊框源地址為產生 通訊訊框的裝置的地址,訊框目的地址為通訊訊框的目 的裝置的地址。 [0024] 抄表系統1〇〇採用的是隨機中繼方式來進行多路並進的全 網抄表,即:多個請求訊框是藉由隨機中繼方式被傳送 至夕個電錶20,多個回應訊框是藉由随機中繼方式被傳 送至集線器10。舉例來說,參閱圖2 ,假設電錶3_〗是圖】 中多個電錶20中的部分電錶。若集線器1〇想要抄寫電錶i 的用電量,則集線器1〇就在抄表系統1〇〇中廣播請求訊框 以查β句電錶i的用電量。由於電錶a、&、c、d與集線器 之間電力線通訊距離比較近且電力線通訊狀態比較好, 故,電錶a ' b、c、d能夠最先從集線器1〇收到該請求訊 框。由於集線器10與電錶e、f、g、h、i、j之間電力線 通訊距離比較遠或電力線通訊狀態比較差,故,電錶e、 099131345 f、g ' h、i 表單編號A0101 、j未能最先從集線器10收到該請求訊框 第10頁/共35頁 。從 0992054922- 201215001 集線器10收到s亥睛求訊框後’電錶a、b、c、d判斷,钱 求訊框是否為查詢自己用電量的請求訊框,由於請求訊 框不是查詢自己的用電量,故’電錶a、b、c ' d以廣播 方式轉發該請求訊框。 [0025] 由於本發明通訊中繼方法採用的是隨機中繼方式,故, 電錶a、b、c、d還有可能再次接收到彼此之間所轉發的 相同請求訊框’對於再次接收的相同請求訊框,電錶a、 b、e、f都會置之不理,以硪保隨機中斷方式的有序進行 Ο [0026] 0 ;:. ; , 由於電錶e、f與電錶a之間電力線通訊跹離比較近且電力 線通訊狀態比較好,故,電錶e、f能最先從電錶a收到該 請求訊框。從電錶a收到該請求訊框後,電錶ef判斷該 請求訊框是否為查詢自己用電量的請求訊柩,由於請求 訊框不是查詢自己的用電量,故,電錶e、f繼續以廣播 方式轉發該請求訊框。 [0027] ❹ 由於本發明通訊中繼章法採用的是廣播方式的隨機中繼 方式,故,電錶e、f還有可能再次接收到彼此之間或其 它電錶b、c、d所轉發的相同請求訊框,對於再次接收的 相同請求訊框,電錶e、f會置之不理。 [0028] 由於電錶i與電錶f之間電力線通訊距離比較近且電力線 通訊狀態比較好,故,電錶丨最先從電錶f收到該請求訊 框。從電錶f收到該請求訊框後,電錶i判斷該請求訊框 是否為查詢自己用電量的請求訊框’由於請求訊框是查 詢自己的用電量’故’電錶i以廣播方式回送該請求訊框 099131345 表單編號A0101 第U頁/共35頁 0992054922-0 201215001 的回應訊框至集線器1 〇以回報用電量。 [0029] [0030] [0031] [0032] 與請求訊框的通訊中繼方式類似,經由電錶^中部分或 全部電錶的轉發,最終請求訊_回應訊框被轉發至集 線益1〇。舉例來說,假定電錶i與集線m。之間的電力線 通訊狀況變得相當好,則請求訊框的回應訊框可能直接 被傳送至集線器1G。假定電鎮以集線器1()之間的電力線 通訊狀況-般,則請求訊框的回應訊框可能需要經由電 錶f與電錶a轉發才能到達集線器1〇。 應當注意的是’ ®2中_路_魏铺著電力線通訊 狀況而發生變化。例如,參閱圖3,蚊電錶a與電錶κ 間的電力線通訊狀況變差,而電錶b與電錶f之間的電力 線通訊狀況變好’則電錶f可能會先接收到電鎮b所轉發 的請求訊框。再例如,參閱圖4,假定電錶f與集線㈣ 之間的電力線通訊狀況變得相當好,則電錶f也可能會最 先從集線器1 0收到請求訊框^ 由此可見’本發明藉由隨機中繼方式自動抄表,不僅智 慧靈活’且通訊距離長,穩定:性好ό 參閱圖5 ’為本發明電錶2Ga —實施方式的功能模組圖。 在本實施方式中,電鎮2〇a為圖1中多個電細中的-個 ,其包括記龍2卜處理扣、通訊模組23及訊框判斷 模組24 °處理器22用於執行通訊模組23及訊框判斷模組 24 〇 記憶體21用於存儲接收佇列21a與發送佇列21b,分別用 於存放電錶20a已接收與將發送的通訊訊框。在本實施方 099131345 表單編號A0101 $ 12頁/共35頁 0992054922-0 [0033] 201215001 式中’通訊訊框包括訊框識別號、訊框類型、訊框源地 址及訊框目的地址,訊框識別號用於識別通訊訊框,訊 框類型用於表明通訊訊框為請求訊框或回應訊框,該訊 框源地址為產生通訊訊框的裝置的地址,該訊框目的地 址為通訊訊框的目的裝置的地址。當通訊訊框為請求訊 棍時’通訊訊框與該通訊訊框的回應訊框的訊框識別號 相同’訊框類型分別為請求訊框與回應訊框,訊框源地 址與訊框目的地址交換。 〇 [0034]舉例來說,假設集線器10的地址為0x100,電錶2〇a的地 址為0x110,請求訊框的類型定義為〇x〇〇l,回應訊框的 類型定義為0x000,當前訊框識別號定為0x111,則集線 器1〇發送的查詢電錶20a用電量的請求訊框的訊框識別號 為0x111,訊框類型為0x001,訊框源地址與訊框目的地 址分別為0x100與OxHO,相應的,該請求訊框的回應訊 框的訊框識別號為〇xlll,訊框類型為〇χ〇〇〇,訊框源地 址與訊框目的地址分別為0χ110與〇χ1〇〇。a new response frame of the new communication frame; placing the new response frame in the transmission queue, and setting the flag of the new response frame to be sent; waiting for the first avoidance time according to the conflict avoidance algorithm; determining the Whether the channel of the power line is idle; if the channel of the power line is idle, the new response frame is sent back to the hub by broadcast; and when the new response frame is received, the new response frame is set in the sending queue The logo is sent. Preferably, the step of placing the new communication frame in the sending queue and forwarding the new communication frame by broadcasting comprises: determining whether the type of the new communication frame is a request frame; if the new communication frame If the type is not a request frame, wait for the second avoidance time according to the conflict avoidance algorithm; determine whether the channel of the power line is idle; and if the channel of the power line is idle, put the new communication frame into the sending queue to Broadcast to forward the new frame. Preferably, the step of placing the new communication frame in the sending queue and forwarding the new communication frame in a broadcast manner further comprises: if the type of the communication frame is a request frame, determining the receiving queue Whether there is a response frame of the new communication frame; if there is no response frame of the new communication frame in the receiving queue, the third avoidance time is calculated according to the conflict avoidance algorithm and it is determined whether the third avoidance time arrives; If the third avoidance time has not arrived, determining whether there is a response frame of the new communication frame in the receiving queue; if the third avoidance time has arrived, determining whether the channel of the power line is idle; and if When the channel of the power line is idle, the new communication frame is placed in the transmission queue, and the new communication frame is broadcasted. The above and other advantages of the invention will be readily apparent from the following detailed description of the embodiments of the invention. 099131345 Form No. Α0101 Page 9 of 35 0992054922-0 [0022] 201215001 [Embodiment] Just ι is the environmental diagram of the embodiment of the invention. In the present embodiment, the meter reading system includes a hub (10) and a plurality of battery cells 20. The hub 1〇 and the plurality of meters 2〇 are connected to each other, and the difference is connected and communicated by the power line 4〇. The hub sends a plurality of request frames to the plurality of electricity meters 20 via the power supply to query the power consumption of the plurality of electricity meters. The plurality of power meters 2 send back a plurality of response frames to the hub 10 via the power line 4G to report more The electricity consumption of the electricity meter 20. In this embodiment, the request frame and the response frame are collectively referred to as a communication frame, and each communication frame includes a frame identification number, a message type, a frame source address, and a frame destination address frame identification number for identifying communication. The frame type is used to indicate that the communication frame is the request frame or the response frame. The source address of the frame is the address of the device that generates the communication frame. The destination address of the frame is the address of the destination device of the communication frame. [0024] The meter reading system 1 随机 adopts a random relay mode to perform multi-way parallel whole-network meter reading, that is, multiple request frames are transmitted to the evening meter 20 by random relay mode, and more The response frames are transmitted to the hub 10 by random relay. For example, referring to FIG. 2, it is assumed that the meter 3_ is a part of the plurality of meters 20 in the figure. If the hub 1 〇 wants to copy the power consumption of the meter i, the hub 1 广播 broadcasts the request frame in the meter reading system 1 to check the power consumption of the meter meter i. Since the power line communication distance between the meters a, & c, d and the hub is relatively close and the power line communication state is relatively good, the meters a ' b, c, d can receive the request frame from the hub 1 最 first. Since the power line communication distance between the hub 10 and the meter e, f, g, h, i, j is relatively long or the power line communication state is relatively poor, the meter e, 099131345 f, g 'h, i form number A0101, j failed. The request message frame 10th/35 pages is first received from the hub 10. From 0992054922-201215001 Hub 10 receives the _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ The power consumption is used, so the 'meters a, b, c' d broadcast the request frame in a broadcast manner. [0025] Since the communication relay method of the present invention adopts a random relay mode, the meters a, b, c, and d may again receive the same request frame forwarded between each other 'for the same received again Request frame, meter a, b, e, f will be ignored, in order to ensure the random interruption of the orderly process [0026] 0 ;:.; , because the electricity meter e, f and meter a between the power line communication comparison The power line communication status is relatively good, so the meter e and f can receive the request frame from the meter a first. After receiving the request frame from the meter a, the meter ef determines whether the request frame is a request for querying the power consumption of the device. Since the request frame does not query the power consumption of the user, the meter e and f continue to The broadcast mode forwards the request frame. [0027] Since the communication relay chapter method of the present invention adopts a random relay mode of the broadcast mode, the electric meters e and f may again receive the same request forwarded by each other or other electric meters b, c, and d. The frame, for the same request frame received again, the meters e, f will be ignored. [0028] Since the power line communication distance between the meter i and the meter f is relatively close and the power line communication state is relatively good, the meter 丨 first receives the request frame from the meter f. After receiving the request frame from the meter f, the meter i determines whether the request frame is a request frame for querying its own power consumption. 'Because the request frame is to query its own power consumption', the meter i is sent back by broadcast. The request frame 099131345 form number A0101 U page / total 35 page 0992054922-0 201215001 response frame to the hub 1 to report the power consumption. [0032] [0032] Similar to the communication relay mode of the request frame, the final request message_response frame is forwarded to the network via the forwarding of some or all of the meters in the meter. For example, assume meter i and hub m. The communication between the power lines becomes quite good, and the response frame of the request frame may be directly transmitted to the hub 1G. Assuming that the town is in a power line communication condition between hubs 1 (), the response frame of the request frame may need to be forwarded via meter f and meter a to reach hub 1. It should be noted that the ' ® 2 _ _ _ Wei spread the power line communication situation and changed. For example, referring to Figure 3, the power line communication between the mosquito meter a and the meter κ deteriorates, and the power line communication between the meter b and the meter f becomes better. Then the meter f may first receive the request forwarded by the town b. Frame. For another example, referring to FIG. 4, it is assumed that the power line communication condition between the meter f and the line (4) becomes quite good, and the meter f may also receive the request frame from the hub 10 first. Automatic repeat metering method is not only smart and flexible, but also has long communication distance and stability: good performance. Refer to Figure 5 for the functional module diagram of the electric meter 2Ga of the present invention. In this embodiment, the electric town 2〇a is one of the plurality of electric thinnings in FIG. 1 , and includes a recording dragon 2 processing buckle, a communication module 23, and a frame judging module 24 ° processor 22 for The execution communication module 23 and the frame determination module 24 memory 21 are used for storing the reception queue 21a and the transmission queue 21b for respectively storing the communication frame that the electric meter 20a has received and will transmit. In the embodiment 099131345 Form No. A0101 $12 pages/35 pages 0992054922-0 [0033] In the 201215001 type, the communication frame includes the frame identification number, the frame type, the frame source address and the frame destination address, and the frame The identification number is used to identify the communication frame, and the frame type is used to indicate that the communication frame is a request frame or a response frame. The source address of the frame is the address of the device that generates the communication frame, and the destination address of the frame is the communication message. The address of the destination device of the box. When the communication frame is a request for a stick, the 'communication frame is the same as the frame identification number of the response frame of the communication frame. 'The frame type is the request frame and the response frame respectively, the source address of the frame and the frame purpose. Address exchange. For example, suppose the address of the hub 10 is 0x100, the address of the meter 2〇a is 0x110, the type of the request frame is defined as 〇x〇〇l, and the type of the response frame is defined as 0x000, the current frame The identification number is set to 0x111, and the frame identification number of the request frame for the power consumption of the query electricity meter 20a sent by the hub 1 is 0x111, the frame type is 0x001, and the source address of the frame and the destination address of the frame are 0x100 and OxHO respectively. Correspondingly, the frame identification number of the response frame of the request frame is 〇xlll, the frame type is 〇χ〇〇〇, and the source address of the frame and the destination address of the frame are 0χ110 and 〇χ1〇〇, respectively.
-"·* i - . --F ' - V 〇 [0035]接收佇列21a包括訊框識別號攔位、訊框類型欄位及訊框 源地址攔位,分別用於記錄所接收的通訊訊框的訊框識 別號、訊框類型及訊框源地址。發送佇列21b包括訊框識 別號攔位、訊框類型欄位及訊框目的地址攔位,分別用 於。己錄所發送的冑訊訊框的訊框識別號、訊框類型及訊 框目的地址。 [0036]通訊模組23用於從電力線40接收新通訊訊框,其中新通 訊訊框可為集電器1〇所發送的請求訊框、其它電錶2〇所 0992054922-0 轉發的請求訊框或所回送的回應訊框,也可為本電錶20a 099131345 表單編號A0101 第13頁/共35頁 201215001 所轉發的請求訊框或所回送的回應訊框。 [〇〇37]訊框判斷模組24用於判斷接收佇列2la中是否有與新通訊 訊框相同的通訊訊框,並當接收佇列21a中沒有與新通訊 訊框相同的通訊訊框時判斷新通訊訊框是否為查詢電錶 2〇a的用電量的請求訊框。在本實施方式中’訊框判斷模 組24藉由判斷新通訊訊框的目的地址是否為電錶2〇a的地 址來判斷新通訊訊框是否為查詢電錶2〇a的用電量的請求 訊框。當新通訊訊框的目的地址是電錶2〇a的地址時,訊 框判斷模組24判定新通訊訊框是查詢電錶2〇a的用電量的 請求訊框。當新通訊訊框的目的地址不是電錶2〇a的地址 時,訊框判斷模組24判定新通訊訊框不是査詢電錶2〇a的 用電量的請求訊框。 [_魏模組23還用於當接收仔列Ha中沒有與新通訊訊框相 同的通訊減㈣由記紐21賴通訊訊框放人接收仔 列21a。當接收仔列2la中有與新通訊訊框相 同的通訊訊 框時’通。il模組23對新通难訊權置之不理,以保證隨機 中繼的有序進行。 : :!: [剩通訊模組23還用於當新通訊訊框是查言旬電錶.的用電量 的清求訊框時產生新通訊訊框的回應訊框,藉由記憶體 21將新通訊訊框的回應訊框放入發送佇列21b,並以廣播 方式回送通訊訊框的回應訊框至集線器1〇以回報電錶2〇a 的用電量。在本實施方式中,通訊模組23根據衝突避讓 演算法等到電力線4〇的通道空閒時以廣播方式回送新通 訊訊框的回應訊框至集缘器1〇。 099131345 表單編號A0101 第U頁/共35頁 0992054922-0-"·* i - . --F ' - V 〇[0035] The receiving queue 21a includes a frame identification number block, a frame type field, and a frame source address block for recording the received Frame ID, frame type and frame source address of the frame. The transmission queue 21b includes a frame identification number block, a frame type field, and a frame destination address block, which are respectively used. The frame identification number, frame type and frame destination address of the frame sent by the message are recorded. [0036] The communication module 23 is configured to receive a new communication frame from the power line 40, wherein the new communication frame can be a request frame sent by the collector 1 , a request frame forwarded by other electric meters 292054922-0 or The response frame sent back can also be the request frame or the response frame sent back by this meter 20a 099131345 Form No. A0101 Page 13 / Total 35 Page 201215001. [〇〇37] The frame judging module 24 is configured to determine whether there is a communication frame in the receiving queue 2a that is identical to the new communication frame, and when there is no communication frame in the receiving queue 21a that is not identical to the new communication frame. It is judged whether the new communication frame is a request frame for inquiring the power consumption of the electric meter 2〇a. In the present embodiment, the frame judgment module 24 determines whether the new communication frame is a request for querying the power consumption of the electricity meter 2〇a by determining whether the destination address of the new communication frame is the address of the electricity meter 2〇a. frame. When the destination address of the new communication frame is the address of the meter 2〇a, the frame judging module 24 determines that the new communication frame is a request frame for inquiring the power consumption of the electric meter 2〇a. When the destination address of the new communication frame is not the address of the meter 2〇a, the frame determination module 24 determines that the new communication frame is not a request frame for querying the power consumption of the meter 2〇a. [_Wei module 23 is also used to receive the same communication loss as the new communication frame in the receiving queue Ha (4). When the receiving message column 2la has the same communication frame as the new communication frame, 'pass. The il module 23 ignores the Xintong dynasty right to ensure the orderly execution of the random relay. : :!: [Remaining communication module 23 is also used to generate a response frame of the new communication frame when the new communication frame is the clearing frame of the power consumption of the meter, and the memory 21 will be The response frame of the new communication frame is placed in the transmission queue 21b, and the response frame of the communication frame is returned to the hub 1 by broadcast to report the power consumption of the meter 2〇a. In the present embodiment, the communication module 23 broadcasts the response frame of the new communication frame to the concentrator 1B in a broadcast manner according to the collision avoidance algorithm and the like when the channel of the power line 4 is idle. 099131345 Form No. A0101 Page U / Total 35 0992054922-0
201215001 L0040J 通訊模紐23還用於當新通訊訊框不是查詢電錶2〇a的用電 量的請求訊框時’將新通訊訊框放入發送佇列21b並以廣 播方式轉發新通訊訊框。 [0041] 在本實施方式中’訊框判斷模組24還用於判斷新通訊訊 框的類型是否為請求訊框。通訊模組23還用於當新通訊 訊框的類型不是請求訊框而是回應訊框時根據衝突避讓 演算法等到電力線40的通道空閒時以廣播方式轉發新通 訊訊框。 Q [0042] 通訊模組2 3還用於當新通訊訊框的類型是請求訊框時判 斷接收佇列21a中是否有新通訊訊框的回應訊框,當接收 仔列21a中沒有有新通訊訊框的回應訊框時根據衝突避讓 演算法等到電力線40的通道空閒時以廣播方式轉發新通 訊訊框。當接收佇列21a中有與新通訊訊輕的回應訊框時 ’通訊模組23對新通訊訊框置之不理;以保證隨機中繼 的有序進行。 ι_..201215001 L0040J Communication module 23 is also used to put the new communication frame into the transmission queue 21b and forward the new communication frame by broadcast when the new communication frame is not requesting the power consumption of the electricity meter 2〇a. . [0041] In the present embodiment, the frame judgment module 24 is further configured to determine whether the type of the new communication frame is a request frame. The communication module 23 is further configured to broadcast the new communication frame in a broadcast manner according to the conflict avoidance algorithm and the like when the channel of the power line 40 is idle when the type of the new communication frame is not the request frame but the response frame. Q [0042] The communication module 23 is further configured to determine whether there is a response frame of the new communication frame in the receiving queue 21a when the type of the new communication frame is the request frame, and there is no new in the receiving queue 21a. The response frame of the communication frame is broadcasted to the new communication frame according to the collision avoidance algorithm until the channel of the power line 40 is idle. When there is a response frame in the receiving queue 21a that is lighter than the new communication message, the communication module 23 ignores the new communication frame to ensure the orderly execution of the random relay. Ι_..
[0043] Ο 在本實施方式中’衝突避讓演算法是指在通訊訊框(包 ,s!, , t ψ ^ 括請求訊框與回意訊框)發送前,先等待02 r的時間, 然後檢測電力線40的通道是否空閒,若電力線4〇的通道 空閒’則以廣播方式發送通訊訊框,否則另選取r*2 r時 間繼續等待。其中’該r是基於電錶2la的地址產生的亂 數。该2 τ被稱為衝突時隙,是電力線40的通道往返傳播 延時’同時也是檢測衝突所需的基本時間。 圖6為本發明通訊中繼方法一實施方式的流程圖。本實施 方式中的通訊中繼方法是藉由圖5中的功能模組來實施。 099131345 表單編號Α0101 第15頁/共35頁 0992054922-0 [0044] 201215001 [0045] 在步驟S100,記憶體21初始化接收佇列21a與發送佇列 21b,分別用於存放電錶21a已接收與將發送的通訊訊框 〇 [0046] 在步驟S1 02,通訊模組23從電力線40接收新通訊訊框。 其中,新通訊訊框為請求訊框或回應訊框。 [0047] 在步驟S104,訊框判斷模組24用於判斷接收佇列21a中 是否有與新通訊訊框相同的通訊訊框。 [0048] 若接收佇列21a中有與新通訊訊框相同的通訊訊框,則對 該新通訊訊框置之不理,回至步驟S102,通訊模組23繼 續接收下一個新通訊訊框。 [0049] 若接收佇列21 a中沒有與新通訊訊框相同的通訊訊框,則 在步驟S106,記憶體21將新通訊訊框放入接收佇列21a 〇 [0050] 在步驟S1 08,訊框判斷模組24判斷新通訊訊框是否為查 詢電錶2la的用電量的請求訊框。在本實施方式中,訊框 判斷模組24藉由判斷新通訊訊框的目的地址是否為電錶 20a的地址來判斷新通訊訊框是否為查詢電錶20a的用電 量的請求訊框。當新通訊訊框的目的地址是電錶2 0a的地 址時,訊框判斷模組24判定新通訊訊框是查詢電錶20a的 用電量的請求訊框。當新通訊訊框的目的地址不是電錶 20a的地址時,訊框判斷模組24判定新通訊訊框不是查詢 電錶20a的用電量的請求訊框。 [0051] 若新通訊訊框是查詢電錶21a的用電量的請求訊框,則在 步驟S110,通訊模組23產生新通訊訊框的新回應訊框, 099131345 表單編號A0101 第16頁/共35頁 0992054922-0 201215001 將新回應訊框放入發送佇列21b,旅以廣播方式回送新回 應訊框至集線器10以回報電錶21a的用電量。 [0052] 若新通訊訊框不是查詢電錶21a的用電量的請求訊框,則 在步驟S112,通訊模組23將新通訊訊框放入發送佇列 21b並以廣播方式轉發新通訊訊框。 [0053] 圖7為圖6中通訊中繼方法的步驟Si 1 0 —實施方式的細節 流程圖。 [0054] 〇 在步驟S200 ’通訊模組23產生新通訊訊框的新回應訊框 ’並藉由記憶體21將新回應訊框放入發送佇列21b,並設 置新回應訊框的標誌為待發送。 [0055] 在步驟S202,通訊模組23根據衝突避讓演算法等待第一 避讓時間。 [0056] 在步驟S204,通訊模組23判斷電力線4〇的通道是否空閒 〇 [0057] 〇 若電力線40的通道空間,則在步驟S206,通訊模組23以 , ^ ·. ... a 廣播方式回送新回赢訊框至集線器1〇。 [0058] 在步驟S208,通訊模組23判斷是否收到新回應訊框。 [0059] 若收到新回應訊框,則在步驟S210,通訊模組23在發送 佇列21b中設置新回應訊框的標誌為已發送。 [0060] 若未收到新回應訊框,則回到步驟S202,通訊模組23繼 續根據衝突避讓演算法等待第一避讓時間。 [0061] 圖8為圖6中通訊中繼方法的步驟S112—實施方式的細節 099131345 表單编號A0101 第17頁/共35頁 0992054922-0 201215001 流程圖。 [0062] 在步驟S300,訊框判斷模組24判斷新通訊訊框的類型是 否為請求訊框。 [0063] 若新通訊訊框的類型不是請求訊框,而是回應訊框,則 在步驟S302,通道判斷模組25根據衝突避讓演算法等待 第二避讓時間。 [0064] 在步驟S304,通訊模組23判斷電力線40的通道是否空閒 〇 [0065] 若電力線40的通道空閒,則在步驟S306,通訊模組23將 新通訊訊框放入發送佇列21b,並以廣播方式轉發新通訊 訊框。 [0066] 若步驟S300的判斷結果為新通訊訊框的類型是請求訊框 ,則訊框判斷模組2 4判斷接收佇列21 a中是否有新通訊訊 框的回應訊框。 [0067] 若接收佇列21a t沒有新通訊訊框的回應訊框,則通訊模 組23根據衝突避讓演算法計算第三避讓時間並判斷第三 避讓時間是否到達。 [0068] 若第三避讓時間未到達,則回到步驟S310,繼續判斷接 收佇列21 a中是否有新通訊訊框的回應訊框。 [0069] 若第三避讓時間已到達,則在步驟S314,通訊模組23判 斷電力線40的通道是否空閒。 [0070] 若電力線40的通道空閒,則在步驟S306,通訊模組23將 新通訊訊框放入發送佇列21b,並以廣播方式轉發新通訊 099131345 表單編號A0101 第18頁/共35頁 0992054922-0 201215001 &TL 框。 在繼’通訊模組23騎是否收騎轉發的新通訊 訊I框。 _]右未收到新通訊訊枢,則回到步驟S3G6,通訊模組23繼 、廣播方式轉發新通訊訊框至集線器1〇,以破保新通 訊訊框被廣播出去。 [0073] 〇 本實施方式中,圖7中步驟s202、圖8中步驟S302與步 驟S312中的衝犬避讓演算,是指在通訊訊框(包括請求 訊框與回應訊梧)發送前,先等待叫了的時間,然後檢 測電力線40的通道是否空閒,若電力蜂㈣通道空閒, 則以廣播方式發送通訊訊框.時間繼續 荨待其中該Γ疋基於電錶21a的地址產生的亂數。該2 Γ被稱為衝突時隙,是電力線40的通道往返傳播延時, 同時也是檢測衝突所需的基本時間。 _4]綜上所述’本發明實施方式中電辕2〇、.及其通訊中繼 Q 方法採用了隨機中繼方式來自動.抄表(即以廣播方式傳 送請求訊框與回應訊框),不僅智慧靈活,且通訊距離 長,穩定性好。另外,還採取了衝突避讓演算法,從而 保證隨機中繼方式能夠有序的進行。 [0075] 總體而言,本發明具有如下特點:(1)不需要調試,直 接通訊,(2 )瞬間組網,沒有歷史記錄;(3 )不限中 繼級別’相對速度較快;(4)全網設備互動,中繼效率 很高。 [0076] 綜上所述’本發明符合發明專利要件,爰依法提出專利 099131345 表單編號A0101 第19頁/共35頁 0992054922-0 201215001 申請。惟,以上所述僅為本發明之較佳實施例,舉凡熟 悉本案技藝之人士,在爰依本案發明精神所作之等效修 飾或變化,皆應包含於以下之申請專利範圍内。 【圖式簡單說明】 [0077] 圖1為本發明電錶一實施方式的環境圖。 [0078] 圖2為本發明電錶一實施方式的網路拓撲圖。 [0079] 圖3為本發明電錶另一實施方式的網路拓撲圖。 [0080] 圖4為本發明電錶又一實施方式的網路拓撲圖。 [0081] 圖5為本發明電錶一實施方式的功能模組圖。 [0082] 圖6為本發明通訊中繼方法一實施方式的流程圖。 [0083] 圖7為圖6中通訊中繼方法的步驟S11 0 —實施方式的細節 流程圖。 [0084] 圖8為圖6中通訊中繼方法的步驟S11 2 —實施方式的細節 流程圖。 【主要元件符號說明】 [0085] 抄表系統:1 0 0 [0086] 集線器:10 [0087] 電錶:20、2 0a、a-j [0088] 記憶體:21 [0089] 接收佇列:21a [0090] 發送佇列:21b 099131345 表單編號A0101 第20頁/共35頁 0992054922-0 24 201215001 [0091] [0092] [0093] [0094] 處理器:22 通訊模組:23 訊框判斷模組 電力線:4 0[0043] In the present embodiment, the “conflict avoidance algorithm” refers to waiting for 02 r before sending the communication frame (packet, s!, , t ψ ^ request frame and return message frame). Then, it is detected whether the channel of the power line 40 is idle. If the channel of the power line 4 is idle, the communication frame is sent in a broadcast manner, otherwise the r*2 r time is selected to continue waiting. Where 'this r is a random number generated based on the address of the meter 2la. This 2 τ is called the collision time slot and is the channel round-trip propagation delay of power line 40, which is also the basic time required to detect the collision. FIG. 6 is a flowchart of an embodiment of a communication relay method according to the present invention. The communication relay method in this embodiment is implemented by the function module in Fig. 5. 099131345 Form No. 1010101 Page 15 / Total 35 Page 0992054922-0 [0044] In step S100, the memory 21 initializes the receiving queue 21a and the transmitting queue 21b for respectively storing and receiving the meter 21a. Communication frame 〇 [0046] In step S102, the communication module 23 receives a new communication frame from the power line 40. The new communication frame is a request frame or a response frame. [0047] In step S104, the frame determining module 24 is configured to determine whether there is a communication frame in the receiving queue 21a that is identical to the new communication frame. [0048] If the receiving frame 21a has the same communication frame as the new communication frame, the new communication frame is ignored, and the process returns to step S102, and the communication module 23 continues to receive the next new communication frame. [0049] If there is no communication frame in the receiving queue 21a that is the same as the new communication frame, then in step S106, the memory 21 puts the new communication frame into the receiving queue 21a [0050] in step S108. The frame judging module 24 judges whether the new communication frame is a request frame for querying the power consumption of the electric meter 2la. In this embodiment, the frame determining module 24 determines whether the new communication frame is a request frame for querying the power consumption of the electricity meter 20a by determining whether the destination address of the new communication frame is the address of the electricity meter 20a. When the destination address of the new communication frame is the address of the electricity meter 20a, the frame determination module 24 determines that the new communication frame is a request frame for querying the power consumption of the electricity meter 20a. When the destination address of the new communication frame is not the address of the electricity meter 20a, the frame determination module 24 determines that the new communication frame is not a request frame for querying the power consumption of the electricity meter 20a. [0051] If the new communication frame is a request frame for querying the power consumption of the electricity meter 21a, then in step S110, the communication module 23 generates a new response frame of the new communication frame, 099131345 Form No. A0101 Page 16 / Total 35 pages 0992054922-0 201215001 The new response frame is placed in the transmission queue 21b, and the brigade broadcasts a new response frame to the hub 10 to report the power consumption of the electricity meter 21a. [0052] If the new communication frame is not the request frame for querying the power consumption of the electricity meter 21a, then in step S112, the communication module 23 puts the new communication frame into the transmission queue 21b and forwards the new communication frame by broadcasting. . [0053] FIG. 7 is a flow chart showing the details of the step Si 1 0 of the communication relay method of FIG. 6. [0054] In step S200, the communication module 23 generates a new response frame of the new communication frame and puts the new response frame into the transmission queue 21b via the memory 21, and sets the flag of the new response frame as To be sent. [0055] In step S202, the communication module 23 waits for the first avoidance time according to the collision avoidance algorithm. [0056] In step S204, the communication module 23 determines whether the channel of the power line 4 is free. [0057] If the channel space of the power line 40, in step S206, the communication module 23 broadcasts, ^.. ... a The method returns a new return win box to the hub 1〇. [0058] In step S208, the communication module 23 determines whether a new response frame is received. [0059] If a new response frame is received, then in step S210, the communication module 23 sets the flag of the new response frame in the transmission queue 21b to be transmitted. [0060] If the new response frame is not received, then returning to step S202, the communication module 23 continues to wait for the first avoidance time according to the collision avoidance algorithm. 8 is a step S112 of the communication relay method of FIG. 6 - details of the implementation. 099131345 Form No. A0101 Page 17 of 35 0992054922-0 201215001 Flowchart. [0062] In step S300, the frame determination module 24 determines whether the type of the new communication frame is a request frame. [0063] If the type of the new communication frame is not a request frame but a response frame, then in step S302, the channel determination module 25 waits for the second avoidance time according to the conflict avoidance algorithm. [0064] In step S304, the communication module 23 determines whether the channel of the power line 40 is idle. [0065] If the channel of the power line 40 is idle, then in step S306, the communication module 23 puts the new communication frame into the transmission queue 21b. The new communication frame is forwarded by broadcast. [0066] If the result of the determination in step S300 is that the type of the new communication frame is the request frame, the frame determining module 24 determines whether there is a response frame of the new communication frame in the receiving queue 21a. [0067] If the receiving queue 21a has no response frame of the new communication frame, the communication module 23 calculates the third avoidance time according to the collision avoidance algorithm and determines whether the third avoidance time has arrived. [0068] If the third avoidance time has not arrived, the process returns to step S310 to continue to determine whether there is a response frame of the new communication frame in the receiving queue 21a. [0069] If the third avoidance time has arrived, then in step S314, the communication module 23 determines whether the channel of the power line 40 is free. [0070] If the channel of the power line 40 is idle, in step S306, the communication module 23 puts the new communication frame into the transmission queue 21b, and forwards the new communication by broadcast. 099131345 Form No. A0101 Page 18/35 pages 0992054922 -0 201215001 & TL box. After the 'communication module 23 rides on whether to ride the new communication I box. _] If the new communication hub is not received right, the process returns to step S3G6, and the communication module 23 relays the new communication frame to the hub 1 in the broadcast mode to break the new communication frame to be broadcasted. [0073] In the present embodiment, the step s202 in FIG. 7 and the step S302 and step S312 in FIG. 8 mean that before the communication frame (including the request frame and the response message) is sent, Waiting for the called time, then detecting whether the channel of the power line 40 is idle. If the power bee (four) channel is idle, the communication frame is sent in a broadcast manner. The time continues to wait for the random number generated by the address based on the address of the electric meter 21a. This 2 Γ is called the collision time slot and is the channel round-trip propagation delay of the power line 40, and is also the basic time required to detect the collision. _4] In summary, the method of the present invention is to use a random relay method to automatically read the meter (ie, transmit the request frame and the response frame by broadcast). Not only smart and flexible, but also long communication distance and good stability. In addition, a collision avoidance algorithm is adopted to ensure that the random relay method can be performed in an orderly manner. [0075] Generally, the present invention has the following features: (1) no debugging, direct communication, (2) instantaneous networking, no history; (3) unlimited relay level 'relative speed is faster; (4) ) Network-wide device interaction, high relay efficiency. [0076] In summary, the present invention meets the requirements of the invention patent, and patents are filed according to law. 099131345 Form No. A0101 Page 19/35 pages 0992054922-0 201215001 Application. However, the above description is only the preferred embodiment of the present invention, and those skilled in the art will be able to include the equivalent modifications or variations in the spirit of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS [0077] FIG. 1 is an environmental diagram of an embodiment of an electric meter according to the present invention. 2 is a network topology diagram of an embodiment of an electric meter according to the present invention. 3 is a network topology diagram of another embodiment of an electric meter according to the present invention. 4 is a network topology diagram of still another embodiment of the electric meter of the present invention. 5 is a functional block diagram of an embodiment of an electric meter according to the present invention. 6 is a flowchart of an embodiment of a communication relay method according to the present invention. 7 is a flow chart showing the details of step S11 0 of the communication relay method of FIG. 6. 8 is a detailed flow chart of step S11 2 - embodiment of the communication relay method of FIG. 6. [Main component symbol description] [0085] Meter reading system: 1 0 0 [0086] Hub: 10 [0087] Meter: 20, 2 0a, aj [0088] Memory: 21 [0089] Receive queue: 21a [0090] ] Send queue: 21b 099131345 Form number A0101 Page 20 / Total 35 page 0992054922-0 24 201215001 [0091] [0093] [0094] Processor: 22 Communication module: 23 Frame judgment module power line: 4 0
099131345 表單編號A0101 第21頁/共35頁 0992054922-0099131345 Form No. A0101 Page 21 of 35 0992054922-0