CN108270520B - Message transmission method, device, storage medium and computer equipment - Google Patents

Message transmission method, device, storage medium and computer equipment Download PDF

Info

Publication number
CN108270520B
CN108270520B CN201810094657.7A CN201810094657A CN108270520B CN 108270520 B CN108270520 B CN 108270520B CN 201810094657 A CN201810094657 A CN 201810094657A CN 108270520 B CN108270520 B CN 108270520B
Authority
CN
China
Prior art keywords
data
message
transmitted
target
sub
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.)
Active
Application number
CN201810094657.7A
Other languages
Chinese (zh)
Other versions
CN108270520A (en
Inventor
杜民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN MTK ELECTRONICS Co.,Ltd.
Original Assignee
杜民
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杜民 filed Critical 杜民
Priority to CN201810094657.7A priority Critical patent/CN108270520B/en
Publication of CN108270520A publication Critical patent/CN108270520A/en
Priority to PCT/CN2018/109883 priority patent/WO2019148884A1/en
Application granted granted Critical
Publication of CN108270520B publication Critical patent/CN108270520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/28Flow control; Congestion control in relation to timing considerations
    • H04L47/283Flow control; Congestion control in relation to timing considerations in response to processing delays, e.g. caused by jitter or round trip time [RTT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a message transmission method, a message transmission device, a storage medium and computer equipment, wherein a message is received through a first port of first equipment; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment. The embodiment of the invention transmits the message and processes the data at the same time when receiving the message, thereby reducing the time for receiving and transmitting the message, reducing the time delay of message transmission and eliminating the time delay jitter of message transmission.

Description

Message transmission method, device, storage medium and computer equipment
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for transmitting a packet, a storage medium, and a computer device.
Background
At present, the transmission mode of the message is that the whole message is received and put into a receiving buffer area, meanwhile, the message is verified, and when the verification is successful, the data in the receiving buffer area is copied to a sending buffer area and then sent to the target device.
Because the current message transmission mode needs to receive the whole message for subsequent processing, the time required by sending and receiving depends on the length of the message, and when the length of the message is not short, delay jitter can occur; and delay is also generated when data transfer is performed between buffers during message transmission.
Disclosure of Invention
Embodiments of the present invention provide a message transmission method, an apparatus, a storage medium, and a computer device, which can reduce a time delay during message transmission and eliminate time delay jitter of message transmission.
In a first aspect, an embodiment of the present invention provides a packet transmission method, including:
receiving a message through a first port of the first device;
sending the message to a second device through a second port while receiving the message;
checking the message to obtain a checking result;
acquiring corresponding target data according to the message, and storing the target data in a cache region;
and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to target equipment.
In a second aspect, an embodiment of the present invention further provides a packet transmission apparatus, including:
a receiving unit, configured to receive a packet through a first port of the first device;
the sending unit is used for sending the message to the second equipment through the second port while receiving the message;
the verification unit is used for verifying the message to obtain a verification result;
the acquisition unit is used for acquiring corresponding target data according to the message and storing the target data in a cache region;
and the processing unit is used for carrying out corresponding processing on the target data in the cache region according to the verification result and sending the data to be transmitted in the cache region to the target equipment.
In a third aspect, a storage medium is provided in an embodiment of the present invention, where a computer program is stored on the storage medium, and when the computer program runs on a computer, the computer is caused to execute the message transmission method provided in any embodiment of the present invention.
In a fourth aspect, the computer device provided in the embodiments of the present invention includes a processor and a memory, where the memory has a computer program, and the processor is configured to execute the message transmission method provided in any embodiment of the present invention by calling the computer program.
Receiving a message through a first port of the first device; sending the message to a second device through a second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to target equipment. According to the scheme, the message is sent out while the message is received, and data processing is carried out simultaneously, so that the time for receiving and sending the message is reduced, the time delay of message transmission is reduced, and the time delay jitter of message transmission is eliminated.
Drawings
The technical solution and other advantages of the present invention will become apparent from the following detailed description of specific embodiments of the present invention, which is to be read in connection with the accompanying drawings.
Fig. 1 is a schematic view of a scenario of a message transmission method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a message transmission method according to an embodiment of the present invention;
fig. 3 is another schematic flow chart of a message transmission method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an audio data transmission scenario provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention;
fig. 6 is another schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present invention are described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the invention have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, but on the contrary, it is to be understood that various steps and operations described hereinafter may be implemented in hardware.
The term "unit" as used herein may be considered a software object executing on the computing system. The various components, units, engines, and services described herein may be viewed as objects of implementation on the computing system. The apparatus and method described herein may be implemented in software, but may also be implemented in hardware, and are within the scope of the present invention.
The terms "first", "second", and "third", etc. in the present invention are used for distinguishing different objects, not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but rather, some embodiments may include additional steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
An execution main body of the message transmission method may be the message transmission device provided in the embodiment of the present invention, or a computer device integrated with the message transmission device, where the message transmission device may be implemented in a hardware or software manner.
Referring to fig. 1, in an embodiment, the computer device may have an a port and a B port, and both the a port and the B port are bidirectional ports, that is, the computer device can receive data and can send data. When the port A receives a message, the port A is the first port mentioned in the embodiment of the invention, and the port B is the second port mentioned in the embodiment of the invention; when the port B receives a message, the port B is the first port mentioned in the embodiment of the present invention, and the port a is the second port mentioned in the embodiment of the present invention, where sending data from the first port to the second port is data downlink, and sending data from the second port to the first port is data uplink; the computer device itself also has a plurality of data buffers for processing data required by the computer device itself.
Fig. 1 is a schematic view of an application scenario of a message transmission method according to an embodiment of the present invention, taking an example that a message transmission apparatus is integrated in a computer device, the computer device may receive a message through a first port of the computer device; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment.
Referring to fig. 2, fig. 2 is a flowchart illustrating a message transmission method according to an embodiment of the present invention. The specific flow of the message transmission method provided by the embodiment of the invention can be as follows:
s201, receiving a message through a first port of first equipment.
In this embodiment, the first device refers to the computer device itself, that is, the computer device receives the message through the first port. For example, when the computer device is an audio device, it receives voice information transmitted from a microphone or the like.
S202, sending the message to the second device through the second port while receiving the message.
And the computer equipment sends the message to the second equipment through the second port with preset time delay while receiving the message at the first port. Wherein, the preset time delay can be freely set.
S203, the message is verified to obtain a verification result.
Specifically, integrity Check and Cyclic Redundancy Check (CRC) Check are performed on the message to obtain a Check result, where the Check result is that the message is successfully checked or the message is failed to be checked.
It should be noted that, because the computer device in this embodiment does not need to receive the entire message to the receiving buffer through the first port, and then check the message, when the message is successfully checked, the message in the receiving buffer is transferred to the sending buffer, and finally the data is sent out through the second port. The message is received through the first port, and simultaneously, the message is transmitted to the second device through the second port, and the message is checked, so that the message is checked while the message is received, and meanwhile, the message is transmitted while the message is received, although some time delay is generated in the transmission process, the time delay is small and can be freely set, for example, the time delay can be 48ns, so that the message is basically transmitted while the message is received.
It will be appreciated that the message contains a plurality of fields, which may include data fields for storing data content and check fields for storing check information. After the computer device in this embodiment obtains the verification result, the verification information in the message may also be updated according to the verification result. For example, when receiving a message through a first port of a computer device, the computer device sends the message to a second device through a second port of the computer device, and checks the received message to obtain a check result, and then updates a check field in the message according to the check result, that is, the check information in the original message check field is replaced with the check information obtained after the message is checked by the computer device, where the check information may include a message check success or a message check failure, and since the existing device needs to check the message after receiving the message, the message can be sent out only after the check success, and when the check fails, the message is discarded and the check information in the message check field is not updated. Compared with the existing equipment, the computer equipment can send out the message more quickly, and can enable other equipment receiving the message to know the correctness of the message in time, so that the time delay of message transmission is reduced to a certain extent.
And S204, acquiring corresponding target data according to the message, and storing the target data in a cache region.
As shown in fig. 1, a functional node, which may be an AEDP node for acquiring corresponding target data or inserting corresponding target data, may be added using a direct insertion or extraction technique (AEDP).
For example, when the computer device receives a message from the first port, the size of a data block may be preset according to data required by the computer device itself, a window may be established according to the size of the preset data block, the window may be controlled to slide on the message, when the sliding position of the window is a second preset position, the data to be acquired corresponding to the second preset position may be acquired, the target data may be acquired, and the target data may be stored in the cache region. The second preset position may be determined by obtaining data required by the computer device itself, that is, when the device needs what data, the window slides to the corresponding position, and then intercepts the data at the corresponding position, and stores the data in the cache region.
For example, when the computer device receives a message from the second port, step S204 may be to obtain, according to the message, corresponding data to be inserted in the buffer, and specifically may be: establishing a data block according to-be-inserted data to be inserted into the computer equipment, then establishing a window according to the size of the preset data block, controlling the window to slide on the message, inserting the corresponding to-be-inserted data when the sliding position of the window is a first preset position to obtain target data, and sending all to-be-transmitted data including the target data in a cache region to the target equipment, wherein the first preset position can be the tail part of the message.
S205, correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target device.
And when the message is successfully verified, sending the data to be transmitted in the cache region to target equipment, wherein the data to be transmitted in the cache region comprises the target data. And when the message check fails, clearing the target data in the cache region.
Particularly, when the message is successfully verified, the first port is arranged to receive a correct mark; when the message check fails, the first port is set to receive the error mark.
As can be seen from the above, in this embodiment, a message is received through the first port of the first device; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment. Compared with the prior method for transmitting the message by the Ethernet technology, the embodiment of the invention can reduce the time delay of message transmission and eliminate the time delay jitter of message transmission, and realizes the transmission of the message with low time delay and no time delay jitter.
The message transmission method of the present invention will be further described below on the basis of the method described in the above embodiment. Referring to fig. 3, the message transmission method may include:
s301, receiving the message through the first port of the first device.
In the embodiment of the present invention, the first device refers to the computer device itself, that is, the computer device receives the packet through the first port. For example, when the computer device is an audio device, it receives voice information transmitted from a microphone or the like.
S302, when receiving the message, sending the message to the second device through the second port.
And the computer equipment sends the message to the second equipment through the second port with preset time delay while receiving the message at the first port. Wherein, the preset time delay can be freely set.
S303, verifying the message to obtain a verification result.
Specifically, integrity Check and Cyclic Redundancy Check (CRC) Check are performed on the message to obtain a Check result, where the Check result is that the message is successfully checked or the message is failed to be checked.
Different from the traditional message transmission of checking before sending, the embodiment can simultaneously send out the message with the preset time delay when receiving the message and check the message, so that the corresponding message is also checked when the message is received; because the preset time delay is small and can be freely set according to requirements, when the message is received, the message is correspondingly sent out.
And S304, updating the verification information in the message according to the verification result.
Wherein, the message includes: the verification information, after obtaining the verification result, may further include: and updating the verification information in the message according to the verification result.
It will be appreciated that the message contains a plurality of fields, which may include data fields for storing data content and check fields for storing check information. After the computer device in this embodiment obtains the verification result, the verification information in the message may also be updated according to the verification result. For example, when receiving a message through a first port of a computer device, the computer device sends the message to a second device through a second port of the computer device, and checks the received message to obtain a check result, and then updates a check field in the message according to the check result, that is, the check information in the original message check field is replaced with the check information obtained after the message is checked by the computer device, where the check information may include a message check success or a message check failure, and since the existing device needs to check the message after receiving the message, the message can be sent out only after the check success, and when the check fails, the message is discarded and the check information in the message check field is not updated. Compared with the existing equipment, the computer equipment can send out the message more quickly, and can enable other equipment receiving the message to know the correctness of the message in time, so that the time delay of message transmission is reduced to a certain extent.
S305, establishing a window according to the size of the preset data block, and controlling the window to slide on the message.
As shown in fig. 1, a functional node, which may be an AEDP node for acquiring corresponding target data or inserting corresponding target data, may be added using a direct insertion or extraction technique (AEDP).
The size of the preset data block can be determined according to the data required by the computer device, so that when the computer device receives the message, a window can be established according to the size of the preset data block, and the window is controlled to slide on the message, so as to obtain the data required by the computer device.
S306, when the current sliding position of the window is a second preset position, acquiring data to be acquired corresponding to the second preset position to obtain target data, and storing the target data in a cache region.
When the data is downlink, when the current sliding position of the window is a second preset position, acquiring data to be acquired corresponding to the second preset position, acquiring target data, and storing the target data in the cache region, wherein the second preset position can be any position of the message data part and can be determined by the amount of data required by the computer device.
When the data is uplink, step S306 may be: and when the current sliding position of the window is a first preset position, inserting data to be inserted, which needs to be inserted, into the computer equipment to obtain target data, wherein the first preset position can be the tail of the message.
S307, when the message check fails, target data in the cache region is cleared, and the data to be transmitted in the cache region is divided into a plurality of pieces of sub data to be transmitted.
S308, when the message is successfully verified, dividing the data to be transmitted (including the target data) in the buffer into a plurality of pieces of sub data to be transmitted.
Step S307 and step S308 may specifically be: when the message check fails, a receiving port is set to receive an error mark, target data stored in a cache region is cleared, and data to be transmitted in the cache region is divided into a plurality of pieces of sub data to be transmitted for transmission. When the message is successfully verified, the receiving port is set to receive the correct mark, the data to be transmitted (including the target data) in the cache region is divided into a plurality of sub data to be transmitted, and the data to be transmitted is transmitted after the successful reception is confirmed every time one data is transmitted, so that the accuracy is improved.
It can be understood that the data to be transmitted originally exists in the cache region, and therefore, whether the target data is stored in the cache region as the data to be transmitted or not, the data to be transmitted originally exists in the cache region needs to be sent to the target device.
S309, sequencing the data to be transmitted of the multiple sub-channels to form a transmission sequence.
In this step, the data to be transmitted is sorted according to the position of each sub data to be transmitted in the data to be transmitted, so that the data sequence in each sub data to be transmitted is the same as the data sequence in the data to be transmitted.
S310, setting the data to be transmitted of the first sub-sequence in the transmission sequence as the data to be transmitted of the current sub-sequence.
S311, sending the current sub data to be transmitted to the target equipment through a plurality of first channels.
And each sub-channel to be transmitted transmits the data once through each first channel.
In this step, the number of the first channels is 8, for example, so that each sub-data to be transmitted is transmitted once through each first channel in turn, for a total of 8 times. And after each sub-to-be-transmitted data is sent (8 times of sending through 8 channels in total), and the target equipment confirms that the sub-to-be-transmitted data is successfully verified, sending the next sub-to-be-transmitted data.
And S312, receiving response information returned by the target equipment.
The response information is generated after the target device receives the current sub-to-be-transmitted data and verifies the current sub-to-be-transmitted data, when any current sub-to-be-transmitted data is verified successfully, the response information is returned successfully, and when all the current sub-to-be-transmitted data are verified successfully, the response information is returned failed. And for the data to be transmitted of the current sub, checking one data to be transmitted of each received data, when the data to be transmitted of one current sub is successfully checked, displaying that the carried information of the data to be transmitted of the current sub is complete and correct, directly judging that the data to be transmitted of the current sub is successfully checked, stopping checking, automatically ignoring the data to be transmitted of the current sub received through other channels, and returning successful response information. And when the data to be transmitted of the sub-channels received through the 8 channels are verified to be failed, judging that the transmission is wrong, and returning failure response information.
And S313, deleting the sub-to-be-transmitted data set as the current sub-to-be-transmitted data from the transmission sequence when the successful response information is received.
And S314, judging whether the transmission sequence has data to be transmitted or not after deletion.
And S315, if the data to be transmitted does not exist, the data to be transmitted is judged to be transmitted completely.
If so, step S310 is performed.
And S316, confirming at least one currently available second channel when the failure response information is received.
In this case, there is a possibility that the current first channel is not clear or there is interference, and therefore the second channel needs to be changed for transmission. The number of the second channels may be one or more.
S317, closing the current multiple first channels, setting the multiple second channels as the first channels, and after the setting is finished, executing the step of sending the current sub-to-be-transmitted data to the target device through the multiple first channels.
As can be seen from the above, in this embodiment, a message is received through the first port of the first device; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment. Compared with the prior method for transmitting the message by the Ethernet technology, the embodiment of the invention can reduce the time delay of message transmission and eliminate the time delay jitter of message transmission, and realizes the transmission of the message with low time delay and no time delay jitter.
Furthermore, in this embodiment, the computer device divides the data to be transmitted in the buffer into multiple pieces of sub-data to be transmitted; sequencing a plurality of pieces of data to be transmitted to form a transmission sequence; sequentially sending each sub data to be transmitted to target equipment through a plurality of first channels according to a transmission sequence, wherein each sub data to be transmitted is sent once through each first channel; therefore, the transmission of the data to be transmitted in the buffer area is completed, and each sub-data to be transmitted is sent for multiple times through a plurality of different first channels, so that the accuracy of data transmission is greatly improved, the stability of transmission delay is ensured, and rapid transmission jitter is avoided under the condition of poor network.
In an embodiment, a message transmission method is further provided, and the method may be applied to various scenarios, please refer to fig. 4, taking the case that the method is applied to an audio data transmission scenario as an example, where the computer device b may be one or more, may exist in a separate form, or may be integrated in a device such as a sound device, and the present embodiment takes the case that the computer device b exists in a separate form as an example.
In the audio data transmission scenario, the computer device b may receive a message through the first port, where the message may be received by the computer device b from another device through the first port, for example, receiving voice information sent by a microphone; then, the computer device b sends the message to a second device through a second port while receiving the message, wherein the second device can be a sound c or other relay devices; meanwhile, the message is checked to obtain a check result; then establishing a window according to the requirement of the computer equipment b or the size of a preset data block, sliding in the message received by the first port, and after sliding to a set position, extracting target data required by the computer equipment b and storing the target data in a cache region of the computer equipment b; and then waiting for the end of message reception, completing message verification while completing message reception, and when the message verification is successful, setting a first port to receive a correct mark, moving the data to be transmitted in the buffer area of the computer equipment b into a receiving queue buffer area, and transmitting the data through a set interface, wherein the data to be transmitted in the buffer area of the computer equipment b can be transmitted to the sound c by the computer equipment b, and can also be transmitted to other equipment. When the message check fails, the first port is set to receive the error mark, the target data in the cache region of the computer device b is cleared, the data to be transmitted in the cache region of the computer device b is moved to the receiving queue buffer region, and the data is sent out through the set interface. It can be understood that, no matter whether the received message verification result is successful or failed, the data to be transmitted may exist in the receive queue buffer, and therefore, no matter whether the received message verification result is successful or failed, the data to be transmitted in the receive queue buffer needs to be sent out, and only when the message reception is successful, the target data acquired by the computer device b needs to be sent out together.
In the audio data transmission scenario, the computer device b may also receive a message through the first port, where the message may be received by the computer device b from another device through the first port, for example, receiving voice information sent by a microphone; then, the computer device b sends the message to a second device through a second port while receiving the message, wherein the second device can be a sound device or other relay devices; meanwhile, the message is checked to obtain a check result; then, according to the requirement of the computer device b or the size of a preset data block, establishing a window, sliding in the message received by the first port, and after sliding to a set position, inserting the data to be inserted into the computer device b, which can be generally inserted into the tail of the message; then waiting for the end of message receiving, completing message verification while completing message receiving, setting a first port to receive a correct mark when message verification is successful, and setting a first port to receive an error mark when message verification is failed; the data to be transmitted, including the inserted data, and the corresponding data check value may then be sent to stereo c or other devices.
As can be seen from the above, the embodiment receives the message through the first port of the computer device; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment. The embodiment of the invention transmits the message and processes the data at the same time when receiving the message, thereby saving the processing time, simultaneously ensuring that the time for transmitting and receiving the message does not depend on the message length, and realizing the low-delay and non-delay jitter transmission of the message.
In an embodiment, a message transmission apparatus is also provided. Referring to fig. 5, fig. 5 is a schematic structural diagram of a message transmission apparatus according to an embodiment of the present invention. The message transmission apparatus is applied to a computer device, and includes a receiving unit 401, a sending unit 402, a checking unit 403, an obtaining unit 404, and a processing unit 405, as follows:
a receiving unit 401, configured to receive a message through a first port of a first device;
a sending unit 402, configured to send a message to a second device through a second port while receiving the message;
a checking unit 403, configured to check the packet to obtain a checking result;
an obtaining unit 404, configured to obtain corresponding target data according to the packet, and store the target data in a cache region;
and the processing unit 405 is configured to perform corresponding processing on the target data in the buffer according to the check result, and send the data to be transmitted in the buffer to the target device.
In an embodiment, referring to fig. 6, the apparatus may further include:
and the updating unit 406 is configured to update the verification information in the message according to the verification result.
It will be appreciated that the message contains a plurality of fields, which may include data fields for storing data content and check fields for storing check information. After the computer device in this embodiment obtains the verification result, the verification information in the message may also be updated according to the verification result. For example, when receiving a message through a first port of a computer device, the computer device sends the message to a second device through a second port of the computer device, and checks the received message to obtain a check result, and then updates a check field in the message according to the check result, that is, the check information in the original message check field is replaced with the check information obtained after the message is checked by the computer device, where the check information may include a message check success or a message check failure, and since the existing device needs to check the message after receiving the message, the message can be sent out only after the check success, and when the check fails, the message is discarded and the check information in the message check field is not updated. Compared with the existing equipment, the computer equipment can send out the message more quickly, and can enable other equipment receiving the message to know the correctness of the message in time, so that the time delay of message transmission is reduced to a certain extent.
In an embodiment, referring to fig. 6, the obtaining unit 404 may include:
the sliding subunit 4041 is configured to establish a window according to the size of the preset data block, and control the window to slide on the message;
and a data processing subunit 4042, configured to perform data processing on the packet based on the sliding position of the window, so as to obtain target data.
In an embodiment, the data processing subunit 4042 may specifically be configured to: when the current sliding position of the window is a first preset position, inserting data to be inserted into the window at the first preset position to obtain target data; or when the current sliding position of the window is a second preset position, acquiring data to be acquired corresponding to the second preset position to obtain target data.
In an embodiment, referring to fig. 6, the processing unit 405 may include:
the clearing subunit 4051 is configured to clear the target data in the buffer area when the message check fails.
A dividing subunit 4052, configured to divide the data to be transmitted into multiple pieces of data to be transmitted;
a sorting subunit 4053, configured to sort the multiple pieces of data to be transmitted to form a transmission sequence;
the sending subunit 4054 is configured to send each sub-data to be transmitted to the target device sequentially through the multiple first channels according to the transmission sequence.
In an embodiment, the sending sub-unit 4054 may specifically be configured to:
setting the data to be transmitted of the first current ordered sub in the transmission sequence as the data to be transmitted of the current sub;
sending current sub data to be transmitted to target equipment through a plurality of first channels, wherein each sub data to be transmitted is sent once through each first channel;
receiving response information returned by the target equipment, wherein the response information is generated after the target equipment receives the current sub data to be transmitted and verifies the current sub data to be transmitted, when the verification of any current sub data to be transmitted is successful, successful response information is returned, and when the verification of any current sub data to be transmitted is failed, failed response information is returned;
when the successful response information is received, deleting the sub to-be-transmitted data which is set as the current sub to-be-transmitted data from the transmission sequence, and setting the currently-sequenced first sub to-be-transmitted data in the transmission sequence as the current sub to-be-transmitted data after deletion;
confirming a plurality of currently available second channels when the failure response information is received;
closing the current plurality of first channels and setting the plurality of second channels as the first channels, and after the setting is completed, triggering the sending subunit 4054 to send the current sub-to-be-transmitted data to the target device through the plurality of first channels.
The steps executed by each unit in the message transmission apparatus may refer to the method steps described in the above method embodiments. The message transmission device may be integrated in a computer device.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing embodiments, which are not described herein again.
As can be seen from the above, in this embodiment, the receiving unit 401 may receive the message through the first port of the first device; the sending unit 402 sends the message to the second device through the second port while receiving the message; the message is verified by the verification unit 403 to obtain a verification result; the obtaining unit 404 obtains corresponding target data according to the message, and stores the target data in a cache region; the processing unit 405 performs corresponding processing on the target data in the cache region according to the check result, and sends the data to be transmitted in the cache region to the target device. Compared with the prior method for transmitting the message by the Ethernet technology, the embodiment of the invention can reduce the time delay of message transmission and eliminate the time delay jitter of message transmission, and realizes the transmission of the message with low time delay and no time delay jitter.
The embodiment of the invention also provides computer equipment. Referring to fig. 7, the computer device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 500 is a control center of the computer device 500, connects various parts of the entire computer device using various interfaces and lines, performs various functions of the computer device 500 by running or loading a computer program stored in the memory 502, and calls data stored in the memory 502, and processes the data, thereby monitoring the computer device 500 as a whole.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by operating the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
In the embodiment of the present invention, the processor 501 in the computer device 500 loads instructions corresponding to one or more processes of the computer program into the memory 502, and the processor 501 runs the computer program stored in the memory 502, so as to implement various functions, as follows:
receiving a message through a first port of first equipment;
sending the message to the second equipment through the second port while receiving the message;
checking the message to obtain a checking result;
acquiring corresponding target data according to the message, and storing the target data in a cache region;
and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment.
In some embodiments, when obtaining the corresponding target data according to the packet, the processor 501 may specifically perform the following steps:
establishing a window according to the size of a preset data block, and controlling the window to slide on a message;
and carrying out data processing on the message based on the sliding position of the window to obtain target data.
In some embodiments, when performing data processing on the packet based on the sliding position of the window to obtain the target data, the processor 501 may specifically perform the following steps:
when the current sliding position of the window is a first preset position, inserting data to be inserted into the window at the first preset position to obtain target data; or
And when the current sliding position of the window is a second preset position, acquiring data to be acquired corresponding to the second preset position to obtain target data.
In some embodiments, when performing corresponding processing on the target data in the cache region according to the check result, the processor 501 may specifically perform the following steps:
and when the message check fails, clearing the target data in the cache region.
In some embodiments, after obtaining the verification result, the processor 501 may further specifically perform the following steps:
and updating the verification information in the message according to the verification result.
In some embodiments, when sending data to be transmitted in the buffer to the target device, the processor 501 may further specifically perform the following steps:
dividing data to be transmitted in a cache region into a plurality of pieces of data to be transmitted;
sequencing a plurality of pieces of data to be transmitted to form a transmission sequence;
and sequentially sending each sub-data to be transmitted to the target equipment through a plurality of first channels according to the transmission sequence.
In some embodiments, when sequentially sending each sub-data to be transmitted to the target device through a plurality of first channels according to the transmission sequence, the processor 501 may further specifically perform the following steps:
setting the data to be transmitted of the first current ordered sub in the transmission sequence as the data to be transmitted of the current sub;
sending current sub data to be transmitted to target equipment through a plurality of first channels, wherein each sub data to be transmitted is sent once through each first channel;
receiving response information returned by the target equipment, wherein the response information is generated after the target equipment receives the current sub data to be transmitted and verifies the current sub data to be transmitted, when the verification of any current sub data to be transmitted is successful, successful response information is returned, and when the verification of any current sub data to be transmitted is failed, failed response information is returned;
when the successful response information is received, deleting the sub to-be-transmitted data set as the current sub to-be-transmitted data from the transmission sequence, and executing the step of setting the first sequenced sub to-be-transmitted data in the transmission sequence as the current sub to-be-transmitted data after deletion;
confirming a plurality of currently available second channels when the failure response information is received;
and closing the current plurality of first channels and setting the plurality of second channels as the first channels, and executing the step of sending the current sub-to-be-transmitted data to the target equipment through the plurality of first channels after the setting is finished.
As can be seen from the above, the computer device of this embodiment receives the message through the first port of the computer device; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment. Compared with the existing method for transmitting the message by the Ethernet technology, the method can reduce the time delay of message transmission, eliminate the time delay jitter of message transmission and realize the low-time delay and no-time delay jitter transmission of the message.
An embodiment of the present invention further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer is caused to execute the message transmission method in any one of the above embodiments, for example: receiving a message through a first port of first equipment; sending the message to the second equipment through the second port while receiving the message; checking the message to obtain a checking result; acquiring corresponding target data according to the message, and storing the target data in a cache region; and correspondingly processing the target data in the cache region according to the verification result, and sending the data to be transmitted in the cache region to the target equipment.
In the embodiment of the present invention, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the message transmission method according to the embodiment of the present invention, it can be understood by a person skilled in the art that all or part of the process of implementing the message transmission method according to the embodiment of the present invention can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory of a computer device, and executed by at least one processor in the computer device, and during the execution process, the process of implementing the embodiment of the message transmission method can be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
For the message transmission device according to the embodiment of the present invention, each functional module may be integrated in one processing chip, or each module may exist alone physically, or two or more modules are integrated in one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description is provided for a message transmission method, apparatus, storage medium and computer device according to the embodiments of the present invention, and a specific example is applied in this document to explain the principle and implementation manner of the present invention, and the description of the above embodiment is only used to help understanding the method and core idea of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (6)

1. A message transmission method is suitable for a first device, and is characterized by comprising the following steps:
receiving a message through a first port of the first device;
sending the message to a second device through a second port while receiving the message;
when a message is received, verifying the message to obtain a verification result;
updating the verification information in the message according to the verification result;
establishing a window according to the size of a preset data block, and controlling the window to slide on the message;
performing data processing on the message based on the sliding position of the window to obtain target data, and storing the target data in a cache region, wherein the target data is data required by the first device;
performing corresponding processing on the target data in the cache region according to the check result, and sending the data to be transmitted in the cache region to the target device, including: when the message check fails, target data in a cache region is cleared, and data to be transmitted in the cache region is divided into a plurality of pieces of sub data to be transmitted; sequencing the data to be transmitted of the multiple molecules to form a transmission sequence; sequentially sending each sub data to be transmitted to target equipment through a plurality of first channels according to the transmission sequence, wherein the data to be transmitted does not include the target data, and when the message verification is successful, dividing the data to be transmitted in the cache region into a plurality of sub data to be transmitted; sequencing the data to be transmitted of the multiple molecules to form a transmission sequence; and sequentially sending each sub-data to be transmitted to target equipment through a plurality of first channels according to the transmission sequence, wherein the data to be transmitted comprises the target data.
2. The message transmission method according to claim 1, wherein performing data processing on the message based on the sliding position of the window to obtain target data comprises:
when the current sliding position of the window is a first preset position, inserting data to be inserted into the window at the first preset position to obtain target data; or
And when the current sliding position of the window is a second preset position, acquiring data to be acquired corresponding to the second preset position to obtain target data.
3. The message transmission method according to claim 1, wherein sequentially sending each sub-data to be transmitted to the target device through a plurality of first channels according to the transmission sequence comprises:
setting the data to be transmitted of the first current ordered sub in the transmission sequence as the data to be transmitted of the current sub;
sending current sub data to be transmitted to target equipment through a plurality of first channels, wherein each sub data to be transmitted is sent once through each first channel;
receiving response information returned by the target equipment, wherein the response information is generated after the target equipment receives the current sub data to be transmitted and verifies the current sub data to be transmitted, when the verification of any current sub data to be transmitted is successful, successful response information is returned, and when the verification of any current sub data to be transmitted is failed, failed response information is returned;
when the successful response information is received, deleting the sub to-be-transmitted data set as the current sub to-be-transmitted data from the transmission sequence, and executing the step of setting the first sequenced sub to-be-transmitted data in the transmission sequence as the current sub to-be-transmitted data after deletion;
confirming a plurality of currently available second channels when the failure response information is received;
and closing the current plurality of first channels, setting the plurality of second channels as the first channels, and executing the step of sending the current sub-to-be-transmitted data to the target equipment through the plurality of first channels after the setting is finished.
4. A message transmission apparatus, adapted to a first device, comprising:
a receiving unit, configured to receive a packet through a first port of the first device;
the sending unit is used for sending the message to the second equipment through the second port while receiving the message;
the verification unit is used for verifying the message while receiving the message to obtain a verification result;
the updating unit is used for updating the verification information in the message according to the verification result;
the acquisition unit is used for establishing a window according to the size of a preset data block and controlling the window to slide on the message; performing data processing on the message based on the sliding position of the window to obtain target data, and storing the target data in a cache region, wherein the target data is data required by the first device;
the processing unit is used for carrying out corresponding processing on the target data in the cache region according to the verification result and sending the data to be transmitted in the cache region to target equipment;
the processing unit is specifically configured to: when the message check fails, target data in a cache region is cleared, and data to be transmitted in the cache region is divided into a plurality of pieces of sub data to be transmitted; sequencing the data to be transmitted of the multiple molecules to form a transmission sequence; sequentially sending each sub data to be transmitted to target equipment through a plurality of first channels according to the transmission sequence, wherein the data to be transmitted does not include the target data, and when the message verification is successful, dividing the data to be transmitted in the cache region into a plurality of sub data to be transmitted; sequencing the data to be transmitted of the multiple molecules to form a transmission sequence; and sequentially sending each sub-data to be transmitted to target equipment through a plurality of first channels according to the transmission sequence, wherein the data to be transmitted comprises the target data.
5. A storage medium having stored thereon a computer program, characterized in that, when the computer program runs on a computer, it causes the computer to execute the message transmission method according to any one of claims 1 to 3.
6. A computer device comprising a processor and a memory, said memory having a computer program, wherein said processor is adapted to perform the message transmission method of any of claims 1 to 3 by invoking said computer program.
CN201810094657.7A 2018-01-31 2018-01-31 Message transmission method, device, storage medium and computer equipment Active CN108270520B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810094657.7A CN108270520B (en) 2018-01-31 2018-01-31 Message transmission method, device, storage medium and computer equipment
PCT/CN2018/109883 WO2019148884A1 (en) 2018-01-31 2018-10-11 Packet transmission method, storage medium, and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810094657.7A CN108270520B (en) 2018-01-31 2018-01-31 Message transmission method, device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN108270520A CN108270520A (en) 2018-07-10
CN108270520B true CN108270520B (en) 2020-08-28

Family

ID=62777203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810094657.7A Active CN108270520B (en) 2018-01-31 2018-01-31 Message transmission method, device, storage medium and computer equipment

Country Status (2)

Country Link
CN (1) CN108270520B (en)
WO (1) WO2019148884A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108270520B (en) * 2018-01-31 2020-08-28 杜民 Message transmission method, device, storage medium and computer equipment
CN109714145B (en) * 2018-12-29 2021-09-21 杭州迪普科技股份有限公司 Method and device for aligning multi-channel data
CN112436972B (en) * 2019-08-26 2022-08-05 丰鸟航空科技有限公司 Data processing method, device, network equipment and computer readable storage medium
CN111586154B (en) * 2020-04-30 2022-08-05 北京百度网讯科技有限公司 Data storage method, device, equipment and storage medium based on transmission channel
CN112511536B (en) * 2020-11-27 2022-10-21 北京经纬恒润科技股份有限公司 Communication method and communication system
CN114268412B (en) * 2021-11-18 2023-10-13 岚图汽车科技有限公司 Vehicle communication method, device, storage medium and equipment
CN114157401B (en) * 2021-12-03 2024-01-23 中国人民解放军国防科技大学 Retransmission buffer device supporting long and short message formats
CN115834259B (en) * 2023-02-21 2023-04-18 广东广宇科技发展有限公司 Safe data transmission method for high-risk communication line

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101471756B (en) * 2007-12-27 2011-05-25 上海无线通信研究中心 Centralization type scheduling HARQ method for multi-hop relay downward system
CN101465813B (en) * 2009-01-08 2011-09-07 杭州华三通信技术有限公司 Method for switching main and standby links, ring shaped networking and switching equipment
US8363550B1 (en) * 2010-06-15 2013-01-29 Google Inc. Adaptive data unit transmission and acknowledgment
CN102752198B (en) * 2012-06-21 2014-10-29 北京星网锐捷网络技术有限公司 Multi-core message forwarding method, multi-core processor and network equipment
CN103501353B (en) * 2013-10-23 2017-12-12 北京经纬恒润科技有限公司 A kind of data relay transmission method, apparatus and system
US9083677B1 (en) * 2013-12-19 2015-07-14 Fortinet, Inc. Human user verification of high-risk network access
CN106302364B (en) * 2015-06-11 2020-03-24 阿里巴巴集团控股有限公司 Agent method, auxiliary agent method and equipment
CN107104782B (en) * 2017-04-15 2021-01-26 深圳市民泰科电子有限公司 Data transmission method and device
CN108270520B (en) * 2018-01-31 2020-08-28 杜民 Message transmission method, device, storage medium and computer equipment

Also Published As

Publication number Publication date
WO2019148884A1 (en) 2019-08-08
CN108270520A (en) 2018-07-10

Similar Documents

Publication Publication Date Title
CN108270520B (en) Message transmission method, device, storage medium and computer equipment
CN107104782B (en) Data transmission method and device
US8352231B2 (en) System for performing a co-simulation and/or emulation of hardware and software
US20230118176A1 (en) Data transmission method and apparatus, computer-readable storage medium, electronic device, and computer program product
CN111930676A (en) Method, device, system and storage medium for communication among multiple processors
CN114710224A (en) Frame synchronization method and device, computer readable medium and electronic device
CN106126080A (en) Voice management method and device
CN108052407A (en) A kind of application crash means of defence, device, equipment and storage medium
CN110310139A (en) Data put-on method and data launch engine
US20220124435A1 (en) Earphone upgrade method, earphone assembly, upgrade device and non-transitory computer readable storage medium
CN110597706A (en) Method and device for testing application program interface data abnormity
CN106302437A (en) Method of speech processing and device
CN111026532B (en) Message queue management method for voice data
CN105471998A (en) Method and device for synchronizing application data in multiple terminals
CN109800202B (en) PCIE (peripheral component interface express) -based data transmission system, method and device
CN110134419A (en) A kind of method for upgrading system, device, equipment and the storage medium of two-sided cabinet
CN111857546A (en) Method, network adapter and computer program product for processing data
CN110896391B (en) Message processing method and device
CN110445578B (en) SPI data transmission method and device
CN108243323B (en) Software upgrading method and device
CN107071548B (en) Video processing method and system
CN116886463B (en) Cascade communication method, device, equipment and medium
US7428242B2 (en) Action list for a split media access and control layer communications system
CN115296956B (en) Kernel tunnel forwarding method and device, electronic equipment and storage medium
US20220360651A1 (en) Method and system for sequencing user data packets

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210104

Address after: 518026 room 504-b, building 3 (Shenzhen Guodian building), Yinxing Zhijie, No. 1301-76, sightseeing Road, Xinlan community, Guanlan street, Longhua District, Shenzhen City, Guangdong Province

Patentee after: SHENZHEN MTK ELECTRONICS Co.,Ltd.

Address before: 518026 24C Haiying building, CaiTian Road, Futian District, Shenzhen City, Guangdong Province

Patentee before: Du Min