CN106776401A - Method for message transmission and device - Google Patents
Method for message transmission and device Download PDFInfo
- Publication number
- CN106776401A CN106776401A CN201611037623.1A CN201611037623A CN106776401A CN 106776401 A CN106776401 A CN 106776401A CN 201611037623 A CN201611037623 A CN 201611037623A CN 106776401 A CN106776401 A CN 106776401A
- Authority
- CN
- China
- Prior art keywords
- message
- sent
- weights
- transmit queue
- priority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
- G06F13/26—Handling requests for interconnection or transfer for access to input/output bus using interrupt with priority control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
- Communication Control (AREA)
- Telephonic Communication Services (AREA)
Abstract
The present disclosure proposes a kind of method for message transmission and device, it is related to communication technical field, this method includes:The first message that application sends is obtained, first message includes the priority of the message;First message is stored in transmit queue, and records the priority and property parameters of first message;Wherein, being stored in the transmit queue after first message includes one or more message to be sent, and every message to be sent priority and property parameters;The priority and property parameters of every message to be sent in transmit queue obtain every transmission priority weights of message to be sent;Second message of transmission priority maximum weight in transmit queue is sent to target processor.Message transmission can be adjusted flexibly sequentially according to the significance level of message, it is ensured that important messages can be sent in time.
Description
Technical field
This disclosure relates to communication technical field, more particularly to a kind of method for message transmission and device.
Background technology
During development communication technologies, the communication between main frame and external equipment is by UART (Universal
Asynchronous Receiver/Transmitter, universal asynchronous receiving-transmitting transmitter) realize serial data and parallel data
Between conversion.The realization of this conversion regime is to be stored in FIFO (First Input First Output, elder generation by by message
Entering and first go out) come what is realized, the transmission order of message is stored in the sequencing of fifo queue according only to message for queue, do not consider to disappear
The significance level of breath itself, be stored in before this FIFO teams after the message of important information is carried into fifo queue, it is necessary to wait
Message in row is sent can be just transmitted, and cause important messages to be sent in time.
The content of the invention
The disclosure provides a kind of method for message transmission and device, is used to solve conventional message transmission not consider the important of message
Degree, the problem for causing important messages to be sent in time.
To achieve these goals, it is described according to the first aspect of the embodiment of the present disclosure, there is provided a kind of method for message transmission
Method includes:
The first message that application sends is obtained, the first message includes the priority of the first message;
The first message is stored in transmit queue, and records the priority and property parameters of the first message;Its
In, being stored in the transmit queue after the first message includes one or more message to be sent, and every to be sent
The priority and property parameters of message;
The priority and property parameters of every message to be sent in the transmit queue obtain described every and treat
Send the transmission priority weights of message;
Second message of transmission priority maximum weight in the transmit queue is sent to target processor.
Optionally, the property parameters of described every message to be sent include:Every Messages Message length to be sent with
And be stored in the timestamp of the transmit queue, the priority of every message to be sent in the transmit queue and
Property parameters obtain the transmission priority weights of every message to be sent, including:
According to the described every priority of message to be sent, message-length and it is stored in the timestamp of the transmit queue,
The described every transmission priority weights of message to be sent are obtained successively using default transmission priority Weights-selected Algorithm.
Optionally, it is described according to the described every priority of message to be sent, message-length and to be stored in the transmission team
The timestamp of row, the described every transmission priority of message to be sent is obtained using default transmission priority Weights-selected Algorithm successively
Weights, including:
The priority of the nth bar message to be sent a. in the transmit queue, message-length and it is stored in the hair
The timestamp of queue is sent, the transmission priority of the nth bar message to be sent is obtained using the transmission priority Weights-selected Algorithm
Weights;
B. by the transmission preferences of the transmission priority weights of nth bar message to be sent and preceding n-1 bars message to be sent
Maximum in level weights is compared;
C. by the transmission priority weights of nth bar message to be sent with both maximums it is one of larger make
It is the maximum of the transmission priority weights of preceding n bars message to be sent;Wherein, n is positive integer, and 2≤n≤N, N are transmission team
The sum of current message to be sent in row;
Step a to step c is performed after adding 1 by the value of n again, until obtaining, N bars in the transmit queue are to be sent to disappear
The maximum of the transmission priority weights of breath.
Optionally, the transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, and T is represented and worked as
Preceding time, TstRepresent that message to be sent is stored in the timestamp of the transmit queue, LmsgRepresent the message-length of message to be sent, a
Priority weighting is represented, b represents time migration (T-Tst) weight.
Optionally, second message by transmission priority maximum weight in the transmit queue is sent to target treatment
Device, including:
Second message corresponding with the maximum of the transmission priority weights is obtained from the transmit queue;
Second message is sent to the target processor.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of massage transmission device, described device includes:Message is obtained
Module, message storage module, weights acquisition module and sending module;
The message capturing module, for obtaining the first message that application sends, the first message includes described the
The priority of one message;
The message storage module, for the first message to be stored in into transmit queue, and records the first message
Priority and property parameters;Wherein, being stored in the transmit queue after the first message includes that one or more is pending
Send message, and every message to be sent priority and property parameters;
The weights acquisition module, for the priority and category of every message to be sent in the transmit queue
Property every transmission priority weights of message to be sent described in parameter acquiring;
The sending module, for the second message of transmission priority maximum weight in the transmit queue to be sent to mesh
Mark processor.
Optionally, the property parameters of described every message to be sent include:The message-length of every message to be sent
And the timestamp of the transmit queue is stored in, the weights acquisition module is used for:
According to the described every priority of message to be sent, message-length and it is stored in the timestamp of the transmit queue,
The described every transmission priority weights of message to be sent are obtained successively using default transmission priority Weights-selected Algorithm.
Optionally, the weights acquisition module includes:Weights acquisition submodule, comparison sub-module and most value acquisition submodule
Block;
The weights acquisition submodule, priority for the nth bar message to be sent in the transmit queue, disappears
Cease length and be stored in the timestamp of the transmit queue, obtaining the nth bar using the transmission priority Weights-selected Algorithm treats
Send the transmission priority weights of message;
The comparison sub-module, for the transmission priority weights of nth bar message to be sent are pending with preceding n-1 bars
The maximum in the transmission priority weights of message is sent to be compared;
It is described to be most worth acquisition submodule, for by the transmission priority weights of nth bar message to be sent with it is described most
The maximum of one of larger transmission priority weights as preceding n bars message to be sent in both big values;Wherein, n is just whole
Number, and 2≤n≤N, N are the sum of message to be sent current in transmit queue;
The weights acquisition submodule, the comparison sub-module and the most value are performed after adding 1 by the value of n again and obtains son
Step performed by module, until obtaining the maximum of the transmission priority weights of the N bars message to be sent in the transmit queue
Value.
Optionally, the transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, and T is represented and worked as
Preceding time, TstRepresent that message to be sent is stored in the timestamp of the transmit queue, LmsgRepresent the message-length of message to be sent, a
Priority weighting is represented, b represents time migration (T-Tst) weight.
Optionally, the sending module includes:Second message acquisition submodule and the second message sending submodule;
The second message acquisition submodule, for being obtained from the transmit queue and the transmission priority weights
Corresponding second message of maximum;
The second message sending submodule, for second message to be sent to the target processor.
By above-mentioned technical proposal, the disclosure utilizes the priority and property parameters of message, according to the transmission preferences of message
Level weights carry out the transmission of decision message sequentially, and the significance level and message for having considered message are stored in the time of queue, can
The problem that conventional message transmission does not consider the significance level of message, causes important messages to be sent in time is solved the problems, such as,
With message transmission being adjusted flexibly sequentially according to the significance level of message, it is ensured that the effect that important messages can be sent in time
Really.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not
The disclosure can be limited.
Brief description of the drawings
Accompanying drawing is, for providing further understanding of the disclosure, and to constitute the part of specification, with following tool
Body implementation method is used to explain the disclosure together, but does not constitute limitation of this disclosure.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for message transmission according to an exemplary embodiment;
Fig. 2 is the flow chart of another method for message transmission according to an exemplary embodiment;
Fig. 3 is the flow chart of another method for message transmission according to an exemplary embodiment;
Fig. 4 is a kind of block diagram of the massage transmission device according to an exemplary embodiment;
Fig. 5 is the block diagram of another massage transmission device according to an exemplary embodiment;
Fig. 6 is the block diagram of another massage transmission device according to an exemplary embodiment.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in implementation method do not represent all implementation methods consistent with the disclosure.Conversely, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects described in detail in claims, the disclosure.
Before the method for message transmission and device for introducing disclosure offer, first to involved by the disclosure each embodiment
Application scenarios are introduced.The disclosure relates generally to the communication between source processor and target processor, wherein source processor
It is parallel data in processing data, and it is serial data that target processor can process reception, therefore before data are sent
Needs realize the conversion between parallel data and serial data using specific circuit, equipment or chip.Therefore the disclosure is each
Application scenarios involved by individual embodiment are:The message sent by the application run on source processor is stored in transmit queue, with
Default mode processes the message in queue, the current message for sending at first is selected from queue, and send in a serial fashion
To target processor.Wherein, the disclosure is illustrated by taking universal asynchronous receiving-transmitting transmitter UART as an example to exemplary embodiment.
Fig. 1 is a kind of flow chart of the method for message transmission according to an exemplary embodiment, as shown in figure 1, the party
Method includes:
Step 101, obtains the first message that application sends, and first message includes the priority of first message.
Example, according to the default host-host protocols of UART, source processor is obtained by serial communication high-level interface from application
The frame structure of the first message for taking can be as shown in table 1, is included in message:It is start bit (STX, Start of Text), preferential
Level (priority), data length (len), data (data) and verification and (checksum), start bit represent the first message
Beginning, priority represent the data in the first message the significance level comprising business information, data length represent this
The digit of the data included in one message, data represent the data message included in the first message, verify and for judging this
Whether first message malfunctions in transmitting procedure, if there is mistake, the letter that can be malfunctioned according to the protocol processes of default
Breath.It should be noted that the application refers to application program, background service or the process run in systems.The first message is
Current time, using the message for sending.A priority can be set according to the communication needs of system and the type of service of message
Strategy, arranges a sequencing, successively assignment to each message in system.The message in system is for example divided into 10
Grade, the message of security alarm class is related to the safety of system, and importance highest, setting priority is 10, and heartbeat class message can
Ensure the synchronization of system time, more important, it is 8 etc. to set priority.Can also according to system state in the process of running,
The assignment of real-time adjustment priority, for example, when CPU (central processing unit Central Processing Unit) utilization rate is too high
When, reduce the priority of the relatively low message of some importance, allow CPU can the urgent message of priority treatment, when CPU usage is low
When, prompting class message is improved, allow CPU to give full play to function.
Table 1
Step 102, is stored in transmit queue, and record the priority and property parameters of first message by first message;Its
In, being stored in the transmit queue after first message includes one or more message to be sent, and every message to be sent is excellent
First level and property parameters.Wherein, the property parameters of every message to be sent include:Every message-length of message to be sent with
And it is stored in the timestamp of transmit queue.It should be noted that the message-length of every message to be sent is total position of the message
(bit) number, contain the total length of start bit, priority, data length, data and verification sum, and be stored in transmit queue when
Between stamp be stored in moment of transmit queue for message to be sent.
By taking first message as an example, the process of step 102, after receiving first message, it is necessary to will first be included in first message
Priority and property parameters parse, and first message is together stored in transmit queue.The property parameters of the first message
The message-length of first message can be included and the timestamp of transmit queue is stored in, wherein the message-length can disappear for first
The digit of breath.Being stored in the transmit queue after first message at least includes a message to be sent.
Step 103, the priority and property parameters of every message to be sent in transmit queue obtain every and treat
Send the transmission priority weights of message.
Example, step 103 can be completed by the transmission daemon on source processor, and transmission daemon is that backstage is used
The service processes of message inter-related task are sent in treatment.
Optionally, according to every priority of message to be sent, message-length and the transmit queue can be stored in
Timestamp, every transmission priority weights of message to be sent are obtained using default transmission priority Weights-selected Algorithm successively.
Step 104, the second message of transmission priority maximum weight in transmit queue is sent to target processor.
Example, the transmission priority weights of the every message to be sent obtained to step 103 are ranked up, and find transmission
The second maximum message of weights, second message is probably any bar message in transmit queue.Then, by sending
Daemon sends to target processor the second message by serial interface.Insertion sort, bubble sort or y-bend can be utilized
The methods such as tree sorting, transmission priority weights are ranked up.
Fig. 2 is the flow chart of another method for message transmission according to an exemplary embodiment, as shown in Fig. 2 step
Described in rapid 103 according to every priority of message to be sent, message-length and be stored in the timestamp of the transmit queue,
Every transmission priority weights of message to be sent are obtained successively using default transmission priority Weights-selected Algorithm, including:
Step 1031, the priority of the nth bar message to be sent in transmit queue, message-length and is stored in transmission
The timestamp of queue, the transmission priority weights of nth bar message to be sent are obtained using transmission priority Weights-selected Algorithm.
Step 1032, the transmission priority weights of nth bar message to be sent are excellent with the transmission of preceding n-1 bars message to be sent
Maximum in first level weights is compared.
Wherein, the maximum in the transmission priority weights of preceding n-1 bars message to be sent is once to carry out step upper
When 1013 to 1033, by (n-1)th transmission priority weights of message to be sent, and preceding n-2 bars message to be sent transmission
What the maximum in weights determined after being compared, by that analogy, so, transmission can be obtained by repeatedly judgement excellent
The maximum of first level weights.And can often judge nth bar and preceding n- during the most value for judging transmission priority weights
In 1 message to be sent during the maximum of transmission priority weights, the maximum is recorded.Example, the maximum can be stored,
The corresponding message of the maximum is recorded simultaneously, the corresponding message of the maximum is found so as to after, can also be by updating pointer
The address of storage marks the maximum, and the pointer is used to point to maximum position in the transmit queue, is looked for so as to after
The corresponding message of the maximum in transmit queue.
Step 1033, makees one of larger in the transmission priority weights of nth bar message to be sent and both maximums
It is the maximum of the transmission priority weights of preceding n bars message to be sent.
Wherein, n is positive integer, and 2≤n≤N, N are the sum of message to be sent current in transmit queue.
Step 1031 to step 1033 is performed again after plus 1 by the value of n after step 1033 has been performed, until obtaining hair
Send the maximum of the transmission priority weights of N bars message to be sent in queue.
Example, when there was only a piece of news in transmit queue, i.e. during n=1, the message can be directly transmitted;Work as n=2
When, the 2nd article of transmission priority weights of message to be sent are obtained according to transmission priority Weights-selected Algorithm, preceding n-1 bars are to be sent to disappear
Breath is the 1st article of message to be sent, and the transmission priority weights of two message are compared, and maximum and corresponding message are put
Enter in caching.The 3rd article of message is judged again, and the 3rd article of transmission preferences of message to be sent are obtained according to transmission priority Weights-selected Algorithm
Level weights, and the to be sent of transmission priority maximum weight in judge the 1st article of last time and the 2nd article of message to be sent disappears
Breath compares, and maximum is put into caching.Perform successively, until the message in transmit queue is all compared finishing, you can obtain
Take the maximum of transmission priority weights in all message to be sent.
Optionally, above-mentioned transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, and T is represented and worked as
Preceding time, TstRepresent that message to be sent is stored in the timestamp of transmit queue, LmsgThe message-length of message to be sent is represented, a is represented
Priority weighting, b represents time migration (T-Tst) weight.
Example, a message to be sent, its priority P is 8, time migration (T-Tst) it is 0.5, the message of the message is long
Degree LmsgIt is 64, priority weighting a is 100, the weight b of time migration is 30.Then the transmission priority weights of the message are 879,
The message sends the message prior to transmission priority weights less than 879.
Fig. 3 is the flow chart of another method for message transmission according to an exemplary embodiment, as shown in figure 3, step
The second message by transmission priority maximum weight in transmit queue described in rapid 104 is sent to target processor, including:
Step 1041, obtains the second message corresponding with the maximum of transmission priority weights from transmit queue.
Step 1042, the second message is sent to target processor.
Example, every transmission priority weights of message to be sent are obtained according to step 103, found in transmit queue
Corresponding second message of maximum of transmission priority weights, and second message is obtained from transmit queue, then second is disappeared
Breath is sent to target processor.
In sum, the disclosure using message priority and property parameters, transmission priority weights according to message come
Sequentially, the significance level and message for having considered message are stored in the time of queue, can solve the problem that tradition for the transmission of decision message
Message transmission does not consider the problem of the significance level of message, is sent with that message can be adjusted flexibly according to the significance level of message
Sequentially, it is ensured that the effect that important messages can be sent in time.
Fig. 4 is a kind of block diagram of the massage transmission device according to an exemplary embodiment, as shown in figure 4, the device
Including:Message capturing module 401, message storage module 402, weights acquisition module 403 and sending module 404;
Message capturing module 401, for obtaining the first message that application sends, first message includes the excellent of first message
First level
Message storage module 402, for first message to be stored in into transmit queue, and record first message priority and
Property parameters;Wherein, being stored in the transmit queue after first message includes one or more message to be sent, and every pending
Send the priority and property parameters of message.
Weights acquisition module 403, priority and the attribute ginseng for every message to be sent in transmit queue
Number obtains every transmission priority weights of message to be sent;
Sending module 404, for the second message of transmission priority maximum weight in transmit queue to be sent to target
Reason device.
, wherein it is desired to illustrate, the property parameters of every message to be sent include:The message of every message to be sent is long
Spend and be stored in the timestamp of the transmit queue.
Optionally, weights acquisition module 403 includes:
According to every priority of message to be sent, message-length and the timestamp of the transmit queue is stored in, utilized
Default transmission priority Weights-selected Algorithm obtains every transmission priority weights of message to be sent successively.
Fig. 5 is the block diagram of another massage transmission device according to an exemplary embodiment, as shown in figure 5, weights
Acquisition module 403 includes:Weights acquisition submodule 4031, comparison sub-module 4032 and most value acquisition submodule 4033;
Weights acquisition submodule 4031, the priority, message for the nth bar message to be sent in transmit queue is long
The timestamp of transmit queue is spent and is stored in, the transmission for obtaining nth bar message to be sent using transmission priority Weights-selected Algorithm is excellent
First level weights.
Comparison sub-module 4032, for disappearing the transmission priority weights of nth bar message to be sent are to be sent with preceding n-1 bars
Maximum in the transmission priority weights of breath is compared.
Most it is worth acquisition submodule 4033, for by the transmission priority weights of nth bar message to be sent and both maximums
In one of the larger transmission priority weights as preceding n bars message to be sent maximum.Wherein, n is positive integer, and 2≤n
≤ N, N are the sum of message to be sent current in transmit queue;
Weights acquisition submodule 4031, comparison sub-module 4032 are performed after adding 1 by the value of n again and is most worth acquisition submodule
Step performed by 4033, until obtaining the maximum of the transmission priority weights of the N bars message to be sent in transmit queue.
Optionally, transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, and T is represented and worked as
Preceding time, TstRepresent that message to be sent is stored in the timestamp of transmit queue, LmsgThe message-length of message to be sent is represented, a is represented
Priority weighting, b represents time migration (T-Tst) weight.
Fig. 6 is the block diagram of another massage transmission device according to an exemplary embodiment, as shown in fig. 6, sending
Module 404 includes:Second message acquisition submodule 4041 and the second message sending submodule 4042;
Second message acquisition submodule 4041, for obtaining the maximum pair with transmission priority weights from transmit queue
The second message answered;
Second message sending submodule 4042, for the second message to be sent to target processor.
Wherein, illustrating for above-mentioned modules realization of functions has been carried out in detail in above method embodiment
Description, here is omitted.
In sum, the disclosure using message priority and property parameters, transmission priority weights according to message come
Sequentially, the significance level and message for having considered message are stored in the time of queue, can solve the problem that tradition for the transmission of decision message
Message transmission does not consider the problem of the significance level of message, is sent with that message can be adjusted flexibly according to the significance level of message
Sequentially, it is ensured that the effect that important messages can be sent in time.
Describe the preferred embodiment of the disclosure in detail above in association with accompanying drawing, but, the disclosure is not limited to above-mentioned reality
The detail in mode is applied, in the range of the technology design of the disclosure, those skilled in the art are considering specification and practice
After the disclosure, other embodiments of the disclosure are readily apparent that, belong to the protection domain of the disclosure.
It is further to note that each particular technique feature described in above-mentioned specific embodiment, in not lance
In the case of shield, can be combined by any suitable means.Simultaneously between a variety of implementation methods of the disclosure
Can also be combined, as long as it is without prejudice to the thought of the disclosure, it should equally be considered as disclosure disclosure of that.
The disclosure is not limited to the precision architecture being described above out, and the scope of the present disclosure is only limited by appended claim
System.
Claims (10)
1. a kind of method for message transmission, it is characterised in that methods described includes:
The first message that application sends is obtained, the first message includes the priority of the first message;
The first message is stored in transmit queue, and records the priority and property parameters of the first message;Wherein, deposit
Entering the transmit queue after the first message includes one or more message to be sent, and every message to be sent
Priority and property parameters;
Described every of priority and the property parameters acquisition of every message to be sent in the transmit queue is to be sent
The transmission priority weights of message;
Second message of transmission priority maximum weight in the transmit queue is sent to target processor.
2. method according to claim 1, it is characterised in that the property parameters of every message to be sent include:Institute
The message-length for stating every message to be sent and the timestamp for being stored in the transmit queue, it is described according in the transmit queue
Every message to be sent priority and property parameters obtain the transmission priority weights of every message to be sent, bag
Include:
According to the described every priority of message to be sent, message-length and the timestamp of the transmit queue is stored in, utilized
Default transmission priority Weights-selected Algorithm obtains the described every transmission priority weights of message to be sent successively.
3. method according to claim 2, it is characterised in that it is described according to the described every priority of message to be sent,
Message-length and the timestamp of the transmit queue is stored in, obtains described successively using default transmission priority Weights-selected Algorithm
Every transmission priority weights of message to be sent, including:
The priority of the nth bar message to be sent a. in the transmit queue, message-length and it is stored in the transmission team
The timestamp of row, the transmission priority weights of the nth bar message to be sent are obtained using the transmission priority Weights-selected Algorithm;
B. the transmission priority weights of nth bar message to be sent are weighed with the transmission priority of preceding n-1 bars message to be sent
Maximum in value is compared;
C. it is the transmission priority weights of nth bar message to be sent are one of larger as preceding with both maximums
The maximum of the transmission priority weights of n bars message to be sent;Wherein, n is positive integer, and 2≤n≤N, N are the transmission team
The sum of current message to be sent in row;
Step a to step c is performed after adding 1 by the value of n again, until obtaining the N bars message to be sent in the transmit queue
The maximum of transmission priority weights.
4. according to the method in claim 2 or 3, it is characterised in that the transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, when T represents current
Between, TstRepresent that message to be sent is stored in the timestamp of the transmit queue, LmsgThe message-length of message to be sent is represented, a is represented
Priority weighting, b represents time migration (T-Tst) weight.
5. method according to claim 3, it is characterised in that it is described by transmission priority weights in the transmit queue most
The second big message is sent to target processor, including:
Second message corresponding with the maximum of the transmission priority weights is obtained from the transmit queue;
Second message is sent to the target processor.
6. a kind of massage transmission device, it is characterised in that described device includes:Message capturing module, message storage module, weights
Acquisition module and sending module;
The message capturing module, for obtaining the first message that application sends, the first message includes that described first disappears
The priority of breath;
The message storage module, for the first message to be stored in into transmit queue, and records the preferential of the first message
Level and property parameters;Wherein, being stored in the transmit queue after the first message includes that one or more to be sent disappears
Breath, and every message to be sent priority and property parameters;
The weights acquisition module, priority and the attribute ginseng for every message to be sent in the transmit queue
Number obtains the transmission priority weights of every message to be sent;
The sending module, for the second message of transmission priority maximum weight in the transmit queue to be sent to target
Reason device.
7. device according to claim 6, it is characterised in that the property parameters of every message to be sent include:Institute
The message-length for stating every message to be sent and the timestamp for being stored in the transmit queue, the weights acquisition module are used for:
According to the described every priority of message to be sent, message-length and the timestamp of the transmit queue is stored in, utilized
Default transmission priority Weights-selected Algorithm obtains the described every transmission priority weights of message to be sent successively.
8. device according to claim 7, it is characterised in that:The weights acquisition module includes:Weights acquisition submodule,
Comparison sub-module and most it is worth acquisition submodule;
The weights acquisition submodule, the priority, message for the nth bar message to be sent in the transmit queue is long
The timestamp of the transmit queue is spent and is stored in, it is to be sent to obtain the nth bar using the transmission priority Weights-selected Algorithm
The transmission priority weights of message;
The comparison sub-module, for disappearing the transmission priority weights of nth bar message to be sent are to be sent with preceding n-1 bars
Maximum in the transmission priority weights of breath is compared;
It is described to be most worth acquisition submodule, for by the transmission priority weights of nth bar message to be sent and the maximum
The maximum of one of larger transmission priority weights as preceding n bars message to be sent in the two;Wherein, n is positive integer, and
2≤n≤N, N are the sum of current message to be sent in the transmit queue;
The weights acquisition submodule, the comparison sub-module are performed after adding 1 by the value of n again and described is most worth acquisition submodule
Performed step, until obtaining the maximum of the transmission priority weights of the N bars message to be sent in the transmit queue.
9. the device according to claim 7 or 8, the transmission priority Weights-selected Algorithm includes:
W=P*a+ (T-Tst)*b+Lmsg
Wherein, W represents the transmission priority weights of message to be sent, and P represents the priority of message to be sent, when T represents current
Between, TstRepresent that message to be sent is stored in the timestamp of the transmit queue, LmsgThe message-length of message to be sent is represented, a is represented
Priority weighting, b represents time migration (T-Tst) weight.
10. device according to claim 8, it is characterised in that the sending module includes:Second message acquisition submodule
With the second message sending submodule;
The second message acquisition submodule, for obtaining the maximum with the transmission priority weights from the transmit queue
It is worth corresponding second message;
The second message sending submodule, for second message to be sent to the target processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611037623.1A CN106776401B (en) | 2016-11-23 | 2016-11-23 | Method for message transmission and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611037623.1A CN106776401B (en) | 2016-11-23 | 2016-11-23 | Method for message transmission and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106776401A true CN106776401A (en) | 2017-05-31 |
CN106776401B CN106776401B (en) | 2019-11-15 |
Family
ID=58973846
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611037623.1A Active CN106776401B (en) | 2016-11-23 | 2016-11-23 | Method for message transmission and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106776401B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109309661A (en) * | 2017-07-28 | 2019-02-05 | Ncr公司 | Reciprocity (P2P) peripheral communications control |
CN110177053A (en) * | 2019-05-07 | 2019-08-27 | 中国工商银行股份有限公司 | A kind of smart message sending method and device |
CN111124716A (en) * | 2019-12-26 | 2020-05-08 | 中国航空工业集团公司沈阳飞机设计研究所 | Multi-priority queue message transmission method in unmanned aerial vehicle |
CN111931042A (en) * | 2020-07-13 | 2020-11-13 | 珠海格力电器股份有限公司 | Information pushing method and device |
CN111984901A (en) * | 2020-08-31 | 2020-11-24 | 上海博泰悦臻电子设备制造有限公司 | Message pushing method and related product thereof |
CN114338499A (en) * | 2021-12-29 | 2022-04-12 | 中国电信股份有限公司 | Data transmission method, device thereof and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102201988A (en) * | 2011-05-12 | 2011-09-28 | 西北工业大学 | Scheduling method of avionics full duplex switched Ethernet (AFDX) exchanger |
CN103246653A (en) * | 2012-02-03 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Data processing method and device |
CN104753769A (en) * | 2015-03-24 | 2015-07-01 | 新余兴邦信息产业有限公司 | Method and device for issuing messages by message queue |
CN105450511A (en) * | 2015-12-23 | 2016-03-30 | 东软集团股份有限公司 | Message scheduling method and device in vehicular ad hoc network VANET |
CN105813032A (en) * | 2016-03-11 | 2016-07-27 | 中国联合网络通信集团有限公司 | Information sending method and server |
-
2016
- 2016-11-23 CN CN201611037623.1A patent/CN106776401B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102201988A (en) * | 2011-05-12 | 2011-09-28 | 西北工业大学 | Scheduling method of avionics full duplex switched Ethernet (AFDX) exchanger |
CN103246653A (en) * | 2012-02-03 | 2013-08-14 | 腾讯科技(深圳)有限公司 | Data processing method and device |
CN104753769A (en) * | 2015-03-24 | 2015-07-01 | 新余兴邦信息产业有限公司 | Method and device for issuing messages by message queue |
CN105450511A (en) * | 2015-12-23 | 2016-03-30 | 东软集团股份有限公司 | Message scheduling method and device in vehicular ad hoc network VANET |
CN105813032A (en) * | 2016-03-11 | 2016-07-27 | 中国联合网络通信集团有限公司 | Information sending method and server |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109309661A (en) * | 2017-07-28 | 2019-02-05 | Ncr公司 | Reciprocity (P2P) peripheral communications control |
CN109309661B (en) * | 2017-07-28 | 2021-07-27 | Ncr公司 | Peer-to-peer (P2P) peripheral communication control |
CN110177053A (en) * | 2019-05-07 | 2019-08-27 | 中国工商银行股份有限公司 | A kind of smart message sending method and device |
CN111124716A (en) * | 2019-12-26 | 2020-05-08 | 中国航空工业集团公司沈阳飞机设计研究所 | Multi-priority queue message transmission method in unmanned aerial vehicle |
CN111931042A (en) * | 2020-07-13 | 2020-11-13 | 珠海格力电器股份有限公司 | Information pushing method and device |
CN111931042B (en) * | 2020-07-13 | 2024-04-05 | 珠海格力电器股份有限公司 | Information pushing method and device |
CN111984901A (en) * | 2020-08-31 | 2020-11-24 | 上海博泰悦臻电子设备制造有限公司 | Message pushing method and related product thereof |
CN114338499A (en) * | 2021-12-29 | 2022-04-12 | 中国电信股份有限公司 | Data transmission method, device thereof and electronic equipment |
CN114338499B (en) * | 2021-12-29 | 2024-05-14 | 中国电信股份有限公司 | Data transmission method, device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN106776401B (en) | 2019-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106776401A (en) | Method for message transmission and device | |
CN102682506B (en) | Intelligent Bluetooth door access control method and device based on symmetric cryptographic technique | |
CN108494725A (en) | A kind of encryption communication method of vehicle-mounted CAN bus message | |
CN105898872A (en) | Uplink transmission method and device | |
CN106160931A (en) | A kind of method and device of information transmission | |
CN107295655A (en) | A kind of transfer resource indicating means, base station, UE and system | |
CN105991709A (en) | Cloud desktop account number management method and apparatus thereof | |
CN106789876A (en) | The authentication method and its device of a kind of cloud terminal server | |
CN107547572A (en) | A kind of CAN communication means based on pseudo random number | |
CN105337837A (en) | Message transmitting method and device | |
CN101964789A (en) | Method and system for safely accessing protected resources | |
CN106817346A (en) | Data transmission method and device and electronic equipment | |
EP3209075B1 (en) | Method, device, and system for data transmission | |
CN106453321A (en) | Authentication server, system and method, and to-be-authenticated terminal | |
CN105809066B (en) | The storage method and terminal of encryption data | |
US11080393B2 (en) | Secure computation system, secure computation apparatus, secure computation method, and secure computation program | |
CN107359989A (en) | Data ciphering method, safety chip and computer-readable recording medium | |
CN107925894A (en) | System and method for channel safety | |
CN105592558A (en) | Data transmission method, terminal and data transmission system | |
CN109246695A (en) | Data transmission method, device and computer readable storage medium | |
CN107483152A (en) | A kind of method for sending, receiving data, device and computer read/write memory medium | |
CN106411477A (en) | Uplink HARQ process maintenance method and device | |
CN103209113A (en) | Method, facility, device and system for transmitting and receiving content information | |
CN108156102A (en) | The blind authentication method and system of frequency selective fading channels based on smoothing technique | |
CN109788017A (en) | Across brand children's wrist-watch information synchronization method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |