TWI752967B - Message transmission system, method and device - Google Patents
Message transmission system, method and device Download PDFInfo
- Publication number
- TWI752967B TWI752967B TW106119852A TW106119852A TWI752967B TW I752967 B TWI752967 B TW I752967B TW 106119852 A TW106119852 A TW 106119852A TW 106119852 A TW106119852 A TW 106119852A TW I752967 B TWI752967 B TW I752967B
- Authority
- TW
- Taiwan
- Prior art keywords
- unit
- message
- thread
- itinerary
- time period
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/548—Queue
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本發明提供一種訊息傳輸系統、方法和裝置,通過根據第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包,發送行程封裝包,實現訊息傳輸,提高網路資源的利用率,以及提高傳輸效率。 The present invention provides a system, method and device for message transmission. The first current time period corresponding to the source travel unit is determined according to the frequency at which the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit according to the first historical time period. According to the size of the itinerary package package corresponding to the first current time period, the message unit in the sending queue of the source itinerary unit is packaged, and the itinerary package package is generated, and the itinerary package package is sent to realize message transmission. Improve the utilization of network resources and improve transmission efficiency.
Description
本發明涉及電腦技術,尤其涉及一種訊息傳輸系統、方法和裝置。 The present invention relates to computer technology, and in particular, to a message transmission system, method and device.
在實時計算系統中,一個行程單元可以包含一個或者多個執行緒單元,行程單元之間、行程單元內的執行緒單元之間會涉及到大量的訊息傳輸。 In a real-time computing system, a travel unit may include one or more thread units, and a large amount of message transmission will be involved between travel units and among thread units within a travel unit.
現有技術中,為了提高訊息傳輸的性能,通常將同一個行程單元內的執行緒單元產生的訊息發送到該行程單元的發送隊列,該行程單元根據行程封裝包的固定的尺度(尺度指行程封裝包中包含的訊息的數量)對發送隊列中的訊息進行封裝(Batch)處理,通過網路通道將封裝處理後生成的行程封裝包從一個行程單元傳輸到另一個行程單元,接收到行程封裝包的行程單元再進行相應的訊息解封裝處理,將解封裝處理後得到的訊息發送到對應的執行緒單元。例如:行程單元A包含執行緒單元A1、執行緒單元A2和執行緒單元A3,行程單元B包含執行緒單元B1、執行緒單元B2和執行緒單元B3,行程單元A的執行緒單元和行程單元B的執行緒單元之間存在訊息傳輸,則將執行緒 單元A1、執行緒單元A2和執行緒單元A3產生的訊息發送到行程單元A的發送隊列,根據行程封裝包的固定的尺度對行程單元A的發送隊列中的訊息進行封裝處理,將封裝處理後生成的封裝包通過行程單元A和行程單元B之間的網路通道發送給行程單元B,行程單元B接收到行程封裝包再進行相應的訊息解封裝處理,將解封裝處理後得到的訊息發送到對應的執行緒單元。 In the prior art, in order to improve the performance of message transmission, the message generated by the thread unit in the same travel unit is usually sent to the sending queue of the travel unit, and the travel unit is based on the fixed scale of the travel package (the scale refers to the travel package). The number of messages contained in the packet) encapsulates (Batch) the messages in the sending queue, transmits the itinerary package generated after the encapsulation processing from one itinerary unit to another itinerary unit through the network channel, and receives the itinerary package. Then the corresponding message decapsulation process is performed on the itinerary unit, and the message obtained after the decapsulation process is sent to the corresponding thread unit. For example: Stroke unit A includes thread unit A1, thread unit A2 and thread unit A3; Stroke unit B includes thread unit B1, thread unit B2 and thread unit B3; Stroke unit A has thread unit and thread unit If there is message transmission between the thread units of B, the thread will be The messages generated by the unit A1, the thread unit A2 and the thread unit A3 are sent to the sending queue of the itinerary unit A, and the messages in the sending queue of the itinerary unit A are encapsulated according to the fixed size of the itinerary encapsulation package. The generated encapsulation package is sent to the itinerary unit B through the network channel between the itinerary unit A and the itinerary unit B. The itinerary unit B receives the itinerary package and then performs the corresponding message decapsulation processing, and sends the message obtained after the decapsulation processing. to the corresponding thread unit.
然而,採用現有技術的方法,進行訊息傳輸時,網路資源的利用率不高。 However, with the method of the prior art, the utilization rate of network resources is not high during message transmission.
本發明提供一種訊息傳輸系統、方法和裝置,以解決現有技術中網路資源的利用率不高的問題。 The present invention provides a message transmission system, method and device to solve the problem of low utilization rate of network resources in the prior art.
一個方面,本發明提供一種訊息傳輸系統,包括:源行程單元和目的行程單元,所述源行程單元包含至少一個執行緒單元,所述源行程單元和所述目的行程單元連接;其中,所述源行程單元,用於根據第一歷史時間段所述至少一個執行緒單元向所述源行程單元的發送隊列發送訊息單元的頻率,確定所述源行程單元的第一當前時間段對應的行程封裝包的尺度,所述訊息單元中包含至少一個訊息;所述源行程單元,還用於根據所述第一當前時間段對應的行程封裝包的尺度,對所述源行程單元的發送隊列中 的訊息單元進行封裝處理,生成行程封裝包;所述源行程單元,還用於向所述目的行程單元發送所述行程封裝包。 In one aspect, the present invention provides a message transmission system, comprising: a source travel unit and a destination travel unit, the source travel unit includes at least one thread unit, the source travel unit and the destination travel unit are connected; wherein, the The source travel unit, configured to determine the travel package corresponding to the first current time period of the source travel unit according to the frequency of sending message units to the sending queue of the source travel unit by the at least one thread unit in the first historical time period The size of the package, and the message unit contains at least one message; the source travel unit is also used to, according to the size of the travel package package corresponding to the first current time period, send a message to the sending queue of the source travel unit The message unit is encapsulated to generate an itinerary package; the source itinerary unit is further configured to send the itinerary package to the destination itinerary unit.
作為一種可實現方式,所述源行程單元具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於所述第一當前時間段對應的行程封裝包的尺度,則按照所述第一當前時間段對應的行程封裝包的尺度,對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,所述第一行程封裝包中包含的訊息單元的數量與所述第一當前時間段對應的行程封裝包的尺度相同。 As an achievable manner, the source travel unit is specifically configured to be greater than or equal to the travel package corresponding to the first current time period if the destination travel unit in the sending queue of the source travel unit is the message unit of the same travel unit. , then according to the scale of the itinerary package corresponding to the first current time period, the message unit whose destination itinerary unit is the same itinerary unit is packaged to generate a first itinerary package, wherein the first itinerary package is The number of information units contained in the itinerary package is the same as the size of the itinerary package corresponding to the first current time period.
作為一種可實現方式,所述源行程單元還具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於所述第一當前時間段對應的行程封裝包的尺度,則確定所述目的行程單元為同一行程單元的訊息單元中最早進入所述發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若所述第一等待時間大於等於所述第一預設定時時間,則對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包,所述第二行程封裝包中包含所述發送隊列中目的行程單元為同一行程單元的所有訊息單元。 As an achievable manner, the source travel unit is also specifically configured to be used if the number of message units whose destination travel unit is the same travel unit in the sending queue of the source travel unit is less than the travel package corresponding to the first current time period , then determine whether the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to a first preset timing time, and if the first waiting time is greater than or equal to is equal to the first preset timing time, then encapsulate the message units whose destination itinerary units are the same itinerary unit, and generate a second itinerary package, where the second itinerary package contains the destination in the sending queue A travel unit is all message units of the same travel unit.
作為一種可實現方式,所述源行程單元具體用於獲取所述第一歷史時間段內,通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的第一數量;以及,獲取 所述第一歷史時間段內,通過所述第二行程封裝包發送的訊息單元的第二數量;根據所述第二數量和所述第一數量的比值以及所述第一歷史時間段對應的行程封裝包的尺度,確定所述第一當前時間段對應的行程封裝包的尺度。 As an achievable manner, the source travel unit is specifically configured to acquire the first number of message units sent through the first travel package and the second travel package within the first historical time period; and ,Obtain Within the first historical time period, the second quantity of message units sent through the second itinerary package; according to the ratio of the second quantity to the first quantity and the corresponding value of the first historical time period The size of the itinerary package is to determine the size of the itinerary package corresponding to the first current time period.
另一方面,本發明提供一種訊息傳輸方法,包括:根據第一歷史時間段源行程單元的執行緒單元向所述源行程單元的發送隊列發送訊息單元的頻率,確定所述源行程單元的第一當前時間段對應的行程封裝包的尺度,所述訊息單元中包含至少一個訊息;根據所述第一當前時間段對應的行程封裝包的尺度,對所述源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;發送所述行程封裝包。 In another aspect, the present invention provides a message transmission method, comprising: determining the first time period of the source travel unit according to the frequency at which the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit in the first historical time period. a size of the itinerary package corresponding to the current time period, the message unit contains at least one message; according to the size of the itinerary package corresponding to the first current time period, the message in the sending queue of the source itinerary unit The unit performs encapsulation processing to generate an itinerary encapsulation package; and sends the itinerary encapsulation package.
作為一種可實現方式,所述行程封裝包包括:第一行程封裝包;所述根據所述第一當前時間段對應的行程封裝包的尺度,對所述源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包,包括:若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於所述第一當前時間段對應的行程封裝包的尺度,則按照所述第一當前時間段對應的行程封裝包的尺度,對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,所述第一行程封裝包中包含的訊息單元的數量與所述 第一當前時間段對應的行程封裝包的尺度相同。 As an achievable manner, the itinerary package includes: a first itinerary package; and according to the size of the itinerary package corresponding to the first current time period, for the message unit in the sending queue of the source itinerary unit Performing encapsulation processing to generate a travel package, including: if the number of message units whose destination travel units are the same travel unit in the sending queue of the source travel unit is greater than or equal to the size of the travel package corresponding to the first current time period, Then, according to the scale of the itinerary package corresponding to the first current time period, the message unit whose destination itinerary unit is the same itinerary unit is packaged to generate a first itinerary package, wherein the first itinerary package is The number of message units contained in the The dimensions of the itinerary packages corresponding to the first current time period are the same.
作為一種可實現方式,所述行程封裝包還包括:第二行程封裝包;所述方法還包括:若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於所述第一當前時間段對應的行程封裝包的尺度,則確定所述目的行程單元為同一行程單元的訊息單元中最早進入所述發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若所述第一等待時間大於等於所述第一預設定時時間,則對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包,所述第二行程封裝包中包含所述發送隊列中目的行程單元為同一行程單元的所有訊息單元。 As an achievable manner, the itinerary package further includes: a second itinerary package; and the method further includes: if the number of message units whose destination itinerary units are the same itinerary unit in the sending queue of the source itinerary unit is less than all the size of the itinerary package corresponding to the first current time period, then determine whether the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to a first preset Timing time, if the first waiting time is greater than or equal to the first preset timing time, encapsulate the message units whose destination itinerary unit is the same itinerary unit, and generate a second itinerary package, the second itinerary package. The travel package includes all message units whose destination travel units in the sending queue are the same travel unit.
作為一種可實現方式,所述根據第一歷史時間段源行程單元的執行緒單元向所述源行程單元的發送隊列發送訊息單元的頻率,確定所述源行程單元的第一當前時間段對應的行程封裝包的尺度,包括:獲取所述第一歷史時間段內,通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的第一數量;以及,獲取所述第一歷史時間段內,通過所述第二行程封裝包發送的訊息單元的第二數量;根據所述第二數量和所述第一數量的比值以及所述第一歷史時間段對應的行程封裝包的尺度,確定所述第一當 前時間段對應的行程封裝包的尺度。 As an achievable manner, determining the frequency corresponding to the first current time period of the source travel unit according to the frequency at which the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit in the first historical time period The scale of the itinerary package includes: acquiring the first number of message units sent through the first itinerary package and the second itinerary package within the first historical time period; and acquiring the first During the historical time period, the second quantity of message units sent through the second itinerary package; according to the ratio of the second quantity to the first quantity and the number of the itinerary package corresponding to the first historical time period scale, determine the first when The scale of the itinerary package corresponding to the previous time period.
作為一種可實現方式,所述根據所述第二數量和所述第一數量的比值以及所述第一歷史時間段對應的行程封裝包的尺度,確定所述第一當前時間段對應的行程封裝包的尺度,包括:若所述比值大於第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,所述第一係數小於1。 As an achievable manner, determining the itinerary package corresponding to the first current time period according to the ratio of the second quantity to the first quantity and the scale of the itinerary package corresponding to the first historical time period The size of the package, including: if the ratio is greater than a first preset threshold, determining that the size of the itinerary package corresponding to the first current time period is the size of the itinerary package corresponding to the first historical time period and the first A product of coefficients, wherein the first coefficient is less than one.
作為一種可實現方式,還包括:若所述比值小於等於所述第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,所述第二係數大於1。 As an achievable manner, the method further includes: if the ratio is less than or equal to the first preset threshold, determining that the scale of the itinerary package corresponding to the first current time period is the itinerary corresponding to the first historical time period The product of the dimension of the package and a second coefficient, wherein the second coefficient is greater than 1.
作為一種可實現方式,還包括:確定所述第一數量與第三數量的比值為所述第二係數,其中,所述第三數量為所述第一歷史時間段的前一時間段通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的數量。 As an achievable manner, the method further includes: determining the ratio of the first quantity to the third quantity as the second coefficient, where the third quantity is the time period passed through the previous time period of the first historical time period as the second coefficient. The number of message units sent by the first travel package and the second travel package.
作為一種可實現方式,所述第一預設閾值為0.5。 As an implementable manner, the first preset threshold is 0.5.
再一方面,本發明提供一種訊息傳輸裝置,包括:處理模組,用於根據第一歷史時間段源行程單元的執行緒單元向所述源行程單元的發送隊列發送訊息單元的頻率,確定所述源行程單元的第一當前時間段對應的行程封 裝包的尺度,所述訊息單元中包含至少一個訊息;封裝模組,用於根據所述第一當前時間段對應的行程封裝包的尺度,對所述源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;發送模組,用於發送所述行程封裝包。 In another aspect, the present invention provides a message transmission device, comprising: a processing module configured to determine the frequency of sending a message unit to a sending queue of the source travel unit according to the frequency of sending a message unit by a thread unit of a source travel unit in a first historical time period. The travel envelope corresponding to the first current time period of the source travel unit The size of the package, the message unit contains at least one message; the package module is used for, according to the size of the itinerary package corresponding to the first current time period, to the message unit in the sending queue of the source travel unit Perform encapsulation processing to generate an itinerary encapsulation package; and a sending module for sending the itinerary encapsulation package.
作為一種可實現方式,所述行程封裝包包括:第一行程封裝包;所述封裝模組具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於所述第一當前時間段對應的行程封裝包的尺度,則按照所述第一當前時間段對應的行程封裝包的尺度,對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,所述第一行程封裝包中包含的訊息單元的數量與所述第一當前時間段對應的行程封裝包的尺度相同。 As an achievable manner, the itinerary package includes: a first itinerary package; and the package module is specifically configured to, if the destination travel unit in the sending queue of the source travel unit is the same travel unit, the number of message units is greater than is equal to the size of the itinerary package corresponding to the first current time period, then according to the size of the itinerary package corresponding to the first current time period, encapsulation processing is performed on the message unit whose destination itinerary unit is the same itinerary unit, A first itinerary package is generated, wherein the number of information units contained in the first itinerary package is the same as the size of the itinerary package corresponding to the first current time period.
作為一種可實現方式,所述行程封裝包還包括:第二行程封裝包;所述封裝模組還具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於所述第一當前時間段對應的行程封裝包的尺度,則確定所述目的行程單元為同一行程單元的訊息單元中最早進入所述發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若所述第一等待時間大於等於所述第一預設定時時間,則對所述目的行程單元為同一行程單元的訊 息單元進行封裝處理,生成第二行程封裝包,所述第二行程封裝包中包含所述發送隊列中目的行程單元為同一行程單元的所有訊息單元。 As an achievable manner, the itinerary package further includes: a second itinerary package; and the package module is also specifically configured to: if the destination itinerary unit in the sending queue of the source itinerary unit is a message unit of the same itinerary unit The quantity is smaller than the size of the itinerary package corresponding to the first current time period, then it is determined whether the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to the first A preset timing time, if the first waiting time is greater than or equal to the first preset timing time, then the destination trip unit is the same trip unit. The message unit performs encapsulation processing to generate a second travel package, where the second travel package includes all message units in the sending queue whose destination travel units are the same travel unit.
作為一種可實現方式,所述處理模組具體用於獲取所述第一歷史時間段內,通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的第一數量;以及,獲取所述第一歷史時間段內,通過所述第二行程封裝包發送的訊息單元的第二數量;根據所述第二數量和所述第一數量的比值以及所述第一歷史時間段對應的行程封裝包的尺度,確定所述第一當前時間段對應的行程封裝包的尺度。 As an achievable manner, the processing module is specifically configured to acquire the first number of message units sent through the first travel package and the second travel package within the first historical time period; and , to obtain the second quantity of message units sent through the second itinerary package within the first historical time period; according to the ratio of the second quantity to the first quantity and the first historical time period The size of the corresponding itinerary package is to determine the size of the itinerary package corresponding to the first current time period.
作為一種可實現方式,所述處理模組具體用於若所述比值大於第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,所述第一係數小於1。 As an achievable manner, the processing module is specifically configured to, if the ratio is greater than a first preset threshold, determine that the scale of the itinerary package corresponding to the first current time period corresponds to the first historical time period The product of the dimension of the itinerary package and a first coefficient, wherein the first coefficient is less than 1.
作為一種可實現方式,所述處理模組還具體用於若所述比值小於等於所述第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,所述第二係數大於1。 As an achievable manner, the processing module is further configured to, if the ratio is less than or equal to the first preset threshold, determine that the size of the itinerary package corresponding to the first current time period is the first The product of the scale of the itinerary package corresponding to the historical time period and a second coefficient, where the second coefficient is greater than 1.
作為一種可實現方式,所述處理模組還用於確定所述第一數量與第三數量的比值為所述第二係數,其中,所述第三數量為所述第一歷史時間段的前一時間段通過所述第 一行程封裝包和所述第二行程封裝包發送的訊息單元的數量。 As an achievable manner, the processing module is further configured to determine the ratio of the first quantity to the third quantity as the second coefficient, where the third quantity is the previous value of the first historical time period a period of time through the The number of message units sent by the one-trip packet and the second-trip packet.
作為一種可實現方式,所述第一預設閾值為0.5。 As an implementable manner, the first preset threshold is 0.5.
又一方面,本發明提供一種訊息傳輸裝置,包括:處理器,用於根據第一歷史時間段源行程單元的執行緒單元向所述源行程單元的發送隊列發送訊息單元的頻率,確定所述源行程單元的第一當前時間段對應的行程封裝包的尺度,所述訊息單元中包含至少一個訊息;所述處理器還用於根據所述第一當前時間段對應的行程封裝包的尺度,對所述源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;發送器,所述發送器耦合至所述處理器,所述發送器用於發送所述行程封裝包。 In yet another aspect, the present invention provides a message transmission apparatus, comprising: a processor configured to determine the the size of the itinerary package corresponding to the first current time period of the source itinerary unit, the message unit contains at least one message; the processor is further configured to, according to the size of the itinerary package corresponding to the first current time period, performing encapsulation processing on the message units in the sending queue of the source itinerary unit, to generate an itinerary encapsulation package; and a transmitter, which is coupled to the processor, and is used for sending the itinerary encapsulation package.
作為一種可實現方式,所述行程封裝包包括:第一行程封裝包;所述處理器具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於所述第一當前時間段對應的行程封裝包的尺度,則按照所述第一當前時間段對應的行程封裝包的尺度,對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,所述第一行程封裝包中包含的訊息單元的數量與所述第一當前時間段對應的行程封裝包的尺度相同。 As an achievable manner, the itinerary package includes: a first itinerary package; and the processor is specifically configured to, if the number of message units whose destination itinerary unit is the same itinerary unit in the sending queue of the source itinerary unit is greater than or equal to The size of the itinerary package corresponding to the first current time period, then according to the size of the itinerary package corresponding to the first current time period, encapsulate the message units whose destination itinerary units are the same itinerary unit, and generate A first itinerary package, wherein the number of information units contained in the first itinerary package is the same as the size of the itinerary package corresponding to the first current time period.
作為一種可實現方式,所述行程封裝包還包括:第二 行程封裝包;所述處理器還具體用於若所述源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於所述第一當前時間段對應的行程封裝包的尺度,則確定所述目的行程單元為同一行程單元的訊息單元中最早進入所述發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若所述第一等待時間大於等於所述第一預設定時時間,則對所述目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包,所述第二行程封裝包中包含所述發送隊列中目的行程單元為同一行程單元的所有訊息單元。 As an achievable manner, the travel package further includes: a second a travel package; the processor is further specifically configured to, if the number of message units whose destination travel units are the same travel unit in the sending queue of the source travel unit is smaller than the size of the travel package corresponding to the first current time period, Then determine whether the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to a first preset timing time, and if the first waiting time is greater than or equal to the For the first preset timing time, the message unit whose destination travel unit is the same travel unit is packaged to generate a second travel package, where the second travel package includes the destination travel unit in the sending queue: All message units of the same trip unit.
作為一種可實現方式,所述處理器具體用於獲取所述第一歷史時間段內,通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的第一數量;以及,獲取所述第一歷史時間段內,通過所述第二行程封裝包發送的訊息單元的第二數量;根據所述第二數量和所述第一數量的比值以及所述第一歷史時間段對應的行程封裝包的尺度,確定所述第一當前時間段對應的行程封裝包的尺度。 As an achievable manner, the processor is specifically configured to acquire the first number of message units sent through the first travel package and the second travel package within the first historical time period; and, Acquire the second quantity of message units sent through the second trip package within the first historical time period; according to the ratio of the second quantity to the first quantity and the correspondence of the first historical time period The dimension of the itinerary package is determined, and the dimension of the itinerary package corresponding to the first current time period is determined.
作為一種可實現方式,所述處理器具體用於若所述比值大於第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,所述第一係數小於1。 As an achievable manner, the processor is specifically configured to, if the ratio is greater than a first preset threshold, determine that the scale of the itinerary package corresponding to the first current time period is the scale corresponding to the first historical time period The product of the dimension of the trip package and a first coefficient, wherein the first coefficient is less than one.
作為一種可實現方式,所述處理器還具體用於若所述比值小於等於所述第一預設閾值,則確定所述第一當前時間段對應的行程封裝包的尺度為所述第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,所述第二係數大於1。 As an achievable manner, the processor is further configured to, if the ratio is less than or equal to the first preset threshold, determine that the scale of the itinerary package corresponding to the first current time period is the first history The product of the scale of the itinerary package corresponding to the time period and a second coefficient, where the second coefficient is greater than 1.
作為一種可實現方式,所述處理器還用於確定所述第一數量與第三數量的比值為所述第二係數,其中,所述第三數量為所述第一歷史時間段的前一時間段通過所述第一行程封裝包和所述第二行程封裝包發送的訊息單元的數量。 As an achievable manner, the processor is further configured to determine the ratio of the first quantity to the third quantity as the second coefficient, where the third quantity is the previous one of the first historical time period The number of message units sent through the first trip package and the second trip package in the time period.
作為一種可實現方式,所述第一預設閾值為0.5。 As an implementable manner, the first preset threshold is 0.5.
又一方面,本發明提供一種訊息傳輸系統,包括:源行程單元,所述源行程單元包括至少一個執行緒單元;所述執行緒單元,用於對所述執行緒單元產生的訊息進行封裝處理,生成訊息單元,所述訊息單元中包含至少兩個訊息;所述執行緒單元,還用於向所述源行程單元的發送隊列發送所述訊息單元。 In another aspect, the present invention provides a message transmission system, comprising: a source run unit, the source run unit includes at least one thread unit; the thread unit is configured to encapsulate a message generated by the thread unit , generating a message unit, where the message unit includes at least two messages; the thread unit is further configured to send the message unit to the sending queue of the source travel unit.
作為一種可實現方式,所述執行緒單元具體用於根據第二當前時間段對應的執行緒封裝包的尺度,對所述執行緒單元產生的訊息進行封裝處理,生成所述訊息單元;作為一種可實現方式,所述執行緒單元還用於根據第二歷史時間段內所述執行緒單元產生的訊息的數量,確定 所述第二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the thread unit is specifically configured to encapsulate the message generated by the thread unit according to the size of the thread package corresponding to the second current time period to generate the message unit; as a kind of In an implementation manner, the thread unit is further configured to determine according to the number of messages generated by the thread unit within the second historical time period. The scale of the thread encapsulation package corresponding to the second current time period.
作為一種可實現方式,所述執行緒單元具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於所述第二當前時間段對應的執行緒封裝包的尺度,則按照所述執行緒封裝包的尺度,對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,所述第一訊息單元中包含的訊息的數量與所述執行緒封裝包的尺度相同。 As an achievable manner, the thread unit is specifically configured to be more than or equal to the thread package corresponding to the second current time period if the destination thread unit generated by the thread unit is the message of the same thread unit. , then according to the scale of the thread encapsulation package, encapsulate the message whose destination thread unit is the same thread unit to generate a first message unit, wherein the message contained in the first message unit The number is the same as the size of the thread wrapper.
作為一種可實現方式,所述執行緒單元還具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於所述第二當前時間段對應的執行緒封裝包的尺度,則確定所述目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若所述第二等待時間大於等於所述第二預設定時時間,則對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,所述第二訊息單元中包含所述執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 As an achievable manner, the thread unit is also specifically configured to, if the destination thread unit generated by the thread unit is the same thread unit, the number of messages is smaller than the thread package corresponding to the second current time period , then determine whether the second waiting time of the earliest generated message among the messages whose destination thread unit is the same thread unit is greater than or equal to a second preset timing time, if the second waiting time is greater than or equal to the first For two preset timings, the message whose destination thread unit is the same thread unit is encapsulated to generate a second message unit, wherein the second message unit includes the destination execution generated by the thread unit. A thread unit is all messages of the same thread unit.
作為一種可實現方式,所述執行緒單元具體用於獲取所述第二歷史時間段內,通過所述第一訊息單元和所述第二訊息單元發送的訊息的第三數量;以及,獲取所述第二歷史時間段內,通過所述第二訊息單元發送的訊息的第四數量;根據所述第四數量和所述第三數量的比值以及所述第二歷史時間段對應的執行緒封裝包的尺度,確定所述第 二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the thread unit is specifically configured to acquire the third quantity of messages sent by the first message unit and the second message unit within the second historical time period; In the second historical time period, the fourth quantity of messages sent by the second message unit; according to the ratio of the fourth quantity to the third quantity and the thread encapsulation corresponding to the second historical time period package dimensions, determine the section 2. The scale of the thread encapsulation package corresponding to the current time period.
又一方面,本發明提供一種訊息傳輸方法,包括:對執行緒單元產生的訊息進行封裝處理,生成訊息單元,所述訊息單元包含至少兩個訊息;向所述源行程單元的發送隊列發送所述訊息單元。 In another aspect, the present invention provides a message transmission method, comprising: encapsulating a message generated by a thread unit to generate a message unit, wherein the message unit includes at least two messages; sending the message to a sending queue of the source process unit the message unit.
作為一種可實現方式,所述對執行緒單元產生的訊息進行封裝處理包括:根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元。 As an achievable manner, the encapsulation processing on the message generated by the thread unit includes: according to the size of the thread encapsulation package corresponding to the second current time period, encapsulating the message generated by the thread unit, and generating the message unit.
作為一種可實現方式,所述根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元之前,還包括:根據第二歷史時間段內所述執行緒單元產生的訊息的數量,確定所述第二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, performing encapsulation processing on the message generated by the thread unit according to the scale of the thread encapsulation package corresponding to the second current time period, and before generating the message unit, further includes: according to the second historical time period The number of messages generated by the thread unit within the thread unit determines the size of the thread package corresponding to the second current time period.
作為一種可實現方式,所述訊息單元包括第一訊息單元;所述根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元,包括:若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於所述第二當前時間段對應的執行緒封裝包的尺度,則按照所述執行緒封裝包的尺度, 對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,所述第一訊息單元中包含的訊息的數量與所述執行緒封裝包的尺度相同。 As an achievable manner, the message unit includes a first message unit; the message unit is generated by encapsulating the message generated by the thread unit according to the size of the thread encapsulation package corresponding to the second current time period, Including: if the number of messages whose destination thread units are the same thread unit generated by the thread unit is greater than or equal to the size of the thread encapsulation package corresponding to the second current time period, then according to the size of the thread encapsulation package scale, The message whose destination thread unit is the same thread unit is encapsulated to generate a first message unit, wherein the number of messages contained in the first message unit is the same as the size of the thread encapsulation package.
作為一種可實現方式,所述訊息單元還包括第二訊息單元;所述方法還包括:若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於所述第二當前時間段對應的執行緒封裝包的尺度,則確定所述目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若所述第二等待時間大於等於所述第二預設定時時間,則對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,所述第二訊息單元中包含所述執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 As an implementable manner, the message unit further includes a second message unit; the method further includes: if the destination thread unit generated by the thread unit is the same thread unit, the number of messages is less than the second current message unit The size of the thread encapsulation package corresponding to the time period is used to determine whether the second waiting time of the earliest generated message among the messages whose destination thread unit is the same thread unit is greater than or equal to the second preset timing time, if the first When the second waiting time is greater than or equal to the second preset timing time, the message whose destination thread unit is the same thread unit is encapsulated to generate a second message unit, wherein the second message unit includes the The destination thread unit generated by the thread unit is all messages of the same thread unit.
作為一種可實現方式,所述根據第二歷史時間段內所述執行緒單元產生的訊息的數量,確定所述第二當前時間段對應的執行緒封裝包的尺度,包括:獲取所述第二歷史時間段內,通過所述第一訊息單元和所述第二訊息單元發送的訊息的第三數量;以及,獲取所述第二歷史時間段內,通過所述第二訊息單元發送的訊息的第四數量;根據所述第四數量和所述第三數量的比值以及所述第二歷史時間段對應的執行緒封裝包的尺度,確定所述第二 當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the determining the size of the thread encapsulation package corresponding to the second current time period according to the number of messages generated by the thread unit in the second historical time period includes: obtaining the second During the historical time period, the third number of messages sent by the first message unit and the second message unit; and obtaining the number of messages sent by the second message unit in the second historical time period a fourth quantity; the second quantity is determined according to the ratio of the fourth quantity to the third quantity and the scale of the thread encapsulation package corresponding to the second historical time period The size of the thread package corresponding to the current time period.
作為一種可實現方式,所述根據所述第四數量和所述第三數量的比值以及所述第二歷史時間段對應的執行緒封裝包的尺度,確定所述第二當前時間段對應的執行緒封裝包的尺度,包括:若所述比值大於第二預設閾值,則確定所述第二當前時間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,所述第三係數小於1。 As an implementable manner, determining the execution corresponding to the second current time period according to the ratio of the fourth quantity to the third quantity and the scale of the thread encapsulation package corresponding to the second historical time period determining the scale of the thread encapsulation package, including: if the ratio is greater than a second preset threshold, determining that the scale of the thread encapsulation package corresponding to the second current time period is the thread encapsulation package corresponding to the second historical time period The product of the scale of , and a third coefficient, wherein the third coefficient is less than 1.
作為一種可實現方式,還包括:若所述比值小於等於所述第二預設閾值,則確定所述第二當前時間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,所述第四係數大於1。 As an implementable manner, the method further includes: if the ratio is less than or equal to the second preset threshold, determining that the scale of the thread encapsulation package corresponding to the second current time period is the scale corresponding to the second historical time period The product of the dimension of the thread encapsulation package and a fourth coefficient, wherein the fourth coefficient is greater than 1.
作為一種可實現方式,所述第二預設閾值為0.5。 As an implementable manner, the second preset threshold is 0.5.
作為一種可實現方式,所述根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元之前,還包括:確定所述執行緒單元產生的訊息的目的執行緒單元不屬於所述源行程單元。 As an achievable manner, performing encapsulation processing on the message generated by the thread unit according to the scale of the thread encapsulation package corresponding to the second current time period, and before generating the message unit, further includes: determining the thread unit The destination thread unit of the generated message does not belong to the source thread unit.
又一方面,本發明提供一種訊息傳輸裝置,包括:封裝模組,用於對執行緒單元產生的訊息進行封裝處理,生成訊息單元,所述訊息單元包含至少兩個訊息;發送模組,用於向所述源行程單元的發送隊列發送所 述訊息單元。 In yet another aspect, the present invention provides a message transmission device, comprising: an encapsulation module for encapsulating a message generated by a thread unit to generate a message unit, the message unit including at least two messages; a sending module for using for sending all messages to the send queue of the source travel unit the message unit.
作為一種可實現方式,所述封裝模組具體用於根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元。 As an achievable manner, the encapsulation module is specifically configured to encapsulate the message generated by the thread unit according to the size of the thread encapsulation package corresponding to the second current time period to generate the message unit.
作為一種可實現方式,還包括:處理模組,用於根據第二歷史時間段內所述執行緒單元產生的訊息的數量,確定所述第二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the method further includes: a processing module configured to determine the size of the thread encapsulation package corresponding to the second current time period according to the number of messages generated by the thread unit in the second historical time period.
作為一種可實現方式,所述訊息單元包括第一訊息單元;所述封裝模組具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於所述第二當前時間段對應的執行緒封裝包的尺度,則按照所述執行緒封裝包的尺度,對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,所述第一訊息單元中包含的訊息的數量與所述執行緒封裝包的尺度相同。 As an achievable manner, the message unit includes a first message unit; and the encapsulation module is specifically configured to be more than or equal to the number of messages of the same thread unit if the destination thread unit generated by the thread unit is the same thread unit. 2. According to the size of the thread encapsulation package corresponding to the current time period, according to the size of the thread encapsulation package, encapsulate the message whose destination thread unit is the same thread unit, and generate a first message unit, wherein, The number of messages contained in the first message unit is the same as the size of the thread encapsulation package.
作為一種可實現方式,所述訊息單元還包括第二訊息單元;所述封裝模組還具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於所述第二當前時間段對應的執行緒封裝包的尺度,則確定所述目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若所述 第二等待時間大於等於所述第二預設定時時間,則對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,所述第二訊息單元中包含所述執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 As an achievable manner, the message unit further includes a second message unit; and the encapsulation module is also specifically configured to, if the destination thread unit generated by the thread unit is the same thread unit, the number of messages is smaller than the number of messages of the same thread unit. The size of the thread encapsulation package corresponding to the second current time period is to determine whether the second waiting time of the earliest generated message among the messages whose destination thread unit is the same thread unit is greater than or equal to the second preset timing time, if said When the second waiting time is greater than or equal to the second preset timing time, the message whose destination thread unit is the same thread unit is encapsulated to generate a second message unit, wherein the second message unit includes The destination thread unit generated by the thread unit is all messages of the same thread unit.
作為一種可實現方式,所述處理模組具體用於獲取所述第二歷史時間段內,通過所述第一訊息單元和所述第二訊息單元發送的訊息的第三數量;以及,獲取所述第二歷史時間段內,通過所述第二訊息單元發送的訊息的第四數量;根據所述第四數量和所述第三數量的比值以及所述第二歷史時間段對應的執行緒封裝包的尺度,確定所述第二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the processing module is specifically configured to obtain the third quantity of messages sent by the first message unit and the second message unit within the second historical time period; In the second historical time period, the fourth quantity of messages sent by the second message unit; according to the ratio of the fourth quantity to the third quantity and the thread encapsulation corresponding to the second historical time period The size of the package is to determine the size of the thread encapsulation package corresponding to the second current time period.
作為一種可實現方式,所述處理模組具體用於若所述比值大於第二預設閾值,則確定所述第二當前時間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,所述第三係數小於1。 As an achievable manner, the processing module is specifically configured to, if the ratio is greater than a second preset threshold, determine that the scale of the thread package corresponding to the second current time period is the second historical time period The product of the dimension of the corresponding thread encapsulation package and a third coefficient, wherein the third coefficient is less than 1.
作為一種可實現方式,所述處理模組還具體用於若所述比值小於等於所述第二預設閾值,則確定所述第二當前時間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,所述第四係數大於1。 As an achievable manner, the processing module is further configured to, if the ratio is less than or equal to the second preset threshold, determine that the size of the thread package corresponding to the second current time period is the first The product of the scale of the thread package corresponding to the two historical time periods and a fourth coefficient, where the fourth coefficient is greater than 1.
作為一種可實現方式,所述第二預設閾值為0.5。 As an implementable manner, the second preset threshold is 0.5.
作為一種可實現方式,所述處理模組還具體用於確定 所述執行緒單元產生的訊息的目的執行緒單元不屬於所述源行程單元。 As an achievable manner, the processing module is also specifically used to determine The destination thread unit of the message generated by the thread unit does not belong to the source run unit.
又一方面,本發明提供一種訊息傳輸裝置,包括:處理器,用於對執行緒單元產生的訊息進行封裝處理,生成訊息單元,所述訊息單元包含至少兩個訊息;發送器,所述發送器耦合至所述處理器,所述發送器用於向所述源行程單元的發送隊列發送所述訊息單元。 In another aspect, the present invention provides a message transmission device, comprising: a processor for encapsulating a message generated by a thread unit to generate a message unit, the message unit including at least two messages; a transmitter for sending the message A transmitter is coupled to the processor, the transmitter for transmitting the message unit to a transmit queue of the source run unit.
作為一種可實現方式,所述處理器具體用於根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成所述訊息單元。 As an achievable manner, the processor is specifically configured to perform encapsulation processing on the message generated by the thread unit according to the size of the thread encapsulation package corresponding to the second current time period to generate the message unit.
作為一種可實現方式,所述處理器還用於根據第二歷史時間段內所述執行緒單元產生的訊息的數量,確定所述第二當前時間段對應的執行緒封裝包的尺度。 As an implementable manner, the processor is further configured to determine the size of the thread encapsulation package corresponding to the second current time period according to the number of messages generated by the thread unit in the second historical time period.
作為一種可實現方式,所述訊息單元包括第一訊息單元;所述處理器具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於所述第二當前時間段對應的執行緒封裝包的尺度,則按照所述執行緒封裝包的尺度,對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,所述第一訊息單元中包含的訊息的數量與所述執行緒封裝包的尺度相同。 As an implementation manner, the message unit includes a first message unit; the processor is specifically configured to, if the destination thread unit generated by the thread unit is the same thread unit, the number of messages is greater than or equal to the second According to the size of the thread encapsulation package corresponding to the current time period, according to the size of the thread encapsulation package, encapsulate the message whose destination thread unit is the same thread unit, and generate a first message unit, wherein the The number of messages contained in the first message unit is the same as the size of the thread encapsulation package.
作為一種可實現方式,所述訊息單元還包括第二訊息單元; 所述處理器還具體用於若所述執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於所述第二當前時間段對應的執行緒封裝包的尺度,則確定所述目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若所述第二等待時間大於等於所述第二預設定時時間,則對所述目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,所述第二訊息單元中包含所述執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 As an implementable manner, the message unit further includes a second message unit; The processor is further specifically configured to determine that if the number of messages whose destination thread unit is the same thread unit generated by the thread unit is smaller than the size of the thread package corresponding to the second current time period Whether the second waiting time of the earliest generated message in the messages whose destination thread unit is the same thread unit is greater than or equal to the second preset timing time, if the second waiting time is greater than or equal to the second preset timing time, then Perform encapsulation processing on the message whose destination thread unit is the same thread unit to generate a second message unit, wherein the second message unit includes the destination thread unit generated by the thread unit is the same thread unit all messages.
作為一種可實現方式,所述處理器具體用於獲取所述第二歷史時間段內,通過所述第一訊息單元和所述第二訊息單元發送的訊息的第三數量;以及,獲取所述第二歷史時間段內,通過所述第二訊息單元發送的訊息的第四數量;根據所述第四數量和所述第三數量的比值以及所述第二歷史時間段對應的執行緒封裝包的尺度,確定所述第二當前時間段對應的執行緒封裝包的尺度。 As an achievable manner, the processor is specifically configured to acquire the third quantity of messages sent by the first message unit and the second message unit within the second historical time period; and acquire the The fourth quantity of messages sent by the second message unit in the second historical time period; according to the ratio of the fourth quantity to the third quantity and the thread encapsulation package corresponding to the second historical time period The scale of the thread encapsulation package corresponding to the second current time period is determined.
作為一種可實現方式,所述處理器具體用於若所述比值大於第二預設閾值,則確定所述第二當前時間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,所述第三係數小於1。 As an achievable manner, the processor is specifically configured to, if the ratio is greater than a second preset threshold, determine that the scale of the thread encapsulation package corresponding to the second current time period corresponds to the second historical time period The product of the scale of the thread encapsulation package and a third coefficient, wherein the third coefficient is less than 1.
作為一種可實現方式,所述處理器還具體用於若所述比值小於等於所述第二預設閾值,則確定所述第二當前時 間段對應的執行緒封裝包的尺度為所述第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,所述第四係數大於1。 As an achievable manner, the processor is further specifically configured to determine the second current time if the ratio is less than or equal to the second preset threshold The dimension of the thread encapsulation package corresponding to the interval is the product of the dimension of the thread encapsulation package corresponding to the second historical time period and a fourth coefficient, where the fourth coefficient is greater than 1.
作為一種可實現方式,所述第二預設閾值為0.5。 As an implementable manner, the second preset threshold is 0.5.
作為一種可實現方式,所述處理器還具體用於確定所述執行緒單元產生的訊息的目的執行緒單元不屬於所述源行程單元。 As an implementable manner, the processor is further specifically configured to determine that the destination thread unit of the message generated by the thread unit does not belong to the source run unit.
又一方面,本發明提供一種訊息傳輸系統,包括:行程單元,所述行程單元包括源執行緒單元和目的執行緒單元;所述源執行緒單元,用於確定所述源執行緒單元產生的訊息的目的執行緒單元是否屬於同一行程單元;所述源執行緒單元,還用於若所述訊息的目的執行緒單元屬於同一行程單元,則向所述目的執行緒單元的接收隊列發送所述訊息。 In yet another aspect, the present invention provides a message transmission system, comprising: a travel unit, the travel unit includes a source thread unit and a destination thread unit; the source thread unit is configured to determine a message generated by the source thread unit Whether the destination thread unit of the message belongs to the same travel unit; the source thread unit is further configured to send the message to the receiving queue of the destination thread unit if the destination thread unit of the message belongs to the same travel unit message.
又一方面,本發明提供一種訊息傳輸方法,包括:確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元;若所述訊息的目的執行緒單元與源執行緒單元屬於同一行程單元,則向所述目的執行緒單元的接收隊列發送所述訊息。 In yet another aspect, the present invention provides a message transmission method, comprising: determining whether the destination thread unit of the generated message and the source thread unit belong to the same itinerary unit; if the destination thread unit of the message and the source thread unit belong to the same thread unit The itinerary unit sends the message to the receiving queue of the destination thread unit.
又一方面,本發明提供一種訊息傳輸裝置,包括:處理模組,用於確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元; 發送模組,用於若所述訊息的目的執行緒單元與源執行緒單元屬於同一行程單元,則向所述目的執行緒單元的接收隊列發送所述訊息。 In another aspect, the present invention provides a message transmission device, comprising: a processing module for determining whether the destination thread unit of the generated message and the source thread unit belong to the same itinerary unit; The sending module is configured to send the message to the receiving queue of the destination thread unit if the destination thread unit of the message and the source thread unit belong to the same itinerary unit.
又一方面,本發明提供一種訊息傳輸裝置,包括:處理器和發送器,所述處理器用於確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元;所述發送器耦合至所述處理器,所述發送器用於若所述訊息的目的執行緒單元與源執行緒單元屬於同一行程單元,則向所述目的執行緒單元的接收隊列發送所述訊息。 In yet another aspect, the present invention provides a message transmission device, comprising: a processor and a transmitter, the processor is configured to determine whether a destination thread unit of a generated message and a source thread unit belong to the same travel unit; the transmitter is coupled to To the processor, the sender is configured to send the message to the receive queue of the destination thread unit if the destination thread unit of the message and the source thread unit belong to the same travel unit.
本發明提供的訊息傳輸系統、方法和裝置,通過根據第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包,發送行程封裝包,實現訊息傳輸,提高網路資源的利用率,以及提高傳輸效率。 In the message transmission system, method and device provided by the present invention, the first current time period corresponding to the source travel unit is determined according to the frequency at which the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit according to the first historical time period. According to the size of the itinerary package package corresponding to the first current time period, the message unit in the sending queue of the source itinerary unit is packaged, and the itinerary package package is generated, and the itinerary package package is sent to realize message transmission. Improve the utilization of network resources and improve transmission efficiency.
601‧‧‧處理模組 601‧‧‧Processing Module
602‧‧‧封裝模組 602‧‧‧Package module
603‧‧‧發送模組 603‧‧‧Send module
701‧‧‧處理器 701‧‧‧Processor
702‧‧‧發送器 702‧‧‧Transmitter
1301‧‧‧封裝模組 1301‧‧‧Packaging module
1302‧‧‧發送模組 1302‧‧‧Send module
1303‧‧‧處理模組 1303‧‧‧Processing module
1401‧‧‧處理器 1401‧‧‧Processor
1402‧‧‧發送器 1402‧‧‧Transmitter
1701‧‧‧處理模組 1701‧‧‧Processing Module
1702‧‧‧發送模組 1702‧‧‧Send module
1801‧‧‧處理器 1801‧‧‧Processor
1802‧‧‧發送器 1802‧‧‧Transmitter
為了更清楚地說明本發明實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的圖式作一簡單地介紹,顯而易見地,下面描述中的圖式是本發明的一些實施例,對於本領域普通技術人員來講,在不付出創造性勞動性的前提下,還可以根據這些圖式獲得其 他的圖式。 In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, under the premise of no creative labor, they can also be obtained according to these drawings. his schema.
圖1為本發明的一種應用場景示意圖;圖2為本發明訊息傳輸系統實施例一的結構示意圖;圖3為本發明訊息傳輸方法實施例一的流程示意圖;圖4為本發明訊息傳輸方法實施例二的流程示意圖;圖5為本發明訊息傳輸方法實施例三的流程示意圖;圖6為本發明訊息傳輸裝置實施例一的結構示意圖;圖7為本發明訊息傳輸裝置實施例二的結構示意圖;圖8為本發明訊息傳輸系統實施例二的結構示意圖;圖9為本發明訊息傳輸方法實施例四的流程示意圖;圖10為本發明訊息傳輸方法實施例五的流程示意圖;圖11為本發明訊息傳輸方法實施例六的流程示意圖;圖12為本發明訊息傳輸方法實施例七的流程示意圖;圖13為本發明訊息傳輸裝置實施例三的結構示意圖;圖14為本發明訊息傳輸裝置實施例四的結構示意圖;圖15為本發明訊息傳輸系統實施例三的結構示意圖;圖16為本發明訊息傳輸方法實施例八的流程示意圖;圖17為本發明訊息傳輸裝置實施例五的結構示意圖;圖18為本發明訊息傳輸裝置實施例六的結構示意圖。 1 is a schematic diagram of an application scenario of the present invention; FIG. 2 is a schematic structural diagram of Embodiment 1 of a message transmission system according to the present invention; FIG. 3 is a schematic flowchart of Embodiment 1 of a message transmission method of the present invention; FIG. 4 is an implementation of the message transmission method of the present invention Fig. 5 is a schematic flowchart of a third embodiment of a message transmission method according to the present invention; Fig. 6 is a schematic structural diagram of a first embodiment of a message transmission apparatus according to the present invention; 8 is a schematic structural diagram of a second embodiment of a message transmission system of the present invention; FIG. 9 is a schematic flowchart of a fourth embodiment of a message transmission method of the present invention; FIG. 10 is a schematic flowchart of a fifth embodiment of the message transmission method of the present invention; FIG. 12 is a schematic flowchart of Embodiment 7 of the message transmission method of the present invention; FIG. 13 is a schematic structural diagram of Embodiment 3 of the message transmission apparatus of the present invention; FIG. 14 is the implementation of the message transmission apparatus of the present invention. Figure 15 is a schematic structural diagram of a third embodiment of a message transmission system according to the present invention; Figure 16 is a schematic flowchart of an eighth embodiment of a message transmission method according to the present invention; 18 is a schematic structural diagram of Embodiment 6 of the message transmission apparatus of the present invention.
下面將結合本發明實施例中的圖式,對本發明實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅是本發明一部分實施例,而不是全部的實施例。基 於本發明中的實施例,本領域普通技術人員在沒有做出創造性勞動前提下所獲得的所有其他實施例,都屬於本發明保護的範圍。 The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. base Regarding the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
這裡將詳細地對示例性實施例進行說明,其示例表示在圖式中。下面的描述涉及圖式時,除非另有表示,不同圖式中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施方式並不代表與本發明相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本發明的一些方面相一致的裝置和方法的例子。 Exemplary embodiments will be described in detail herein, examples of which are illustrated in the drawings. When the following description refers to the drawings, the same numerals in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with some aspects of the invention as detailed in the appended claims.
應當明確,所描述的實施例僅是本發明一部分實施例,而不是全部的實施例。基於本發明中的實施例,本領域普通技術人員在沒有作出創造性勞動前提下所獲得的所有其它實施例,都屬於本發明保護的範圍。 It should be understood that the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
在本發明實施例中使用的術語是僅出於描述特定實施例的目的,而非旨在限制本發明。在本發明實施例和所附申請專利範圍中所使用的單數形式的“一種”、“所述”和“該”也旨在包括多數形式,除非上下文清楚地表示其他含義。 The terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
應當理解,本文中使用的術語“和/或”僅是一種描述關聯對象的關聯關係,表示可以存在三種關係,例如,A和/或B,可以表示:單獨存在A,同時存在A和B,單獨存在B這三種情況。另外,本文中字符“/”,一般表示前後關聯對象是一種“或”的關係。 It should be understood that the term "and/or" used in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist simultaneously, There are three cases of B alone. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship.
應當理解,儘管在本發明實施例中可能採用術語第 一、第二、第三等來描述XXX,但這些XXX不應限於這些術語。這些術語僅用來將XXX彼此區分開。例如,在不脫離本發明實施例範圍的情況下,第一XXX也可以被稱為第二XXX,類似地,第二XXX也可以被稱為第一XXX。 It should be understood that although the term No. 1 may be used in the embodiments of the present invention First, second, third, etc. to describe XXX, but these XXX should not be limited to these terms. These terms are only used to distinguish XXX from each other. For example, without departing from the scope of the embodiments of the present invention, the first XXX may also be referred to as the second XXX, and similarly, the second XXX may also be referred to as the first XXX.
取決於語境,如在此所使用的詞語“如果”、“若”可以被解釋成為“在……時”或“當……時”或“響應於確定”或“響應於檢測”。類似地,取決於語境,短語“如果確定”或“如果檢測(陳述的條件或事件)”可以被解釋成為“當確定時”或“響應於確定”或“當檢測(陳述的條件或事件)時”或“響應於檢測(陳述的條件或事件)”。 Depending on the context, the words "if", "if" as used herein may be interpreted as "at" or "when" or "in response to determining" or "in response to detecting". Similarly, the phrases "if determined" or "if detected (stated condition or event)" can be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)", depending on the context event)" or "in response to detection (statement or event)".
還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的商品或者系統不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種商品或者系統所固有的要素。在沒有更多限制的情況下,由語句“包括一個......”限定的要素,並不排除在包括所述要素的商品或者系統中還存在另外的相同要素。 It should also be noted that the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a commodity or system comprising a list of elements includes not only those elements, but also includes not explicitly listed other elements, or elements inherent to the commodity or system. Without further limitation, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the article or system comprising said element.
這裡將詳細地對示例性實施例進行說明,其示例表示在圖式中。下面的描述涉及圖式時,除非另有表示,不同圖式中的相同數字表示相同或相似的要素。以下示例性實施例中所描述的實施方式並不代表與本發明相一致的所有實施方式。相反,它們僅是與如所附申請專利範圍中所詳述的、本發明的一些方面相一致的裝置和方法的例子。 Exemplary embodiments will be described in detail herein, examples of which are illustrated in the drawings. When the following description refers to the drawings, the same numerals in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with some aspects of the invention as detailed in the appended claims.
本發明應用於不同的執行緒單元之間進行訊息傳輸的場景,其中,包括同一行程單元的不同執行緒單元之間進行訊息傳輸,以及不同行程單元的執行緒單元之間進行訊息傳輸,圖1為本發明的一種應用場景示意圖,該應用場景中包含行程單元A和行程單元B,其中,行程單元A包含執行緒單元A1、執行緒單元A2和執行緒單元A3,行程單元B包含執行緒單元B1、執行緒單元B2和執行緒單元B3,各執行緒單元之間可以進行訊息傳輸,例如:一種情況為:行程單元A的執行緒單元A1和行程單元B的執行緒單元B2之間進行訊息傳輸,另一種情況為行程單元A的執行緒單元A1和行程單元A的執行緒單元A2之間進行訊息傳輸。 The present invention is applied to the scenario of message transmission between different thread units, including the message transmission between different thread units of the same itinerary unit, and the message transmission between thread units of different itinerary units, as shown in FIG. 1 . A schematic diagram of an application scenario of the present invention, the application scenario includes a trip unit A and a trip unit B, wherein the trip unit A includes a thread unit A1, a thread unit A2 and a thread unit A3, and the trip unit B includes a thread unit B1, the thread unit B2 and the thread unit B3, message transmission can be performed between the thread units, for example: one case is: the thread unit A1 of the itinerary unit A and the thread unit B2 of the itinerary unit B The other case is that a message is transmitted between the thread unit A1 of the travel unit A and the thread unit A2 of the travel unit A.
本發明所描述的訊息單元中可以包含一條訊息或者多條訊息,取決於執行緒單元在向源行程單元發送訊息之前,是否對訊息進行了封裝處理,若執行緒單元在發送訊息之前,對訊息進行了封裝處理,則訊息單元中通常包含兩條或兩條以上的訊息,若執行緒單元在發送訊息之前,未對訊息進行封裝處理,則訊息單元指一條訊息。 The message unit described in the present invention may include one message or multiple messages, depending on whether the thread unit encapsulates the message before sending the message to the source travel unit. After the encapsulation process is performed, the message unit usually contains two or more messages. If the thread unit does not encapsulate the message before sending the message, the message unit refers to a message.
本發明所描述的行程封裝包是指行程單元進行封裝處理之後產生的封裝包。 The travel package described in the present invention refers to the package generated after the travel unit performs the package process.
為了便於描述,本發明將發送端的源行程單元進行封裝處理過程中所用的參數,與源行程單元的執行緒單元進行封裝處理過程中所用的參數通過在第一、第二進行區分。 For convenience of description, the present invention distinguishes the parameters used in the encapsulation process of the source run unit of the sending end and the parameters used in the encapsulation process of the thread unit of the source run unit through the first and the second.
例如:源行程單元進行封裝處理過程中所用的參數包括:第一歷史時間段、第一當前時間段、第一等待時間和/或第一預預設定時時間等。 For example, the parameters used in the encapsulation process of the source travel unit include: a first historical time period, a first current time period, a first waiting time and/or a first preset timing time, and the like.
執行緒單元進行封裝處理過程中所用的參數包括:第二歷史時間段、第二當前時間段、第二等待時間和/或第二預預設定時時間等。 The parameters used in the encapsulation process by the thread unit include: a second historical time period, a second current time period, a second waiting time, and/or a second preset timing time, and the like.
本發明包括但不限於以下主要的改進點: The present invention includes but is not limited to the following main improvements:
1、源行程單元對發送隊列中訊息進行封裝處理時,所採用的行程封裝包的尺度不是固定的,而是根據第一歷史時間段內源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率確定,從而,使得行程封裝包的尺度的設置更加合理,避免因行程封裝包的尺度設置過大時,網路通道空閒時間長,以及避免因行程封裝包的尺寸設置過小時,造成網路通道的帶寬浪費,並且,進行封裝處理的次數較多,造成一定的延時,因此,本發明根據歷史時間段內源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率確定行程封裝包的尺度更加合理,可以提高網路資源的利用率,以及提高傳輸效率。 1. When the source travel unit encapsulates the messages in the sending queue, the size of the travel package used is not fixed, but is based on the thread unit of the source travel unit in the first historical time period to the sending queue of the source travel unit. The frequency of sending the message unit is determined, thereby making the setting of the size of the itinerary package more reasonable, avoiding long idle time of the network channel when the size of the itinerary package is set too large, and avoiding that the size of the itinerary package is too small The bandwidth of the network channel is wasted, and the number of times of encapsulation processing is large, which causes a certain delay. Therefore, the present invention sends the message unit to the sending queue of the source travel unit according to the thread unit of the source travel unit in the historical time period. The frequency determines that the size of the itinerary package is more reasonable, which can improve the utilization rate of network resources and improve the transmission efficiency.
2、源行程單元對發送隊列中訊息進行封裝處理時,除了依據行程封裝包的尺度進行封裝處理外,還設置第一預設定時時間,若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間大於等於第一預設定時時間,則對目的 行程單元為同一行程單元的訊息單元進行封裝處理,從而,避免因源行程單元的執行緒單元發送訊息單元的頻率不穩定時,因訊息單元數量較長時間不能滿足行程封裝包的尺度而無法進行封裝處理,導致訊息發送時延較長的問題。 2. When the source travel unit encapsulates the messages in the sending queue, in addition to the encapsulation processing according to the size of the travel package, a first preset timing time is also set. If the destination travel unit in the sending queue of the source travel unit is the same travel The first waiting time of the message unit that enters the sending queue earliest among the message units of the unit is greater than or equal to the first preset timing time. The itinerary unit is encapsulated for the message units of the same itinerary unit, so that when the frequency of sending message units by the thread unit of the source itinerary unit is unstable, the number of message units cannot meet the size of the itinerary package for a long time. Encapsulation processing, resulting in a long delay in message sending.
3、源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元前,也可以對訊息進行封裝處理。進行封裝處理時,執行緒封裝包的尺度可以是固定的,也可以是根據第二歷史時間段內產生的訊息的數量確定的,對此,本發明不做限制。 3. Before the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit, the message may also be encapsulated. During the encapsulation process, the size of the thread encapsulation packet may be fixed, or may be determined according to the number of messages generated in the second historical time period, which is not limited in the present invention.
4、源行程單元的執行緒單元對產生的訊息進行封裝處理時,除了依據執行緒封裝包的尺度進行封裝處理外,還設置第二預設定時時間,當目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的等待時間大於等於第二預設定時時間,則對目的執行緒單元為同一執行緒單元的訊息進行封裝處理。 4. When the thread unit of the source process unit encapsulates the generated message, in addition to performing the encapsulation process according to the size of the thread encapsulation package, a second preset timing time is also set. When the destination thread unit is the same thread unit The waiting time of the earliest generated message among the messages is greater than or equal to the second preset timing time, and the message whose destination thread unit is the same thread unit is encapsulated.
5、源行程單元的執行緒單元對產生的訊息進行封裝處理之前,確定訊息的目的執行緒單元是否屬於源行程單元,若訊息的目的行程單元不屬於源行程單元,則對訊息進行封裝處理,生成訊息單元發送到源行程單元的發送隊列,若訊息的目的行程單元屬於源行程單元,則直接發送到目的執行緒單元的接收隊列,即,無需先將訊息發送到行程單元的發送隊列,再通過網路通道發送到該行程單元的接收隊列,再發送到目的執行緒單元,從而,縮短訊息 發送的時延,提高訊息傳輸效率。 5. Before the thread unit of the source travel unit encapsulates the generated message, it is determined whether the destination thread unit of the message belongs to the source travel unit. If the destination travel unit of the message does not belong to the source travel unit, the message is encapsulated. The generated message unit is sent to the send queue of the source travel unit. If the destination travel unit of the message belongs to the source travel unit, it is directly sent to the receive queue of the destination thread unit, that is, the message does not need to be sent to the send queue of the travel unit first, and then It is sent to the receiving queue of the travel unit through the network channel, and then sent to the destination thread unit, thereby shortening the message Sending delay, improve the efficiency of message transmission.
下面以具體地實施例對本發明的技術方案進行詳細說明。下面這幾個具體的實施例可以相互結合,對於相同或相似的概念或過程可能在某些實施例不再贅述。 The technical solutions of the present invention will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
圖2為本發明訊息傳輸系統實施例一的結構示意圖,如圖2所示,本實施例的系統包括元行程單元和目的行程單元,其中,源行程單元包含至少一個執行緒單元,源行程單元和目的行程單元連接;在圖2中,源行程單元以行程A為例示出,目的行程單元以行程B示出,源行程單元包含至少一個執行緒單元以3個執行緒單元為例示出,分別為執行緒單元A1、執行緒單元A2和執行緒單元A3;執行緒B中也可以包含至少一個執行緒單元,以執行緒單元B1、執行緒單元B2和執行緒單元B3示出。 FIG. 2 is a schematic structural diagram of Embodiment 1 of the message transmission system of the present invention. As shown in FIG. 2 , the system of this embodiment includes a meta-travel unit and a destination-travel unit, wherein the source-travel unit includes at least one thread unit, and the source-travel unit includes at least one thread unit. It is connected with the destination stroke unit; in FIG. 2, the source stroke unit is shown as stroke A, the destination stroke unit is shown as stroke B, the source stroke unit contains at least one thread unit, and three thread units are shown as examples, respectively Thread unit A1, thread unit A2 and thread unit A3; thread B may also include at least one thread unit, which is shown as thread unit B1, thread unit B2 and thread unit B3.
其中,源行程單元根據第一歷史時間段至少一個執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,訊息單元中包含至少一個訊息;並根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;生成行程封裝包之後向目的行程單元發送行程封裝包。 The source travel unit determines the size of the travel package corresponding to the first current time period of the source travel unit according to the frequency of sending message units to the sending queue of the source travel unit by at least one thread unit in the first historical time period. It contains at least one message; and according to the scale of the itinerary package corresponding to the first current time period, encapsulates the message units in the sending queue of the source itinerary unit to generate the itinerary package; and sends the itinerary package to the destination itinerary after generating the itinerary package. Itinerary package.
在上述實施例中,源行程單元根據第一歷史時間段至少一個執行緒單元向源行程單元的發送隊列發送訊息單元的頻率時,具體為:若源行程單元的發送隊列中目的行程單元為目的行程單元的訊息單元的數量大於等於第一當前 時間段對應的行程封裝包的尺度,源行程單元則按照第一當前時間段對應的行程封裝包的尺度,對目的行程單元為目的行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,第一行程封裝包中包含的訊息單元的數量與第一當前時間段對應的行程封裝包的尺度相同。 In the above embodiment, when the source travel unit sends a message unit to the sending queue of the source travel unit according to the frequency of at least one thread unit in the first historical time period, it is specifically: if the destination travel unit in the sending queue of the source travel unit is the destination The number of message units of the travel unit is greater than or equal to the first current The size of the itinerary package corresponding to the time period, the source itinerary unit encapsulates the message unit of the destination itinerary unit according to the size of the itinerary package corresponding to the first current time period, and generates the first itinerary package, Wherein, the number of information units included in the first travel package is the same as the size of the travel package corresponding to the first current time period.
在上述實施例中,源行程單元根據第一歷史時間段至少一個執行緒單元向源行程單元的發送隊列發送訊息單元的頻率時,還包括:若源行程單元的發送隊列中目的行程單元為目的行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度,源行程單元則確定目的行程單元為目的行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若第一等待時間大於等於第一預設定時時間,則對目的行程單元為目的行程單元的訊息單元進行封裝處理,生成第二行程封裝包,第二行程封裝包中包含發送隊列中目的行程單元為目的行程單元的所有訊息單元。 In the above embodiment, when the source travel unit sends the frequency of message units to the sending queue of the source travel unit according to the frequency of at least one thread unit in the first historical time period, the method further includes: if the destination travel unit in the sending queue of the source travel unit is the destination The number of message units of the travel unit is less than the size of the travel package corresponding to the first current time period, and the source travel unit determines whether the destination travel unit is the first waiting time of the message unit that enters the sending queue earliest among the message units of the destination travel unit. is greater than or equal to the first preset timing time, and if the first waiting time is greater than or equal to the first preset timing time, the message unit whose destination travel unit is the destination travel unit is packaged to generate a second travel package, and the second travel package The packet contains all message units whose destination travel unit in the sending queue is the destination travel unit.
在上述實施例中,源行程單元根據第一歷史時間段至少一個執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度時,具體為:源行程單元獲取第一歷史時間段內,通過第一行程封裝包和第二行程封裝包發送的訊息單元的第一數量;以及,獲取第一歷史時間段內,通過第二行程封裝包發送的訊息單元的第二數量;根據第二數量和第一數量的比值以及第一歷史時間段對應的行程封裝包的 尺度,確定第一當前時間段對應的行程封裝包的尺度。 In the above embodiment, the source travel unit determines the size of the travel package corresponding to the first current time period of the source travel unit according to the frequency at which at least one thread unit sends message units to the sending queue of the source travel unit in the first historical time period , specifically: the source travel unit obtains the first number of message units sent through the first travel package and the second travel package within the first historical time period; The second number of message units sent by the travel package; according to the ratio of the second number to the first number and the travel package corresponding to the first historical time period Scale, to determine the scale of the itinerary package corresponding to the first current time period.
圖2所示訊息傳輸系統實施例中源行程單元具體可用於執行圖3至圖5所示方法實施例的技術方案,其實現原理和技術效果,參見圖3至圖5所示方法實施例中的詳細描述,此處不再贅述。 The source travel unit in the embodiment of the message transmission system shown in FIG. 2 can be specifically used to implement the technical solutions of the method embodiments shown in FIG. 3 to FIG. The detailed description is not repeated here.
圖3為本發明訊息傳輸方法實施例一的流程示意圖,如圖2所示,本實施例由發送端執行,具體地,S301至303由發送端的源行程單元執行,本實施例的方法如下: FIG. 3 is a schematic flowchart of Embodiment 1 of the message transmission method of the present invention. As shown in FIG. 2 , this embodiment is executed by the sender. Specifically, S301 to 303 are executed by the source travel unit of the sender. The method of this embodiment is as follows:
S301:根據第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度。 S301: Determine the size of the travel package corresponding to the first current time period of the source travel unit according to the frequency of sending message units by the thread unit of the source travel unit to the sending queue of the source travel unit in the first historical time period.
其中,訊息單元中包含至少一個訊息。 Wherein, the message unit includes at least one message.
第一當前時間段是指要對源行程單元的發送隊列中的訊息單元進行封裝處理;第一歷史時間段是指第一當前時間段之前的時間段。 The first current time period refers to the encapsulation processing of the message units in the sending queue of the source travel unit; the first historical time period refers to the time period before the first current time period.
即:根據之前時間段的源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,可以更加合理的預估當前時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,因此,基於第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,所確定的行程封裝包的尺度更加合理。當第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率發送變化後,第一 當前時間段對應的行程封裝包的尺度也會相應的發生變化,即,第一當前時間段對應的行程封裝包的尺度會隨時第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率的變化而變化,從而,使得行程封裝包的尺度設置更加合理。 That is: according to the frequency of sending message units from the thread unit of the source travel unit to the send queue of the source travel unit in the previous time period, it can be more reasonably estimated that the thread unit of the source travel unit in the current time period sends the queue of the source travel unit to the send queue of the source travel unit. The frequency of sending message units, therefore, based on the frequency at which the thread unit of the source travel unit sends message units to the sending queue of the source travel unit in the first historical time period, determine the value of the travel package corresponding to the first current time period of the source travel unit. The size of the determined itinerary package is more reasonable. When the frequency at which the thread unit of the source travel unit sends message units to the sending queue of the source travel unit changes in the first historical time period, the first The size of the itinerary package corresponding to the current time period will also change accordingly, that is, the size of the itinerary package corresponding to the first current time period will change at any time from the thread unit of the source itinerary unit of the first historical time period to the size of the source itinerary unit. The frequency at which the sending queue sends the message unit changes, thereby making the size setting of the itinerary package more reasonable.
S302:根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包。 S302: Encapsulate the message units in the sending queue of the source travel unit according to the scale of the travel package corresponding to the first current time period to generate a travel package.
例如:第一當前時間段對應的行程封裝包的尺度為3個訊息單元,則獲取對源行程單元的發送隊列中目的行程單元為同一行程單元的3個訊息單元,進行封裝處理,生成行程單元包。 For example, if the size of the itinerary package corresponding to the first current time period is 3 message units, then obtain 3 message units whose destination itinerary unit is the same itinerary unit in the sending queue of the source itinerary unit, and perform the encapsulation processing to generate the itinerary unit. Bag.
S303:發送行程封裝包。 S303: Send the itinerary package.
將進行封裝包通過行程單元之間的網路通道發送到目的行程單元,以使目的行程單元進行相應地解封裝處理,發送到對應的目的執行緒單元,完成訊息傳輸。 The encapsulation packet is sent to the destination itinerary unit through the network channel between the itinerary units, so that the destination itinerary unit performs corresponding decapsulation processing, and is sent to the corresponding destination thread unit to complete the message transmission.
本實施例,通過根據第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包,發送行程封裝包,實現訊息傳輸,由於行程封裝包的尺度是根據第一歷史時間段內源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率確定, 從而,使得行程封裝包的尺度的設置更加合理,避免因行程封裝包的尺度設置過大時,網路通道空閒時間長,以及避免因行程封裝包的尺寸設置過小時,造成網路通道的帶寬浪費,並且,進行封裝處理的次數較多,造成一定的延時,因此,本發明根據歷史時間段內源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率確定行程封裝包的尺度更加合理,可以提高網路資源的利用率,以及提高傳輸效率。 In this embodiment, the size of the itinerary package corresponding to the first current time period of the source travel unit is determined by the frequency of sending message units to the sending queue of the source travel unit by the thread unit of the source travel unit in the first historical time period. The scale of the itinerary package corresponding to the first current time period, encapsulates the message units in the sending queue of the source itinerary unit, generates the itinerary package, sends the itinerary package, and realizes the message transmission, because the size of the itinerary package is based on Determine the frequency at which the thread unit of the source travel unit sends the message unit to the sending queue of the source travel unit in the first historical time period, Therefore, the setting of the size of the itinerary package is more reasonable, and the idle time of the network channel is long when the size of the itinerary package is set too large, and the bandwidth of the network channel is avoided due to the size of the itinerary package being set too small. , and the number of times of encapsulation processing is large, resulting in a certain delay. Therefore, the present invention determines the size of the itinerary package according to the frequency of the thread unit of the source itinerary unit sending the message unit to the sending queue of the source itinerary unit within the historical time period. It is more reasonable, which can improve the utilization rate of network resources and improve the transmission efficiency.
圖4為本發明訊息傳輸方法實施例二的流程示意圖,本實施例是在圖3所示實施例的基礎上,進一步地,對S302的可能的實現方式的描述,其中,可以通過兩種方式觸發行程單元進行封裝處理,其中,第一種方式為:源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於第一當前時間段對應的行程封裝包的尺度,則觸發行程單元進行封裝處理。第二種方式為:源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度,但目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間大於等於第一預設定時時間,則觸發行程單元進行訊息封裝處理。為了便於描述,將通過第一種方式觸發進行封裝處理產生的行程封裝包描述為“第一行程封裝包”,將通過第二種方式觸發進行封裝處理產生的行程封裝包描述為“第二行程封裝包”,如圖4所示,本實施例如下: FIG. 4 is a schematic flowchart of Embodiment 2 of the message transmission method according to the present invention. This embodiment is based on the embodiment shown in FIG. 3 , and further describes the possible implementation of S302 , wherein, two methods can be used. Trigger the itinerary unit to perform encapsulation processing, wherein the first method is: the number of message units whose destination itinerary unit is the same itinerary unit in the sending queue of the source itinerary unit is greater than or equal to the size of the itinerary package corresponding to the first current time period, then Trigger the travel unit for packaging processing. The second method is: the number of message units whose destination travel unit is the same travel unit in the sending queue of the source travel unit is smaller than the size of the travel package corresponding to the first current time period, but the destination travel unit is the message unit of the same travel unit If the first waiting time of the message unit that enters the sending queue earliest is greater than or equal to the first preset timing time, the travel unit is triggered to perform message encapsulation processing. For the convenience of description, the itinerary package generated by triggering the packaging process in the first way is described as "the first itinerary package", and the itinerary package generated by triggering the package process in the second way is described as "the second itinerary package" package", as shown in Figure 4, this embodiment is as follows:
S401:判斷源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量是否大於等於第一當前時間段對應的行程封裝包的尺度。 S401: Determine whether the number of message units whose destination travel units are the same travel unit in the sending queue of the source travel unit is greater than or equal to the size of the travel package corresponding to the first current time period.
若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於第一當前時間段對應的行程封裝包的尺度,則執行S402。 If the number of message units whose destination travel units are the same travel unit in the sending queue of the source travel unit is greater than or equal to the size of the travel package corresponding to the first current time period, step S402 is executed.
若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度,則執行S403。 If the number of message units whose destination itinerary unit is the same itinerary unit in the sending queue of the source itinerary unit is smaller than the size of the itinerary package corresponding to the first current time period, execute S403.
S402:按照第一當前時間段對應的行程封裝包的尺度,對目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包。 S402: According to the scale of the itinerary package corresponding to the first current time period, package the message units whose destination itinerary units are the same itinerary unit, to generate a first itinerary package.
其中,第一行程封裝包中包含的訊息單元的數量與第一當前時間段對應的行程封裝包的尺度相同。 Wherein, the number of information units included in the first travel package is the same as the size of the travel package corresponding to the first current time period.
即:通過第一種方式觸發行程單元進行封裝處理。 That is: trigger the travel unit to perform packaging processing in the first way.
S403:確定目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間。 S403: Determine whether the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to the first preset timing time.
若第一等待時間大於等於第一預設定時時間,則執行S404。 If the first waiting time is greater than or equal to the first preset timing time, S404 is executed.
若第一等待時間小於第一預設定時時間,則返回執行S401。 If the first waiting time is less than the first preset timing time, return to S401.
其中,第一預設定時時間可以根據經驗值進行設置。第一等待時間由專門的執行緒單元(描述為定時執行緒單 元)進行監控,當第一等待時間大於等於第一預設定時時間時,該定時執行緒單元向源行程單元發送指示訊息,觸發源行程單元進行封裝處理。 The first preset timing time may be set according to an empirical value. The first wait time is determined by a dedicated thread unit (described as a timed thread list element) to monitor, when the first waiting time is greater than or equal to the first preset timing time, the timing thread unit sends an instruction message to the source travel unit to trigger the source travel unit to perform packaging processing.
S404:對目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包。 S404: Encapsulate the message units whose destination travel units are the same travel unit to generate a second travel package.
其中,第二行程封裝包中包含發送隊列中目的行程單元為同一行程單元的所有訊息單元。 The second trip package includes all message units whose destination trip units in the sending queue are the same trip unit.
即:通過第二種方式觸發進行封裝處理。 That is, the encapsulation processing is triggered by the second method.
本實施例,通過兩種方式觸發行程單元進行封裝處理,當源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於第一當前時間段對應的行程封裝包的尺度,則觸發按照第一當前時間段對應的行程封裝包的尺度,對目的行程單元為同一行程單元的訊息單元進行封裝處理;當源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度了,但目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間大於等於第一預設定時時間,則觸發進行訊息封裝處理。從而,避免因源行程單元的執行緒單元發送訊息單元的頻率不穩定時,因訊息單元數量較長時間不能滿足行程封裝包的尺度而無法進行封裝處理,導致訊息發送時延較長的問題。 In this embodiment, the travel unit is triggered to perform encapsulation processing in two ways. When the number of message units whose destination travel unit is the same travel unit in the sending queue of the source travel unit is greater than or equal to the size of the travel package corresponding to the first current time period, Then trigger according to the scale of the itinerary package package corresponding to the first current time period to encapsulate the message unit whose destination itinerary unit is the same itinerary unit; The number is smaller than the size of the itinerary package corresponding to the first current time period, but the first waiting time of the message unit that enters the sending queue earliest among the message units whose destination itinerary unit is the same itinerary unit is greater than or equal to the first preset timing time, then Trigger for message encapsulation processing. Therefore, when the frequency of sending message units by the thread unit of the source travel unit is unstable, the message unit cannot be packaged because the number of message units cannot meet the size of the travel package for a long time, resulting in a long message sending delay.
圖5為本發明訊息傳輸方法實施例三的流程示意圖,本實施例是在實施例二所示實施例的基礎上,對S301的一 種可能的實現的方式的描述,如圖5所示: FIG. 5 is a schematic flowchart of the third embodiment of the message transmission method according to the present invention. This embodiment is based on the embodiment shown in the second embodiment, and the first step of S301 is modified. A description of a possible implementation is shown in Figure 5:
S501:獲取第一歷史時間段內,通過第一行程封裝包和第二行程封裝包發送的訊息單元的第一數量。 S501: Acquire a first number of message units sent through the first travel package and the second travel package within the first historical time period.
S502:獲取第一歷史時間段內,通過第二行程封裝包發送的訊息單元的第二數量。 S502: Acquire the second quantity of message units sent through the second trip package within the first historical time period.
其中,S501和S502的執行順序不做限制。 The execution order of S501 and S502 is not limited.
S503:根據第二數量和第一數量的比值以及第一歷史時間段對應的行程封裝包的尺度,確定第一當前時間段對應的行程封裝包的尺度。 S503: Determine the size of the itinerary package corresponding to the first current time period according to the ratio of the second quantity to the first quantity and the size of the itinerary package corresponding to the first historical time period.
通過第二數量和第一數量的比值,可以獲知第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率的變化趨勢,第一預設閾值通常設置為0.5,若比值大於第一預設閾值,說明執行緒單元向源行程單元的發送隊列發送訊息單元的頻率變慢,大多數的訊息是通過第二種方式觸發進行封裝處理的,因此,要減小行程封裝包的尺度。若比值大於0.5,說明執行緒單元向源行程單元的發送隊列發送訊息單元的頻率變快,大多數的訊息是通過第一種方式觸發進行封裝處理的,因此,要增大行程封裝包的尺度。 Through the ratio of the second quantity to the first quantity, the change trend of the frequency of sending the message unit from the thread unit of the source travel unit to the sending queue of the source travel unit in the first historical time period can be known. The first preset threshold is usually set to 0.5 , if the ratio is greater than the first preset threshold, it means that the frequency of the thread unit sending message units to the sending queue of the source itinerary unit becomes slower. Most of the messages are triggered by the second method for encapsulation processing. Dimensions of the itinerary package. If the ratio is greater than 0.5, it means that the frequency of the thread unit sending message units to the sending queue of the source itinerary unit becomes faster. Most of the messages are triggered by the first method for encapsulation processing. Therefore, the size of the itinerary encapsulation package should be increased. .
當要縮小行程封裝包的尺度時,要確保第一歷史時間段對應的行程封裝包的尺度大於1。 When reducing the size of the itinerary package, it is necessary to ensure that the size of the itinerary package corresponding to the first historical time period is greater than 1.
具體地,包括但不限於以下兩種可能的實現方式: Specifically, including but not limited to the following two possible implementations:
一種可能的實現方式:若比值大於第一預設閾值,則確定第一當前時間段對 應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,第一係數小於1。即使第一當前時間段對應的行程封裝包的尺度小於第一歷史時間段對應的行程封裝包的尺度。 A possible implementation: if the ratio is greater than the first preset threshold, then determine that the first current time period is paired with The scale of the corresponding travel package is the product of the scale of the travel package corresponding to the first historical time period and the first coefficient, where the first coefficient is less than 1. Even if the size of the itinerary package corresponding to the first current time period is smaller than the size of the itinerary package corresponding to the first historical time period.
另一種可能的實現方式:若比值小於等於第一預設閾值,則確定第一當前時間段對應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,第二係數大於1。即使第一當前時間段對應的行程封裝包的尺度小大於第一歷史時間段對應的行程封裝包的尺度。 Another possible implementation manner: if the ratio is less than or equal to the first preset threshold, determine that the scale of the itinerary package corresponding to the first current time period is the product of the scale of the itinerary package corresponding to the first historical time period and the second coefficient , where the second coefficient is greater than 1. Even if the size of the itinerary package corresponding to the first current time period is smaller than the size of the itinerary package corresponding to the first historical time period.
其中,第二係數的一種可能的獲取方式為:確定第一數量與第三數量的比值為第二係數,其中,第三數量為第一歷史時間段的前一時間段通過第一行程封裝包和第二行程封裝包發送的訊息單元的數量。 Wherein, a possible way of obtaining the second coefficient is: determining the ratio of the first quantity to the third quantity as the second coefficient, wherein the third quantity is the previous time period of the first historical time period through the first itinerary package package and the number of message units sent by the second trip packet.
本實施例,通過獲取第一歷史時間段內,通過第一行程封裝包和第二行程封裝包發送的訊息單元的第一數量,以及獲取第一歷史時間段內,通過第二行程封裝包發送的訊息單元的第二數量,根據第二數量和第一數量的比值以及第一歷史時間段對應的行程封裝包的尺度,確定第一當前時間段對應的行程封裝包的尺度。從而,使得行程封裝包的尺度設置的更加合理。 In this embodiment, by acquiring the first number of message units sent through the first trip package and the second trip package within the first historical time period, and by acquiring the first number of message units sent through the second trip package within the first historical time period The second quantity of the message unit is determined according to the ratio of the second quantity to the first quantity and the size of the itinerary package corresponding to the first historical time period to determine the size of the travel package corresponding to the first current time period. Therefore, the dimension setting of the itinerary package is made more reasonable.
圖6為本發明訊息傳輸裝置實施例一的結構示意圖,本實施例的裝置包括處理模組601、封裝模組602和發送模組603,其中,處理模組601用於根據第一歷史時間段源行
程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,訊息單元中包含至少一個訊息;封裝模組602用於根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;發送模組603用於發送行程封裝包。
6 is a schematic structural diagram of Embodiment 1 of a message transmission apparatus according to the present invention. The apparatus of this embodiment includes a
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例一所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 1 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖6中,行程封裝包包括:第一行程封裝包;封裝模組602具體用於若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於第一當前時間段對應的行程封裝包的尺度,則按照第一當前時間段對應的行程封裝包的尺度,對目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,第一行程封裝包中包含的訊息單元的數量與第一當前時間段對應的行程封裝包的尺度相同。
In FIG. 6 , the itinerary package includes: a first itinerary package; the
在圖6中,行程封裝包還包括:第二行程封裝包;封裝模組602還具體用於若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度,則確定目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若第一等待時間大於等於第一預設定時時間,則對目的行程
單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包,第二行程封裝包中包含發送隊列中目的行程單元為同一行程單元的所有訊息單元。
In FIG. 6 , the itinerary package further includes: a second itinerary package; the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例二所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 2 of the message transmission method correspondingly, and its implementation principle and technical effect are similar, and will not be repeated here.
在圖6中處理模組601具體用於獲取第一歷史時間段內,通過第一行程封裝包和第二行程封裝包發送的訊息單元的第一數量;以及,獲取第一歷史時間段內,通過第二行程封裝包發送的訊息單元的第二數量;根據第二數量和第一數量的比值以及第一歷史時間段對應的行程封裝包的尺度,確定第一當前時間段對應的行程封裝包的尺度。
In FIG. 6, the
其中,處理模組601具體用於若比值大於第一預設閾值,則確定第一當前時間段對應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,第一係數小於1。
The
其中,處理模組601還具體用於若比值小於等於第一預設閾值,則確定第一當前時間段對應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,第二係數大於1。
The
其中,處理模組601還用於確定第一數量與第三數量的比值為第二係數,其中,第三數量為第一歷史時間段的前一時間段通過第一行程封裝包和第二行程封裝包發送的訊息單元的數量。
Wherein, the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例三所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 3 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
圖7為本發明訊息傳輸裝置實施例二的結構示意圖,本實施例的裝置包括處理器701和發送器702,其中,處理器701用於根據第一歷史時間段源行程單元的執行緒單元向源行程單元的發送隊列發送訊息單元的頻率,確定源行程單元的第一當前時間段對應的行程封裝包的尺度,訊息單元中包含至少一個訊息;處理器701還用於根據第一當前時間段對應的行程封裝包的尺度,對源行程單元的發送隊列中的訊息單元進行封裝處理,生成行程封裝包;發送器702發送器耦合至處理器,發送器用於發送行程封裝包。
FIG. 7 is a schematic structural diagram of Embodiment 2 of a message transmission apparatus according to the present invention. The apparatus of this embodiment includes a
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例一所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 1 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖7中,行程封裝包包括:第一行程封裝包;處理器701具體用於若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量大於等於第一當前時間段對應的行程封裝包的尺度,則按照第一當前時間段對應的行程封裝包的尺度,對目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第一行程封裝包,其中,第一行程封裝包中包含的訊息單元的數量與第一當前時間段對應的行程封裝包的尺度相同。
In FIG. 7 , the itinerary package includes: a first itinerary package; the
在圖7中,行程封裝包還包括:第二行程封裝包;處理器701還具體用於若源行程單元的發送隊列中目的行程單元為同一行程單元的訊息單元的數量小於第一當前時間段對應的行程封裝包的尺度,則確定目的行程單元為同一行程單元的訊息單元中最早進入發送隊列的訊息單元的第一等待時間是否大於等於第一預設定時時間,若第一等待時間大於等於第一預設定時時間,則對目的行程單元為同一行程單元的訊息單元進行封裝處理,生成第二行程封裝包,第二行程封裝包中包含發送隊列中目的行程單元為同一行程單元的所有訊息單元。
In FIG. 7 , the travel package further includes: a second travel package; the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例二所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 2 of the message transmission method correspondingly, and its implementation principle and technical effect are similar, and will not be repeated here.
在圖7中,處理器701具體用於獲取第一歷史時間段內,通過第一行程封裝包和第二行程封裝包發送的訊息單元的第一數量;以及,獲取第一歷史時間段內,通過第二行程封裝包發送的訊息單元的第二數量;根據第二數量和第一數量的比值以及第一歷史時間段對應的行程封裝包的尺度,確定第一當前時間段對應的行程封裝包的尺度。
In FIG. 7 , the
其中,處理器701具體用於若比值大於第一預設閾值,則確定第一當前時間段對應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第一係數的乘積,其中,第一係數小於1。
The
其中,處理器701還具體用於若比值小於等於第一預
設閾值,則確定第一當前時間段對應的行程封裝包的尺度為第一歷史時間段對應的行程封裝包的尺度與第二係數的乘積,其中,第二係數大於1。
The
其中,處理器701還用於確定第一數量與第三數量的比值為第二係數,其中,第三數量為第一歷史時間段的前一時間段通過第一行程封裝包和第二行程封裝包發送的訊息單元的數量。
The
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例三所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 3 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
圖8為本發明訊息傳輸系統實施例二的結構示意圖,該系統包括源行程單元,源行程單元包括至少一個執行緒單元,如圖8所示,圖8中源行程單元以行程單元A示出,至少一個執行緒單元以執行緒單元A1、執行緒單元A2和執行緒單元A3示出,其中,執行緒單元對執行緒單元產生的訊息進行封裝處理,生成訊息單元,訊息單元中包含至少兩個訊息;執行緒單元向源行程單元的發送隊列發送訊息單元。 8 is a schematic structural diagram of Embodiment 2 of a message transmission system according to the present invention, the system includes a source travel unit, and the source travel unit includes at least one thread unit, as shown in FIG. 8 , the source travel unit in FIG. 8 is shown as travel unit A , at least one thread unit is shown as thread unit A1, thread unit A2 and thread unit A3, wherein the thread unit encapsulates the message generated by the thread unit to generate a message unit, and the message unit includes at least two message; the thread unit sends the message unit to the send queue of the source travel unit.
在上述實施例中,執行緒單元對執行緒單元產生的訊息進行封裝處理,生成訊息單元,具體為:執行緒單元根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成訊息單元;在上述實施例中,執行緒單元對執行緒單元產生的訊息進行封裝處理,生成訊息單元之前,執行緒單元根據第 二歷史時間段內執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度。 In the above embodiment, the thread unit encapsulates the message generated by the thread unit to generate the message unit. Specifically, the thread unit generates a message unit for the thread unit according to the size of the thread encapsulation package corresponding to the second current time period. In the above embodiment, the thread unit encapsulates the message generated by the thread unit, and before generating the message unit, the thread unit according to the first The number of messages generated by the thread unit in the second historical time period determines the size of the thread encapsulation package corresponding to the second current time period.
在上述實施例中,執行緒單元根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成訊息單元時,具體為:執行緒單元具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則按照執行緒封裝包的尺度,對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,第一訊息單元中包含的訊息的數量與執行緒封裝包的尺度相同。 In the above embodiment, the thread unit encapsulates the message generated by the thread unit according to the size of the thread encapsulation package corresponding to the second current time period, and when generating the message unit, it is specifically: the thread unit is specifically used if If the number of messages with the destination thread unit generated by the thread unit is the same thread unit is greater than or equal to the size of the thread package corresponding to the second current time period, then according to the size of the thread package, the destination thread unit is the same. The message of the thread unit is encapsulated to generate a first message unit, wherein the number of messages contained in the first message unit is the same as the size of the thread encapsulation package.
在上述實施例中,執行緒單元根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成訊息單元時,具體為:執行緒單元還具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,則確定目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若第二等待時間大於等於第二預設定時時間,則對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,第二訊息單元中包含執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 In the above embodiment, the thread unit encapsulates the message generated by the thread unit according to the size of the thread encapsulation package corresponding to the second current time period, and when generating the message unit, specifically: the thread unit is also specifically used for If the number of messages whose destination thread unit is the same thread unit generated by the thread unit is smaller than the size of the thread encapsulation package corresponding to the second current time period, it is determined that the destination thread unit is the earliest among the messages of the same thread unit. Whether the second waiting time of the message is greater than or equal to the second preset timing time, if the second waiting time is greater than or equal to the second preset timing time, encapsulate the message whose destination thread unit is the same thread unit, and generate the first Two message units, wherein the second message unit includes all messages whose destination thread unit generated by the thread unit is the same thread unit.
在上述實施例中,執行緒單元根據第二歷史時間段內 執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度時,具體為:執行緒單元具體用於獲取第二歷史時間段內,通過第一訊息單元和第二訊息單元發送的訊息的第三數量;以及,獲取第二歷史時間段內,通過第二訊息單元發送的訊息的第四數量;根據第四數量和第三數量的比值以及第二歷史時間段對應的執行緒封裝包的尺度,確定第二當前時間段對應的執行緒封裝包的尺度。 In the above-mentioned embodiment, the thread unit according to the second historical time period The number of messages generated by the thread unit, when determining the size of the thread package corresponding to the second current time period, is specifically: the thread unit is specifically used to obtain, in the second historical time period, the The third quantity of messages sent by the message unit; and, obtaining the fourth quantity of messages sent by the second message unit within the second historical time period; according to the ratio of the fourth quantity to the third quantity and the correspondence of the second historical time period The scale of the thread encapsulation package is determined, and the dimension of the thread encapsulation package corresponding to the second current time period is determined.
圖8所示訊息傳輸系統實施例中源行程單元具體可用於執行圖9至圖12所示方法實施例的技術方案,其實現原理和技術效果,參見圖9至圖12所示方法實施例中的詳細描述,此處不再贅述。 The source travel unit in the embodiment of the message transmission system shown in FIG. 8 can be specifically used to implement the technical solutions of the method embodiments shown in FIG. 9 to FIG. The detailed description is not repeated here.
圖9為本發明訊息傳輸方法實施例四的流程示意圖,本實施例由發送端的執行緒單元執行,本實施例所對應的技術方案可以在獨立執行,也可以結合上述各實施例,在上述各實施例的基礎執行:如下所示: FIG. 9 is a schematic flowchart of Embodiment 4 of the message transmission method according to the present invention. This embodiment is executed by the thread unit of the sending end. The technical solution corresponding to this embodiment can be executed independently, or can be combined with the above embodiments. The basic implementation of the embodiment: as follows:
S901:對執行緒單元產生的訊息進行封裝處理,生成訊息單元。 S901: Encapsulate the message generated by the thread unit to generate a message unit.
其中,訊息單元包含至少兩個訊息。 Wherein, the message unit includes at least two messages.
其中,對執行緒單元產生的訊息進行封裝處理所採用的執行緒封裝包的尺度,可以是固定不變的,也可以是根據第二歷史時間段內執行緒單元產生的訊息的數量,動態確定的,對此,本發明不做限制。 The scale of the thread encapsulation package used to encapsulate the messages generated by the thread unit may be fixed, or it may be dynamically determined according to the number of messages generated by the thread unit in the second historical time period However, the present invention does not limit it.
S902:向源行程單元的發送隊列發送上述訊息單元。 S902: Send the above message unit to the sending queue of the source travel unit.
本實施例,通過執行緒單元對執行緒單元產生的訊息進行封裝處理,生成訊息單元,向源行程單元的發送隊列發送訊息單元,由於在執行緒單元處進行封裝處理,進一步地,提高訊息傳輸的性能。 In this embodiment, the message generated by the thread unit is encapsulated by the thread unit, the message unit is generated, and the message unit is sent to the sending queue of the source travel unit. Since the encapsulation process is performed at the thread unit, the message transmission is further improved. performance.
實施例五 Embodiment 5
圖10為本發明訊息傳輸方法實施例五的流程示意圖,本實施例是在圖9所示實施例的基礎上,進一步地,在執行S901之前,還包括: FIG. 10 is a schematic flowchart of Embodiment 5 of the message transmission method according to the present invention. This embodiment is based on the embodiment shown in FIG. 9, and further, before executing S901, further includes:
S1000:根據第二歷史時間段內執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度。 S1000: Determine the size of the thread encapsulation package corresponding to the second current time period according to the number of messages generated by the thread unit in the second historical time period.
本實施例,通過根據第二歷史時間段內執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度,執行緒封裝包的尺度設置更加合理。 In this embodiment, by determining the size of the thread encapsulation package corresponding to the second current time period according to the number of messages generated by the thread unit in the second historical time period, the size of the thread encapsulation package is set more reasonable.
實施例六 Embodiment 6
圖11為本發明訊息傳輸方法實施例六的流程示意圖,本實施例是在實施例五或實施例六所示實施例的基礎上,進一步地,S901的可能的實現的方式的描述,其中,其中,可以通過兩種方式觸發執行緒單元進行封裝處理,其中,第一種方式為:執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則觸發執行緒單元進行 封裝處理。第二種方式為:執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,但目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間大於等於第二預設定時時間,則觸發執行緒單元進行訊息封裝處理。為了便於描述,將通過第一種方式觸發執行緒單元進行封裝處理產生的訊息單元描述為“第一訊息單元”,將通過第二種方式觸發執行緒單元進行封裝處理產生的訊息單元描述為“第二訊息單元”,如圖11所示,本實施例如下: FIG. 11 is a schematic flowchart of Embodiment 6 of the message transmission method according to the present invention. This embodiment is based on the embodiment shown in Embodiment 5 or Embodiment 6, and further describes a possible implementation manner of S901, wherein, There are two ways to trigger the thread unit to perform encapsulation processing. The first way is: the number of messages whose destination thread unit generated by the thread unit is the same thread unit is greater than or equal to the number of messages corresponding to the second current time period. the size of the thread encapsulation package, the thread unit is triggered to perform package processing. The second method is: the number of messages whose destination thread unit is the same thread unit generated by the thread unit is smaller than the size of the thread package corresponding to the second current time period, but the destination thread unit is the same thread unit. When the second waiting time of the earliest generated message among the messages is greater than or equal to the second preset timing time, the thread unit is triggered to perform message encapsulation processing. For the convenience of description, the message unit generated by triggering the thread unit to perform encapsulation processing in the first method is described as "the first message unit", and the message unit generated by triggering the thread unit to perform encapsulation processing in the second method is described as " The second message unit", as shown in Figure 11, this embodiment is as follows:
S1101:判斷執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量是否大於等於第二當前時間段對應的執行緒封裝包的尺度。 S1101: Determine whether the number of messages generated by the thread unit whose destination thread unit is the same thread unit is greater than or equal to the size of the thread package corresponding to the second current time period.
若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則執行S1102。 If the number of messages in which the destination thread unit generated by the thread unit is the same thread unit is greater than or equal to the size of the thread package corresponding to the second current time period, S1102 is executed.
若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,則執行S1103。 If the number of messages whose destination thread unit is generated by the thread unit is the same thread unit is smaller than the size of the thread package corresponding to the second current time period, S1103 is executed.
S1102:按照執行緒封裝包的尺度,對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元。 S1102: According to the scale of the thread encapsulation package, encapsulate the messages whose destination thread units are the same thread unit to generate a first message unit.
其中,第一訊息單元中包含的訊息的數量與執行緒封裝包的尺度相同。 Wherein, the number of messages contained in the first message unit is the same as the size of the thread encapsulation package.
即:通過第一種方式觸發執行緒單元進行封裝處理。 That is: trigger the thread unit to perform encapsulation processing in the first way.
S1103:確定目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間。 S1103: Determine whether the second waiting time of the earliest generated message among the messages whose destination thread unit is the same thread unit is greater than or equal to a second preset timing time.
若第二等待時間大於等於第二預設定時時間,則執行S1104。 If the second waiting time is greater than or equal to the second preset timing time, execute S1104.
若第二等待時間小於第二預設定時時間,則返回執行S1101。 If the second waiting time is less than the second preset timing time, return to S1101.
其中,第二預設定時時間可以根據經驗值進行設置。第二等待時間由專門的執行緒單元(描述為定時執行緒單元)進行監控,當第二等待時間大於等於第二預設定時時間時,該定時執行緒單元向產生訊息的執行緒單元發送指示訊息,觸發產生訊息的執行緒單元進行封裝處理。 Wherein, the second preset timing time may be set according to an empirical value. The second waiting time is monitored by a special thread unit (described as a timing thread unit), and when the second waiting time is greater than or equal to the second preset timing time, the timing thread unit sends an instruction to the thread unit that generated the message message, triggering the thread unit that generated the message to perform encapsulation processing.
S1104:對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元。 S1104: Encapsulate messages whose destination thread units are the same thread unit to generate a second message unit.
其中,第二訊息單元中包含執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。 Wherein, the second message unit includes all messages whose destination thread unit generated by the thread unit is the same thread unit.
即:通過第二種方式觸發執行緒單元進行封裝處理。 That is: trigger the thread unit to perform encapsulation processing in the second way.
本實施例:通過兩種方式觸發執行緒單元進行封裝處理,當執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則觸發按照執行緒封裝包的尺度,對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元;當執行緒單元產生的目的執行緒單元為同一 執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,但目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,則觸發執行緒單元對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,從而,避免因執行緒單元產生訊息的頻率不穩定時,訊息數量較長時間不能滿足執行緒封裝包的尺度而無法進行封裝處理,導致訊息發送時延較長的問題。 In this embodiment, the thread unit is triggered to perform encapsulation processing in two ways. When the number of messages whose destination thread unit is the same thread unit generated by the thread unit is greater than or equal to the size of the thread encapsulation package corresponding to the second current time period , then trigger according to the scale of the thread encapsulation package to encapsulate the message whose destination thread unit is the same thread unit to generate the first message unit; when the destination thread unit generated by the thread unit is the same thread unit The number of messages of the thread unit is smaller than the size of the thread package corresponding to the second current time period, but whether the second waiting time of the earliest generated message among the messages whose destination thread unit is the same thread unit is greater than or equal to the second prediction When the time is set, the thread unit is triggered to encapsulate the messages whose destination thread unit is the same thread unit to generate a second message unit, so as to avoid a longer number of messages when the frequency of messages generated by the thread unit is not stable. The time cannot meet the size of the thread encapsulation package and cannot be encapsulated, resulting in a long delay in message sending.
實施例七 Embodiment 7
圖12為本發明訊息傳輸方法實施例七的流程示意圖,本實施例是在實施例六所示實施例的基礎上,進一步地,S1000的一種可能的實現的方式的描述,如圖12所示: FIG. 12 is a schematic flowchart of Embodiment 7 of the message transmission method according to the present invention. This embodiment is based on the embodiment shown in Embodiment 6, and further describes a possible implementation manner of S1000, as shown in FIG. 12 . :
S1201:獲取第二歷史時間段內,通過第一訊息單元和第二訊息單元發送的訊息的第三數量。 S1201: Acquire a third quantity of messages sent by the first message unit and the second message unit within the second historical time period.
S1202:獲取第二歷史時間段內,通過第二訊息單元發送的訊息的第四數量。 S1202: Acquire the fourth quantity of messages sent by the second message unit in the second historical time period.
其中,S1201和S1202的執行順序不做限制。 The execution order of S1201 and S1202 is not limited.
S1203:根據第四數量和第三數量的比值以及第二歷史時間段對應的執行緒封裝包的尺度,確定第二當前時間段對應的執行緒封裝包的尺度。 S1203: Determine the size of the thread package corresponding to the second current time period according to the ratio of the fourth number to the third number and the size of the thread package corresponding to the second historical time period.
通過第四數量和第三數量的比值,可以獲知第二歷史時間段執行緒單元產生訊息的頻率的變化趨勢,第二預設閾值通常設置為0.5,若比值大於第二預設閾值,說明執 行緒單元產生訊息的頻率變慢,大多數的訊息是通過第二種方式觸發執行緒單元進行封裝處理的,因此,要減小執行緒封裝包的尺度。若比值大於0.5,說明執行緒單元產生訊息的頻率變快,大多數的訊息是通過第一種方式觸發執行緒單元進行封裝處理的,因此,要增大執行緒封裝包的尺度。 Through the ratio of the fourth number to the third number, the trend of the frequency of messages generated by the thread unit in the second historical time period can be known. The second preset threshold is usually set to 0.5. If the ratio is greater than the second preset threshold, it means that the The frequency of messages generated by the thread unit becomes slower. Most of the messages trigger the thread unit for encapsulation processing through the second method. Therefore, it is necessary to reduce the size of the thread encapsulation package. If the ratio is greater than 0.5, it means that the frequency of message generation by the thread unit becomes faster. Most of the messages are triggered by the first method to trigger the thread unit for encapsulation processing. Therefore, the size of the thread encapsulation package should be increased.
當要縮小執行緒封裝包的尺度時,要確保第二歷史時間段對應的執行緒封裝包的尺度大於1。 When reducing the size of the thread encapsulation package, it is necessary to ensure that the dimension of the thread encapsulation package corresponding to the second historical time period is greater than 1.
具體地,包括但不限於以下兩種可能的實現方式: Specifically, including but not limited to the following two possible implementations:
一種可能的實現方式:若比值大於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,第三係數小於1。即使第二當前時間段對應的執行緒封裝包的尺度小於第二歷史時間段對應的行程封裝包的尺度。 A possible implementation: if the ratio is greater than the second preset threshold, determine that the scale of the thread encapsulation package corresponding to the second current time period is the product of the scale of the thread encapsulation package corresponding to the second historical time period and the third coefficient , where the third coefficient is less than 1. Even if the size of the thread package corresponding to the second current time period is smaller than the size of the itinerary package corresponding to the second historical time period.
另一種可能的實現方式:若比值小於等於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,第四係數大於1。即使第二當前時間段對應的行程封裝包的尺度小大於第二歷史時間段對應的行程封裝包的尺度。 Another possible implementation manner: if the ratio is less than or equal to the second preset threshold, determine the scale of the thread encapsulation package corresponding to the second current time period as the scale of the thread encapsulation package corresponding to the second historical time period and the fourth coefficient , where the fourth coefficient is greater than 1. Even if the size of the itinerary package corresponding to the second current time period is smaller than the size of the itinerary package corresponding to the second historical time period.
本實施例,通過獲取第二歷史時間段內,通過第一訊息單元和第二訊息單元發送的訊息的第三數量,以及,獲取第二歷史時間段內,通過第二訊息單元發送的訊息的第 四數量,根據第四數量和第三數量的比值以及第二歷史時間段對應的執行緒封裝包的尺度,確定第二當前時間段對應的執行緒封裝包的尺度,從而,使得執行緒封裝包的尺度設置更加合理。 In this embodiment, by acquiring the third number of messages sent by the first message unit and the second message unit in the second historical time period, and by acquiring the number of messages sent by the second message unit in the second historical time period the first Fourth quantity, according to the ratio of the fourth quantity to the third quantity and the scale of the thread encapsulation package corresponding to the second historical time period, determine the dimension of the thread encapsulation package corresponding to the second current time period, so that the thread encapsulation package is made The scale setting is more reasonable.
圖13為本發明訊息傳輸裝置實施例三的結構示意圖,本實施例的裝置包括封裝模組1301、發送模組1302,其中,封裝模組1301用於對執行緒單元產生的訊息進行封裝處理,生成訊息單元,訊息單元包含至少兩個訊息;發送模組1302用於向源行程單元的發送隊列發送訊息單元。
13 is a schematic structural diagram of Embodiment 3 of the message transmission apparatus of the present invention. The apparatus of this embodiment includes an
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例四所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus in this embodiment can be used to execute the technical solution shown in Embodiment 4 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖13中,封裝模組1301具體用於根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成訊息單元。還包括:處理模組1303用於根據第二歷史時間段內執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度。
In FIG. 13 , the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例五所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 5 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖13中,訊息單元包括第一訊息單元;封裝模組1301具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則按照執行緒封裝包
的尺度,對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,第一訊息單元中包含的訊息的數量與執行緒封裝包的尺度相同。
In FIG. 13 , the message unit includes a first message unit; the
在圖13中,訊息單元還包括第二訊息單元;封裝模組1301還具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,則確定目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若第二等待時間大於等於第二預設定時時間,則對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,第二訊息單元中包含執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。
In FIG. 13 , the message unit further includes a second message unit; the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例六所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus in this embodiment can be used to execute the technical solution shown in Embodiment 6 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, and are not repeated here.
在圖13中,處理模組1303具體用於獲取第二歷史時間段內,通過第一訊息單元和第二訊息單元發送的訊息的第三數量;以及,獲取第二歷史時間段內,通過第二訊息單元發送的訊息的第四數量;根據第四數量和第三數量的比值以及第二歷史時間段對應的執行緒封裝包的尺度,確定第二當前時間段對應的執行緒封裝包的尺度。
In FIG. 13 , the
其中,處理模組1303具體用於若比值大於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為
第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,第三係數小於1。
The
其中,處理模組1303還具體用於若比值小於等於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,第四係數大於1。
Wherein, the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例七所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 7 of the message transmission method correspondingly, and its implementation principle and technical effect are similar, and details are not repeated here.
圖14為本發明訊息傳輸裝置實施例四的結構示意圖,本實施例的裝置包括處理器1401和發送器1402,其中,處理器1401用於對執行緒單元產生的訊息進行封裝處理,生成訊息單元,訊息單元包含至少兩個訊息;發送器1402發送器耦合至處理器,發送器用於向源行程單元的發送隊列發送訊息單元。
14 is a schematic structural diagram of Embodiment 4 of a message transmission apparatus according to the present invention. The apparatus of this embodiment includes a
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例四所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus in this embodiment can be used to execute the technical solution shown in Embodiment 4 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖14中,處理器1401具體用於根據第二當前時間段對應的執行緒封裝包的尺度,對執行緒單元產生的訊息進行封裝處理,生成訊息單元。
In FIG. 14 , the
在圖14中,處理器1401還用於根據第二歷史時間段內執行緒單元產生的訊息的數量,確定第二當前時間段對應的執行緒封裝包的尺度。
In FIG. 14 , the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例五所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 5 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, which will not be repeated here.
在圖14中,訊息單元包括第一訊息單元;處理器1401具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量大於等於第二當前時間段對應的執行緒封裝包的尺度,則按照執行緒封裝包的尺度,對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第一訊息單元,其中,第一訊息單元中包含的訊息的數量與執行緒封裝包的尺度相同。
In FIG. 14 , the message unit includes a first message unit; the
在圖14中,訊息單元還包括第二訊息單元;處理器1401還具體用於若執行緒單元產生的目的執行緒單元為同一執行緒單元的訊息的數量小於第二當前時間段對應的執行緒封裝包的尺度,則確定目的執行緒單元為同一執行緒單元的訊息中最早產生的訊息的第二等待時間是否大於等於第二預設定時時間,若第二等待時間大於等於第二預設定時時間,則對目的執行緒單元為同一執行緒單元的訊息進行封裝處理,生成第二訊息單元,其中,第二訊息單元中包含執行緒單元產生的目的執行緒單元為同一執行緒單元的所有訊息。
In FIG. 14 , the message unit further includes a second message unit; the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例六所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus in this embodiment can be used to execute the technical solution shown in Embodiment 6 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, and are not repeated here.
在圖14中,處理器1401具體用於獲取第二歷史時間段
內,通過第一訊息單元和第二訊息單元發送的訊息的第三數量;以及,獲取第二歷史時間段內,通過第二訊息單元發送的訊息的第四數量;根據第四數量和第三數量的比值以及第二歷史時間段對應的執行緒封裝包的尺度,確定第二當前時間段對應的執行緒封裝包的尺度。
In FIG. 14, the
在圖14中,處理器1401具體用於若比值大於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為第二歷史時間段對應的執行緒封裝包的尺度與第三係數的乘積,其中,第三係數小於1。
In FIG. 14 , the
在圖14中,處理器1401還具體用於若比值小於等於第二預設閾值,則確定第二當前時間段對應的執行緒封裝包的尺度為第二歷史時間段對應的執行緒封裝包的尺度與第四係數的乘積,其中,第四係數大於1。
In FIG. 14 , the
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例七所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in Embodiment 7 of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, and will not be repeated here.
圖15為本發明訊息傳輸系統實施例三的結構示意圖,如圖15所示,該系統包括,行程單元,行程單元包括源執行緒單元和目的執行緒單元;在圖15中,行程單元以行程單元A示出,源執行緒單元以執行緒單元A1示出,目的執行緒單元以執行緒單元A2示出;源執行緒單元確定源執行緒單元產生的訊息的目的執行緒單元是否屬於同一行程單元;源執行緒單元若訊息的目的執行緒單元屬於同一行程單元,則向目的執行緒單元的接收隊列發送訊息。 FIG. 15 is a schematic structural diagram of Embodiment 3 of the message transmission system of the present invention. As shown in FIG. 15 , the system includes a travel unit, and the travel unit includes a source thread unit and a destination thread unit; Unit A is shown, the source thread unit is shown as thread unit A1, and the destination thread unit is shown as thread unit A2; the source thread unit determines whether the destination thread unit of the message generated by the source thread unit belongs to the same itinerary unit; source thread unit If the destination thread unit of the message belongs to the same travel unit, send the message to the receiving queue of the destination thread unit.
圖15所示訊息傳輸系統實施例中源行程單元具體可用於執行圖16所示方法實施例的技術方案,其實現原理和技術效果,參見圖16所示方法實施例中的詳細描述,此處不再贅述。 The source travel unit in the embodiment of the message transmission system shown in FIG. 15 can be specifically used to execute the technical solution of the embodiment of the method shown in FIG. 16 . For the realization principle and technical effect, please refer to the detailed description in the embodiment of the method shown in FIG. 16 , here No longer.
圖16為本發明訊息傳輸方法實施例八的流程示意圖,本實施例所對應的技術方案可以獨立執行,也可以結合上述各實施例,在上述各實施例的基礎上執行,具體如下: 16 is a schematic flowchart of Embodiment 8 of a message transmission method according to the present invention. The technical solution corresponding to this embodiment can be executed independently, or can be executed in combination with the above-mentioned embodiments on the basis of the above-mentioned embodiments, as follows:
S1601:源執行緒單元確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元。 S1601: The source thread unit determines whether the destination thread unit of the generated message and the source thread unit belong to the same travel unit.
結合圖1,例如:源執行緒單元為執行緒單元A1,產生的訊息的目的執行緒單元為執行緒單元A2或者執行緒單元A3,則認為產生的訊息的目的執行緒單元與源執行緒單元屬於同一行程單元。 1, for example: the source thread unit is the thread unit A1, and the destination thread unit of the generated message is the thread unit A2 or the thread unit A3, then it is considered that the destination thread unit and the source thread unit of the generated message are belong to the same itinerary unit.
再例如:源執行緒單元為執行緒單元A1,產生的訊息的目的執行緒單元為執行緒單元B1、執行緒單元B2或者執行緒單元B3,則認為產生的訊息的目的執行緒單元與源執行緒單元不屬於同一行程單元。 For another example, if the source thread unit is thread unit A1, and the destination thread unit of the generated message is thread unit B1, thread unit B2 or thread unit B3, it is considered that the destination thread unit of the generated message is the same as the source thread unit. The thread units do not belong to the same stroke unit.
若執行緒單元產生的訊息的目的執行緒單元屬於源執行緒單元,則執行S1602。 If the destination thread unit of the message generated by the thread unit belongs to the source thread unit, execute S1602.
S1602:源執行緒單元發送訊息到目的執行緒單元的接收隊列。 S1602: The source thread unit sends a message to the receive queue of the destination thread unit.
即:無需先將訊息發送到行程單元的發送隊列,再通過網路通道發送到該行程單元的接收隊列,再發送到目的執行緒單元,而是直接在行程單元內部,將訊息從一個執 行緒單元傳輸到另一個執行緒單元,從而,縮短訊息發送的時延。 That is, there is no need to first send the message to the sending queue of the itinerary unit, then send it to the receiving queue of the itinerary unit through the network channel, and then send it to the destination thread unit, but directly inside the itinerary unit, send the message from an execution unit A thread unit is transmitted to another thread unit, thereby reducing the delay of message sending.
例如:圖1中的執行緒單元A1產生的訊息的目的執行緒單元為執行緒單元A2,則直接在行程單元A內,將訊息從執行緒單元A1發送到執行緒單元A2的接收隊列。 For example, if the destination thread unit of the message generated by thread unit A1 in FIG. 1 is thread unit A2, the message is directly sent from thread unit A1 to the receive queue of thread unit A2 in travel unit A.
本實施例,通過確定執行緒單元產生的訊息的目的執行緒單元是否屬於源執行緒單元,當執行緒單元產生的訊息的目的執行緒單元屬於源執行緒單元,則直接發送訊息到目的執行緒單元的接收隊列,從而,縮短訊息發送的時延,提高訊息傳輸效率。 In this embodiment, by determining whether the destination thread unit of the message generated by the thread unit belongs to the source thread unit, when the destination thread unit of the message generated by the thread unit belongs to the source thread unit, the message is directly sent to the destination thread The receiving queue of the unit, thereby shortening the delay of message sending and improving the efficiency of message transmission.
圖17為本發明訊息傳輸裝置實施例五的結構示意圖,本實施例的裝置包括處理模組1701和發送模組1702,其中,處理模組1701用於確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元;發送模組1702用於若訊息的目的執行緒單元與源執行緒單元屬於同一行程單元,則向目的執行緒單元的接收隊列發送訊息。
17 is a schematic structural diagram of Embodiment 5 of the message transmission apparatus of the present invention. The apparatus of this embodiment includes a
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例八所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The device of this embodiment can be used to execute the technical solution shown in the eighth embodiment of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, and are not repeated here.
圖18為本發明訊息傳輸裝置實施例六的結構示意圖,本實施例的裝置包括處理器1801和發送器1802,其中,處理器1801用於確定產生的訊息的目的執行緒單元是否與源執行緒單元屬於同一行程單元;發送器1802耦合至處理器1801,發送器1802用於若訊息的目的執行緒單元與源執行
緒單元屬於同一行程單元,則向目的執行緒單元的接收隊列發送所述訊息。
18 is a schematic structural diagram of Embodiment 6 of a message transmission apparatus according to the present invention. The apparatus of this embodiment includes a
本實施例的裝置,對應的可用於執行訊息傳輸方法實施例八所示的技術方案,其實現原理和技術效果類似,此處不再贅述。 The apparatus of this embodiment can be used to execute the technical solution shown in the eighth embodiment of the message transmission method correspondingly, and the implementation principle and technical effect thereof are similar, and will not be repeated here.
本發明還可提供一種處理器可讀儲存媒介,該可讀儲存媒介中儲存有程式指令,該程式指令用於使處理器執行上述訊息傳輸方法實施例一至實施例八中所有步驟或部分步驟。上述可讀儲存媒介可以是由任何類型的易失性或非易失性儲存設備或者它們的組合實現,如靜態隨機存取記憶體(SRAM),電可抹除可編程唯讀記憶體(EEPROM),可抹除可編程唯讀記憶體(EPROM),可編程唯讀記憶體(PROM),唯讀記憶體(ROM),磁記憶體,快閃記憶體,磁碟或光碟 The present invention can further provide a processor-readable storage medium, the readable storage medium stores program instructions, and the program instructions are used to cause the processor to execute all or part of the steps in the first to eighth embodiments of the above message transmission method. The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage devices or combinations thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM) ), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Disk or Optical Disk
最後應說明的是:以上各實施例僅用以說明本發明的技術方案,而非對其限制;儘管參照前述各實施例對本發明進行了詳細的說明,本領域的普通技術人員應當理解:其依然可以對前述各實施例所記載的技術方案進行修改,或者對其中部分或者全部技術特徵進行等同替換;而這些修改或者替換,並不使相應技術方案的本質脫離本發明各實施例技術方案的範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. Scope.
Claims (30)
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
??201610726969.6 | 2016-08-25 | ||
CN201610726969.6 | 2016-08-25 | ||
CN201610726969.6A CN107783845B (en) | 2016-08-25 | 2016-08-25 | Message transmission system, method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201807585A TW201807585A (en) | 2018-03-01 |
TWI752967B true TWI752967B (en) | 2022-01-21 |
Family
ID=61245472
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW106119852A TWI752967B (en) | 2016-08-25 | 2017-06-14 | Message transmission system, method and device |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN107783845B (en) |
TW (1) | TWI752967B (en) |
WO (1) | WO2018036406A1 (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101127685A (en) * | 2007-09-20 | 2008-02-20 | 中兴通讯股份有限公司 | An inter-process communication device and inter-process communication method |
CN103164267A (en) * | 2013-03-29 | 2013-06-19 | 汉柏科技有限公司 | Lock-free message queue implementation method |
US20130208592A1 (en) * | 2010-08-06 | 2013-08-15 | Bejing Qiantang Network Technology Company, Ltd. | Traffic-control-based data transmission method and communication system |
TW201334469A (en) * | 2011-12-29 | 2013-08-16 | Intel Corp | Shaping data packet traffic |
CN103853621A (en) * | 2012-12-05 | 2014-06-11 | 腾讯科技(深圳)有限公司 | Inter-process interactive method and relevant terminal equipment |
TW201536004A (en) * | 2014-02-28 | 2015-09-16 | Cavium Inc | Packet output processing |
US20150295841A1 (en) * | 2014-04-14 | 2015-10-15 | Qualcomm Incorporated | Efficient packet aggregation using dynamic wait time |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0689139A3 (en) * | 1994-06-22 | 1997-09-10 | Ibm | Anonymous reply port method and apparatus for a microkernel data processing system |
US6385658B2 (en) * | 1997-06-27 | 2002-05-07 | Compaq Information Technologies Group, L.P. | Method and apparatus for synchronized message passing using shared resources |
US6744765B1 (en) * | 2000-08-24 | 2004-06-01 | Sun Microsystems, Inc. | Mechanism for completing messages in memory |
CN100492302C (en) * | 2006-11-27 | 2009-05-27 | 浙江大学 | Method for realizing interprocess asynchronous communication based on Java |
US8401952B1 (en) * | 2009-03-24 | 2013-03-19 | Trading Technologies International, Inc. | Trade order submission for electronic trading |
CN103207806B (en) * | 2012-01-12 | 2016-05-04 | 阿里巴巴集团控股有限公司 | A kind of method and system thereof that sends message |
CN104159129B (en) * | 2014-08-08 | 2015-06-17 | 北京大学 | Method for progressively transmitting partial splitting blocks under remote sensing data limited bandwidth |
-
2016
- 2016-08-25 CN CN201610726969.6A patent/CN107783845B/en active Active
-
2017
- 2017-06-14 TW TW106119852A patent/TWI752967B/en active
- 2017-08-15 WO PCT/CN2017/097492 patent/WO2018036406A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101127685A (en) * | 2007-09-20 | 2008-02-20 | 中兴通讯股份有限公司 | An inter-process communication device and inter-process communication method |
US20130208592A1 (en) * | 2010-08-06 | 2013-08-15 | Bejing Qiantang Network Technology Company, Ltd. | Traffic-control-based data transmission method and communication system |
TW201334469A (en) * | 2011-12-29 | 2013-08-16 | Intel Corp | Shaping data packet traffic |
CN103853621A (en) * | 2012-12-05 | 2014-06-11 | 腾讯科技(深圳)有限公司 | Inter-process interactive method and relevant terminal equipment |
CN103164267A (en) * | 2013-03-29 | 2013-06-19 | 汉柏科技有限公司 | Lock-free message queue implementation method |
TW201536004A (en) * | 2014-02-28 | 2015-09-16 | Cavium Inc | Packet output processing |
US20150295841A1 (en) * | 2014-04-14 | 2015-10-15 | Qualcomm Incorporated | Efficient packet aggregation using dynamic wait time |
Also Published As
Publication number | Publication date |
---|---|
CN107783845B (en) | 2021-04-13 |
CN107783845A (en) | 2018-03-09 |
WO2018036406A1 (en) | 2018-03-01 |
TW201807585A (en) | 2018-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021042783A1 (en) | Video image display method and apparatus, electronic device and storage medium | |
JP7394986B2 (en) | Method of transmitting data packets and apparatus for implementing this method | |
US9774651B2 (en) | Method and apparatus for rapid data distribution | |
US20160285812A1 (en) | Method of issuing messages of a message queue and a message issuing device | |
KR102408176B1 (en) | Client service transmission method and device | |
CN113285931B (en) | Streaming media transmission method, streaming media server and streaming media system | |
CN114390000B (en) | TSN flow scheduling method and related equipment based on enqueue shaping | |
US20140269271A1 (en) | Methods and systems for network congestion management | |
US20150326698A1 (en) | Network timeouts using intentionally delayed transmissions | |
US9807026B2 (en) | Hierarchical quality of service scheduling method and device | |
WO2014146468A1 (en) | Method and apparatus for scheduling and buffering data packet, and computer storage medium | |
WO2020168933A1 (en) | Network request processing method, device, terminal and storage medium | |
CN104052676B (en) | A kind of data processing method of transmission path device and transmission path | |
CN114513472A (en) | Network congestion control method and device | |
US20230171197A1 (en) | Packet transmission method, apparatus, device, and readable storage medium | |
TWI752967B (en) | Message transmission system, method and device | |
WO2016095323A1 (en) | Data transmission method and apparatus based on serial server | |
WO2021092760A1 (en) | Data transmission method and ble device | |
US8854957B2 (en) | Packet retransmission control system, packet retransmission control method and retransmission control program | |
Kim et al. | Preemptive switched ethernet for real-time process control system | |
WO2022188807A1 (en) | Data transmission system and related device | |
WO2023123377A1 (en) | Network flow scheduling method, apparatus, and system | |
WO2012106902A1 (en) | Queue management method, apparatus and system | |
WO2024051701A1 (en) | Scheduling optimization method and apparatus, device, and storage medium | |
US20140269748A1 (en) | Method and apparatus having improved line rate ip packet communication |