WO2017107083A1 - Data sending method and receiving method, apparatus and system - Google Patents

Data sending method and receiving method, apparatus and system Download PDF

Info

Publication number
WO2017107083A1
WO2017107083A1 PCT/CN2015/098372 CN2015098372W WO2017107083A1 WO 2017107083 A1 WO2017107083 A1 WO 2017107083A1 CN 2015098372 W CN2015098372 W CN 2015098372W WO 2017107083 A1 WO2017107083 A1 WO 2017107083A1
Authority
WO
WIPO (PCT)
Prior art keywords
label
data
data packet
service data
receiving end
Prior art date
Application number
PCT/CN2015/098372
Other languages
French (fr)
Chinese (zh)
Inventor
张鲲鹏
张金锁
姚传群
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 PCT/CN2015/098372 priority Critical patent/WO2017107083A1/en
Publication of WO2017107083A1 publication Critical patent/WO2017107083A1/en

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

Definitions

  • the present invention relates to the field of network technologies, and in particular, to a data sending method, a receiving method, an apparatus, and a system.
  • the sending end often sends service data to the receiving end, and the receiving end caches the service data in the buffer area, and then reads the service data from the buffer area, thereby processing the service data. If the service data sent by the sender exceeds the processing capability of the receiver, the buffer will overflow. The receiver will discard the service data and the service data transmission fails.
  • the transmitting end may send a status acquisition instruction to the receiving end to request the current state of the receiving end before receiving the service data, and the receiving end receives the status obtaining instruction and determines that the current processing service can be processed.
  • the receiving end receives the status obtaining instruction and determines that the current processing service can be processed.
  • the sender receives the Ready status response, it calculates the service data sent and received in a unit time, obtains the traffic rate at this time, and determines the traffic rate. If the preset traffic limit is exceeded, if the traffic rate does not exceed the preset traffic limit, the service data is sent to the receiver to implement flow control and backpressure.
  • the Ready status response can only indicate that the receiving end can process the service data when receiving the status acquisition instruction, and It is not possible for the receiving end to process the service data when it receives the service data of the sending end. If the receiving end can not process the service data when receiving the service data of the sending end, the service data will still be discarded, causing the service data transmission to fail. .
  • the present invention provides a data transmitting method, a receiving method, an apparatus, and a system.
  • the technical solution is as follows:
  • a data sending method comprising:
  • the sender obtains a label from the label resource pool, where the label resource pool has a label representation
  • the sender currently has the right to send service data to the receiving end;
  • the sending end generates a first data packet according to the to-be-sent service data of the sending end;
  • the sending end sends the first data packet to the receiving end.
  • the first data packet includes the acquired label and the service data.
  • the sending end obtains a label from the label resource pool, including:
  • the sending end determines that at least one label exists in the label resource pool, obtaining a label from the label resource pool.
  • the sending end before the sending end generates the first data packet according to the to-be-sent service data of the sending end, the method also includes:
  • the generating, by the service data processing capability of the receiving end, the label resource pool includes:
  • the transmitting end calculates a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes one data packet;
  • the sending end acquires a service data processing capability of the receiving end, where the service data processing capability is used to indicate a maximum number of data packets processed by the receiving end in a unit time;
  • the sending end uses the product of the service data processing capability and the total processing time of the one data packet as the total processing capability value of the receiving end;
  • the method further includes:
  • the obtained tag is deleted from the tag resource pool.
  • the method further includes:
  • the second data packet sent by the receiving end where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate a processing result of the service data by the receiving end;
  • the sending end generates, according to the acquired label and the to-be-sent service data of the terminal, the first After the packet, it also includes:
  • the sending end stores the detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
  • the sending end establishes a correspondence between the label and the detailed information
  • the method further includes:
  • the sending end acquires a memory address corresponding to the label according to the corresponding relationship
  • the sending end recovers the memory space indicated by the memory address according to the memory address.
  • the method further includes:
  • the sending end When the sending end performs obtaining a label from the label resource pool, the sending end starts timing;
  • the sending end regenerates the label, and regenerates according to the regenerated label and the service data. Transmitting, by the first data packet, the regenerated first data packet to the receiving end.
  • the method further includes:
  • the status of the receiving end is determined to be not in place
  • the state of the receiving end is determined to be in place.
  • the method further includes:
  • the service data is suspended until the label is obtained from the label resource pool, and then the first number is generated according to the obtained label and the service data. According to the packet, the first data packet is sent to the receiving end.
  • the method further includes:
  • the label is not recovered to the label resource pool, querying the detailed information corresponding to the label according to the correspondence, determining a memory address in the detailed information, and recovering the memory according to the memory address The memory space indicated by the address.
  • the method is applied to a transmitting end in a distributed system, where the distributed system includes a receiving end and at least A sender.
  • a data receiving method comprising:
  • the receiving end receives the first data packet sent by the sending end, and the first data packet is generated by the sending end by acquiring a label from the label resource pool, and is generated according to the to-be-sent service data, where the label resource pool has a label indicating the sending
  • the terminal currently has the right to send service data to the receiving end;
  • the receiving end processes the service data based on the current service data processing capability.
  • the method further includes:
  • the receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where The indication data is used to indicate a processing result of the service data by the receiving end.
  • the method is applied to a receiving end in a distributed system, where the distributed system includes a receiving end and at least one The sender.
  • a data transmitting apparatus comprising:
  • a label obtaining module configured to obtain a label from a label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send service data to the receiving end;
  • a data packet generating module configured to generate a first data packet according to the to-be-sent service data of the sending end
  • a sending module configured to send, to the receiving end, the first data packet generated by the data packet generating module.
  • the first data packet The acquired tag and the business data are included.
  • the label obtaining module is further configured to: if it is determined that at least one label exists in the label resource pool, Get a label in the label resource pool.
  • the device further includes:
  • the label resource pool generating module is configured to generate the label resource pool according to the service data processing capability of the receiving end.
  • the label resource pool generating module is further configured to perform transmission according to the sending end and the receiving end a delay time, and a time when the receiving end processes a data packet, calculating a total processing time of the one data packet; acquiring a service data processing capability of the receiving end, where the service data processing capability is used to indicate that the receiving end is The maximum number of data packets processed per unit time; the product of the service data processing capability and the total processing time of the one data packet is used as the total processing capability value of the receiving end; and generated according to the total processing capability value
  • the label resource pool, the label number of the label resource pool is equal to the total processing capability value.
  • the device further includes:
  • a deleting module configured to delete the label acquired by the label obtaining module from the label resource pool.
  • the device further includes:
  • a receiving module configured to receive a second data packet sent by the receiving end, where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate Decoding the processing result of the service data by the receiving end;
  • a label recycling module configured to collect the label in the second data packet received by the receiving module into the label resource pool.
  • the device further includes:
  • a storage module configured to store detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
  • Establishing a relationship module configured to establish a correspondence between the label and the detailed information
  • a memory address obtaining module configured to acquire a memory address corresponding to the label according to the correspondence established by the establishing relationship module
  • the memory space recovery module is configured to recover the memory space indicated by the memory address according to the memory address obtained by the memory address acquisition module.
  • the device further includes:
  • a timing module configured to start timing when the label obtaining module acquires a label from the label resource pool
  • a label generating module configured to regenerate the label if the timing of the timing module reaches a preset duration and the label acquired by the label obtaining module is not recycled to the label resource pool;
  • the data packet generating module is further configured to regenerate the first data packet according to the label and the service data regenerated by the label generation module;
  • the sending module is further configured to send, to the receiving end, a first data packet that is regenerated by the data packet generating module.
  • a data receiving apparatus where the data receiving apparatus is applied to a receiving end, and the apparatus includes:
  • a receiving module configured to receive a first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label resource pool has a label representation
  • the sending end currently has the right to send service data to the receiving end;
  • the processing module is configured to process the service data in the first data packet received by the receiving module based on the current service data processing capability.
  • the device further includes:
  • a sending module configured to send a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet,
  • the indication data is used to indicate a processing result of the service data by the receiving end.
  • a fifth aspect provides a data transmission system, where the system includes: a receiving end and at least one transmitting end;
  • Each sender is configured to obtain a label from a label resource pool, where the label resource pool has a label
  • the sign indicates that the sending end currently has the right to send the service data to the receiving end; the first data packet is generated according to the to-be-sent service data of the sending end; and the first data packet is sent to the receiving end.
  • the receiving end is configured to receive a first data packet sent by any sending end, and process the service data in the received first data packet according to a current service data processing capability.
  • the sending end that sends the first data packet is further used to delete the acquired label from the label resource pool;
  • the sending end of the first data packet is further configured to receive the second data packet returned by the receiving end, and collect the label in the second data packet into the label resource pool.
  • the system is a distributed system, where the distributed system includes multiple sending ends and the receiving end.
  • a label is obtained in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, and sends the first data packet according to the service data to be sent.
  • the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data only when the receiving end currently has the service data processing capability, so as not to exceed
  • the current service data processing capability of the receiving end avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
  • the first data packet is generated according to the acquired label and the to-be-sent service data, and the first data packet is sent to the receiving end, so that the number of labels that have been acquired in the label resource pool is equal to the number of sent data packets, thereby The number of the remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiving end. That is, the label in the label resource pool can indicate that the sending end currently has the right to send the service data to the receiving end.
  • the label is obtained from the label resource pool, which saves the execution step of obtaining the label and improves the success rate of acquiring the label.
  • the tag resource pool is generated according to the service processing capability of the receiving end, that is, the transmission delay time between the transmitting end and the receiving end, the processing time of the receiving end for one data packet, and the data packet processed by the receiving end in the unit time.
  • the maximum number of the calculation, the total processing capacity value of the receiving end is calculated, and the label resource pool is generated according to the total processing capability value, and the initial number of labels in the label resource pool can be refined.
  • Exactly indicating the total service data processing capability of the receiving end to the transmitting end, so that the transmitting end can indicate the current service data processing capability of the receiving end by the number of initial labels determined by the number of initial labels and the number of transmitted data packets, and the label resources are guaranteed.
  • the presence of a label in the pool indicates that the sender currently has the right to send service data to the receiver, which improves the accuracy and ensures that the sender can send service data only when the receiver has the service data processing capability currently available on the receiver.
  • the problem of failure increases the transmission success rate and increases flexibility.
  • the label in the label resource pool can accurately indicate that the sending end currently has the right to send the service data to the receiving end, and the accuracy of the remaining number of labels is improved.
  • the number of remaining labels in the label resource pool is increased by the recycling manner, thereby ensuring After the number of labels is increased, the number of remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiving end.
  • the label in the label resource pool can accurately indicate that the sending end currently has the right to send service data to the receiving end, which improves the Accuracy.
  • the memory address corresponding to the label may be queried according to the corresponding relationship, and the memory is reclaimed according to the memory address.
  • the memory space indicated by the address By tagging the detailed information of the service data with the tag, it is not necessary to carry the detailed information when the first data packet is sent, and the detailed information of the service data can be determined, which saves bandwidth and improves flexibility.
  • the memory space indicated by the memory address is recovered in time, thereby saving memory resources.
  • the label is obtained from the label resource pool
  • timing is started.
  • the timer duration reaches the preset duration
  • the corresponding label is regenerated, and the regenerated label and service are generated according to the label.
  • the problem of reducing the number of labels in the processing of the service data ensures that the number of remaining labels can accurately indicate the current service data processing capability of the receiving end.
  • the presence of the label in the label resource pool can accurately indicate that the transmitting end currently has the service data to be sent to the receiving end. Permissions, increased accuracy.
  • the current state of the receiving end can be obtained, and the current state of the receiving end can be uploaded to the upper layer software, so that the upper layer software can send the transmitting end according to the current state of the receiving end. Coordinated control for increased flexibility.
  • the service data is suspended, and when the label is obtained from the label resource pool, the first data packet is generated according to the obtained label and the service data.
  • the receiving end sends the first data packet, which can ensure that the transmitting end sends the service data only when the receiving end has the service data processing capability, thereby avoiding the problem of the transmission failure and improving the transmission success rate.
  • the label recovery timeout when the label recovery timeout is performed, the detailed information corresponding to the label is queried according to the corresponding relationship, the memory address in the detailed information is determined, and the memory space indicated by the memory address is recovered, thereby avoiding memory leakage and improving flexibility.
  • the transmitting end can be applied to a distributed system, which ensures that multiple transmitting ends in the distributed system can perform flow control by themselves without affecting other transmitting ends, and is convenient for each transmitting end in the distributed system. Order management, with high flexibility.
  • FIG. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a distributed acceleration system according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of another distributed acceleration system according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a data sending device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a data receiving device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a data receiving apparatus according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a data transmission method according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a data sending method according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of a data receiving method according to an embodiment of the present invention.
  • FIG. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention.
  • the system includes a transmitting end 101 and a receiving end 102.
  • the sending end 101 is configured to obtain a label from the label resource pool, and the label in the label resource pool indicates that the sending end 101 currently has the right to send the service data to the receiving end; and the first data packet is generated according to the service data to be sent by the sending end 101. Transmitting the first data packet to the receiving end 102;
  • the receiving end 102 is configured to receive the first data packet sent by the sending end 101, and process the service data in the received first data packet based on the current service data processing capability.
  • the first data packet includes the acquired label and service data.
  • the sending end 101 is further configured to: obtain a label from the label resource pool if it is determined that at least one label exists in the label resource pool.
  • the sending end 101 is further configured to generate a label resource pool according to the service data processing capability of the receiving end 102 before generating the first data packet according to the to-be-sent service data of the sending end 101.
  • the sending end 101 is further configured to: before the first data packet is generated according to the to-be-sent service data of the sending end 101, according to a transmission delay time between the transmitting end 101 and the receiving end 102, and the receiving end 102 processes one The time of the data packet, the total processing time of a data packet is calculated; the service data processing capability of the receiving end 102 is obtained, and the service data processing capability is used to indicate the maximum number of data packets processed by the receiving end in a unit time; The product of the service data processing capability and the total processing time of the one data packet is used as the total processing capability value of the receiving end; according to the total processing capability value, a label resource pool is generated, and the label resource pool has a label number equal to the total processing capability value.
  • the sending end 101 is further configured to delete the obtained label from the label resource pool.
  • the receiving end 102 is further configured to send, to the sending end 101, a second data packet, where the second data packet includes a label in the first data packet, and is processed by processing the service data in the first data packet.
  • the indication data is used to indicate the processing result of the service data by the receiving end;
  • the sending end 101 is further configured to receive the second data packet sent by the receiving end 102, and the label included in the second data packet Recycle to the tag resource pool.
  • the sending end 101 is further configured to: after generating the first data packet according to the acquired label and the to-be-sent service data of the terminal, storing the detailed information of the service data, where the detailed information includes the memory of the service data to be sent. An address; establishing a correspondence between the label and the detailed information; after receiving the second data packet sent by the receiving end 102, acquiring a memory address corresponding to the label according to the corresponding relationship; and recovering the memory according to the memory address The memory space indicated by the address.
  • the sending end 101 is further configured to start timing when acquiring a label from the label resource pool; If the timeout period reaches the preset duration, and the acquired label is not reclaimed into the label resource pool, the sending end 101 regenerates the label, and regenerates the first data packet according to the regenerated label and the service data. Sending the regenerated first data packet to the receiving end 102.
  • the system is a distributed system comprising a receiving end 102 and two or more transmitting ends 101.
  • the data transmission system may be a distributed acceleration system.
  • the distributed acceleration system includes a plurality of local service servers 201 and a plurality of remote acceleration servers 202, wherein each remote acceleration server 202 is configured with Accelerate the engine.
  • a plurality of specific references are two or more, and are not described again.
  • the local service server 201 can apply for the acceleration processing capability of the remote acceleration server 202, and after applying for a certain acceleration processing capability, send the service data that needs to be accelerated to the remote acceleration server 202, and the remote acceleration server 202 can receive the service data. And using the configured acceleration engine to accelerate the service data, and return the instruction data obtained after the acceleration processing to the local service server 201.
  • the local service server 201 is used as the sending end, and the remote acceleration server 202 is used as the receiving end.
  • the label can be obtained from the label resource pool.
  • the presence of the label indicates that the local service server 201 currently has the right to send the service data to the remote acceleration server 202, and generates a first data packet according to the service data to be sent by the local service server 201, and sends the first data packet to the remote acceleration server 202. data pack.
  • the remote acceleration server 202 receives the first data packet sent by the local service server 201, and can accelerate the service data by using the configured acceleration engine based on the currently available acceleration processing capability.
  • the local service server 201 may also delete the obtained label from the label resource pool, and after receiving the second data packet returned by the remote acceleration server 202, the label in the second data packet may be recycled to the label resource. Pool.
  • the local service server 201 and the remote acceleration server 202 can be directly connected through a port or connected through a switch.
  • the local service server 201 includes a local processing unit (Central Processing Unit) 301 and a local service board 302, and the remote acceleration server 202 includes a remote end.
  • the local CPU 301 is connected to the local service board 302, and the remote CPU 303 is connected to the remote acceleration board 304.
  • the local service board 302 and the remote acceleration board 304 can be connected through the switch 305.
  • the local service board 302 and the remote acceleration board 304 respectively include a plurality of AE (Accelerate Engine) modules and a plurality of rAE (Remote Accelerate Engine) management modules, wherein the AE module is used for The local service data is accelerated, and the service data sent by other boards is received, and the service data is accelerated, and the instruction data of the processing completion is returned.
  • the rAE management module is configured to configure according to the instructions sent by the processor.
  • the other boards of the AE module send service data, and the other boards accelerate the service data and receive the returned indication data.
  • the local service board 302 obtains a label from the label resource pool in the process of sending the service data to the remote acceleration board 304 according to the instruction sent by the local CPU 301.
  • the label resource pool has a label indicating the local service board 302.
  • the user has the right to send the service data to the remote acceleration board 304, and generates the first data packet according to the to-be-sent service data of the local service card 302, and sends the first data packet to the remote acceleration board 304.
  • the remote acceleration board 304 can receive the first service packet sent by the local service board 302, and process the service data based on the current service data processing capability.
  • the transmitting end and the receiving end shown in the foregoing embodiments may be located in the same device or may be located in different devices.
  • the sender and the receiver can be different modules in the same device, and the two modules can interact with each other.
  • the sending end is located in the data sending device
  • the receiving end is located in the data receiving device, and the data sending device and the data receiving device can interact with each other.
  • FIG. 4 is a schematic structural diagram of a data sending device according to an embodiment of the present invention.
  • the device includes: a receiver 401, a transmitter 402, a memory 404, and a processor 404.
  • the receiver 401, the transmitter 402, and the The memory 404 is respectively connected to the processor 404.
  • the memory 404 stores program code, and the processor 404 is configured to call the program code to perform the following operations:
  • the label in the label resource pool indicates that the sender currently has the right to send service data to the receiver.
  • the first data packet is transmitted to the receiving end by the transmitter 402.
  • the first data packet includes the acquired label and the service data.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • a tag is obtained from the tag resource pool.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • the tag resource pool is generated according to the service data processing capability of the receiving end.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • processor 404 is configured to invoke the program code to perform the following operations:
  • the obtained tag is deleted from the tag resource pool.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • the second data packet sent by the receiving end where the second data packet includes the acquired label and the indication data obtained by processing the service data, where the indication data is used to indicate that the receiving end is to the service data.
  • the processing result; the acquired label included in the second data packet is recycled to the label resource pool.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • the specific information includes a memory address of the service data to be sent; establishing a correspondence between the tag and the detailed information; and obtaining, according to the correspondence, a memory address corresponding to the tag; according to the memory address, Reclaims the memory space indicated by this memory address.
  • processor 404 is configured to invoke the program code to perform the following operations:
  • the timer When a tag is obtained from the tag resource pool, the timer is started; if the timer duration reaches the preset duration, and the acquired tag is not reclaimed into the tag resource pool, the sender regenerates the tag according to the regenerated tag. And the service data, regenerating the first data packet, and sending the regenerated first data packet to the receiving end.
  • FIG. 5 is a schematic structural diagram of a data receiving device according to an embodiment of the present invention.
  • the device includes: a receiver 501, a transmitter 502, a memory 503, and a processor 504.
  • the receiver 501, the The transmitter 502 and the memory 503 are respectively connected to the processor 504.
  • the memory 503 stores program code
  • the processor 504 is configured to call the program code to perform the following operations:
  • the receiver 501 Receiving, by the receiver 501, the first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label exists in the label resource pool to indicate the sending end Currently has the right to send business data to the receiving end;
  • the business data is processed based on current business data processing capabilities.
  • processor 504 is configured to invoke the program code to perform the following operations:
  • FIG. 6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present invention.
  • the data sending apparatus is applied to a transmitting end.
  • the apparatus includes: a label obtaining module 601, a data packet generating module 602, and a sending module 603.
  • the label obtaining module 601 is configured to obtain a label from the label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send the service data to the receiving end;
  • a data packet generating module 602 configured to generate a first data packet according to the to-be-sent service data of the sending end;
  • the sending module 603 is configured to send the first data packet to the receiving end.
  • the device provided by the embodiment of the present invention obtains a label from the label resource pool, and sends a label according to the to-be-sent service data, on the premise that the label has a right to send the service data to the receiving end.
  • the first data packet enables the receiving end to process the service data based on the current service data processing capability after receiving the first data packet, thereby ensuring that the transmitting end can send the service only when the receiving end currently has the service data processing capability. Data, so as to avoid exceeding the current service data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
  • the first data packet includes the acquired label and the service data.
  • the label obtaining module 601 is further configured to: obtain a label from the label resource pool if it is determined that at least one label exists in the label resource pool.
  • the device further includes:
  • a label resource pool generating module 604 configured to generate, according to the service data processing capability of the receiving end, The tag resource pool.
  • the label resource pool generating module 601 is further configured to calculate a total processing time of the one data packet according to a transmission delay time between the sending end and the receiving end, and a time when the receiving end processes a data packet.
  • the total processing capability value of the receiving end is generated according to the total processing capability value, and the label resource pool has a label number equal to the total processing capability value.
  • the device further includes:
  • the deleting module 605 is configured to delete the label acquired by the label obtaining module from the label resource pool.
  • the device further includes:
  • the receiving module 606 is configured to receive the second data packet sent by the receiving end, where the second data packet includes the acquired label and the indication data obtained by processing the service data, where the indication data is used to indicate that the receiving end is Processing result of business data;
  • the label collection module 607 is configured to collect the label in the second data packet received by the receiving module into the label resource pool.
  • the device further includes:
  • the storage module 608 is configured to store detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
  • Establishing a relationship module 609 configured to establish a correspondence between the label and the detailed information
  • the memory address obtaining module 610 is configured to obtain a memory address corresponding to the label according to the correspondence established by the establishing relationship module.
  • the memory space recovery module 611 is configured to recover the memory space indicated by the memory address according to the memory address obtained by the memory address acquisition module.
  • the device further includes:
  • the timing module 612 is configured to start timing when the label obtaining module acquires a label from the label resource pool;
  • the label generating module 613 is configured to regenerate the label if the timing of the timing module reaches a preset duration and the label acquired by the label obtaining module is not recycled to the label resource pool;
  • the data packet generating module 602 is further configured to regenerate the first data packet according to the label and the service data regenerated by the label generation module.
  • the sending module 603 is further configured to send, to the receiving end, the first data packet that is regenerated by the data packet generating module.
  • FIG. 7 is a schematic structural diagram of a data receiving apparatus according to an embodiment of the present invention.
  • the data receiving apparatus is applied to a receiving end.
  • the apparatus includes: a receiving module 701 and a processing module 702.
  • the receiving module 701 is configured to receive a first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where a label exists in the label resource pool to indicate the sending The terminal currently has the right to send service data to the receiving end;
  • the processing module 702 is configured to process the service data in the first data packet received by the receiving module 701 based on the current service data processing capability.
  • the apparatus provided by the embodiment of the present invention can receive the first data packet sent to the receiving end on the premise that the transmitting end has the right to send the service data to the receiving end, and can be based on the current service data processing capability in the first data packet.
  • the processing of the service data ensures that the data packet sent by the sender does not exceed the current service data processing capability of the receiving end, avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
  • the device further includes:
  • the sending module 703 is configured to send, to the sending end, a second data packet, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where the indication data is It is used to indicate the processing result of the service data by the receiving end.
  • FIG. 8 is a flowchart of a data transmission method according to an embodiment of the present invention.
  • the interaction body of the method is a sender and a receiver, and the sender and the receiver may be a terminal, a server, a virtual machine, or a single
  • the device, such as a board, may also be a sending port and a receiving port configured on the device, which are not limited in this embodiment of the present invention.
  • the data transmission method includes the following steps:
  • the sender obtains a label from the label resource pool.
  • the label exists in the label resource pool can be used to indicate the service data processing capability of the receiving end. If there is a label in the label resource pool, that is, the number of labels in the label resource pool is greater than 0, it indicates that the receiving end currently has the service data processing capability. At this time, if the sending end sends the service data to the receiving end, the receiving end can be based on the current The service data processing capability processes the service data. Therefore, when the label exists in the label resource pool, the sender has the right to send the service data to the receiver. And If there is no label in the label resource pool, that is, the number of labels in the label resource pool is 0, it means that the receiving end does not currently have the service data processing capability.
  • the sending end sends the service data to the receiving end, the receiving end cannot The service data is processed, and the service data is discarded. Therefore, when it is determined that the label resource pool does not have a label, the sender does not have the right to send the service data to the receiver.
  • step 801 can be implemented in the following two manners without limitation:
  • the sending end determines that at least one label exists in the label resource pool, a label is obtained from the label resource pool.
  • a label is obtained from the label resource pool; if it is determined that the label resource pool has no label, The obtaining step is not performed until the at least one label exists in the label resource pool, and then the action of obtaining the label from the label resource pool is performed.
  • Method 2 Obtain a label directly from the identity resource pool.
  • the sender does not determine whether there is at least one label in the label resource pool, but directly attempts to obtain a label from the identifier resource pool. If the label is successfully obtained, the number of remaining labels in the label resource pool is greater than 0, and the receiving end Currently, the ability to process data packets is not available. If the label fails to be obtained, it indicates that there is no label in the label resource pool, and the receiving end does not currently have the ability to process data packets.
  • the sending end generates a first data packet according to the to-be-sent service data of the sending end, and sends the first data packet to the receiving end.
  • the sending end may encapsulate the service data to be sent into the first data packet, and send the first data packet to the receiving end. That is, the first data packet includes service data to be transmitted.
  • the sending end may encapsulate the obtained label and the service data to be sent into a first data packet, and send the first data packet to the receiving end.
  • a packet of data That is, the first data packet includes the acquired label and the service data to be sent.
  • the tag is obtained from the tag resource pool, and the tag is configured to obtain the tag 89 from the tag resource pool, and encapsulate the tag 89 and the service data to be sent into the first data packet, and send the packet to the receiving end.
  • a packet of data For example, if the tag is in the tag resource pool, the tag is obtained from the tag resource pool, and the tag is configured to obtain the tag 89 from the tag resource pool, and encapsulate the tag 89 and the service data to be sent into the first data packet, and send the packet to the receiving end.
  • a packet of data is
  • each time a service data is to be sent a label needs to be obtained from the label resource pool, and only after successfully obtaining a label from the label resource pool
  • the obtained label and the service data to be sent are encapsulated into a first data packet, and the first data packet is sent to the receiving end, and if the label is not obtained from the label resource pool, the sending The terminal will suspend the sending of the service data until the tag is successfully obtained from the tag resource pool, and then the obtained tag and the service data to be sent are encapsulated into the first data packet, and the first data is sent to the receiving end. package.
  • the number of initial labels in the label resource pool may indicate the total service data processing capability of the receiving end, and each time the transmitting end needs to obtain a label from the label resource pool before sending the service data, the label resource is already obtained from the label resource.
  • the number of tags that are sent out of the pool is the number of packets that have been sent by the sender. It can indicate the number of packets that the receiver is currently processing. It can reflect the service data processing capability currently occupied by the receiver, but in the label resource pool.
  • the number of remaining labels is the number of data packets that the sender can also send, which can indicate the current idle data processing capability of the receiver.
  • the sending end may also acquire the label after obtaining a label from the label resource pool each time.
  • the label is deleted from the label resource pool, so that the number of labels in the label resource pool decreases as the data of the to-be-sent service of the sender decreases. Therefore, the number of data packets sent by the sender can be controlled according to the number of remaining labels.
  • the flow control of the sending end is implemented, thereby ensuring that the number of data packets being processed at any time does not exceed the upper limit of the processing data processing capability of the receiving end, and the flow control is achieved.
  • the sending end may use the related protocol between the sending end and the receiving end to send the first data packet to the receiving end, or send the first data packet to the switch, where the first data packet is sent by the switch.
  • the embodiment of the present invention does not limit the forwarding to the receiving end.
  • the receiving end receives the first data packet sent by the sending end, and processes the service data according to the current service data processing capability.
  • the first data packet sent by the sending end includes service data
  • the receiving end may receive the first data packet sent by the sending end, and decapsulate the first data packet to obtain The business data in the first data packet.
  • the first data packet sent by the sending end includes the acquired label and the service data
  • the receiving end may receive the first data packet sent by the sending end, and perform the first data packet. Decapsulation, obtaining the label and service data in the first data packet.
  • the receiving end can directly process the service data based on the current service data processing capability, and obtain the processed indication data without discarding the first data packet.
  • the indication data is used to indicate a processing result of the service data by the receiving end, and the indicator number
  • the data obtained by processing the service data may be included, or the indication data may also include a success response or a failure response generated after the service data is processed, which is not limited by the embodiment of the present invention.
  • the receiving end may process the service data in different manners, and the specific processing manner may be determined according to the negotiation between the sending end and the receiving end, or determined according to the default processing manner of the receiving end, or according to the first data packet.
  • the processing mode of the carrying is determined, and the processing manner may include acceleration, calculation, analysis, and the like, which are not limited in the embodiment of the present invention. For example, if the transmitting end requests the receiving end to perform acceleration processing on the service data sent by the receiving end, after receiving the first data packet, the receiving end may perform acceleration processing on the service data to obtain accelerated data.
  • the method further includes:
  • the sending end generates a label resource pool according to the service data processing capability of the receiving end.
  • the maximum number of data packets that the transmitting end can send to the receiving end is determined according to the service processing capability of the receiving end, and the label resource pool is generated according to the maximum number.
  • the number of initial labels of the label resource pool is equal to the maximum number, so that the number of data packets sent is controlled according to the maximum number, so as to ensure that the number of sent data packets does not exceed the service data processing capability of the receiving end.
  • the service data processing capability of the receiving end may be all the service data processing capability of the receiving end, and may also be the service data processing capability that the sending end applies for from the receiving end, which is not limited in this embodiment of the present invention.
  • the sending end generates a label resource pool according to the service data processing capability of the receiving end, including: the sending end calculates a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes a data packet, and calculates a The total processing time of the data packet is obtained, and the service data processing capability of the receiving end is used to indicate the maximum number of data packets processed by the receiving end in a unit time, and the service data processing capability and the one data are calculated.
  • the product of the total processing time of the packet can obtain the maximum number of data packets processed by the receiving end in the total processing time, and the total processing capability value of the receiving end in the total processing time is generated according to the total processing capability value.
  • the tag resource pool is such that the number of tags of the newly generated tag resource pool is equal to the total processing capability value to indicate that the initial tag number in the tag resource pool is equal to the total processing capability value.
  • the transmission delay time is the time required for the transmitter to transmit a data packet between the sender and the receiver, and the time for processing a data packet is the time elapsed since the receiver starts processing the data to complete the processing.
  • the total processing time of the one packet is to send a packet from the sender.
  • the time required to receive the data packet returned after the receiving end processing is completed is the sum of the transmission delay time and the processing time.
  • the generating the label resource pool according to the total processing capability value includes: the sending end uses the obtained total processing capability value as the initial label number, generates a label corresponding to the initial label number, and establishes a label resource pool.
  • the established label resource pool includes a label corresponding to the initial number of labels, so that the sending of the data packet is restricted according to the label in the label resource pool in a subsequent process.
  • the sender can mark multiple tags according to the sequence number. For example, if the number of initial labels is 100, the sender may establish a label resource pool, where the label resource pool includes labels Tag0-Tag99.
  • the maximum number of data packets processed by the receiving end per unit time can be determined according to the packet processing rate of the receiving end. Then, the initial number of labels in the label resource pool can be derived from the following formula:
  • Num is the initial number of labels
  • Packet ⁇ Rate is the packet processing rate of the receiving end
  • T 1 is the transmission delay time between the transmitting end and the receiving end
  • T 2 is the processing time of the receiving end for one data packet.
  • the packet processing rate of the receiving end is 100000 pps (packet per second), indicating that the maximum number of data packets processed in the receiving end 1s is 100000, and the maximum number of data packets processed by the receiving end within 1 ms.
  • the number is 100.
  • the receiving end has a processing time of 5 ms for one data packet and a transmission delay time of 5 ms
  • the total processing time of the receiving end for one data packet is 10 ms.
  • the total processing capacity of the receiving end is 1000, and the initial number of labels is determined to be 1000.
  • the calculated initial number of tags can indicate the maximum number of data packets that the receiving end can process in the total processing time of the transmitting end, that is, the total service data processing capability of the receiving end in the total processing time. During the total processing time, if the number of data packets sent by the sender does not reach the initial number of labels, the total service data processing capability of the receiver is not exceeded.
  • the method further includes:
  • the receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet.
  • the receiving end After the receiving end processes the service data in the first data packet to obtain the indication data, the label in the first data packet and the indication data may be performed. Encapsulating into a second data packet and transmitting the second data packet to the transmitting end.
  • the receiving end may decapsulate the first data packet to obtain Tag89 and service data, and the receiving end may process the service data to obtain the processed data. Indicating data, and the Tag89 and the indication data are encapsulated into a second data packet, and the second data packet is sent to the transmitting end.
  • step 804 the method further includes:
  • the sending end receives the second data packet sent by the receiving end, and collects the label in the second data packet into the label resource pool.
  • the sending end may decapsulate the second data packet to obtain the label in the second data packet and the processed indication data.
  • the service data processing capability of the service data is released, and the sender reclaims the decapsulated label into the label resource pool, thereby ensuring the label resource.
  • the number of labels in the pool decreases as the data to be sent of the sender decreases, and increases with the label collection.
  • the number of labels in the label resource pool accurately indicates the current service data processing capability of the receiver, and the label resource pool.
  • the presence of a tag can accurately indicate that the sender currently has the right to send service data to the receiver.
  • the recycling of the label can also ensure that the labels that have been used in the subsequent process can be reused, saving label resources.
  • the transmitting end since the transmitting end may send multiple service data, and the detailed information of different service data is inconvenient to distinguish, the transmitting end needs to carry the detailed information of the service data when transmitting the service data, and the receiving end returns the indication data. It is also necessary to return the detailed information, and the transmitting end can determine which detailed information of the detailed information of the business data is. That is, the transmission information needs to be carried in the transmission process between the transmitting end and the receiving end, which will occupy a certain bandwidth.
  • the sending end may store the detailed information of the service data after acquiring the label from the label resource pool, and establish a correspondence between the label and the detailed information, and mark the details of the service data by using the label. information.
  • the sending end may query the detailed information corresponding to the label according to the corresponding relationship. In the transmission process between the sender and the receiver, the detailed information does not need to be carried, which saves bandwidth.
  • the detailed information includes at least a memory address of the service data, and may further include a sender ID (Identification), a queue number of the service data, and the like.
  • the detailed information in the embodiment of the present invention is not limited.
  • the sending end after receiving the second data packet, obtains the label and the indication data carried in the second data packet, and may query the memory address corresponding to the label according to the corresponding relationship, and store the returned data according to the memory address. Indicate the data. In this way, not only the problem of flow control is solved, but also the record of the transmitted service data information can be realized, and the design requirements of the distributed system are satisfied.
  • the sending end may further query the memory address corresponding to the label according to the corresponding relationship, and recover the memory according to the memory address.
  • the memory space indicated by the address so that the memory space is applied to other business data to be sent later, which saves memory resources.
  • the sending end may store the detailed information such as the queue number, the memory address, and the sender ID of the service data to be sent, and establish Tag89 and the detailed information.
  • the Tag89 and the service data are encapsulated into a first data packet not including the detailed information, and the first data packet is sent to the receiving end.
  • the sending end receives the second data packet including the Tag89 and the indication data, the memory address corresponding to the Tag89 may be queried according to the established correspondence relationship, and the memory space indicated by the memory address is recovered according to the queried memory address.
  • the sending end may start timing when the sending end acquires a label from the label resource pool, and when the timing duration reaches a preset duration, it is determined whether the acquired label has been recycled to the label resource pool. If the obtained label has not been recycled to the label resource pool, it means that the label collection timeout, the first data packet may have been lost, or the receiving end may be abnormal, and the business data cannot be processed or the second data packet cannot be returned. Then, in order to prevent the service data from being processed and to avoid reducing the number of tags when the new service data is not sent, the tag resource pool can regenerate the corresponding tag and regenerate according to the regenerated tag and service data.
  • the preset duration may be set by the sending end according to the general duration of obtaining the label from the label resource pool to the label resource pool, or may be based on the transmission delay time between the sending end and the receiving end.
  • the specific setting of the processing time of a data packet is not limited in this embodiment of the present invention.
  • the sender can also determine whether the receiver is in place according to whether the label is reclaimed. If the label reclaims timeout, it indicates that the receiver may not be started or an abnormality occurs, that is, the receiver cannot work normally. Then, the status of the receiving end can be determined as not being in place. If the label does not have a recovery timeout, it indicates that the receiving end can work normally, and the status of the receiving end can be determined to be in place.
  • the sending end may also collect the actual duration from the time the label is acquired to the collection of the label, and the actual duration is used as a processing delay for processing the corresponding service data by the receiving end, and the receiving is determined according to the processing delay.
  • the current running state of the terminal and uploading the current running state of the receiving end to the upper layer software, or statistically analyzing the change of the processing delay of the receiving end, uploading to the upper layer software, thereby eliminating the need to send special probe data to the current end of the receiving end.
  • the running status is detected, which saves the detection resources.
  • the receiver may not regenerate the first data packet, and cancel the processing of the service data again.
  • the transmitting end may query the detailed information corresponding to the label according to the correspondence, determine the memory space indicated by the memory address according to the memory address included in the detailed information, and recover the memory space.
  • the sending end may identify an abnormal condition of the label collection timeout.
  • the retransmission mechanism is directly triggered to resend the first data packet, or the memory is reclaimed according to the memory address in the detailed information.
  • the memory space indicated by the address may be also report an exception to the upper layer software, and the upper layer software determines whether to send the first data packet again or to reclaim the memory space, and the sender may trigger the retransmission mechanism according to the instruction of the upper layer software. Or reclaim the memory space indicated by the memory address.
  • the above method can ensure that the number of data packets being processed by the receiving end does not exceed the processing upper limit at any time, and achieves the purpose of flow control, ensuring the accuracy and real-time performance of the flow control, and at the same time, the transmitting end can process according to the real-time processing of the receiving end.
  • the result is to decide whether to send the first data packet and implement autonomous flow control.
  • the receiving end does not return the label when the processing is not completed, so that the sending end cannot reclaim the label. If the receiving end does not currently have the service data processing capability, the number of remaining labels of the transmitting end is 0, so that the transmitting end can be controlled to suspend the sending service. Data, the back pressure on the sender is achieved.
  • the embodiment of the present invention is only an example of performing data packet transmission between a transmitting end and a receiving end.
  • the method can also be applied to a complex system of multiple transmitting ends or multiple receiving ends.
  • networking environments such as distributed systems.
  • the data provided by the embodiment of the present invention can be used for data transmission between any of the transmitting ends and any receiving end to ensure the flow control of each node in the system, ensuring reliability, and can also be applied to the transmitting end.
  • multiple senders can perform traffic control by themselves, and each sender can control the number of data packets sent according to the service data processing capability that each party applies to the receiver, It affects other senders and facilitates the orderly management of each sender in a distributed system. It can adapt to complex networking scenarios and has high flexibility.
  • the method provided by the embodiment of the present invention after the label is present in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, according to the service data to be sent.
  • Sending the first data packet so that after receiving the first data packet, the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data processing capability if the receiving end currently has the service data processing capability.
  • Business data so as to avoid exceeding the current business data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
  • the number of remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiver, and the accuracy is improved; and the service data is marked by the label.
  • the detailed information does not need to carry the detailed information when the first data packet is sent, and can also determine the detailed information of the service data, which saves bandwidth and improves flexibility; if the label recycling timeout, the corresponding label is regenerated, and according to the re The generated label and the service data regenerate the first data packet, and send the regenerated first data packet to the receiving end, thereby avoiding the problem that the service data processing fails, and avoiding reducing when the receiving end does not process the service data.
  • the problem of the number of tags ensures that the number of remaining tags can accurately indicate the current service data processing capability of the receiving end and improve the accuracy.
  • FIG. 9 is a flowchart of a data sending method according to an embodiment of the present invention.
  • the execution body of the embodiment of the present invention is a transmitting end. Referring to FIG. 9, the method includes the following steps:
  • the sender obtains a label from the label resource pool, and the label in the label resource pool indicates that the sender currently has the right to send service data to the receiver.
  • the sending end generates a first data packet according to the to-be-sent service data of the sending end.
  • the sending end sends the first data packet to the receiving end.
  • the method provided by the embodiment of the present invention after the label is present in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, according to the service data to be sent.
  • Sending the first data packet so that after receiving the first data packet, the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data processing capability if the receiving end currently has the service data processing capability.
  • Business data so as to avoid exceeding the current business data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
  • the first data packet includes the acquired label and the service data.
  • the sending end obtains a label from the label resource pool, including:
  • the method before the sending end generates the first data packet according to the to-be-sent service data of the sending end, the method further includes:
  • the tag resource pool is generated according to the service data processing capability of the receiving end.
  • the generating the label resource pool according to the service data processing capability of the receiving end including:
  • the transmitting end calculates a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes one data packet;
  • the sending end acquires the service data processing capability of the receiving end, where the service data processing capability is used to indicate the maximum number of data packets processed by the receiving end in a unit time;
  • the sending end uses the product of the service data processing capability and the total processing time of the one data packet as the total processing capability value of the receiving end;
  • the tag resource pool is generated according to the total processing capability value, and the tag resource pool has a label number equal to the total processing capability value.
  • the method further includes:
  • the obtained tag is deleted from the tag resource pool.
  • the method further includes:
  • the acquired label included in the second data packet is recycled to the label resource pool.
  • the method further includes:
  • the sending end stores the detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
  • the sending end establishes a correspondence between the label and the detailed information
  • the method further includes:
  • the sending end acquires a memory address corresponding to the label according to the correspondence relationship
  • the sender reclaims the memory space indicated by the memory address according to the memory address.
  • the method further includes:
  • the sender When the sender performs a label acquisition from the label resource pool, the sender starts timing;
  • the sender regenerates the label, and regenerates the first data packet according to the regenerated label and the service data. Sending the regenerated first data packet to the receiving end.
  • FIG. 10 is a flowchart of a data receiving method according to an embodiment of the present invention.
  • the executor of the embodiment of the present invention may be a receiving end. Referring to FIG. 10, the method includes the following steps:
  • the receiving end receives the first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label in the label resource pool indicates that the sending end is current. Have the right to send business data to the receiving end;
  • the receiving end processes the service data based on the current service data processing capability.
  • the method provided by the embodiment of the present invention can receive the first data packet sent to the receiving end on the premise that the transmitting end has the right to send the service data to the receiving end, and can be based on the current service data processing capability in the first data packet.
  • the processing of the service data ensures that the data packet sent by the sender does not exceed the current service data processing capability of the receiving end, avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
  • the method further includes:
  • the receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where the indication data is used to indicate The result of processing the service data by the receiving end.
  • the completion of the hardware may also be performed by a program to instruct related hardware.
  • the program may be stored in a computer readable storage medium.
  • the storage medium mentioned above may be a read only memory, a magnetic disk or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

Disclosed are a data sending method, receiving method, apparatus and system, falling within the technical field of networks. The method comprises: acquiring a label from a label resource pool, wherein the label resource pool has a label representing that the sending end currently has the permission to send service data to a receiving end; generating a first data packet according to service data to be sent; and sending the first data packet to the receiving end. In the present invention, by acquiring a label from a label resource pool on the premise that the label resource pool has a label, namely, a sending end currently having the permission to send service data to a receiving end, and then sending a first data packet according to service data to be sent, so that the receiving end can process the service data based on a current service data processing capability, thereby guaranteeing that the sending end can send the service data where the receiving end currently has a service data processing capability, avoiding the problem of transmission failure, improving transmission success rate, and improving the flexibility.

Description

数据发送方法、接收方法、装置及系统Data transmitting method, receiving method, device and system 技术领域Technical field
本发明涉及网络技术领域,特别涉及一种数据发送方法、接收方法、装置及系统。The present invention relates to the field of network technologies, and in particular, to a data sending method, a receiving method, an apparatus, and a system.
背景技术Background technique
在网络系统中,发送端经常要向接收端发送业务数据,由接收端在缓存区中缓存业务数据,再从缓存区中读取该业务数据,从而对该业务数据进行处理。如果发送端发送的业务数据超出接收端的处理能力,会导致缓存区溢出,则接收端会丢弃该业务数据,导致业务数据传输失败。In the network system, the sending end often sends service data to the receiving end, and the receiving end caches the service data in the buffer area, and then reads the service data from the buffer area, thereby processing the service data. If the service data sent by the sender exceeds the processing capability of the receiver, the buffer will overflow. The receiver will discard the service data and the service data transmission fails.
为了避免业务数据传输失败的问题,发送端在发送业务数据之前,可以先向接收端发送状态获取指令,以请求获取接收端当前的状态,接收端接收到该状态获取指令并确定当前能够处理业务数据时,可以返回用于表示能够处理业务数据的Ready状态响应,发送端接收到Ready状态响应时,再计算单位时间内发送和接收的业务数据,得到此时的流量速率,并判断该流量速率是否超出预设的流量上限,如果流量速率未超出预设的流量上限,则向接收端发送业务数据,实现了流控和反压。In order to avoid the problem of service data transmission failure, the transmitting end may send a status acquisition instruction to the receiving end to request the current state of the receiving end before receiving the service data, and the receiving end receives the status obtaining instruction and determines that the current processing service can be processed. When the data is received, it can return a Ready status response indicating that the service data can be processed. When the sender receives the Ready status response, it calculates the service data sent and received in a unit time, obtains the traffic rate at this time, and determines the traffic rate. If the preset traffic limit is exceeded, if the traffic rate does not exceed the preset traffic limit, the service data is sent to the receiver to implement flow control and backpressure.
在实现本发明的过程中,发明人发现现有技术至少存在以下问题:In the process of implementing the present invention, the inventors have found that the prior art has at least the following problems:
接收端接收到状态获取指令时返回Ready状态响应与接收端接收到发送端的业务数据之间存在一定的延时,Ready状态响应仅能够表示接收端在接收到状态获取指令时能够处理业务数据,并不能表示接收端在后续接收到发送端的业务数据时还能够处理业务数据,那么,如果接收端接收到发送端的业务数据时已不能处理该业务数据,仍会丢弃该业务数据,导致业务数据传输失败。There is a certain delay between the return of the Ready status response when the receiving end receives the status acquisition command and the service data received by the receiving end, and the Ready status response can only indicate that the receiving end can process the service data when receiving the status acquisition instruction, and It is not possible for the receiving end to process the service data when it receives the service data of the sending end. If the receiving end can not process the service data when receiving the service data of the sending end, the service data will still be discarded, causing the service data transmission to fail. .
发明内容Summary of the invention
为了克服现有技术中存在的问题,本发明提供一种数据发送方法、接收方法、装置及系统。所述技术方案如下:In order to overcome the problems existing in the prior art, the present invention provides a data transmitting method, a receiving method, an apparatus, and a system. The technical solution is as follows:
第一方面,提供了一种数据发送方法,所述方法包括:In a first aspect, a data sending method is provided, the method comprising:
发送端从标签资源池中获取一个标签,所述标签资源池中存在标签表示所 述发送端当前具备向接收端发送业务数据的权限;The sender obtains a label from the label resource pool, where the label resource pool has a label representation The sender currently has the right to send service data to the receiving end;
所述发送端根据所述发送端的待发送业务数据,生成第一数据包;The sending end generates a first data packet according to the to-be-sent service data of the sending end;
所述发送端向所述接收端发送所述第一数据包。The sending end sends the first data packet to the receiving end.
结合第一方面,在第一方面的第一种可能实现方式中,所述第一数据包包括所述获取的标签和所述业务数据。In conjunction with the first aspect, in a first possible implementation manner of the first aspect, the first data packet includes the acquired label and the service data.
结合第一方面的上述任一种可能实现方式,在第一方面的第二种可能实现方式中,所述发送端从标签资源池中获取一个标签,包括:With reference to any of the foregoing possible implementation manners of the foregoing aspect, in a second possible implementation manner of the first aspect, the sending end obtains a label from the label resource pool, including:
若所述发送端确定所述标签资源池中存在至少一个标签,则从所述标签资源池中获取一个标签。And if the sending end determines that at least one label exists in the label resource pool, obtaining a label from the label resource pool.
结合第一方面的上述任一种可能实现方式,在第一方面的第三种可能实现方式中,在所述发送端根据所述发送端的待发送业务数据,生成第一数据包之前,所述方法还包括:With reference to any one of the foregoing possible implementation manners of the first aspect, in a third possible implementation manner of the first aspect, before the sending end generates the first data packet according to the to-be-sent service data of the sending end, The method also includes:
根据所述接收端的业务数据处理能力,生成所述标签资源池。Generating the label resource pool according to the service data processing capability of the receiving end.
结合第一方面的上述任一种可能实现方式,在第一方面的第四种可能实现方式中,所述根据所述接收端的业务数据处理能力,生成所述标签资源池,包括:With the foregoing possible implementation manner of the foregoing aspect, in a fourth possible implementation manner of the foregoing aspect, the generating, by the service data processing capability of the receiving end, the label resource pool includes:
所述发送端根据所述发送端与所述接收端之间的传输延迟时间,以及所述接收端处理一个数据包的时间,计算所述一个数据包的总处理时间;The transmitting end calculates a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes one data packet;
所述发送端获取所述接收端的业务数据处理能力,所述业务数据处理能力用于指示所述接收端在单位时间内处理的数据包的最大个数;The sending end acquires a service data processing capability of the receiving end, where the service data processing capability is used to indicate a maximum number of data packets processed by the receiving end in a unit time;
所述发送端将所述业务数据处理能力与所述一个数据包的总处理时间的乘积作为所述接收端的总处理能力数值;The sending end uses the product of the service data processing capability and the total processing time of the one data packet as the total processing capability value of the receiving end;
根据所述总处理能力数值,生成所述标签资源池,所述标签资源池的标签数目等于所述总处理能力数值。And generating, by the total processing capability value, the label resource pool, where the label resource pool has a label number equal to the total processing capability value.
结合第一方面的上述任一种可能实现方式,在第一方面的第五种可能实现方式中,所述方法还包括:With reference to any of the foregoing possible implementations of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes:
将所述获取的标签从所述标签资源池中删除。The obtained tag is deleted from the tag resource pool.
结合第一方面的上述任一种可能实现方式,在第一方面的第六种可能实现方式中,所述方法还包括:With reference to any of the foregoing possible implementations of the first aspect, in a sixth possible implementation manner of the first aspect, the method further includes:
所述发送端接收所述接收端发送的第二数据包,所述第二数据包包括所述获取的标签和对所述业务数据处理后得到的指示数据,所述指示数据用于指示 所述接收端对所述业务数据的处理结果;Receiving, by the sending end, the second data packet sent by the receiving end, where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate a processing result of the service data by the receiving end;
将所述第二数据包中包含的所述获取的标签回收至所述标签资源池。Retrieving the acquired tag included in the second data packet to the tag resource pool.
结合第一方面的上述任一种可能实现方式,在第一方面的第七种可能实现方式中,在所述发送端根据所述获取的标签和所述终端的待发送业务数据,生成第一数据包之后,还包括:With reference to any one of the foregoing possible implementations of the first aspect, in a seventh possible implementation manner of the first aspect, the sending end generates, according to the acquired label and the to-be-sent service data of the terminal, the first After the packet, it also includes:
所述发送端存储所述业务数据的详情信息,所述详情信息包括所述待发送业务数据的内存地址;The sending end stores the detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
所述发送端建立所述标签与所述详情信息的对应关系;The sending end establishes a correspondence between the label and the detailed information;
在所述发送端接收所述接收端发送的所述第二数据包之后,所述方法还包括:After the sending end receives the second data packet sent by the receiving end, the method further includes:
所述发送端根据所述对应关系,获取所述标签对应的内存地址;The sending end acquires a memory address corresponding to the label according to the corresponding relationship;
所述发送端根据所述内存地址,回收所述内存地址指示的内存空间。The sending end recovers the memory space indicated by the memory address according to the memory address.
结合第一方面的上述任一种可能实现方式,在第一方面的第八种可能实现方式中,所述方法还包括:In conjunction with any of the foregoing possible implementations of the first aspect, in an eighth possible implementation manner of the first aspect, the method further includes:
在所述发送端执行从标签资源池中获取一个标签时,所述发送端开始计时;When the sending end performs obtaining a label from the label resource pool, the sending end starts timing;
若计时时长达到预设时长,且所述获取的标签未回收至所述标签资源池中,则所述发送端重新生成所述标签,根据重新生成的所述标签和所述业务数据,重新生成所述第一数据包,向所述接收端发送重新生成的第一数据包。If the time period reaches a preset duration, and the acquired label is not reclaimed into the label resource pool, the sending end regenerates the label, and regenerates according to the regenerated label and the service data. Transmitting, by the first data packet, the regenerated first data packet to the receiving end.
结合第一方面的上述任一种可能实现方式,在第一方面的第九种可能实现方式中,所述方法还包括:With reference to any of the foregoing possible implementations of the first aspect, in a ninth possible implementation manner of the first aspect, the method further includes:
当统计的时长到达预设时长时,判断是否已将所述标签回收至所述标签资源池;When the duration of the statistics reaches a preset duration, it is determined whether the label has been recycled to the label resource pool;
若未将所述标签回至所述标签资源池,则将所述接收端的状态确定为未在位;If the label is not returned to the label resource pool, the status of the receiving end is determined to be not in place;
若已将所述标签回收至所述标签资源池,则将所述接收端的状态确定为在位。If the tag has been recycled to the tag resource pool, the state of the receiving end is determined to be in place.
结合第一方面的上述任一种可能实现方式,在第一方面的第十种可能实现方式中,所述方法还包括:With reference to any one of the foregoing possible implementations of the first aspect, in a tenth possible implementation manner of the first aspect, the method further includes:
如果从标签资源池中未获取到任一标签,暂停发送所述业务数据,直至从标签资源池中获取到标签时,再根据获取到的标签和所述业务数据生成第一数 据包,向接收端发送所述第一数据包。If the label is not obtained from the label resource pool, the service data is suspended until the label is obtained from the label resource pool, and then the first number is generated according to the obtained label and the service data. According to the packet, the first data packet is sent to the receiving end.
结合第一方面的上述任一种可能实现方式,在第一方面的第十一种可能实现方式中,所述方法还包括:With reference to any of the foregoing possible implementations of the first aspect, in an eleventh possible implementation manner of the first aspect, the method further includes:
如果还未将所述标签回收至所述标签资源池,则根据所述对应关系,查询所述标签对应的详情信息,确定所述详情信息中的内存地址,根据所述内存地址回收所述内存地址指示的内存空间。If the label is not recovered to the label resource pool, querying the detailed information corresponding to the label according to the correspondence, determining a memory address in the detailed information, and recovering the memory according to the memory address The memory space indicated by the address.
结合第一方面的上述任一种可能实现方式,在第一方面的第十二种可能实现方式中,所述方法应用于分布式系统中的发送端,所述分布式系统包括接收端和至少一个发送端。With reference to any of the foregoing possible implementation manners of the first aspect, in a twelfth possible implementation manner of the first aspect, the method is applied to a transmitting end in a distributed system, where the distributed system includes a receiving end and at least A sender.
第二方面,提供了一种数据接收方法,所述方法包括:In a second aspect, a data receiving method is provided, the method comprising:
接收端接收发送端发送的第一数据包,所述第一数据包由所述发送端从标签资源池获取一个标签后根据待发送业务数据生成,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;The receiving end receives the first data packet sent by the sending end, and the first data packet is generated by the sending end by acquiring a label from the label resource pool, and is generated according to the to-be-sent service data, where the label resource pool has a label indicating the sending The terminal currently has the right to send service data to the receiving end;
所述接收端基于当前的业务数据处理能力,对所述业务数据进行处理。The receiving end processes the service data based on the current service data processing capability.
结合第二方面,在第二方面的第一种可能实现方式中,所述方法还包括:With reference to the second aspect, in a first possible implementation manner of the second aspect, the method further includes:
所述接收端向所述发送端发送第二数据包,所述第二数据包包含所述第一数据包中的标签和对所述第一数据包中业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果。The receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where The indication data is used to indicate a processing result of the service data by the receiving end.
结合第二方面的上述任一种可能实现方式,在第二方面的第二种可能实现方式中,所述方法应用于分布式系统中的接收端,所述分布式系统包括接收端和至少一个发送端。With reference to any of the foregoing possible implementation manners of the second aspect, in a second possible implementation manner of the second aspect, the method is applied to a receiving end in a distributed system, where the distributed system includes a receiving end and at least one The sender.
第三方面,提供了一种数据发送装置,所述装置包括:In a third aspect, a data transmitting apparatus is provided, the apparatus comprising:
标签获取模块,用于从标签资源池中获取一个标签,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;a label obtaining module, configured to obtain a label from a label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send service data to the receiving end;
数据包生成模块,用于根据所述发送端的待发送业务数据,生成第一数据包;a data packet generating module, configured to generate a first data packet according to the to-be-sent service data of the sending end;
发送模块,用于向所述接收端发送所述数据包生成模块生成的第一数据包。And a sending module, configured to send, to the receiving end, the first data packet generated by the data packet generating module.
结合第三方面,在第三方面的第一种可能实现方式中,所述第一数据包包 括所述获取的标签和所述业务数据。With reference to the third aspect, in a first possible implementation manner of the third aspect, the first data packet The acquired tag and the business data are included.
结合第三方面的上述任一种可能实现方式,在第三方面的第二种可能实现方式中,所述标签获取模块还用于若确定所述标签资源池中存在至少一个标签,则从所述标签资源池中获取一个标签。With reference to any one of the foregoing possible implementations of the third aspect, in a second possible implementation manner of the third aspect, the label obtaining module is further configured to: if it is determined that at least one label exists in the label resource pool, Get a label in the label resource pool.
结合第三方面的上述任一种可能实现方式,在第三方面的第三种可能实现方式中,所述装置还包括:In conjunction with any of the foregoing possible implementations of the third aspect, in a third possible implementation manner of the third aspect, the device further includes:
标签资源池生成模块,用于根据所述接收端的业务数据处理能力,生成所述标签资源池。The label resource pool generating module is configured to generate the label resource pool according to the service data processing capability of the receiving end.
结合第三方面的上述任一种可能实现方式,在第三方面的第四种可能实现方式中,所述标签资源池生成模块还用于根据所述发送端与所述接收端之间的传输延迟时间,以及所述接收端处理一个数据包的时间,计算所述一个数据包的总处理时间;获取所述接收端的业务数据处理能力,所述业务数据处理能力用于指示所述接收端在单位时间内处理的数据包的最大个数;将所述业务数据处理能力与所述一个数据包的总处理时间的乘积作为所述接收端的总处理能力数值;根据所述总处理能力数值,生成所述标签资源池,所述标签资源池的标签数目等于所述总处理能力数值。With the foregoing possible implementation manner of the foregoing aspect, in a fourth possible implementation manner of the third aspect, the label resource pool generating module is further configured to perform transmission according to the sending end and the receiving end a delay time, and a time when the receiving end processes a data packet, calculating a total processing time of the one data packet; acquiring a service data processing capability of the receiving end, where the service data processing capability is used to indicate that the receiving end is The maximum number of data packets processed per unit time; the product of the service data processing capability and the total processing time of the one data packet is used as the total processing capability value of the receiving end; and generated according to the total processing capability value The label resource pool, the label number of the label resource pool is equal to the total processing capability value.
结合第三方面的上述任一种可能实现方式,在第三方面的第五种可能实现方式中,所述装置还包括:In conjunction with any of the foregoing possible implementations of the third aspect, in a fifth possible implementation manner of the third aspect, the device further includes:
删除模块,用于将所述标签获取模块获取的标签从所述标签资源池中删除。And a deleting module, configured to delete the label acquired by the label obtaining module from the label resource pool.
结合第三方面的上述任一种可能实现方式,在第三方面的第六种可能实现方式中,所述装置还包括:With reference to any of the foregoing possible implementations of the third aspect, in a sixth possible implementation manner of the third aspect, the device further includes:
接收模块,用于接收所述接收端发送的第二数据包,所述第二数据包包括所述获取的标签和对所述业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果;a receiving module, configured to receive a second data packet sent by the receiving end, where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate Decoding the processing result of the service data by the receiving end;
标签回收模块,用于将所述接收模块接收到的第二数据包中的标签回收至所述标签资源池。And a label recycling module, configured to collect the label in the second data packet received by the receiving module into the label resource pool.
结合第三方面的上述任一种可能实现方式,在第三方面的第七种可能实现方式中,所述装置还包括:With reference to any of the foregoing possible implementations of the third aspect, in a seventh possible implementation manner of the third aspect, the device further includes:
存储模块,用于存储所述业务数据的详情信息,所述详情信息包括所述待发送业务数据的内存地址; a storage module, configured to store detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
建立关系模块,用于建立所述标签与所述详情信息的对应关系;Establishing a relationship module, configured to establish a correspondence between the label and the detailed information;
内存地址获取模块,用于根据所述建立关系模块建立的对应关系,获取所述标签对应的内存地址;a memory address obtaining module, configured to acquire a memory address corresponding to the label according to the correspondence established by the establishing relationship module;
内存空间回收模块,用于根据所述内存地址获取模块获取的内存地址,回收所述内存地址指示的内存空间。The memory space recovery module is configured to recover the memory space indicated by the memory address according to the memory address obtained by the memory address acquisition module.
结合第三方面的上述任一种可能实现方式,在第三方面的第八种可能实现方式中,所述装置还包括:In conjunction with any of the foregoing possible implementations of the third aspect, in an eighth possible implementation manner of the third aspect, the device further includes:
计时模块,用于在所述标签获取模块从所述标签资源池中获取一个标签时,开始计时;a timing module, configured to start timing when the label obtaining module acquires a label from the label resource pool;
标签生成模块,用于若所述计时模块的计时时长达到预设时长,且所述标签获取模块获取的标签未回收至所述标签资源池中时,重新生成所述标签;a label generating module, configured to regenerate the label if the timing of the timing module reaches a preset duration and the label acquired by the label obtaining module is not recycled to the label resource pool;
所述数据包生成模块,还用于根据所述标签生成模块重新生成的所述标签和所述业务数据,重新生成所述第一数据包;The data packet generating module is further configured to regenerate the first data packet according to the label and the service data regenerated by the label generation module;
所述发送模块,还用于向所述接收端发送所述数据包生成模块重新生成的第一数据包。The sending module is further configured to send, to the receiving end, a first data packet that is regenerated by the data packet generating module.
第四方面,提供了一种数据接收装置,所述数据接收装置应用于接收端,所述装置包括:According to a fourth aspect, a data receiving apparatus is provided, where the data receiving apparatus is applied to a receiving end, and the apparatus includes:
接收模块,用于接收发送端发送的第一数据包,所述第一数据包由所述发送端从标签资源池获取一个标签后根据待发送业务数据生成,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;a receiving module, configured to receive a first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label resource pool has a label representation The sending end currently has the right to send service data to the receiving end;
处理模块,用于基于当前的业务数据处理能力,对所述接收模块接收到的第一数据包中的业务数据进行处理。The processing module is configured to process the service data in the first data packet received by the receiving module based on the current service data processing capability.
结合第四方面,在第四方面的第一种可能实现方式中,所述装置还包括:With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the device further includes:
发送模块,用于向所述发送端发送第二数据包,所述第二数据包包含所述第一数据包中的标签和对所述第一数据包中业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果。a sending module, configured to send a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, The indication data is used to indicate a processing result of the service data by the receiving end.
第五方面,提供了一种数据传输系统,所述系统包括:接收端和至少一个发送端;A fifth aspect provides a data transmission system, where the system includes: a receiving end and at least one transmitting end;
每个发送端用于从标签资源池中获取一个标签,所述标签资源池中存在标 签表示所述发送端当前具备向接收端发送业务数据的权限;根据所述发送端的待发送业务数据,生成第一数据包;向所述接收端发送所述第一数据包。Each sender is configured to obtain a label from a label resource pool, where the label resource pool has a label The sign indicates that the sending end currently has the right to send the service data to the receiving end; the first data packet is generated according to the to-be-sent service data of the sending end; and the first data packet is sent to the receiving end.
所述接收端用于接收任一发送端发送的第一数据包;基于当前的业务数据处理能力,对所述接收到的第一数据包中的业务数据进行处理。The receiving end is configured to receive a first data packet sent by any sending end, and process the service data in the received first data packet according to a current service data processing capability.
结合第五方面,在第五方面的第一种可能实现方式中,所述发送所述第一数据包的发送端还用于将所述获取的标签从所述标签资源池中删除;With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the sending end that sends the first data packet is further used to delete the acquired label from the label resource pool;
发送所述第一数据包的发送端还用于接收所述接收端返回的第二数据包,并将所述第二数据包中的所述标签回收至所述标签资源池。The sending end of the first data packet is further configured to receive the second data packet returned by the receiving end, and collect the label in the second data packet into the label resource pool.
结合第五方面的上述任一种可能实现方式,在第五方面的第二种可能实现方式中,所述系统为分布式系统,所述分布式系统包括多个发送端和所述接收端。With reference to any one of the foregoing possible implementation manners of the fifth aspect, in a second possible implementation manner of the fifth aspect, the system is a distributed system, where the distributed system includes multiple sending ends and the receiving end.
本发明实施例提供的技术方案的有益效果是:The beneficial effects of the technical solutions provided by the embodiments of the present invention are:
本发明实施例通过在标签资源池中存在标签,即发送端当前具备向接收端发送业务数据的权限的前提下,从标签资源池中获取一个标签,并根据待发送业务数据发送第一数据包,使得接收端接收该第一数据包后,能够基于当前的业务数据处理能力对业务数据进行处理,保证了发送端能够在接收端当前具备业务数据处理能力的情况下才发送业务数据,以免超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。In the embodiment of the present invention, a label is obtained in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, and sends the first data packet according to the service data to be sent. After receiving the first data packet, the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data only when the receiving end currently has the service data processing capability, so as not to exceed The current service data processing capability of the receiving end avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
进一步地,通过根据获取的标签和待发送业务数据生成第一数据包,并向接收端发送该第一数据包,使得标签资源池中已被获取的标签数目等于已发送的数据包数目,从而使得标签资源池中的剩余标签数目可以精确指示接收端当前的业务数据处理能力,即标签资源池中存在标签可以表示发送端当前具备向接收端发送业务数据的权限。Further, the first data packet is generated according to the acquired label and the to-be-sent service data, and the first data packet is sent to the receiving end, so that the number of labels that have been acquired in the label resource pool is equal to the number of sent data packets, thereby The number of the remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiving end. That is, the label in the label resource pool can indicate that the sending end currently has the right to send the service data to the receiving end.
进一步地,通过在发送端确定标签资源池中存在至少一个标签时,才从标签资源池中获取一个标签,节省了获取标签的执行步骤,提高了获取标签的成功率。Further, when the at least one label in the label resource pool is determined by the sending end, the label is obtained from the label resource pool, which saves the execution step of obtaining the label and improves the success rate of acquiring the label.
进一步地,通过根据接收端的业务处理能力,生成标签资源池,即根据发送端与接收端之间的传输延迟时间、接收端对一个数据包的处理时间以及接收端在单位时间内处理的数据包的最大个数,计算接收端的总处理能力数值,并根据该总处理能力数值生成标签资源池,标签资源池中的初始标签数目能够精 确地指示接收端对发送端的总业务数据处理能力,使得发送端能够以初始标签数目和已发送的数据包数目所确定的剩余标签数目来表示接收端当前的业务数据处理能力,保证了标签资源池中存在标签可以表示发送端当前具备向接收端发送业务数据的权限,提高了准确度,保证了发送端能够在接收端当前具备的业务数据处理能力的情况下才发送业务数据,避免了传输失败的问题,提高了传输成功率,提高了灵活性。Further, the tag resource pool is generated according to the service processing capability of the receiving end, that is, the transmission delay time between the transmitting end and the receiving end, the processing time of the receiving end for one data packet, and the data packet processed by the receiving end in the unit time. The maximum number of the calculation, the total processing capacity value of the receiving end is calculated, and the label resource pool is generated according to the total processing capability value, and the initial number of labels in the label resource pool can be refined. Exactly indicating the total service data processing capability of the receiving end to the transmitting end, so that the transmitting end can indicate the current service data processing capability of the receiving end by the number of initial labels determined by the number of initial labels and the number of transmitted data packets, and the label resources are guaranteed. The presence of a label in the pool indicates that the sender currently has the right to send service data to the receiver, which improves the accuracy and ensures that the sender can send service data only when the receiver has the service data processing capability currently available on the receiver. The problem of failure increases the transmission success rate and increases flexibility.
进一步地,通过将获取的标签从所述标签资源池中删除,保证了标签资源池中存在标签可以准确表示发送端当前具备向接收端发送业务数据的权限,提高了剩余标签数目的准确度。Further, by deleting the obtained label from the label resource pool, it is ensured that the label in the label resource pool can accurately indicate that the sending end currently has the right to send the service data to the receiving end, and the accuracy of the remaining number of labels is improved.
进一步地,通过将该接收端返回的第二数据包中的标签回收至标签资源池,在接收端处理第一数据包结束时,通过回收的方式增加标签资源池中的剩余标签数目,保证了增加标签数目后,标签资源池中的剩余标签数目能够精确地指示接收端当前的业务数据处理能力,标签资源池中存在标签可以准确表示发送端当前具备向接收端发送业务数据的权限,提高了精确度。Further, by recycling the label in the second data packet returned by the receiving end to the label resource pool, when the receiving end processes the first data packet, the number of remaining labels in the label resource pool is increased by the recycling manner, thereby ensuring After the number of labels is increased, the number of remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiving end. The label in the label resource pool can accurately indicate that the sending end currently has the right to send service data to the receiving end, which improves the Accuracy.
进一步地,通过存储业务数据的详情信息,并建立标签与该详情信息的对应关系,在接收到第二数据包时,根据对应关系可以查询该标签对应的内存地址,并根据该内存地址回收内存地址指示的内存空间。通过以标签来标记业务数据的详情信息,无需在发送第一数据包时携带该详情信息也可以确定业务数据的详情信息,节省了带宽,提高了灵活性。而且在接收端对第一数据包处理完成时,及时地回收内存地址指示的内存空间,节省了内存资源。Further, by storing the detailed information of the service data, and establishing a correspondence between the label and the detailed information, when the second data packet is received, the memory address corresponding to the label may be queried according to the corresponding relationship, and the memory is reclaimed according to the memory address. The memory space indicated by the address. By tagging the detailed information of the service data with the tag, it is not necessary to carry the detailed information when the first data packet is sent, and the detailed information of the service data can be determined, which saves bandwidth and improves flexibility. Moreover, when the receiving end completes processing of the first data packet, the memory space indicated by the memory address is recovered in time, thereby saving memory resources.
进一步地,通过从标签资源池中获取标签时,开始计时,当计时时长达到预设时长时,如果标签还未回收至标签资源池,则重新生成对应的标签,并根据重新生成的标签和业务数据,重新生成第一数据包,向接收端发送重新生成的第一数据包,使得接收端能够重新对该业务数据进行处理,避免了业务数据处理失败的问题,且避免了在接收端未对业务数据进行处理时减小标签数目的问题,保证了剩余标签数目能够精确地指示接收端当前的业务数据处理能力,标签资源池中存在标签可以准确表示发送端当前具备向接收端发送业务数据的权限,提高了精确度。Further, when the label is obtained from the label resource pool, timing is started. When the timer duration reaches the preset duration, if the label has not been recycled to the label resource pool, the corresponding label is regenerated, and the regenerated label and service are generated according to the label. Data, regenerating the first data packet, and sending the regenerated first data packet to the receiving end, so that the receiving end can re-process the service data, avoiding the problem that the service data processing fails, and avoiding that the receiving end is not correct. The problem of reducing the number of labels in the processing of the service data ensures that the number of remaining labels can accurately indicate the current service data processing capability of the receiving end. The presence of the label in the label resource pool can accurately indicate that the transmitting end currently has the service data to be sent to the receiving end. Permissions, increased accuracy.
进一步地,通过根据标签是否回收超时来判断接收端是否在位,能够获取接收端当前的状态,并能够将接收端当前的状态上传至上层软件,以便上层软件根据接收端当前的状态对发送端进行协调控制,提高了灵活性。 Further, by determining whether the receiving end is in position according to whether the label is reclaimed, the current state of the receiving end can be obtained, and the current state of the receiving end can be uploaded to the upper layer software, so that the upper layer software can send the transmitting end according to the current state of the receiving end. Coordinated control for increased flexibility.
进一步地,通过在从标签资源池中未获取到任一标签时,暂停发送业务数据,直至从标签资源池中获取到标签时,再根据获取到的标签和业务数据生成第一数据包,向接收端发送该第一数据包,能够保证发送端在接收端具备业务数据处理能力的情况下才发送业务数据,避免了传输失败的问题,提高了传输成功率。Further, when any label is not obtained from the label resource pool, the service data is suspended, and when the label is obtained from the label resource pool, the first data packet is generated according to the obtained label and the service data. The receiving end sends the first data packet, which can ensure that the transmitting end sends the service data only when the receiving end has the service data processing capability, thereby avoiding the problem of the transmission failure and improving the transmission success rate.
进一步地,通过在标签回收超时时,根据对应关系查询该标签对应的详情信息,确定该详情信息中的内存地址,并回收该内存地址指示的内存空间,能够避免内存泄露,提高了灵活性。Further, when the label recovery timeout is performed, the detailed information corresponding to the label is queried according to the corresponding relationship, the memory address in the detailed information is determined, and the memory space indicated by the memory address is recovered, thereby avoiding memory leakage and improving flexibility.
进一步地,该发送端可以应用于分布式系统中,保证了分布式系统中的多个发送端可以自行进行流量控制,不会对其他发送端造成影响,便于对分布式系统中各个发送端的有序管理,具有较高的灵活性。Further, the transmitting end can be applied to a distributed system, which ensures that multiple transmitting ends in the distributed system can perform flow control by themselves without affecting other transmitting ends, and is convenient for each transmitting end in the distributed system. Order management, with high flexibility.
附图说明DRAWINGS
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention. Other drawings may also be obtained from those of ordinary skill in the art in light of the inventive work.
图1是本发明实施例提供的一种数据传输系统的结构示意图;1 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention;
图2是本发明实施例提供的一种分布式加速系统的结构示意图;2 is a schematic structural diagram of a distributed acceleration system according to an embodiment of the present invention;
图3是本发明实施例提供的另一种分布式加速系统的结构示意图;3 is a schematic structural diagram of another distributed acceleration system according to an embodiment of the present invention;
图4是本发明实施例提供的一种数据发送设备的结构示意图;4 is a schematic structural diagram of a data sending device according to an embodiment of the present invention;
图5是本发明实施例提供的一种数据接收设备的结构示意图;FIG. 5 is a schematic structural diagram of a data receiving device according to an embodiment of the present disclosure;
图6是本发明实施例提供的一种数据发送装置的结构示意图;FIG. 6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present invention;
图7是本发明实施例提供的一种数据接收装置的结构示意图;FIG. 7 is a schematic structural diagram of a data receiving apparatus according to an embodiment of the present invention;
图8是本发明实施例提供的一种数据传输方法流程图;FIG. 8 is a flowchart of a data transmission method according to an embodiment of the present invention;
图9是本发明实施例提供的一种数据发送方法流程图;FIG. 9 is a flowchart of a data sending method according to an embodiment of the present invention;
图10是本发明实施例提供的一种数据接收方法流程图。FIG. 10 is a flowchart of a data receiving method according to an embodiment of the present invention.
具体实施方式detailed description
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。 The embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
图1是本发明实施例提供的一种数据传输系统的结构示意图,参见图1,该系统包括发送端101和接收端102。FIG. 1 is a schematic structural diagram of a data transmission system according to an embodiment of the present invention. Referring to FIG. 1, the system includes a transmitting end 101 and a receiving end 102.
发送端101用于从标签资源池中获取一个标签,标签资源池中存在标签表示发送端101当前具备向接收端发送业务数据的权限;根据发送端101的待发送业务数据,生成第一数据包;向接收端102发送该第一数据包;The sending end 101 is configured to obtain a label from the label resource pool, and the label in the label resource pool indicates that the sending end 101 currently has the right to send the service data to the receiving end; and the first data packet is generated according to the service data to be sent by the sending end 101. Transmitting the first data packet to the receiving end 102;
接收端102用于接收发送端101发送的第一数据包;基于当前的业务数据处理能力,对接收到的第一数据包中的业务数据进行处理。The receiving end 102 is configured to receive the first data packet sent by the sending end 101, and process the service data in the received first data packet based on the current service data processing capability.
可选地,该第一数据包包括该获取的标签和业务数据。Optionally, the first data packet includes the acquired label and service data.
可选地,该发送端101还用于若确定该标签资源池中存在至少一个标签,则从标签资源池中获取一个标签。Optionally, the sending end 101 is further configured to: obtain a label from the label resource pool if it is determined that at least one label exists in the label resource pool.
可选地,该发送端101还用于在根据发送端101的待发送业务数据,生成第一数据包之前,根据接收端102的业务数据处理能力,生成标签资源池。Optionally, the sending end 101 is further configured to generate a label resource pool according to the service data processing capability of the receiving end 102 before generating the first data packet according to the to-be-sent service data of the sending end 101.
可选地,该发送端101还用于在根据发送端101的待发送业务数据,生成第一数据包之前,根据发送端101与接收端102之间的传输延迟时间,以及接收端102处理一个数据包的时间,计算一个数据包的总处理时间;获取接收端102的业务数据处理能力,该业务数据处理能力用于指示该接收端在单位时间内处理的数据包的最大个数;将该业务数据处理能力与该一个数据包的总处理时间的乘积作为该接收端的总处理能力数值;根据该总处理能力数值,生成标签资源池,该标签资源池的标签数目等于该总处理能力数值。Optionally, the sending end 101 is further configured to: before the first data packet is generated according to the to-be-sent service data of the sending end 101, according to a transmission delay time between the transmitting end 101 and the receiving end 102, and the receiving end 102 processes one The time of the data packet, the total processing time of a data packet is calculated; the service data processing capability of the receiving end 102 is obtained, and the service data processing capability is used to indicate the maximum number of data packets processed by the receiving end in a unit time; The product of the service data processing capability and the total processing time of the one data packet is used as the total processing capability value of the receiving end; according to the total processing capability value, a label resource pool is generated, and the label resource pool has a label number equal to the total processing capability value.
可选地,该发送端101还用于将获取的标签从该标签资源池中删除。Optionally, the sending end 101 is further configured to delete the obtained label from the label resource pool.
可选地,该接收端102还用于向该发送端101发送第二数据包,该第二数据包包含该第一数据包中的标签和对该第一数据包中业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果;该发送端101还用于接收该接收端102发送的第二数据包,并将该第二数据包中包含的标签回收至该标签资源池。Optionally, the receiving end 102 is further configured to send, to the sending end 101, a second data packet, where the second data packet includes a label in the first data packet, and is processed by processing the service data in the first data packet. The indication data is used to indicate the processing result of the service data by the receiving end; the sending end 101 is further configured to receive the second data packet sent by the receiving end 102, and the label included in the second data packet Recycle to the tag resource pool.
可选地,发送端101还用于在根据获取的标签和该终端的待发送业务数据,生成第一数据包之后,存储该业务数据的详情信息,该详情信息包括该待发送业务数据的内存地址;建立该标签与该详情信息的对应关系;在接收到该接收端102发送的该第二数据包之后,根据该对应关系,获取该标签对应的内存地址;根据该内存地址,回收该内存地址指示的内存空间。Optionally, the sending end 101 is further configured to: after generating the first data packet according to the acquired label and the to-be-sent service data of the terminal, storing the detailed information of the service data, where the detailed information includes the memory of the service data to be sent. An address; establishing a correspondence between the label and the detailed information; after receiving the second data packet sent by the receiving end 102, acquiring a memory address corresponding to the label according to the corresponding relationship; and recovering the memory according to the memory address The memory space indicated by the address.
可选地,该发送端101还用于从标签资源池中获取一个标签时,开始计时; 若计时时长达到预设时长,且该获取的标签未回收至该标签资源池中,则该发送端101重新生成该标签,根据重新生成的该标签和该业务数据,重新生成该第一数据包,向该接收端102发送重新生成的第一数据包。Optionally, the sending end 101 is further configured to start timing when acquiring a label from the label resource pool; If the timeout period reaches the preset duration, and the acquired label is not reclaimed into the label resource pool, the sending end 101 regenerates the label, and regenerates the first data packet according to the regenerated label and the service data. Sending the regenerated first data packet to the receiving end 102.
可选地,该系统为分布式系统,该分布式系统包括接收端102和两个或两个以上的发送端101。Optionally, the system is a distributed system comprising a receiving end 102 and two or more transmitting ends 101.
进一步地,该数据传输系统可以为分布式加速系统,参见图2,该分布式加速系统包括多个本地业务服务器201和多个远端加速服务器202,其中,每个远端加速服务器202配置有加速引擎。其中,多个具体指的是两个或两个以上,不再赘述。Further, the data transmission system may be a distributed acceleration system. Referring to FIG. 2, the distributed acceleration system includes a plurality of local service servers 201 and a plurality of remote acceleration servers 202, wherein each remote acceleration server 202 is configured with Accelerate the engine. Wherein, a plurality of specific references are two or more, and are not described again.
本地业务服务器201可以申请远端加速服务器202的加速处理能力,申请到一定的加速处理能力后,将需要加速的业务数据发送到远端加速服务器202,该远端加速服务器202可以接收该业务数据,利用其配置的加速引擎,对该业务数据进行加速处理,并将加速处理后得到的指示数据返回至该本地业务服务器201。The local service server 201 can apply for the acceleration processing capability of the remote acceleration server 202, and after applying for a certain acceleration processing capability, send the service data that needs to be accelerated to the remote acceleration server 202, and the remote acceleration server 202 can receive the service data. And using the configured acceleration engine to accelerate the service data, and return the instruction data obtained after the acceleration processing to the local service server 201.
以本地业务服务器201作为发送端,以远端加速服务器202作为接收端,本地业务服务器201在向远端加速服务器202发送业务数据时,可以先从标签资源池中获取一个标签,该标签资源池中存在标签表示本地业务服务器201当前具备向远端加速服务器202发送业务数据的权限,并根据本地业务服务器201的待发送业务数据,生成第一数据包,向远端加速服务器202发送该第一数据包。The local service server 201 is used as the sending end, and the remote acceleration server 202 is used as the receiving end. When the local service server 201 sends the service data to the remote acceleration server 202, the label can be obtained from the label resource pool. The presence of the label indicates that the local service server 201 currently has the right to send the service data to the remote acceleration server 202, and generates a first data packet according to the service data to be sent by the local service server 201, and sends the first data packet to the remote acceleration server 202. data pack.
远端加速服务器202接收本地业务服务器201发送的第一数据包,可以基于当前具备的加速处理能力,利用配置的加速引擎对该业务数据进行加速处理。The remote acceleration server 202 receives the first data packet sent by the local service server 201, and can accelerate the service data by using the configured acceleration engine based on the currently available acceleration processing capability.
可选地,本地业务服务器201还可以将获取的标签从标签资源池中删除,接收到远端加速服务器202返回的第二数据包后,还可以将第二数据包中的标签回收至标签资源池。Optionally, the local service server 201 may also delete the obtained label from the label resource pool, and after receiving the second data packet returned by the remote acceleration server 202, the label in the second data packet may be recycled to the label resource. Pool.
更进一步地,在该分布式加速系统中,本地业务服务器201和远端加速服务器202可以直接通过端口连接,或者通过交换机连接。Further, in the distributed acceleration system, the local service server 201 and the remote acceleration server 202 can be directly connected through a port or connected through a switch.
例如,参见图3,本地业务服务器201包括本地CPU(Central Processing Unit,中央处理器)301和本地业务单板302,远端加速服务器202包括远端 CPU303和远端加速单板304。其中,本地CPU301与本地业务单板302连接,远端CPU303与远端加速单板304连接,本地业务单板302和远端加速单板304之间可通过交换机305连接。For example, referring to FIG. 3, the local service server 201 includes a local processing unit (Central Processing Unit) 301 and a local service board 302, and the remote acceleration server 202 includes a remote end. The CPU 303 and the remote acceleration board 304. The local CPU 301 is connected to the local service board 302, and the remote CPU 303 is connected to the remote acceleration board 304. The local service board 302 and the remote acceleration board 304 can be connected through the switch 305.
另外,本地业务单板302和远端加速单板304分别包括多个AE(Accelerate Engine,加速引擎)模块和多个rAE(Remote Accelerate Engine,远端加速引擎)管理模块,其中,AE模块用于对本地业务数据进行加速处理,也可以接收其它单板发送的业务数据,并对该业务数据进行加速处理,返回处理完成的指示数据,rAE管理模块用于根据处理器发送的指令,向配置有AE模块的其它单板发送业务数据,由其它单板对该业务数据进行加速处理,并接收返回的指示数据。In addition, the local service board 302 and the remote acceleration board 304 respectively include a plurality of AE (Accelerate Engine) modules and a plurality of rAE (Remote Accelerate Engine) management modules, wherein the AE module is used for The local service data is accelerated, and the service data sent by other boards is received, and the service data is accelerated, and the instruction data of the processing completion is returned. The rAE management module is configured to configure according to the instructions sent by the processor. The other boards of the AE module send service data, and the other boards accelerate the service data and receive the returned indication data.
本地业务单板302在根据本地CPU301发送的指令,向远端加速单板304发送业务数据的过程中,可以先从标签资源池中获取一个标签,标签资源池中存在标签表示本地业务单板302当前具备向远端加速单板304发送业务数据的权限,并根据本地业务单板302的待发送业务数据,生成第一数据包,向向远端加速单板304发送该第一数据包,该远端加速单板304可以接收本地业务单板302发送第一数据包,并基于当前的业务数据处理能力,对该业务数据进行处理。The local service board 302 obtains a label from the label resource pool in the process of sending the service data to the remote acceleration board 304 according to the instruction sent by the local CPU 301. The label resource pool has a label indicating the local service board 302. Currently, the user has the right to send the service data to the remote acceleration board 304, and generates the first data packet according to the to-be-sent service data of the local service card 302, and sends the first data packet to the remote acceleration board 304. The remote acceleration board 304 can receive the first service packet sent by the local service board 302, and process the service data based on the current service data processing capability.
上述实施例中所示的发送端和接收端可以位于同一设备中,也可以位于不同设备中。例如,发送端和接收端可以为同一设备中的不同模块,两个模块之间可以进行交互。或者,发送端位于数据发送设备,接收端位于数据接收设备,数据发送设备和数据接收设备之间可以进行交互,具体可以参见下述实施例。The transmitting end and the receiving end shown in the foregoing embodiments may be located in the same device or may be located in different devices. For example, the sender and the receiver can be different modules in the same device, and the two modules can interact with each other. Alternatively, the sending end is located in the data sending device, and the receiving end is located in the data receiving device, and the data sending device and the data receiving device can interact with each other. For details, refer to the following embodiments.
图4是本发明实施例提供的一种数据发送设备的结构示意图,参见图4,包括:接收器401、发射器402、存储器404和处理器404,该接收器401、该发射器402和该存储器404分别与该处理器404连接,该存储器404存储有程序代码,该处理器404用于调用该程序代码,执行以下操作:FIG. 4 is a schematic structural diagram of a data sending device according to an embodiment of the present invention. Referring to FIG. 4, the device includes: a receiver 401, a transmitter 402, a memory 404, and a processor 404. The receiver 401, the transmitter 402, and the The memory 404 is respectively connected to the processor 404. The memory 404 stores program code, and the processor 404 is configured to call the program code to perform the following operations:
从标签资源池中获取一个标签,标签资源池中存在标签表示发送端当前具备向接收端发送业务数据的权限;Obtain a label from the label resource pool. The label in the label resource pool indicates that the sender currently has the right to send service data to the receiver.
根据该发送端的待发送业务数据,生成第一数据包;Generating a first data packet according to the to-be-sent service data of the sending end;
通过发射器402,向接收端发送该第一数据包。The first data packet is transmitted to the receiving end by the transmitter 402.
可选地,该第一数据包包括该获取的标签和该业务数据。 Optionally, the first data packet includes the acquired label and the service data.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
若确定该标签资源池中存在至少一个标签,则从该标签资源池中获取一个标签。If it is determined that at least one tag exists in the tag resource pool, a tag is obtained from the tag resource pool.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
根据接收端的业务数据处理能力,生成该标签资源池。The tag resource pool is generated according to the service data processing capability of the receiving end.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
根据该发送端与该接收端之间的传输延迟时间,以及该接收端处理一个数据包的时间,计算该一个数据包的总处理时间;获取该接收端的业务数据处理能力,该业务数据处理能力用于指示该接收端在单位时间内处理的数据包的最大个数;将该业务数据处理能力与该一个数据包的总处理时间的乘积作为该接收端的总处理能力数值;根据该总处理能力数值,生成该标签资源池,该标签资源池的标签数目等于该总处理能力数值。Calculating a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes a data packet; acquiring a service data processing capability of the receiving end, the service data processing capability The maximum number of data packets used by the receiving end to process in a unit time; the product of the service data processing capability and the total processing time of the one data packet is used as the total processing capability value of the receiving end; according to the total processing capability The value is generated, and the label resource pool is generated, and the label resource pool has a label number equal to the total processing capability value.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
将该获取的标签从该标签资源池中删除。The obtained tag is deleted from the tag resource pool.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
通过接收器401接收该接收端发送的第二数据包,该第二数据包包括该获取的标签和对该业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果;将该第二数据包中包含的该获取的标签回收至该标签资源池。Receiving, by the receiver 401, the second data packet sent by the receiving end, where the second data packet includes the acquired label and the indication data obtained by processing the service data, where the indication data is used to indicate that the receiving end is to the service data. The processing result; the acquired label included in the second data packet is recycled to the label resource pool.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
存储该业务数据的详情信息,该详情信息包括该待发送业务数据的内存地址;建立该标签与该详情信息的对应关系;根据该对应关系,获取该标签对应的内存地址;根据该内存地址,回收该内存地址指示的内存空间。Storing the detailed information of the service data, the specific information includes a memory address of the service data to be sent; establishing a correspondence between the tag and the detailed information; and obtaining, according to the correspondence, a memory address corresponding to the tag; according to the memory address, Reclaims the memory space indicated by this memory address.
可选地,该处理器404用于调用该程序代码,执行以下操作:Optionally, the processor 404 is configured to invoke the program code to perform the following operations:
从标签资源池中获取一个标签时,开始计时;若计时时长达到预设时长,且该获取的标签未回收至该标签资源池中,则该发送端重新生成该标签,根据重新生成的该标签和该业务数据,重新生成该第一数据包,向该接收端发送重新生成的第一数据包。When a tag is obtained from the tag resource pool, the timer is started; if the timer duration reaches the preset duration, and the acquired tag is not reclaimed into the tag resource pool, the sender regenerates the tag according to the regenerated tag. And the service data, regenerating the first data packet, and sending the regenerated first data packet to the receiving end.
图5是本发明实施例提供的一种数据接收设备的结构示意图,参见图5,包括:接收器501、发射器502、存储器503和处理器504,该接收器501、该 发射器502和该存储器503分别与该处理器504连接,该存储器503存储有程序代码,该处理器504用于调用该程序代码,执行以下操作:FIG. 5 is a schematic structural diagram of a data receiving device according to an embodiment of the present invention. Referring to FIG. 5, the device includes: a receiver 501, a transmitter 502, a memory 503, and a processor 504. The receiver 501, the The transmitter 502 and the memory 503 are respectively connected to the processor 504. The memory 503 stores program code, and the processor 504 is configured to call the program code to perform the following operations:
通过接收器501,接收发送端发送的第一数据包,该第一数据包由该发送端从标签资源池获取一个标签后根据待发送业务数据生成,该标签资源池中存在标签表示该发送端当前具备向接收端发送业务数据的权限;Receiving, by the receiver 501, the first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label exists in the label resource pool to indicate the sending end Currently has the right to send business data to the receiving end;
基于当前的业务数据处理能力,对该业务数据进行处理。The business data is processed based on current business data processing capabilities.
可选地,该处理器504用于调用该程序代码,执行以下操作:Optionally, the processor 504 is configured to invoke the program code to perform the following operations:
通过发射器502向发送端发送第二数据包,该第二数据包包含该第一数据包中的标签和对该第一数据包中业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果。Transmitting, by the transmitter 502, a second data packet to the transmitting end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where the indication data is used to indicate The result of processing the service data by the receiving end.
图6是本发明实施例提供的一种数据发送装置的结构示意图,该数据发送装置应用于发送端,参见图6,该装置包括:标签获取模块601、数据包生成模块602和发送模块603。FIG. 6 is a schematic structural diagram of a data sending apparatus according to an embodiment of the present invention. The data sending apparatus is applied to a transmitting end. Referring to FIG. 6, the apparatus includes: a label obtaining module 601, a data packet generating module 602, and a sending module 603.
标签获取模块601,用于从标签资源池中获取一个标签,该标签资源池中存在标签表示该发送端当前具备向接收端发送业务数据的权限;The label obtaining module 601 is configured to obtain a label from the label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send the service data to the receiving end;
数据包生成模块602,用于根据该发送端的待发送业务数据,生成第一数据包;a data packet generating module 602, configured to generate a first data packet according to the to-be-sent service data of the sending end;
发送模块603,用于向接收端发送该第一数据包。The sending module 603 is configured to send the first data packet to the receiving end.
本发明实施例提供的装置,通过在标签资源池中存在标签,即发送端当前具备向接收端发送业务数据的权限的前提下,从标签资源池中获取一个标签,并根据待发送业务数据发送第一数据包,使得接收端接收该第一数据包后,能够基于当前的业务数据处理能力对业务数据进行处理,保证了发送端能够在接收端当前具备业务数据处理能力的情况下才发送业务数据,以免超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。The device provided by the embodiment of the present invention obtains a label from the label resource pool, and sends a label according to the to-be-sent service data, on the premise that the label has a right to send the service data to the receiving end. The first data packet enables the receiving end to process the service data based on the current service data processing capability after receiving the first data packet, thereby ensuring that the transmitting end can send the service only when the receiving end currently has the service data processing capability. Data, so as to avoid exceeding the current service data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
可选地,该第一数据包包括该获取的标签和该业务数据。Optionally, the first data packet includes the acquired label and the service data.
可选地,该标签获取模块601还用于若确定该标签资源池中存在至少一个标签,则从该标签资源池中获取一个标签。Optionally, the label obtaining module 601 is further configured to: obtain a label from the label resource pool if it is determined that at least one label exists in the label resource pool.
可选地,该装置还包括:Optionally, the device further includes:
标签资源池生成模块604,用于根据该接收端的业务数据处理能力,生成 该标签资源池。a label resource pool generating module 604, configured to generate, according to the service data processing capability of the receiving end, The tag resource pool.
可选地,该标签资源池生成模块601还用于根据该发送端与该接收端之间的传输延迟时间,以及该接收端处理一个数据包的时间,计算该一个数据包的总处理时间;获取该接收端的业务数据处理能力,该业务数据处理能力用于指示该接收端在单位时间内处理的数据包的最大个数;将该业务数据处理能力与该一个数据包的总处理时间的乘积作为该接收端的总处理能力数值;根据该总处理能力数值,生成该标签资源池,该标签资源池的标签数目等于该总处理能力数值。Optionally, the label resource pool generating module 601 is further configured to calculate a total processing time of the one data packet according to a transmission delay time between the sending end and the receiving end, and a time when the receiving end processes a data packet. Obtaining a service data processing capability of the receiving end, where the service data processing capability is used to indicate a maximum number of data packets processed by the receiving end in a unit time; a product of the service data processing capability and the total processing time of the one data packet The total processing capability value of the receiving end is generated according to the total processing capability value, and the label resource pool has a label number equal to the total processing capability value.
可选地,该装置还包括:Optionally, the device further includes:
删除模块605,用于将该标签获取模块获取的标签从该标签资源池中删除。The deleting module 605 is configured to delete the label acquired by the label obtaining module from the label resource pool.
可选地,该装置还包括:Optionally, the device further includes:
接收模块606,用于接收该接收端发送的第二数据包,该第二数据包包括该获取的标签和对该业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果;The receiving module 606 is configured to receive the second data packet sent by the receiving end, where the second data packet includes the acquired label and the indication data obtained by processing the service data, where the indication data is used to indicate that the receiving end is Processing result of business data;
标签回收模块607,用于将该接收模块接收到的第二数据包中的标签回收至该标签资源池。The label collection module 607 is configured to collect the label in the second data packet received by the receiving module into the label resource pool.
可选地,该装置还包括:Optionally, the device further includes:
存储模块608,用于存储该业务数据的详情信息,该详情信息包括该待发送业务数据的内存地址;The storage module 608 is configured to store detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
建立关系模块609,用于建立该标签与该详情信息的对应关系;Establishing a relationship module 609, configured to establish a correspondence between the label and the detailed information;
内存地址获取模块610,用于根据该建立关系模块建立的对应关系,获取该标签对应的内存地址;The memory address obtaining module 610 is configured to obtain a memory address corresponding to the label according to the correspondence established by the establishing relationship module.
内存空间回收模块611,用于根据该内存地址获取模块获取的内存地址,回收该内存地址指示的内存空间。The memory space recovery module 611 is configured to recover the memory space indicated by the memory address according to the memory address obtained by the memory address acquisition module.
可选地,该装置还包括:Optionally, the device further includes:
计时模块612,用于在该标签获取模块从该标签资源池中获取一个标签时,开始计时;The timing module 612 is configured to start timing when the label obtaining module acquires a label from the label resource pool;
标签生成模块613,用于若该计时模块的计时时长达到预设时长,且该标签获取模块获取的标签未回收至该标签资源池中时,重新生成该标签;The label generating module 613 is configured to regenerate the label if the timing of the timing module reaches a preset duration and the label acquired by the label obtaining module is not recycled to the label resource pool;
该数据包生成模块602,还用于根据该标签生成模块重新生成的该标签和该业务数据,重新生成该第一数据包; The data packet generating module 602 is further configured to regenerate the first data packet according to the label and the service data regenerated by the label generation module.
该发送模块603,还用于向该接收端发送该数据包生成模块重新生成的第一数据包。The sending module 603 is further configured to send, to the receiving end, the first data packet that is regenerated by the data packet generating module.
图7是本发明实施例提供的一种数据接收装置的结构示意图,该数据接收装置应用于接收端,参见图7,该装置包括:接收模块701和处理模块702。FIG. 7 is a schematic structural diagram of a data receiving apparatus according to an embodiment of the present invention. The data receiving apparatus is applied to a receiving end. Referring to FIG. 7, the apparatus includes: a receiving module 701 and a processing module 702.
接收模块701,用于接收发送端发送的第一数据包,该第一数据包由该发送端从标签资源池获取一个标签后根据待发送业务数据生成,该标签资源池中存在标签表示该发送端当前具备向接收端发送业务数据的权限;The receiving module 701 is configured to receive a first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where a label exists in the label resource pool to indicate the sending The terminal currently has the right to send service data to the receiving end;
处理模块702,用于基于当前的业务数据处理能力,对接收模块701接收到的第一数据包中的业务数据进行处理。The processing module 702 is configured to process the service data in the first data packet received by the receiving module 701 based on the current service data processing capability.
本发明实施例提供的装置,通过接收在发送端具备向接收端发送业务数据的权限的前提下向接收端发送的第一数据包,能够基于当前的业务数据处理能力,对第一数据包中的业务数据进行处理,保证了发送端发送的数据包不会超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。The apparatus provided by the embodiment of the present invention can receive the first data packet sent to the receiving end on the premise that the transmitting end has the right to send the service data to the receiving end, and can be based on the current service data processing capability in the first data packet. The processing of the service data ensures that the data packet sent by the sender does not exceed the current service data processing capability of the receiving end, avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
可选地,该装置还包括:Optionally, the device further includes:
发送模块703,用于向该发送端发送第二数据包,该第二数据包包含该第一数据包中的标签和对该第一数据包中业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果。The sending module 703 is configured to send, to the sending end, a second data packet, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where the indication data is It is used to indicate the processing result of the service data by the receiving end.
在图1所示的数据传输系统的基础上,本发明实施例提供了一种应用于该数据传输系统的数据传输方法。图8是本发明实施例提供的一种数据传输方法流程图,参见图8,该方法的交互主体为发送端和接收端,该发送端和该接收端可以为终端、服务器、虚拟机、单板等设备,也可以为设备上配置的发送端口和接收端口,本发明实施例对此均不做限定。该数据传输方法包括以下步骤:Based on the data transmission system shown in FIG. 1, an embodiment of the present invention provides a data transmission method applied to the data transmission system. FIG. 8 is a flowchart of a data transmission method according to an embodiment of the present invention. Referring to FIG. 8, the interaction body of the method is a sender and a receiver, and the sender and the receiver may be a terminal, a server, a virtual machine, or a single The device, such as a board, may also be a sending port and a receiving port configured on the device, which are not limited in this embodiment of the present invention. The data transmission method includes the following steps:
801、发送端从标签资源池中获取一个标签。801. The sender obtains a label from the label resource pool.
其中,标签资源池中是否存在标签可以用于指示接收端的业务数据处理能力。若标签资源池中存在标签,即标签资源池中的标签数目大于0,则表示接收端当前具备业务数据处理能力,此时,若发送端向接收端发送业务数据,该接收端能够基于当前的业务数据处理能力对该业务数据进行处理,因此可以确定该标签资源池中存在标签时,发送端具备向接收端发送业务数据的权限。而 若标签资源池中不存在标签,即标签资源池中的标签数目为0,则表示接收端当前不具备业务数据处理能力,此时,若发送端向接收端发送业务数据,该接收端将不能对该业务数据进行处理,将丢弃该业务数据,因此可以确定该标签资源池中不存在标签时,发送端不具备向接收端发送业务数据的权限。Whether the label exists in the label resource pool can be used to indicate the service data processing capability of the receiving end. If there is a label in the label resource pool, that is, the number of labels in the label resource pool is greater than 0, it indicates that the receiving end currently has the service data processing capability. At this time, if the sending end sends the service data to the receiving end, the receiving end can be based on the current The service data processing capability processes the service data. Therefore, when the label exists in the label resource pool, the sender has the right to send the service data to the receiver. And If there is no label in the label resource pool, that is, the number of labels in the label resource pool is 0, it means that the receiving end does not currently have the service data processing capability. At this time, if the sending end sends the service data to the receiving end, the receiving end cannot The service data is processed, and the service data is discarded. Therefore, when it is determined that the label resource pool does not have a label, the sender does not have the right to send the service data to the receiver.
具体地,步骤801具体可以采用如下两种方式实施,不予限制:Specifically, step 801 can be implemented in the following two manners without limitation:
方式一,若该发送端确定该标签资源池中存在至少一个标签,则从该标签资源池中获取一个标签。In the first mode, if the sending end determines that at least one label exists in the label resource pool, a label is obtained from the label resource pool.
即,先判断该标签资源池中是否存在至少一个标签,若确定该标签资源池中存在至少一个标签,则从该标签资源池中获取一个标签;若确定该标签资源池中已经没有标签,则不执行获取步骤,直到确定该标签资源池中存在至少一个标签时,再执行从该标签资源池中获取标签的动作。That is, if there is at least one label in the label resource pool, if it is determined that at least one label exists in the label resource pool, a label is obtained from the label resource pool; if it is determined that the label resource pool has no label, The obtaining step is not performed until the at least one label exists in the label resource pool, and then the action of obtaining the label from the label resource pool is performed.
方式二、直接从标识资源池中获取一个标签。Method 2: Obtain a label directly from the identity resource pool.
即发送端不判断该标签资源池中是否存在至少一个标签,而是直接尝试从标识资源池中获取一个标签,若成功获取标签,则表示该标签资源池中的剩余标签数目大于0,接收端当前具备处理数据包的能力;而若获取标签失败,则表示该标签资源池中已经没有标签,接收端当前不具备处理数据包的能力。That is, the sender does not determine whether there is at least one label in the label resource pool, but directly attempts to obtain a label from the identifier resource pool. If the label is successfully obtained, the number of remaining labels in the label resource pool is greater than 0, and the receiving end Currently, the ability to process data packets is not available. If the label fails to be obtained, it indicates that there is no label in the label resource pool, and the receiving end does not currently have the ability to process data packets.
802、发送端根据发送端的待发送业务数据,生成第一数据包,并向接收端发送该第一数据包。802. The sending end generates a first data packet according to the to-be-sent service data of the sending end, and sends the first data packet to the receiving end.
在第一种可能的实现方式中,在从标签资源池中获取到一个标签后,该发送端可以将待发送的业务数据封装成第一数据包,并向接收端发送该第一数据包。即该第一数据包包括待发送的业务数据。In a first possible implementation, after obtaining a label from the label resource pool, the sending end may encapsulate the service data to be sent into the first data packet, and send the first data packet to the receiving end. That is, the first data packet includes service data to be transmitted.
在第二种可能的实现方式中,在从标签资源池中获取到一个标签后,该发送端可以将获取的标签和待发送的业务数据封装成第一数据包,并向接收端发送该第一数据包。即该第一数据包包括获取的标签和待发送的业务数据。In a second possible implementation manner, after obtaining a label from the label resource pool, the sending end may encapsulate the obtained label and the service data to be sent into a first data packet, and send the first data packet to the receiving end. A packet of data. That is, the first data packet includes the acquired label and the service data to be sent.
例如,若该标签资源池中剩余标签Tag89~99,则该发送端可以从标签资源池中获取Tag89,并将该Tag89与待发送的业务数据封装成第一数据包,向接收端发送该第一数据包。For example, if the tag is in the tag resource pool, the tag is obtained from the tag resource pool, and the tag is configured to obtain the tag 89 from the tag resource pool, and encapsulate the tag 89 and the service data to be sent into the first data packet, and send the packet to the receiving end. A packet of data.
需要说明的是,本实施例中,在每次要发送业务数据之前,均需要从标签资源池中获取一个标签,而且,只有在从该标签资源池中成功获取到一个标签的前提下,才会将该获取到的标签和待发送的业务数据封装成第一数据包,并向接收端发送该第一数据包,而如果未从该标签资源池中获取到标签,该发送 端将暂停发送该业务数据,直到从标签资源池中成功获取到一个标签后,才会将获取到的标签和待发送的业务数据封装成第一数据包,并向接收端发送该第一数据包。It should be noted that, in this embodiment, each time a service data is to be sent, a label needs to be obtained from the label resource pool, and only after successfully obtaining a label from the label resource pool The obtained label and the service data to be sent are encapsulated into a first data packet, and the first data packet is sent to the receiving end, and if the label is not obtained from the label resource pool, the sending The terminal will suspend the sending of the service data until the tag is successfully obtained from the tag resource pool, and then the obtained tag and the service data to be sent are encapsulated into the first data packet, and the first data is sent to the receiving end. package.
另外,该标签资源池中的初始标签数目可以表示该接收端的总业务数据处理能力,后续在每次发送端要发送业务数据之前,均需要从标签资源池中获取一个标签,则已经从标签资源池中取出的标签数目即为发送端已发送的数据包的数目,可以表示接收端当前正在处理的数据包数目,能够反映出接收端当前被占用的业务数据处理能力,而标签资源池中的剩余标签数目即为发送端还可以发送的数据包数目,可以表示接收端当前空闲的业务数据处理能力。In addition, the number of initial labels in the label resource pool may indicate the total service data processing capability of the receiving end, and each time the transmitting end needs to obtain a label from the label resource pool before sending the service data, the label resource is already obtained from the label resource. The number of tags that are sent out of the pool is the number of packets that have been sent by the sender. It can indicate the number of packets that the receiver is currently processing. It can reflect the service data processing capability currently occupied by the receiver, but in the label resource pool. The number of remaining labels is the number of data packets that the sender can also send, which can indicate the current idle data processing capability of the receiver.
进一步地,为了保证该标签资源池中的剩余标签数目能够准确地指示接收端当前的业务数据处理能力,该发送端还可以在每次从该标签资源池中获取到一个标签后,将获取的标签从该标签资源池中删除,从而使得该标签资源池中标签的数目随着该发送端的待发送业务数据的减少而减少,如此,可以根据剩余标签数目控制发送端发送的数据包的数目,实现了对发送端的流量控制,从而保证了任意时刻正在处理的数据包的数目不会超出接收端的业务数据处理能力上限,达到了流控的目的。Further, in order to ensure that the number of remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiving end, the sending end may also acquire the label after obtaining a label from the label resource pool each time. The label is deleted from the label resource pool, so that the number of labels in the label resource pool decreases as the data of the to-be-sent service of the sender decreases. Therefore, the number of data packets sent by the sender can be controlled according to the number of remaining labels. The flow control of the sending end is implemented, thereby ensuring that the number of data packets being processed at any time does not exceed the upper limit of the processing data processing capability of the receiving end, and the flow control is achieved.
另外,该发送端可以利用该发送端与该接收端之间的相关协议,向该接收端发送第一数据包,也可以将该第一数据包发送至交换机,由交换机将该第一数据包转发至该接收端,本发明实施例对此不做限定。In addition, the sending end may use the related protocol between the sending end and the receiving end to send the first data packet to the receiving end, or send the first data packet to the switch, where the first data packet is sent by the switch. The embodiment of the present invention does not limit the forwarding to the receiving end.
803、接收端接收发送端发送的第一数据包,基于当前的业务数据处理能力,对该业务数据进行处理。803. The receiving end receives the first data packet sent by the sending end, and processes the service data according to the current service data processing capability.
在第一种可能的实现方式中,该发送端发送的第一数据包中包括业务数据,则该接收端可以接收发送端发送的第一数据包,对该第一数据包进行解封装,得到该第一数据包中的业务数据。In a first possible implementation, the first data packet sent by the sending end includes service data, and the receiving end may receive the first data packet sent by the sending end, and decapsulate the first data packet to obtain The business data in the first data packet.
在第二种可能的实现方式中,该发送端发送的第一数据包中包括获取的标签和业务数据,则该接收端可以接收发送端发送的第一数据包,对该第一数据包进行解封装,得到该第一数据包中的标签和业务数据。In a second possible implementation manner, the first data packet sent by the sending end includes the acquired label and the service data, and the receiving end may receive the first data packet sent by the sending end, and perform the first data packet. Decapsulation, obtaining the label and service data in the first data packet.
由于当前接收端具备业务数据处理能力,则该接收端可以直接基于当前的业务数据处理能力,对该业务数据进行处理,得到处理后的指示数据,而不会丢弃该第一数据包。Because the current receiving end has the service data processing capability, the receiving end can directly process the service data based on the current service data processing capability, and obtain the processed indication data without discarding the first data packet.
其中,该指示数据用于指示该接收端对该业务数据的处理结果,该指示数 据可以包括对该业务数据进行处理后得到的数据,或者该指示数据也可以包括对该业务数据进行处理后所生成的成功响应或失败响应,本发明实施例对此不做限定。The indication data is used to indicate a processing result of the service data by the receiving end, and the indicator number The data obtained by processing the service data may be included, or the indication data may also include a success response or a failure response generated after the service data is processed, which is not limited by the embodiment of the present invention.
实际应用中,该接收端可以对该业务数据进行不同方式的处理,具体的处理方式可以根据发送端与接收端协商确定,或者根据接收端默认的处理方式确定,或者根据该第一数据包中携带的处理方式确定,且该处理方式可以包括加速、计算、分析等,本发明实施例此不做限定。例如,若发送端请求接收端对其发送的业务数据进行加速处理,则该接收端接收到该第一数据包后,可以对该业务数据进行加速处理,得到加速处理后的数据。In the actual application, the receiving end may process the service data in different manners, and the specific processing manner may be determined according to the negotiation between the sending end and the receiving end, or determined according to the default processing manner of the receiving end, or according to the first data packet. The processing mode of the carrying is determined, and the processing manner may include acceleration, calculation, analysis, and the like, which are not limited in the embodiment of the present invention. For example, if the transmitting end requests the receiving end to perform acceleration processing on the service data sent by the receiving end, after receiving the first data packet, the receiving end may perform acceleration processing on the service data to obtain accelerated data.
可选地,在图8所示实施例的第一种实现场景下,在步骤801之前还包括:Optionally, in the first implementation scenario of the embodiment shown in FIG. 8, before step 801, the method further includes:
800、发送端根据接收端的业务数据处理能力,生成标签资源池。800. The sending end generates a label resource pool according to the service data processing capability of the receiving end.
本发明实施例中,为了避免业务数据传输失败的问题,可以根据接收端的业务处理处理能力,确定发送端能够向接收端发送数据包的最大个数,根据该最大个数生成标签资源池,使得该标签资源池的初始标签数目等于该最大个数,从而按照该最大个数控制发送的数据包数目,以保证发送出的数据包数目不会超出接收端的业务数据处理能力。In the embodiment of the present invention, in order to avoid the problem of service data transmission failure, the maximum number of data packets that the transmitting end can send to the receiving end is determined according to the service processing capability of the receiving end, and the label resource pool is generated according to the maximum number. The number of initial labels of the label resource pool is equal to the maximum number, so that the number of data packets sent is controlled according to the maximum number, so as to ensure that the number of sent data packets does not exceed the service data processing capability of the receiving end.
其中,该接收端的业务数据处理能力可以为该接收端所有的业务数据处理能力,也可以为该发送端从该接收端申请到的业务数据处理能力,本发明实施例对此不做限定。The service data processing capability of the receiving end may be all the service data processing capability of the receiving end, and may also be the service data processing capability that the sending end applies for from the receiving end, which is not limited in this embodiment of the present invention.
具体地,发送端根据接收端的业务数据处理能力,生成标签资源池,包括:发送端根据该发送端与该接收端之间的传输延迟时间,以及该接收端处理一个数据包的时间,计算一个数据包的总处理时间,获取该接收端的业务数据处理能力,该业务数据处理能力用于指示该接收端在单位时间内处理的数据包的最大个数,计算该业务数据处理能力与该一个数据包的总处理时间的乘积,可以得到接收端在该总处理时间内处理的数据包的最大个数,作为该接收端在总处理时间内的总处理能力数值,根据该总处理能力数值,生成该标签资源池,使得新生成的标签资源池的标签数目等于该总处理能力数值,以表示标签资源池中的初始标签数目等于该总处理能力数值。Specifically, the sending end generates a label resource pool according to the service data processing capability of the receiving end, including: the sending end calculates a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes a data packet, and calculates a The total processing time of the data packet is obtained, and the service data processing capability of the receiving end is used to indicate the maximum number of data packets processed by the receiving end in a unit time, and the service data processing capability and the one data are calculated. The product of the total processing time of the packet can obtain the maximum number of data packets processed by the receiving end in the total processing time, and the total processing capability value of the receiving end in the total processing time is generated according to the total processing capability value. The tag resource pool is such that the number of tags of the newly generated tag resource pool is equal to the total processing capability value to indicate that the initial tag number in the tag resource pool is equal to the total processing capability value.
其中,该传输延迟时间为发送端测试到的在发送端和接收端之间传输一个数据包所需的时间,处理一个数据包的时间为接收端从开始处理数据到处理完成所经过的时间,该一个数据包的总处理时间为从发送端开始发送一个数据包 到接收到接收端处理完成后返回的数据包所需的时间,即为该传输延迟时间与该处理时间的和值。The transmission delay time is the time required for the transmitter to transmit a data packet between the sender and the receiver, and the time for processing a data packet is the time elapsed since the receiver starts processing the data to complete the processing. The total processing time of the one packet is to send a packet from the sender. The time required to receive the data packet returned after the receiving end processing is completed is the sum of the transmission delay time and the processing time.
其中,根据该总处理能力数值,生成该标签资源池包括:该发送端将得到的总处理能力数值作为初始标签数目,生成与该初始标签数目对应的标签,并建立标签资源池。建立的标签资源池中包括与该初始标签数目对应的标签,以便在后续过程中根据标签资源池中的标签来限制数据包的发送。The generating the label resource pool according to the total processing capability value includes: the sending end uses the obtained total processing capability value as the initial label number, generates a label corresponding to the initial label number, and establishes a label resource pool. The established label resource pool includes a label corresponding to the initial number of labels, so that the sending of the data packet is restricted according to the label in the label resource pool in a subsequent process.
为了便于区分,该发送端可以按照序号为多个标签进行标记。例如,若初始标签数目为100,则该发送端可以建立标签资源池,该标签资源池中包括标签Tag0~Tag99。For the sake of distinction, the sender can mark multiple tags according to the sequence number. For example, if the number of initial labels is 100, the sender may establish a label resource pool, where the label resource pool includes labels Tag0-Tag99.
另外,接收端在单位时间内处理的数据包的最大个数可以根据接收端的数据包处理速率确定。则,该标签资源池中的初始标签数目可以根据以下公式得出:In addition, the maximum number of data packets processed by the receiving end per unit time can be determined according to the packet processing rate of the receiving end. Then, the initial number of labels in the label resource pool can be derived from the following formula:
Num=Packet·Rate×(T1+T2);Num=Packet·Rate×(T 1 +T 2 );
其中,Num为初始标签数目,Packet·Rate为接收端的数据包处理速率,T1为发送端与接收端之间的传输延迟时间,T2为接收端对一个数据包的处理时间。Among them, Num is the initial number of labels, Packet·Rate is the packet processing rate of the receiving end, T 1 is the transmission delay time between the transmitting end and the receiving end, and T 2 is the processing time of the receiving end for one data packet.
假设该接收端的数据包处理速率为100000pps(packet per second,每秒包数),表示该接收端1s内处理的数据包的最大个数为100000,则该接收端1ms内处理的数据包的最大个数为100。假设该接收端对一个数据包的处理时间为5ms,传输延迟时间也为5ms,则该接收端对一个数据包的总处理时间为10ms。计算该最大个数100与该总处理时间10ms之间的乘积,即可得出该接收端的总处理能力数值为1000,则确定该初始标签数目为1000。Assume that the packet processing rate of the receiving end is 100000 pps (packet per second), indicating that the maximum number of data packets processed in the receiving end 1s is 100000, and the maximum number of data packets processed by the receiving end within 1 ms. The number is 100. Assuming that the receiving end has a processing time of 5 ms for one data packet and a transmission delay time of 5 ms, the total processing time of the receiving end for one data packet is 10 ms. Calculating the product between the maximum number of 100 and the total processing time of 10 ms, the total processing capacity of the receiving end is 1000, and the initial number of labels is determined to be 1000.
计算出的初始标签数目即可指示该接收端在发送端的总处理时间内可以处理的数据包的最大数目,也即是接收端在总处理时间内的总业务数据处理能力。在该总处理时间内,如果发送端发送的数据包的数目未达到该初始标签数目,就不会超出接收端的总业务数据处理能力。The calculated initial number of tags can indicate the maximum number of data packets that the receiving end can process in the total processing time of the transmitting end, that is, the total service data processing capability of the receiving end in the total processing time. During the total processing time, if the number of data packets sent by the sender does not reach the initial number of labels, the total service data processing capability of the receiver is not exceeded.
可选地,结合图8所示实施例或上述图8所示实施例的第一种实现场景,在图8所示实施例的第二种实现场景下,上述方法还包括:Optionally, in combination with the first implementation scenario of the embodiment shown in FIG. 8 or the foregoing embodiment shown in FIG. 8, in the second implementation scenario of the embodiment shown in FIG. 8, the method further includes:
804、接收端向发送端发送第二数据包,该第二数据包包含该第一数据包中的标签和对该第一数据包中的业务数据处理后得到的指示数据。804. The receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet.
基于步骤803中的第二种可能的实现方式,接收端对该第一数据包中的业务数据进行处理得到指示数据后,可以将该第一数据包中的标签和该指示数据 封装成第二数据包,并向发送端发送该第二数据包。After the receiving end processes the service data in the first data packet to obtain the indication data, the label in the first data packet and the indication data may be performed. Encapsulating into a second data packet and transmitting the second data packet to the transmitting end.
基于步骤802的举例,该接收端接收到该第一数据包后,可以对该第一数据包进行解封装,得到Tag89和业务数据,该接收端可以对该业务数据进行处理,得到处理后的指示数据,并将该Tag89和该指示数据封装成第二数据包,向发送端发送该第二数据包。Based on the example of step 802, after receiving the first data packet, the receiving end may decapsulate the first data packet to obtain Tag89 and service data, and the receiving end may process the service data to obtain the processed data. Indicating data, and the Tag89 and the indication data are encapsulated into a second data packet, and the second data packet is sent to the transmitting end.
进一步地,在步骤804之后还包括:Further, after step 804, the method further includes:
805、发送端接收接收端发送的第二数据包,将该第二数据包中的标签回收至标签资源池。805. The sending end receives the second data packet sent by the receiving end, and collects the label in the second data packet into the label resource pool.
发送端接收到接收端发送的第二数据包后,可以对该第二数据包进行解封装,得到该第二数据包中的标签和处理后的指示数据。由于此时接收端已经对业务数据处理完成,处理该业务数据时所占用的业务数据处理能力已经被释放,则该发送端将解封装得到的标签回收至标签资源池,从而能够保证该标签资源池中标签的数目随着该发送端的待发送业务数据的减少而减少,而随着标签的回收而增加,标签资源池中的剩余标签数目准确指示接收端当前的业务数据处理能力,标签资源池中存在标签能够准确表示发送端当前具备向接收端发送业务数据的权限。另外,对该标签的回收还可以保证在后续过程中已经使用过的标签还可以再次使用,节省了标签资源。After receiving the second data packet sent by the receiving end, the sending end may decapsulate the second data packet to obtain the label in the second data packet and the processed indication data. After the processing of the service data is completed, the service data processing capability of the service data is released, and the sender reclaims the decapsulated label into the label resource pool, thereby ensuring the label resource. The number of labels in the pool decreases as the data to be sent of the sender decreases, and increases with the label collection. The number of labels in the label resource pool accurately indicates the current service data processing capability of the receiver, and the label resource pool. The presence of a tag can accurately indicate that the sender currently has the right to send service data to the receiver. In addition, the recycling of the label can also ensure that the labels that have been used in the subsequent process can be reused, saving label resources.
相关技术中,由于发送端可能要发送多个业务数据,而不同业务数据的详情信息不便区分,因此,发送端在发送业务数据时,需要携带该业务数据的详情信息,接收端返回指示数据时,也需要返回该详情信息,发送端才能确定业务数据的详情信息是哪一个详情信息。也即是,在发送端与接收端的传输过程中需要携带详情信息,这将会占用一定的带宽。In the related art, since the transmitting end may send multiple service data, and the detailed information of different service data is inconvenient to distinguish, the transmitting end needs to carry the detailed information of the service data when transmitting the service data, and the receiving end returns the indication data. It is also necessary to return the detailed information, and the transmitting end can determine which detailed information of the detailed information of the business data is. That is, the transmission information needs to be carried in the transmission process between the transmitting end and the receiving end, which will occupy a certain bandwidth.
而本发明实施例中,为了避免占用带宽,该发送端从标签资源池中获取标签之后,可以存储业务数据的详情信息,并建立标签与详情信息的对应关系,以标签来标记业务数据的详情信息。后续过程中,发送端接收到接收端返回的第二数据包,并获取该第二数据包中携带的标签后,可以根据对应关系,查询该标签对应的详情信息。则在发送端与接收端的传输过程中不需要携带详情信息,节省了带宽。In the embodiment of the present invention, in order to avoid occupying bandwidth, the sending end may store the detailed information of the service data after acquiring the label from the label resource pool, and establish a correspondence between the label and the detailed information, and mark the details of the service data by using the label. information. In the subsequent process, after receiving the second data packet returned by the receiving end, and obtaining the label carried in the second data packet, the sending end may query the detailed information corresponding to the label according to the corresponding relationship. In the transmission process between the sender and the receiver, the detailed information does not need to be carried, which saves bandwidth.
其中,该详情信息至少包括该业务数据的内存地址,另外还可以包括发送端ID(Identification,序列号)、业务数据的队列号等,本发明实施例对该详情信息不做限定。 The detailed information includes at least a memory address of the service data, and may further include a sender ID (Identification), a queue number of the service data, and the like. The detailed information in the embodiment of the present invention is not limited.
可选的,发送端接收到第二数据包,获取到该第二数据包中携带的标签和指示数据后,可以根据对应关系,查询该标签对应的内存地址,并根据内存地址,存储返回的指示数据。如此,不仅解决了流控的问题,还能实现对已发送业务数据信息的记录,满足分布式系统的设计要求。Optionally, after receiving the second data packet, the sending end obtains the label and the indication data carried in the second data packet, and may query the memory address corresponding to the label according to the corresponding relationship, and store the returned data according to the memory address. Indicate the data. In this way, not only the problem of flow control is solved, but also the record of the transmitted service data information can be realized, and the design requirements of the distributed system are satisfied.
或者,在接收到第二数据包,获取到该第二数据包中携带的标签和指示数据后,发送端还可以根据对应关系,查询该标签对应的内存地址,并根据内存地址,回收该内存地址所指示的内存空间,以便将该内存空间应用于后续要发送的其他业务数据,节省了内存资源。Alternatively, after receiving the second data packet and obtaining the label and the indication data carried in the second data packet, the sending end may further query the memory address corresponding to the label according to the corresponding relationship, and recover the memory according to the memory address. The memory space indicated by the address, so that the memory space is applied to other business data to be sent later, which saves memory resources.
例如,基于步骤804的举例,该发送端从标签资源池中获取到Tag89后,可以存储该待发送的业务数据的队列号、内存地址、发送端ID等详情信息,并建立Tag89和该详情信息的对应关系,将该Tag89与业务数据封装成不包括该详情信息的第一数据包,并向接收端发送该第一数据包。当发送端接收到包括Tag89和指示数据的第二数据包时,可以根据已建立的对应关系查询与Tag89对应内存地址,根据查询到的内存地址,回收该内存地址指示的内存空间。For example, after obtaining the tag 89 from the tag resource pool, the sending end may store the detailed information such as the queue number, the memory address, and the sender ID of the service data to be sent, and establish Tag89 and the detailed information. Corresponding relationship, the Tag89 and the service data are encapsulated into a first data packet not including the detailed information, and the first data packet is sent to the receiving end. When the sending end receives the second data packet including the Tag89 and the indication data, the memory address corresponding to the Tag89 may be queried according to the established correspondence relationship, and the memory space indicated by the memory address is recovered according to the queried memory address.
进一步地,该发送端可以在该发送端执行从标签资源池中获取一个标签时,开始计时,当计时时长达到预设时长时,判断是否已将获取的标签回收至标签资源池。如果还未将获取的标签回收至标签资源池,则表示标签回收超时,第一数据包可能已经丢失,或者,该接收端可能发生异常,导致无法对业务数据进行处理或者无法返回第二数据包,那么,为了避免业务数据得不到处理且避免在未发送新的业务数据时减小标签的数目,该标签资源池可以重新生成对应的标签,并根据重新生成的标签和业务数据,重新生成第一数据包,向接收端发送重新生成的第一数据包,该发送端接收该重新生成的第一数据包,可以重新对该业务数据进行处理,并返回处理后的指示数据和对应的标签,以便接收端可以将该标签回收至标签资源池。Further, the sending end may start timing when the sending end acquires a label from the label resource pool, and when the timing duration reaches a preset duration, it is determined whether the acquired label has been recycled to the label resource pool. If the obtained label has not been recycled to the label resource pool, it means that the label collection timeout, the first data packet may have been lost, or the receiving end may be abnormal, and the business data cannot be processed or the second data packet cannot be returned. Then, in order to prevent the service data from being processed and to avoid reducing the number of tags when the new service data is not sent, the tag resource pool can regenerate the corresponding tag and regenerate according to the regenerated tag and service data. Transmitting, by the first data packet, the regenerated first data packet to the receiving end, the transmitting end receiving the regenerated first data packet, and reprocessing the service data, and returning the processed indication data and the corresponding label So that the receiver can recycle the label to the label resource pool.
其中,该预设时长可以由发送端根据从标签资源池中获取标签到该标签被回收至标签资源池之间的一般时长设置,也可以根据发送端和接收端之间的传输延迟时间与接收端对一个数据包的处理时间具体设置,本发明实施例对此不做限定。The preset duration may be set by the sending end according to the general duration of obtaining the label from the label resource pool to the label resource pool, or may be based on the transmission delay time between the sending end and the receiving end. The specific setting of the processing time of a data packet is not limited in this embodiment of the present invention.
发送端还可以根据标签是否回收超时来判断接收端是否在位,如果标签回收超时,则表示该接收端可能未启动或出现异常,即该接收端无法正常工作, 则可以将该接收端的状态确定为未在位,如果标签未出现回收超时的情况,则表示该接收端可以正常工作,可以将该接收端的状态确定为在位。且,该发送端还可以在回收标签时,统计从获取该标签到回收该标签的实际时长,将该实际时长作为该接收端处理对应业务数据的处理时延,根据该处理时延判断该接收端当前的运行状态,并将该接收端当前的运行状态上传至上层软件,或者统计分析该接收端处理时延的变化情况,上传至上层软件,从而无需发送专门的探测数据来对接收端的当前运行状态进行探测,节省了探测资源。The sender can also determine whether the receiver is in place according to whether the label is reclaimed. If the label reclaims timeout, it indicates that the receiver may not be started or an abnormality occurs, that is, the receiver cannot work normally. Then, the status of the receiving end can be determined as not being in place. If the label does not have a recovery timeout, it indicates that the receiving end can work normally, and the status of the receiving end can be determined to be in place. The sending end may also collect the actual duration from the time the label is acquired to the collection of the label, and the actual duration is used as a processing delay for processing the corresponding service data by the receiving end, and the receiving is determined according to the processing delay. The current running state of the terminal, and uploading the current running state of the receiving end to the upper layer software, or statistically analyzing the change of the processing delay of the receiving end, uploading to the upper layer software, thereby eliminating the need to send special probe data to the current end of the receiving end. The running status is detected, which saves the detection resources.
另外,当计时时长达到预设时长时,如果还未将标签回收至标签资源池,该接收端还可以不再重新生成第一数据包,取消重新对该业务数据的处理。而且,为了避免内存泄露,该发送端可以根据该对应关系,查询该标签对应的详情信息,根据该详情信息包括的内存地址,确定该内存地址指示的内存空间,并回收该内存空间。In addition, when the timer duration reaches the preset duration, if the label has not been recycled to the label resource pool, the receiver may not regenerate the first data packet, and cancel the processing of the service data again. Moreover, in order to avoid memory leakage, the transmitting end may query the detailed information corresponding to the label according to the correspondence, determine the memory space indicated by the memory address according to the memory address included in the detailed information, and recover the memory space.
实际应用中,该发送端可以识别标签回收超时的异常情况,在识别出该异常情况时,直接触发重传机制,实现第一数据包的再次发送,或者根据详情信息中的内存地址,回收内存地址指示的内存空间。或者,在标签回收超时时,该发送端还可以向上层软件上报异常,由上层软件决定要再次发送第一数据包还是要回收内存空间,该发送端可以根据上层软件的指示,触发重传机制或者回收内存地址指示的内存空间。In an actual application, the sending end may identify an abnormal condition of the label collection timeout. When the abnormal condition is identified, the retransmission mechanism is directly triggered to resend the first data packet, or the memory is reclaimed according to the memory address in the detailed information. The memory space indicated by the address. Alternatively, when the label collection timeout occurs, the sender may also report an exception to the upper layer software, and the upper layer software determines whether to send the first data packet again or to reclaim the memory space, and the sender may trigger the retransmission mechanism according to the instruction of the upper layer software. Or reclaim the memory space indicated by the memory address.
采用上述方法可以保证任意时刻接收端正在处理的数据包数目不会超出其处理上限,达到了流控的目的,确保了流控的准确性和实时性,同时,发送端能够根据接收端的实时处理结果决定是否发送第一数据包,实现了自主流控。而接收端在处理还未完成时,不会返回标签,使得发送端不能回收标签,如果接收端当前不具备业务数据处理能力,发送端的剩余标签数目即为0,从而能够控制发送端暂停发送业务数据,实现了对发送端的反压。The above method can ensure that the number of data packets being processed by the receiving end does not exceed the processing upper limit at any time, and achieves the purpose of flow control, ensuring the accuracy and real-time performance of the flow control, and at the same time, the transmitting end can process according to the real-time processing of the receiving end. The result is to decide whether to send the first data packet and implement autonomous flow control. The receiving end does not return the label when the processing is not completed, so that the sending end cannot reclaim the label. If the receiving end does not currently have the service data processing capability, the number of remaining labels of the transmitting end is 0, so that the transmitting end can be controlled to suspend the sending service. Data, the back pressure on the sender is achieved.
需要说明的是,本发明实施例仅是以在一个发送端和一个接收端之间进行数据包传输为例,而在实际应用中,该方法还可以应用于多发送端或多接收端的复杂系统和组网环境中,如分布式系统。It should be noted that the embodiment of the present invention is only an example of performing data packet transmission between a transmitting end and a receiving end. In practical applications, the method can also be applied to a complex system of multiple transmitting ends or multiple receiving ends. And networking environments, such as distributed systems.
在分布式系统中,任一发送端与任一接收端之间可以采用本发明实施例提供的方法进行数据传输,保证系统中各节点的流量控制,保证了可靠性,也可以应用于发送端的特定业务数据,具有较高的灵活性,满足了多样性需求。In the distributed system, the data provided by the embodiment of the present invention can be used for data transmission between any of the transmitting ends and any receiving end to ensure the flow control of each node in the system, ensuring reliability, and can also be applied to the transmitting end. Specific business data, with high flexibility to meet the diversity needs.
另外,在包括多个发送端和多个接收端的分布式系统中,由于单个接收端 需要同时处理多个发送端的业务数据,如果采用反压的方式对多个发送端与该接收端之间的数据流量进行控制,则会出现在一个发送端发送的业务数据超出接收端的业务数据处理能力时,该接收端将会反压与所有发送端之间的数据通道,导致所有发送端暂停发送业务数据,从而影响其他发送端的业务数据的正常处理。In addition, in a distributed system including a plurality of transmitting ends and a plurality of receiving ends, due to a single receiving end The service data of multiple senders needs to be processed at the same time. If the data traffic between multiple senders and receivers is controlled by backpressure, the service data sent by one sender exceeds the service data of the receiver. When the capability is enabled, the receiving end will backpressure the data channel with all the transmitting ends, causing all the transmitting ends to suspend the transmission of service data, thereby affecting the normal processing of the service data of other transmitting ends.
而本发明实施例中,在分布式系统中,多个发送端可以自行进行流量控制,各个发送端可以根据各自向该接收端申请到的业务数据处理能力,控制发送的数据包的数目,不会对其他发送端造成影响,便于对分布式系统中各个发送端的有序管理,能够适应复杂组网场景,具有较高的灵活性。In the embodiment of the present invention, in a distributed system, multiple senders can perform traffic control by themselves, and each sender can control the number of data packets sent according to the service data processing capability that each party applies to the receiver, It affects other senders and facilitates the orderly management of each sender in a distributed system. It can adapt to complex networking scenarios and has high flexibility.
本发明实施例提供的方法,通过在标签资源池中存在标签,即发送端当前具备向接收端发送业务数据的权限的前提下,从标签资源池中获取一个标签后,才根据待发送业务数据发送第一数据包,使得接收端接收该第一数据包后,能够基于当前的业务数据处理能力对业务数据进行处理,保证了发送端能够在接收端当前具备业务数据处理能力的情况下才发送业务数据,以免超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。The method provided by the embodiment of the present invention, after the label is present in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, according to the service data to be sent. Sending the first data packet, so that after receiving the first data packet, the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data processing capability if the receiving end currently has the service data processing capability. Business data, so as to avoid exceeding the current business data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
另外,通过将发送端返回的标签回收至标签资源池,保证了标签资源池中的剩余标签数目能够精确地指示接收端当前的业务数据处理能力,提高了精确度;通过以标签来标记业务数据的详情信息,无需在发送第一数据包时携带该详情信息也可以确定业务数据的详情信息,节省了带宽,提高了灵活性;通过如果标签回收超时,则重新生成对应的标签,并根据重新生成的标签和业务数据,重新生成第一数据包,向接收端发送重新生成的第一数据包,避免了业务数据处理失败的问题,且避免了在接收端未对业务数据进行处理时减小标签数目的问题,保证了剩余标签数目能够精确地指示接收端当前的业务数据处理能力,提高了精确度。In addition, by recycling the label returned by the sender to the label resource pool, the number of remaining labels in the label resource pool can accurately indicate the current service data processing capability of the receiver, and the accuracy is improved; and the service data is marked by the label. The detailed information does not need to carry the detailed information when the first data packet is sent, and can also determine the detailed information of the service data, which saves bandwidth and improves flexibility; if the label recycling timeout, the corresponding label is regenerated, and according to the re The generated label and the service data regenerate the first data packet, and send the regenerated first data packet to the receiving end, thereby avoiding the problem that the service data processing fails, and avoiding reducing when the receiving end does not process the service data. The problem of the number of tags ensures that the number of remaining tags can accurately indicate the current service data processing capability of the receiving end and improve the accuracy.
图9是本发明实施例提供的一种数据发送方法流程图,本发明实施例的执行主体为发送端,参见图9,该方法包括以下步骤:FIG. 9 is a flowchart of a data sending method according to an embodiment of the present invention. The execution body of the embodiment of the present invention is a transmitting end. Referring to FIG. 9, the method includes the following steps:
901、发送端从标签资源池中获取一个标签,该标签资源池中存在标签表示该发送端当前具备向接收端发送业务数据的权限;901. The sender obtains a label from the label resource pool, and the label in the label resource pool indicates that the sender currently has the right to send service data to the receiver.
902、该发送端根据该发送端的待发送业务数据,生成第一数据包; 902. The sending end generates a first data packet according to the to-be-sent service data of the sending end.
903、该发送端向该接收端发送该第一数据包。903. The sending end sends the first data packet to the receiving end.
本发明实施例提供的方法,通过在标签资源池中存在标签,即发送端当前具备向接收端发送业务数据的权限的前提下,从标签资源池中获取一个标签后,才根据待发送业务数据发送第一数据包,使得接收端接收该第一数据包后,能够基于当前的业务数据处理能力对业务数据进行处理,保证了发送端能够在接收端当前具备业务数据处理能力的情况下才发送业务数据,以免超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。The method provided by the embodiment of the present invention, after the label is present in the label resource pool, that is, the sender currently has the right to send the service data to the receiving end, and obtains a label from the label resource pool, according to the service data to be sent. Sending the first data packet, so that after receiving the first data packet, the receiving end can process the service data based on the current service data processing capability, and ensure that the sending end can send the service data processing capability if the receiving end currently has the service data processing capability. Business data, so as to avoid exceeding the current business data processing capability of the receiving end, avoiding the problem of transmission failure, improving the transmission success rate and improving flexibility.
可选地,该第一数据包包括该获取的标签和该业务数据。Optionally, the first data packet includes the acquired label and the service data.
可选地,该发送端从标签资源池中获取一个标签,包括:Optionally, the sending end obtains a label from the label resource pool, including:
若该发送端确定该标签资源池中存在至少一个标签,则从该标签资源池中获取一个标签。If the sender determines that at least one tag exists in the tag resource pool, a tag is obtained from the tag resource pool.
可选地,在该发送端根据该发送端的待发送业务数据,生成第一数据包之前,该方法还包括:Optionally, before the sending end generates the first data packet according to the to-be-sent service data of the sending end, the method further includes:
根据该接收端的业务数据处理能力,生成该标签资源池。The tag resource pool is generated according to the service data processing capability of the receiving end.
可选地,该根据该接收端的业务数据处理能力,生成该标签资源池,包括:Optionally, the generating the label resource pool according to the service data processing capability of the receiving end, including:
该发送端根据该发送端与该接收端之间的传输延迟时间,以及该接收端处理一个数据包的时间,计算该一个数据包的总处理时间;The transmitting end calculates a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes one data packet;
该发送端获取该接收端的业务数据处理能力,该业务数据处理能力用于指示该接收端在单位时间内处理的数据包的最大个数;The sending end acquires the service data processing capability of the receiving end, where the service data processing capability is used to indicate the maximum number of data packets processed by the receiving end in a unit time;
该发送端将该业务数据处理能力与该一个数据包的总处理时间的乘积作为该接收端的总处理能力数值;The sending end uses the product of the service data processing capability and the total processing time of the one data packet as the total processing capability value of the receiving end;
根据该总处理能力数值,生成该标签资源池,该标签资源池的标签数目等于该总处理能力数值。The tag resource pool is generated according to the total processing capability value, and the tag resource pool has a label number equal to the total processing capability value.
可选地,该方法还包括:Optionally, the method further includes:
将该获取的标签从该标签资源池中删除。The obtained tag is deleted from the tag resource pool.
可选地,该方法还包括:Optionally, the method further includes:
该发送端接收该接收端发送的第二数据包,该第二数据包包括该获取的标签和对该业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果;Receiving, by the sending end, the second data packet sent by the receiving end, where the second data packet includes the acquired label and the indication data obtained by processing the service data, where the indication data is used to indicate that the receiving end is to the service data. process result;
将该第二数据包中包含的该获取的标签回收至该标签资源池。 The acquired label included in the second data packet is recycled to the label resource pool.
可选地,在该发送端根据该获取的标签和该终端的待发送业务数据,生成第一数据包之后,还包括:Optionally, after the sending, by the sending end, the first data packet, according to the acquired label and the to-be-sent service data of the terminal, the method further includes:
该发送端存储该业务数据的详情信息,该详情信息包括该待发送业务数据的内存地址;The sending end stores the detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
该发送端建立该标签与该详情信息的对应关系;The sending end establishes a correspondence between the label and the detailed information;
在该发送端接收该接收端发送的该第二数据包之后,该方法还包括:After the sending end receives the second data packet sent by the receiving end, the method further includes:
该发送端根据该对应关系,获取该标签对应的内存地址;The sending end acquires a memory address corresponding to the label according to the correspondence relationship;
该发送端根据该内存地址,回收该内存地址指示的内存空间。The sender reclaims the memory space indicated by the memory address according to the memory address.
可选地,该方法还包括:Optionally, the method further includes:
在该发送端执行从标签资源池中获取一个标签时,该发送端开始计时;When the sender performs a label acquisition from the label resource pool, the sender starts timing;
若计时时长达到预设时长,且该获取的标签未回收至该标签资源池中,则该发送端重新生成该标签,根据重新生成的该标签和该业务数据,重新生成该第一数据包,向该接收端发送重新生成的第一数据包。If the timeout period reaches the preset duration, and the acquired label is not reclaimed into the label resource pool, the sender regenerates the label, and regenerates the first data packet according to the regenerated label and the service data. Sending the regenerated first data packet to the receiving end.
图10是本发明实施例提供的一种数据接收方法流程图,本发明实施例的执行主体可以为接收端,参见图10,该方法包括以下步骤:FIG. 10 is a flowchart of a data receiving method according to an embodiment of the present invention. The executor of the embodiment of the present invention may be a receiving end. Referring to FIG. 10, the method includes the following steps:
1001、接收端接收发送端发送的第一数据包,该第一数据包由该发送端从标签资源池获取一个标签后根据待发送业务数据生成,该标签资源池中存在标签表示该发送端当前具备向接收端发送业务数据的权限;1001: The receiving end receives the first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label in the label resource pool indicates that the sending end is current. Have the right to send business data to the receiving end;
1002、接收端基于当前的业务数据处理能力,对该业务数据进行处理。1002. The receiving end processes the service data based on the current service data processing capability.
本发明实施例提供的方法,通过接收在发送端具备向接收端发送业务数据的权限的前提下向接收端发送的第一数据包,能够基于当前的业务数据处理能力,对第一数据包中的业务数据进行处理,保证了发送端发送的数据包不会超出接收端当前的业务数据处理能力,避免了传输失败的问题,提高了传输成功率,提高了灵活性。The method provided by the embodiment of the present invention can receive the first data packet sent to the receiving end on the premise that the transmitting end has the right to send the service data to the receiving end, and can be based on the current service data processing capability in the first data packet. The processing of the service data ensures that the data packet sent by the sender does not exceed the current service data processing capability of the receiving end, avoids the problem of transmission failure, improves the transmission success rate, and improves flexibility.
可选地,该方法还包括:Optionally, the method further includes:
该接收端向该发送端发送第二数据包,该第二数据包包含该第一数据包中的标签和对该第一数据包中业务数据处理后得到的指示数据,该指示数据用于指示该接收端对该业务数据的处理结果。The receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where the indication data is used to indicate The result of processing the service data by the receiving end.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通 过硬件来完成,也可以通过程序来指令相关的硬件完成,该的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those skilled in the art can understand that all or part of the steps of implementing the above embodiments can be The completion of the hardware may also be performed by a program to instruct related hardware. The program may be stored in a computer readable storage medium. The storage medium mentioned above may be a read only memory, a magnetic disk or an optical disk.
以上该仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are within the spirit and scope of the present invention, should be included in the scope of the present invention. within.

Claims (25)

  1. 一种数据发送方法,其特征在于,所述方法包括:A data transmitting method, characterized in that the method comprises:
    发送端从标签资源池中获取一个标签,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;The sending end obtains a label from the label resource pool, and the label in the label resource pool indicates that the sending end currently has the right to send the service data to the receiving end;
    所述发送端根据所述发送端的待发送业务数据,生成第一数据包;The sending end generates a first data packet according to the to-be-sent service data of the sending end;
    所述发送端向所述接收端发送所述第一数据包。The sending end sends the first data packet to the receiving end.
  2. 根据权利要求1所述的方法,其特征在于,所述第一数据包包括所述获取的标签和所述业务数据。The method of claim 1 wherein said first data packet comprises said acquired tag and said service data.
  3. 根据权利要求1所述的方法,其特征在于,所述发送端从标签资源池中获取一个标签,包括:The method according to claim 1, wherein the sender obtains a label from the label resource pool, including:
    若所述发送端确定所述标签资源池中存在至少一个标签,则从所述标签资源池中获取一个标签。And if the sending end determines that at least one label exists in the label resource pool, obtaining a label from the label resource pool.
  4. 根据权利要求1所述的方法,其特征在于,在所述发送端根据所述发送端的待发送业务数据,生成第一数据包之前,所述方法还包括:The method according to claim 1, wherein before the generating end generates the first data packet according to the to-be-sent service data of the sending end, the method further includes:
    根据所述接收端的业务数据处理能力,生成所述标签资源池。Generating the label resource pool according to the service data processing capability of the receiving end.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述接收端的业务数据处理能力,生成所述标签资源池,包括:The method according to claim 4, wherein the generating the label resource pool according to the service data processing capability of the receiving end comprises:
    所述发送端根据所述发送端与所述接收端之间的传输延迟时间,以及所述接收端处理一个数据包的时间,计算所述一个数据包的总处理时间;The transmitting end calculates a total processing time of the one data packet according to a transmission delay time between the transmitting end and the receiving end, and a time when the receiving end processes one data packet;
    所述发送端获取所述接收端的业务数据处理能力,所述业务数据处理能力用于指示所述接收端在单位时间内处理的数据包的最大个数;The sending end acquires a service data processing capability of the receiving end, where the service data processing capability is used to indicate a maximum number of data packets processed by the receiving end in a unit time;
    所述发送端将所述业务数据处理能力与所述一个数据包的总处理时间的乘积作为所述接收端的总处理能力数值;The sending end uses the product of the service data processing capability and the total processing time of the one data packet as the total processing capability value of the receiving end;
    根据所述总处理能力数值,生成所述标签资源池,所述标签资源池的标签数目等于所述总处理能力数值。 And generating, by the total processing capability value, the label resource pool, where the label resource pool has a label number equal to the total processing capability value.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 5, wherein the method further comprises:
    将所述获取的标签从所述标签资源池中删除。The obtained tag is deleted from the tag resource pool.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6 wherein the method further comprises:
    所述发送端接收所述接收端发送的第二数据包,所述第二数据包包括所述获取的标签和对所述业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果;Receiving, by the sending end, the second data packet sent by the receiving end, where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate the The processing result of the service data by the receiving end;
    将所述第二数据包中包含的所述获取的标签回收至所述标签资源池。Retrieving the acquired tag included in the second data packet to the tag resource pool.
  8. 根据权利要求7所述的方法,其特征在于,在所述发送端根据所述获取的标签和所述终端的待发送业务数据,生成第一数据包之后,还包括:The method according to claim 7, wherein after the generating, by the sending end, the first data packet, according to the acquired label and the to-be-sent service data of the terminal, the method further includes:
    所述发送端存储所述业务数据的详情信息,所述详情信息包括所述待发送业务数据的内存地址;The sending end stores the detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
    所述发送端建立所述标签与所述详情信息的对应关系;The sending end establishes a correspondence between the label and the detailed information;
    在所述发送端接收所述接收端发送的所述第二数据包之后,所述方法还包括:After the sending end receives the second data packet sent by the receiving end, the method further includes:
    所述发送端根据所述对应关系,获取所述标签对应的内存地址;The sending end acquires a memory address corresponding to the label according to the corresponding relationship;
    所述发送端根据所述内存地址,回收所述内存地址指示的内存空间。The sending end recovers the memory space indicated by the memory address according to the memory address.
  9. 根据权利要求6-8任一项所述的方法,其特征在于,所述方法还包括:The method of any of claims 6-8, wherein the method further comprises:
    在所述发送端执行从标签资源池中获取一个标签时,所述发送端开始计时;When the sending end performs obtaining a label from the label resource pool, the sending end starts timing;
    若计时时长达到预设时长,且所述获取的标签未回收至所述标签资源池中,则所述发送端重新生成所述标签,根据重新生成的所述标签和所述业务数据,重新生成所述第一数据包,向所述接收端发送重新生成的第一数据包。If the time period reaches a preset duration, and the acquired label is not reclaimed into the label resource pool, the sending end regenerates the label, and regenerates according to the regenerated label and the service data. Transmitting, by the first data packet, the regenerated first data packet to the receiving end.
  10. 一种数据接收方法,其特征在于,所述方法包括:A data receiving method, characterized in that the method comprises:
    接收端接收发送端发送的第一数据包,所述第一数据包由所述发送端从标签资源池获取一个标签后根据待发送业务数据生成,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;The receiving end receives the first data packet sent by the sending end, and the first data packet is generated by the sending end by acquiring a label from the label resource pool, and is generated according to the to-be-sent service data, where the label resource pool has a label indicating the sending The terminal currently has the right to send service data to the receiving end;
    所述接收端基于当前的业务数据处理能力,对所述业务数据进行处理。 The receiving end processes the service data based on the current service data processing capability.
  11. 根据权利要求10所述的方法,其特征在于,所述方法还包括:The method of claim 10, wherein the method further comprises:
    所述接收端向所述发送端发送第二数据包,所述第二数据包包含所述第一数据包中的标签和对所述第一数据包中业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果。The receiving end sends a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, where The indication data is used to indicate a processing result of the service data by the receiving end.
  12. 一种数据发送装置,其特征在于,所述数据发送装置应用于发送端,所述装置包括:A data transmitting apparatus, wherein the data transmitting apparatus is applied to a transmitting end, and the apparatus includes:
    标签获取模块,用于从标签资源池中获取一个标签,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;a label obtaining module, configured to obtain a label from a label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send service data to the receiving end;
    数据包生成模块,用于根据所述发送端的待发送业务数据,生成第一数据包;a data packet generating module, configured to generate a first data packet according to the to-be-sent service data of the sending end;
    发送模块,用于向所述接收端发送所述数据包生成模块生成的第一数据包。And a sending module, configured to send, to the receiving end, the first data packet generated by the data packet generating module.
  13. 根据权利要求12所述的装置,其特征在于,所述第一数据包包括所述获取的标签和所述业务数据。The apparatus of claim 12, wherein the first data packet comprises the acquired tag and the service data.
  14. 根据权利要求12所述的装置,其特征在于,所述标签获取模块还用于若确定所述标签资源池中存在至少一个标签,则从所述标签资源池中获取一个标签。The device according to claim 12, wherein the tag obtaining module is further configured to: obtain a tag from the tag resource pool if it is determined that at least one tag exists in the tag resource pool.
  15. 根据权利要求12所述的装置,其特征在于,所述装置还包括:The device of claim 12, wherein the device further comprises:
    标签资源池生成模块,用于根据所述接收端的业务数据处理能力,生成所述标签资源池。The label resource pool generating module is configured to generate the label resource pool according to the service data processing capability of the receiving end.
  16. 根据权利要求15所述的装置,其特征在于,所述标签资源池生成模块还用于根据所述发送端与所述接收端之间的传输延迟时间,以及所述接收端处理一个数据包的时间,计算所述一个数据包的总处理时间;获取所述接收端的业务数据处理能力,所述业务数据处理能力用于指示所述接收端在单位时间内处理的数据包的最大个数;将所述业务数据处理能力与所述一个数据包的总处理时间的乘积作为所述接收端的总处理能力数值;根据所述总处理能力数值,生成所述标签资源池,所述标签资源池的标签数目等于所述总处理能力数值。 The device according to claim 15, wherein the tag resource pool generating module is further configured to: according to a transmission delay time between the transmitting end and the receiving end, and the receiving end processing a data packet Time, calculating a total processing time of the one data packet; acquiring a service data processing capability of the receiving end, where the service data processing capability is used to indicate a maximum number of data packets processed by the receiving end in a unit time; a product of the service data processing capability and the total processing time of the one data packet as a total processing capability value of the receiving end; generating, according to the total processing capability value, the label resource pool, the label of the label resource pool The number is equal to the total processing power value.
  17. 根据权利要求12-16任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 12-16, wherein the device further comprises:
    删除模块,用于将所述标签获取模块获取的标签从所述标签资源池中删除。And a deleting module, configured to delete the label acquired by the label obtaining module from the label resource pool.
  18. 根据权利要求17所述的装置,其特征在于,所述装置还包括:The device according to claim 17, wherein the device further comprises:
    接收模块,用于接收所述接收端发送的第二数据包,所述第二数据包包括所述获取的标签和对所述业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果;a receiving module, configured to receive a second data packet sent by the receiving end, where the second data packet includes the acquired label and indication data obtained by processing the service data, where the indication data is used to indicate Decoding the processing result of the service data by the receiving end;
    标签回收模块,用于将所述接收模块接收到的第二数据包中包含的所述标签获取模块获取的标签回收至所述标签资源池。The label collection module is configured to collect the label acquired by the label acquisition module included in the second data packet received by the receiving module into the label resource pool.
  19. 根据权利要求18所述的装置,其特征在于,所述装置还包括:The device of claim 18, wherein the device further comprises:
    存储模块,用于存储所述业务数据的详情信息,所述详情信息包括所述待发送业务数据的内存地址;a storage module, configured to store detailed information of the service data, where the detailed information includes a memory address of the service data to be sent;
    建立关系模块,用于建立所述标签与所述详情信息的对应关系;Establishing a relationship module, configured to establish a correspondence between the label and the detailed information;
    内存地址获取模块,用于根据所述建立关系模块建立的对应关系,获取所述标签对应的内存地址;a memory address obtaining module, configured to acquire a memory address corresponding to the label according to the correspondence established by the establishing relationship module;
    内存空间回收模块,用于根据所述内存地址获取模块获取的内存地址,回收所述内存地址指示的内存空间。The memory space recovery module is configured to recover the memory space indicated by the memory address according to the memory address obtained by the memory address acquisition module.
  20. 根据权利要求17-19任一项所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 17 to 19, wherein the device further comprises:
    计时模块,用于在所述标签获取模块从所述标签资源池中获取一个标签时,开始计时;a timing module, configured to start timing when the label obtaining module acquires a label from the label resource pool;
    标签生成模块,用于若所述计时模块的计时时长达到预设时长,且所述标签获取模块获取的标签未回收至所述标签资源池中时,重新生成所述标签;a label generating module, configured to regenerate the label if the timing of the timing module reaches a preset duration and the label acquired by the label obtaining module is not recycled to the label resource pool;
    所述数据包生成模块,还用于根据所述标签生成模块重新生成的所述标签和所述业务数据,重新生成所述第一数据包;The data packet generating module is further configured to regenerate the first data packet according to the label and the service data regenerated by the label generation module;
    所述发送模块,还用于向所述接收端发送所述数据包生成模块重新生成的第一数据包。The sending module is further configured to send, to the receiving end, a first data packet that is regenerated by the data packet generating module.
  21. 一种数据接收装置,其特征在于,所述数据接收装置应用于接收端, 所述装置包括:A data receiving device, wherein the data receiving device is applied to a receiving end, The device includes:
    接收模块,用于接收发送端发送的第一数据包,所述第一数据包由所述发送端从标签资源池获取一个标签后根据待发送业务数据生成,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;a receiving module, configured to receive a first data packet sent by the sending end, where the first data packet is generated by the sending end from the label resource pool, and is generated according to the service data to be sent, where the label resource pool has a label representation The sending end currently has the right to send service data to the receiving end;
    处理模块,用于基于当前的业务数据处理能力,对所述接收模块接收到的第一数据包中的业务数据进行处理。The processing module is configured to process the service data in the first data packet received by the receiving module based on the current service data processing capability.
  22. 根据权利要求21所述的装置,其特征在于,所述装置还包括:The device of claim 21, wherein the device further comprises:
    发送模块,用于向所述发送端发送第二数据包,所述第二数据包包含所述第一数据包中的标签和对所述第一数据包中业务数据处理后得到的指示数据,所述指示数据用于指示所述接收端对所述业务数据的处理结果。a sending module, configured to send a second data packet to the sending end, where the second data packet includes a label in the first data packet and indication data obtained by processing the service data in the first data packet, The indication data is used to indicate a processing result of the service data by the receiving end.
  23. 一种数据传输系统,其特征在于,所述系统包括:接收端和至少一个发送端;A data transmission system, characterized in that the system comprises: a receiving end and at least one transmitting end;
    每个发送端用于从标签资源池中获取一个标签,所述标签资源池中存在标签表示所述发送端当前具备向接收端发送业务数据的权限;根据所述发送端的待发送业务数据,生成第一数据包;向所述接收端发送所述第一数据包。Each of the sending ends is configured to obtain a label from the label resource pool, where the label in the label resource pool indicates that the sending end currently has the right to send the service data to the receiving end; and the generating end is generated according to the to-be-sent service data of the sending end. a first data packet; the first data packet is sent to the receiving end.
    所述接收端用于接收任一发送端发送的第一数据包;基于当前的业务数据处理能力,对所述接收到的第一数据包中的业务数据进行处理。The receiving end is configured to receive a first data packet sent by any sending end, and process the service data in the received first data packet according to a current service data processing capability.
  24. 根据权利要求23所述的系统,其特征在于,发送所述第一数据包的发送端还用于将所述获取的标签从所述标签资源池中删除;The system according to claim 23, wherein the sending end of the first data packet is further configured to delete the acquired label from the label resource pool;
    发送所述第一数据包的发送端还用于接收所述接收端返回的第二数据包,并将所述第二数据包中的标签回收至所述标签资源池。The sending end of the first data packet is further configured to receive the second data packet returned by the receiving end, and collect the label in the second data packet into the label resource pool.
  25. 根据权利要求23所述的系统,其特征在于,所述系统为分布式系统,所述分布式系统包括多个发送端和所述接收端。 The system of claim 23 wherein said system is a distributed system, said distributed system comprising a plurality of transmitting ends and said receiving end.
PCT/CN2015/098372 2015-12-23 2015-12-23 Data sending method and receiving method, apparatus and system WO2017107083A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/098372 WO2017107083A1 (en) 2015-12-23 2015-12-23 Data sending method and receiving method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/098372 WO2017107083A1 (en) 2015-12-23 2015-12-23 Data sending method and receiving method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2017107083A1 true WO2017107083A1 (en) 2017-06-29

Family

ID=59088630

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/098372 WO2017107083A1 (en) 2015-12-23 2015-12-23 Data sending method and receiving method, apparatus and system

Country Status (1)

Country Link
WO (1) WO2017107083A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055291A (en) * 2021-04-29 2021-06-29 全球能源互联网研究院有限公司 Data packet sending method, router and data packet transmission system
CN113723967A (en) * 2018-06-21 2021-11-30 创新先进技术有限公司 Business risk analysis method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101115053A (en) * 2007-08-24 2008-01-30 中国科学院计算技术研究所 Credit flow control method
CN101115008A (en) * 2007-08-24 2008-01-30 中国科学院计算技术研究所 Credit based flow control system, apparatus and method
CN101534173A (en) * 2009-04-20 2009-09-16 福建星网锐捷网络有限公司 Method and system for controlling data flow
CN102075436A (en) * 2011-02-10 2011-05-25 成都市华为赛门铁克科技有限公司 Ethernet, and data transmitting method and device thereof
WO2014169860A1 (en) * 2013-09-26 2014-10-23 中兴通讯股份有限公司 Data transmission method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101115053A (en) * 2007-08-24 2008-01-30 中国科学院计算技术研究所 Credit flow control method
CN101115008A (en) * 2007-08-24 2008-01-30 中国科学院计算技术研究所 Credit based flow control system, apparatus and method
CN101534173A (en) * 2009-04-20 2009-09-16 福建星网锐捷网络有限公司 Method and system for controlling data flow
CN102075436A (en) * 2011-02-10 2011-05-25 成都市华为赛门铁克科技有限公司 Ethernet, and data transmitting method and device thereof
WO2014169860A1 (en) * 2013-09-26 2014-10-23 中兴通讯股份有限公司 Data transmission method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723967A (en) * 2018-06-21 2021-11-30 创新先进技术有限公司 Business risk analysis method, device and equipment
CN113055291A (en) * 2021-04-29 2021-06-29 全球能源互联网研究院有限公司 Data packet sending method, router and data packet transmission system

Similar Documents

Publication Publication Date Title
CN111147564B (en) Data file transmission method, system and communication terminal
US8468288B2 (en) Method for efficient guest operating system (OS) migration over a network
CN106134138B (en) Congestion control method, equipment and system
WO2016131172A1 (en) Method and device for updating network service descriptor
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
US7725556B1 (en) Computer system with concurrent direct memory access
CN106921665B (en) Message processing method and network equipment
CN105610730B (en) Message interaction method and system between CPU and network equipment
US10601692B2 (en) Integrating a communication bridge into a data processing system
US8948020B2 (en) Detecting and isolating dropped or out-of-order packets in communication networks
CN115174490B (en) Data transmission method and network application terminal
CN111107182B (en) MAC address synchronization method, device, system, equipment and medium
WO2017107083A1 (en) Data sending method and receiving method, apparatus and system
CN113992654A (en) High-speed file transmission method, system, equipment and medium
WO2014092551A1 (en) System and method for optimal memory management between cpu and fpga unit
CN108063809B (en) Machine equipment data acquisition method and acquisition system
CN101951327B (en) iSCSI network system and network fault detection method
CN105763375A (en) Data packet transmission method, receiving method and microwave station
US10372667B2 (en) Communication apparatus and control method thereof
CN106230658A (en) A kind of method and apparatus monitoring the network equipment
US8332498B2 (en) Synchronized relay messaging and coordinated network processing using SNMP
WO2016197659A1 (en) Packet reception method, device and system for network media stream
CN114401127A (en) Data packet transmission method, device and equipment based on zeroMQ
CN113055493B (en) Data packet processing method, device, system, scheduling device and storage medium
CN116155826A (en) Message receiving and transmitting method, network equipment, system and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15911082

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15911082

Country of ref document: EP

Kind code of ref document: A1