CN110602166B - Method, terminal device and storage medium for solving problem of repeated data transmission - Google Patents

Method, terminal device and storage medium for solving problem of repeated data transmission Download PDF

Info

Publication number
CN110602166B
CN110602166B CN201910731393.6A CN201910731393A CN110602166B CN 110602166 B CN110602166 B CN 110602166B CN 201910731393 A CN201910731393 A CN 201910731393A CN 110602166 B CN110602166 B CN 110602166B
Authority
CN
China
Prior art keywords
data frame
transmission
sending
length
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910731393.6A
Other languages
Chinese (zh)
Other versions
CN110602166A (en
Inventor
董时舫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PAX Computer Technology Shenzhen Co Ltd
Original Assignee
PAX Computer Technology Shenzhen Co Ltd
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 PAX Computer Technology Shenzhen Co Ltd filed Critical PAX Computer Technology Shenzhen Co Ltd
Priority to CN201910731393.6A priority Critical patent/CN110602166B/en
Publication of CN110602166A publication Critical patent/CN110602166A/en
Application granted granted Critical
Publication of CN110602166B publication Critical patent/CN110602166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/085Payment architectures involving remote charge determination or related payment systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The application is applicable to the technical field of communication, and provides a method, terminal equipment and storage medium for solving the problem of repeated data transmission, which comprises the following steps: after the data frame is sent, modifying the sending length in the descriptor corresponding to the sent data frame into a preset length; the preset length is not less than the minimum effective sending length of an MAC controller used for sending the data frame; and clearing the sending buffer corresponding to the data frame which is sent. The method for solving the problem of repeated data sending breaks the integrity and effectiveness of the data frame of the cache by timely cleaning the sending cache, and solves the problems that the existing communication equipment has higher solving cost in the problem of repeated account deduction caused by processing repeated data sending and the phenomenon of repeated account deduction cannot be eradicated.

Description

Method, terminal device and storage medium for solving problem of repeated data transmission
Technical Field
The present application belongs to the field of communication technologies, and in particular, to a method, a terminal device, and a storage medium for solving a problem of repeated data transmission.
Background
Under some abnormal conditions, the MAC (Media Access Control, MAC for short) layer of the ethernet module in the communication device may have an abnormal phenomenon of repeatedly transmitting data that has already been transmitted. For financial payment devices, repeated transmission of data may cause a failure of repeated deduction of the user account.
The payment by the financial payment device via ethernet is a common way. Because the ethernet is a network shared by multiple devices, when the network is busy, viruses or bad programs attack, the MAC layer of the ethernet module in the payment device is easy to be abnormal, and sometimes, the data frame which has been successfully sent is sent again, so that the account fund of the user is repeatedly deducted by the background server.
The existing technical scheme for solving the problem of repeatedly deducting account funds caused by repeated data transmission on an Ethernet link generally has the problem of high solution cost, and the problem can not be eradicated possibly.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method, a terminal device, and a storage medium for solving the problem of repeated account deduction caused by repeated data transmission, so as to solve the problem that the current communication device has a high solution cost in handling the problem, and cannot eliminate the problem.
For the sake of brevity, hereinafter, the problem of duplicate withholding due to duplicate data transmission is simply referred to as a data duplicate transmission problem.
According to a first aspect, an embodiment of the present application provides a method for solving a problem of data retransmission, including: after the data frame is sent, modifying the sending length in the descriptor corresponding to the sent data frame into a preset length; the preset length is greater than or equal to the minimum effective sending length of a MAC controller used for sending the data frame, the minimum effective sending length depends on the MAC controller and is an integer greater than or equal to zero; and clearing the sending buffer corresponding to the data frame which is sent.
With reference to the first aspect, in some embodiments of the present application, the modifying a transmission length in a descriptor corresponding to a data frame that has completed transmission to a preset length includes: reading a pointer register of the MAC controller, and acquiring a current read operation pointer according to the pointer register; acquiring a descriptor corresponding to the data frame which is sent according to the current reading operation pointer; and modifying the sending length in the descriptor into a preset length.
With reference to the first aspect, in some embodiments of the present application, the obtaining, according to the current read operation pointer, a descriptor corresponding to a data frame that has completed sending includes: storing the current reading operation pointer into a preset pointer variable; within the range of a sending buffer annular queue of the MAC controller, returning the pointer variable by a preset distance; the preset distance is the size of one descriptor; and acquiring a descriptor corresponding to the data frame which is finished to be sent according to the pointer variable after returning the preset distance.
With reference to the first aspect, in some embodiments of the present application, the clearing a transmission buffer corresponding to a data frame that has completed transmission includes: and cleaning all sending buffers corresponding to the data frames which are sent completely.
With reference to the first aspect, in some embodiments of the present application, the clearing a transmission buffer corresponding to a data frame that has completed transmission includes: clearing part of sending buffer corresponding to the data frame which is sent; when the part sending buffer corresponding to the data frame which is sent is cleaned, the address information in the sending buffer corresponding to the data frame which is sent is cleared.
With reference to the first aspect, in some embodiments of the present application, when the MAC controller transmits a data frame in a polling transmission manner, after the data frame is transmitted, according to a preset transmission buffer cleaning interrupt procedure, a transmission length in a descriptor corresponding to the data frame whose transmission is completed is modified to a preset length, and a transmission buffer corresponding to the data frame whose transmission is completed is cleaned.
With reference to the first aspect, in some embodiments of the present application, when the MAC controller transmits a data frame in an interrupt transmission manner, after the data frame is transmitted, a transmission buffer cleaning interrupt subroutine preset in an interrupt transmission routine is used to modify a transmission length in a descriptor corresponding to the data frame that has been completely transmitted to a preset length, and clean a transmission buffer corresponding to the data frame that has been completely transmitted.
According to a second aspect, an embodiment of the present application provides a terminal device, including: a sending length modifying unit, configured to modify a sending length in a descriptor corresponding to a data frame that has been sent to a preset length after sending the data frame; the preset length is greater than or equal to the minimum effective sending length of a MAC controller used for sending the data frame, the minimum effective sending length depends on the MAC controller and is an integer greater than or equal to zero; and the sending buffer cleaning unit is used for cleaning the sending buffer corresponding to the data frame which is sent.
According to a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method according to the first aspect or any embodiment of the first aspect when executing the computer program.
According to a fourth aspect, embodiments of the present application provide a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the method according to the first aspect or any embodiment of the first aspect.
According to the method for solving the problem of repeated data sending, after the data frames are sent, the sending length in the corresponding descriptor is modified into a smaller value which is not smaller than the minimum effective sending length, the integrity of the cached original sent data frames is damaged, and the repeated charge deduction problem cannot be caused even if the data frames are sent mistakenly again. In addition, the method for solving the problem of repeated data transmission provided by the embodiment of the application also cleans the transmission buffer in time after the data frame is transmitted, so that the original data frame which is buffered is not effective, and even if the data frame is mistakenly transmitted again when the MAC controller or the driving program thereof is abnormal, the repeated charge problem can not be caused. The method for solving the problem of repeated data sending provided by the embodiment of the application does not improve hardware equipment for sending data, and has the advantage of low cost while eradicating the problem of repeated account deduction. The method for solving the problem of repeated data sending can timely clear the sending cache, and solves the problems that the cost of the existing communication equipment in processing the repeated data sending is high and the phenomenon of repeated account deduction cannot be eradicated.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a specific example of a method for solving a problem of data retransmission according to an embodiment of the present application;
fig. 2 is a flowchart of another specific example of a method for solving the problem of data retransmission according to an embodiment of the present application;
fig. 3 is a schematic diagram of a specific example of a terminal device provided in an embodiment of the present application;
fig. 4 is a schematic diagram of another specific example of a terminal device provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The ethernet module is one of important communication modules in financial payment equipment, and under some abnormal conditions, an abnormal phenomenon that the MAC layer of the ethernet module repeatedly sends already sent data occurs, which may cause repeated deduction of accounts of users. Here, MAC is a proper term in ethernet and is an abbreviation of Media Access Control/medium Access Control. Ethernet modules are typically divided into four layers from top to bottom: the media access sub-layer is one sub-layer in the link layer, also called MAC sub-layer, and is referred to as MAC layer for short. The MAC layer is used to control the associated hardware responsible for interfacing with the wired transmission medium, e.g., to control transparent transmission of link layer protocol data units, to control access to the physical transmission medium.
The conventional methods for solving the problem of repeated data transmission mainly include:
a. the priority of an Ethernet module interrupt service program in the equipment is improved;
b. the running speed of the whole driving program of the Ethernet module is accelerated;
c. increasing the sending and receiving buffer space of an Ethernet module MAC layer in the equipment;
d. and relieving the congestion condition of the network, searching the source of the virus or the bad program, and eradicating the virus or the bad program.
Method a is limited by a number of factors, for example, when the priority of the ethernet module interrupt service routine in the device is not adjustable or has reached its maximum, or the services of other modules are affected after adjustment, method a will not be implementable. Furthermore, relying solely on method a does not ensure a thorough solution to the data retransmission problem. The method b needs to improve the working frequency of the main control CPU or greatly optimize the driving code of the Ethernet module, and has the problems of high cost and great implementation difficulty. Not only does method c require more memory resources to be consumed, but the device still suffers from data retransmission problems when the interference strength of the problem source is further increased. The method d needs to examine the whole system, has higher cost and higher implementation difficulty, and can not eradicate the problem of data retransmission, namely the possibility of fault recurrence exists.
The conventional solution to the data retransmission problem generally has the problems of high cost, high implementation difficulty and difficulty in thorough solution.
In the MAC sublayer, in order to improve transmission efficiency, a transmission buffer ring queue (referred to as a transmission buffer ring for short) is generally used to manage and transmit data. The upper layer program submits the data to be sent to the MAC sublayer, which encapsulates the data and writes the encapsulated data into the tail of the sending buffer ring, and updates the tail pointer (i.e., modulo one). The data frames to be sent are arranged in the sending buffer ring closely frame by frame according to the submitting sequence. The MAC controller takes out a data frame from the head pointer of the transmission buffer ring to automatically transmit the data frame in sequence frame by frame; after each frame is sent, the MAC controller updates the head pointer (namely, one is increased in a mode); the MAC controller continues to transmit frame by frame until the tail pointer is reached.
When a driver has a vulnerability in the management of the head pointer and the tail pointer of the transmission buffer ring, or the MAC controller causes the head pointer or the tail pointer to be disordered under an abnormal condition, the problem that a plurality of transmitted data frames in the transmission buffer ring are transmitted again occurs.
The embodiment of the application solves the problem of data retransmission by adding a sending buffer clearing processing flow to the original MAC layer driver based on understanding and analysis of the data sending mechanism. When the network is under the condition of large flow, virus or bad program attack, even if the MAC controller or the drive program thereof is abnormal and a phenomenon that a plurality of old data frames in the data cache are sent again is generated, the cache is cleaned, so that effective information cannot be sent out; finally, the problem of repeated account deduction of the user account caused by repeated sending of the MAC layer can be avoided.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
An embodiment of the present application provides a method for solving a problem of data retransmission, and as shown in fig. 1, the method for solving the problem of data retransmission may include the following steps:
step S101: and after the data frame is sent, modifying the sending length in the descriptor corresponding to the sent data frame into a preset length.
Specifically, the preset length should be as small as possible, but should be not less than the minimum effective transmission length acceptable by the MAC controller for transmitting the data frame; the minimum effective transmit length is dependent on the MAC controller and is an integer greater than or equal to zero.
In a specific embodiment, the transmission length indicated by the descriptor corresponding to the data frame whose transmission is completed may be reduced, for example, to the minimum effective transmission length. The minimum effective transmission length refers to the minimum transmission length that can be accepted by the MAC controller, for example, for a MAC controller with a minimum effective transmission length of 17 bytes, when the transmission length indicated by the descriptor is 17 bytes (i.e., equal to the minimum effective transmission length), the data frame corresponding to the descriptor can be transmitted successfully, and the number of transmitted information bits is the least.
The MAC controller realizes the transmission management of the data frame through the transmission buffer circular queue. The transmission buffer circular queue is a structure queue composed of descriptors, and the descriptors are generally composed of fields such as length to be transmitted, frame start mark, frame end mark, frame check sequence generation mode, transmission state indication and frame data start address. The specific names of the corresponding fields and the arrangement order of the fields may be different on different MAC controllers, and other field information may be included.
As an example, the transmit buffer circular queue may be defined with an array of structures as:
# define N64// Total number of set Transmit descriptors
struct TX_BUF_RING
{
An unscented short TxLen; // length to be transmitted
bit SOF; // frame Start flag
bit EOF; // end of frame flag
char FcsMode; // frame check sequence generation
char TransferStatus; // transmission status indication
char DataBufAddr; // frame data start Address
}TxBufRing[N];
Here, N is the total number of the set transmission descriptors, and may be set according to the system resource situation and the transmission requirement of the upper layer driver, and typical setting values are: 10. 30, 64, 100, etc.; the size of N determines the size of the transmit buffer loop. The size of the single transmit descriptor is specified by the MAC controller, typically 8 bytes, and its size is denoted by the symbol M.
Since the descriptor contains the length field to be transmitted, modifying this field allows assigning a smaller length value to it, i.e. the length of transmission indicated by the descriptor can be reduced.
In practical applications, as shown in fig. 2, the process of step S101 can be implemented by the following sub-steps:
step S1011: and reading a pointer register of the MAC controller, and acquiring a current read operation pointer according to the pointer register.
After transmitting the data frame, the current read operation pointer may be read from the transmit buffer ring of the MAC controller and its read pointer register. Specifically, after the data frame is transmitted, the read operation pointer points to the address of the next descriptor to be read.
Step S1012: and acquiring the descriptor corresponding to the data frame which is completely sent according to the current read operation pointer.
Specifically, the current read operation pointer may be first stored in a preset pointer variable, for example, the current read operation pointer may be stored in the pointer variable praad; secondly, within the range of the sending buffer ring queue of the MAC controller, the pointer variable is backed by a preset distance, for example, the pointer variable praad can be backed by the size of one descriptor; and finally, acquiring the descriptor corresponding to the data frame which is sent according to the pointer variable after returning the preset distance. After the pointer variable praad returns the size of one descriptor, the pointer variable praad can just point to the descriptor which is just sent, so that the method for solving the problem of data repeat sending provided by the embodiment of the application can finally obtain the descriptor corresponding to the data frame which is sent completely again according to the read operation pointer obtained by reading.
Step S1013: the transmission length in the descriptor is modified to a preset length.
After the pointer variable praad obtains the descriptor corresponding to the data frame which has completed transmission again, the transmission length in the descriptor can be reduced by modifying the content of a specific field in the descriptor so as to modify the transmission length of the descriptor to a preset length.
Step S102: and clearing the sending buffer corresponding to the data frame which is sent.
When the cache is cleared, either a full or partial clearing may be used. Specifically, when the buffer is cleared in a total clearing manner, all sending buffers corresponding to the data frames which have been sent need to be cleared; when the buffer is cleared by using the partial clearing method, only a part of the transmission buffer corresponding to the data frame whose transmission is completed may be cleared, for example, address information (including a destination MAC address and/or a destination IP address) in the transmission buffer corresponding to the data frame whose transmission is completed may be cleared, and it is not necessary to perform clearing processing on all the transmission buffers.
In practical applications, for financial payment devices with data transceiving functions, such as point of sale (POS) machines (including intelligent POS and traditional POS), there are two basic ways for data transmission processing of MAC controllers and MAC layer drivers: a polling transmission mode and an interrupt transmission mode.
When the MAC controller transmits a data frame in a polling transmission manner, after the data frame is transmitted, the transmission length in the descriptor corresponding to the data frame whose transmission has been completed may be modified to a preset length according to a preset transmission buffer cleaning interrupt program, and the transmission buffer corresponding to the data frame whose transmission has been completed may be cleaned.
For the MAC controller that performs data frame transmission by using a polling transmission method, according to the method for solving the problem of data retransmission provided in the embodiment of the present application, a corresponding transmission buffer cleaning interrupt program is pre-programmed, the transmission buffer cleaning interrupt program is started in the system initialization process of the driver, and an interrupt vector of the transmission interrupt service program is configured, so that after each data frame is completely transmitted, the transmission buffer cleaning interrupt program is triggered to clean the transmission buffer in time, thereby solving the problem of data frame retransmission.
For the MAC controller that transmits a data frame in an interrupt transmission manner, according to the method for solving the problem of repeated data transmission provided in the embodiment of the present application, a transmission buffer cleaning interrupt subroutine is added to an original interrupt transmission routine, so that after each data frame is transmitted, the transmission buffer cleaning interrupt subroutine is triggered to clean the transmission buffer in time, and the problem of data frame retransmission is solved. It should be noted that the transmission buffer cleaning interrupt routine provided in the embodiment of the present application is not used for transmitting data frames, but is used only for transmission buffer cleaning processing. In addition, the sending buffer cleaning interrupt subroutine should be added before the existing interrupt sending program code to avoid mistakenly cleaning the newly written data frame to be sent.
After the sending buffer cleaning is completed by adopting the sending buffer cleaning interrupt program or the sending buffer cleaning interrupt subprogram, the sending interrupt identification bit needs to be cleared to finish the current interrupt.
According to the method for solving the problem of repeated data transmission, after the data frame is transmitted, the integrity of the buffered original data frame which is transmitted is damaged by modifying the transmission length in the corresponding descriptor into a value which is not less than the minimum effective transmission length. In addition, the method for solving the problem of repeated data transmission provided by the embodiment of the application also cleans the transmission cache in time after the data frame is transmitted, so that the original data frame which is cached and transmitted loses effectiveness, when the MAC controller or the driving program thereof is abnormal, the mistakenly transmitted data is invalid, the repeated account deduction problem can be avoided, and the repeated account deduction fault caused by data retransmission can be eradicated. The method for solving the problem of repeated data sending provided by the embodiment of the application does not improve hardware equipment for sending data, and has the advantage of low cost while eradicating repeated account deduction faults. The method for solving the problem of repeated data transmission can timely clear the transmission cache, and solves the problems that the cost of the existing communication equipment is high in the process of solving the problem of repeated data transmission and the fault cannot be eradicated.
Specifically, the method for solving the problem of repeated data transmission provided by the embodiment of the present application adopts a "sparse" strategy. When a large flow, virus or bad program attack occurs to the network, the phenomenon that the old data frame in the data cache is repeatedly sent still occurs, but the old data frame is already a cleaned and invalid data frame, so that the problem of repeated account deduction caused by retransmission of the MAC layer can be avoided. The method for solving the problem of repeated data transmission improves the capability of preventing the attack and the interference of the Ethernet module, and improves the accuracy and the reliability of the financial payment equipment for executing payment transaction on the Ethernet link.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
An embodiment of the present application further provides a terminal device, as shown in fig. 3, where the terminal device may include: a transmission length modification unit 301 and a transmission buffer cleaning unit 302.
The sending length modifying unit 301 is configured to modify, after sending the data frame, a sending length in a descriptor corresponding to the data frame that has been sent to a preset length; the preset length is greater than or equal to the minimum effective transmission length accepted by a MAC controller used for transmitting the data frame, the minimum effective transmission length depends on the MAC controller and is an integer greater than or equal to zero; the corresponding working process can be referred to as step S101 in the above method embodiment.
The sending buffer cleaning unit 302 is configured to clean a sending buffer corresponding to the data frame that has been sent; the corresponding working process can be referred to step S102 in the above method embodiment.
Fig. 4 is a schematic diagram of another terminal device provided in an embodiment of the present application. As shown in fig. 4, the terminal device 600 of this embodiment includes: a processor 601, a memory 602, and a computer program 603 stored in said memory 602 and executable on said processor 601, such as a program to solve the problem of repeated transmission of data. The processor 601, when executing the computer program 603, implements the steps in the above-mentioned embodiments of the method for solving the problem of repeated data transmission, such as the steps S101 to S102 shown in fig. 1. Alternatively, the processor 601, when executing the computer program 603, implements the functions of each module/unit in each device embodiment described above, for example, the functions of the transmission length modification unit 301 and the transmission buffer cleaning unit 302 shown in fig. 3.
The computer program 603 may be partitioned into one or more modules/units that are stored in the memory 602 and executed by the processor 601 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 603 in the terminal device 600. For example, the computer program 603 may be partitioned into a synchronization module, a summarization module, an acquisition module, a return module (a module in a virtual device).
The terminal device 600 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 601, a memory 602. Those skilled in the art will appreciate that fig. 4 is merely an example of a terminal device 600 and does not constitute a limitation of terminal device 600 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 601 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 602 may be an internal storage unit of the terminal device 600, such as a hard disk or a memory of the terminal device 600. The memory 602 may also be an external storage device of the terminal device 600, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 600. Further, the memory 602 may also include both an internal storage unit and an external storage device of the terminal device 600. The memory 602 is used for storing the computer programs and other programs and data required by the terminal device. The memory 602 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for solving a problem of repeated data transmission, comprising:
after the data frame is sent, reducing the sending length in the descriptor corresponding to the sent data frame to a preset length; the preset length is greater than or equal to the minimum effective sending length of a MAC controller used for sending the data frame, the minimum effective sending length depends on the MAC controller and is an integer greater than or equal to zero;
and clearing the sending buffer corresponding to the data frame which is sent.
2. The method for solving the problem of repeated data transmission according to claim 1, wherein the modifying the transmission length in the descriptor corresponding to the data frame whose transmission is completed to a preset length comprises:
reading a pointer register of the MAC controller, and acquiring a current read operation pointer according to the pointer register;
acquiring a descriptor corresponding to the data frame which is sent according to the current reading operation pointer;
and modifying the sending length in the descriptor into a preset length.
3. The method for solving the problem of repeated data transmission according to claim 2, wherein the obtaining the descriptor corresponding to the data frame whose transmission is completed according to the current read operation pointer comprises:
storing the current reading operation pointer into a preset pointer variable;
within the range of a sending buffer annular queue of the MAC controller, returning the pointer variable by a preset distance; the preset distance is the size of one descriptor;
and acquiring a descriptor corresponding to the data frame which is finished to be sent according to the pointer variable after returning the preset distance.
4. The method for solving the problem of repeated data transmission according to claim 1, wherein the clearing the transmission buffer corresponding to the data frame whose transmission is completed comprises:
and cleaning all sending buffers corresponding to the data frames which are sent completely.
5. The method for solving the problem of repeated data transmission according to claim 1, wherein the clearing the transmission buffer corresponding to the data frame whose transmission is completed comprises:
clearing part of sending buffer corresponding to the data frame which is sent;
when the part sending buffer corresponding to the data frame which is sent is cleaned, the address information in the sending buffer corresponding to the data frame which is sent is cleared.
6. The method as claimed in any one of claims 1 to 5, wherein when the MAC controller transmits a data frame by a polling transmission method, after the data frame is transmitted, the transmission length in the descriptor corresponding to the data frame whose transmission has been completed is modified to a preset length according to a preset transmission buffer cleaning interrupt procedure, and the transmission buffer corresponding to the data frame whose transmission has been completed is cleaned.
7. The method as claimed in any one of claims 1 to 5, wherein when the MAC controller transmits a data frame by an interrupt transmission method, after the data frame is transmitted, the transmission length in the descriptor corresponding to the data frame whose transmission has been completed is modified to a preset length by a transmission buffer cleaning subroutine preset in an interrupt transmission routine, and the transmission buffer corresponding to the data frame whose transmission has been completed is cleaned.
8. A terminal device, comprising:
a transmission length modification unit, configured to reduce a transmission length in a descriptor corresponding to a data frame that has been completed to a preset length after the data frame is transmitted; the preset length is greater than or equal to the minimum effective sending length of a MAC controller used for sending the data frame, the minimum effective sending length depends on the MAC controller and is an integer greater than or equal to zero;
and the sending buffer cleaning unit is used for cleaning the sending buffer corresponding to the data frame which is sent.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN201910731393.6A 2019-08-08 2019-08-08 Method, terminal device and storage medium for solving problem of repeated data transmission Active CN110602166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910731393.6A CN110602166B (en) 2019-08-08 2019-08-08 Method, terminal device and storage medium for solving problem of repeated data transmission

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910731393.6A CN110602166B (en) 2019-08-08 2019-08-08 Method, terminal device and storage medium for solving problem of repeated data transmission

Publications (2)

Publication Number Publication Date
CN110602166A CN110602166A (en) 2019-12-20
CN110602166B true CN110602166B (en) 2022-03-08

Family

ID=68853698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910731393.6A Active CN110602166B (en) 2019-08-08 2019-08-08 Method, terminal device and storage medium for solving problem of repeated data transmission

Country Status (1)

Country Link
CN (1) CN110602166B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111600809B (en) * 2020-05-15 2023-11-21 北京光润通科技发展有限公司 Gigabit single optical port server adapter
CN114124858B (en) * 2022-01-29 2022-05-17 飞腾信息技术有限公司 Control method and control device
CN115102673B (en) * 2022-04-29 2023-11-03 中国船舶集团有限公司第七一六研究所 PRP protocol repeated frame discrimination processing method and system based on frame memory pool

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6327615B1 (en) * 1998-09-30 2001-12-04 Stmicroelectronics, Inc. Method and system of controlling transfer of data by updating descriptors in descriptor rings
US7787481B1 (en) * 2004-07-19 2010-08-31 Advanced Micro Devices, Inc. Prefetch scheme to minimize interpacket gap
CN102065568A (en) * 2009-11-17 2011-05-18 中国科学院微电子研究所 Data descriptor-based medium access control (MAC) software and hardware interaction method and hardware realization device
CN103034599A (en) * 2012-12-12 2013-04-10 深圳国微技术有限公司 Security DMA (Direct Memory Access) controller, SOC (System-on-a-Chip) system and data transportation method of SOC system
CN107707546A (en) * 2017-09-29 2018-02-16 江苏农林职业技术学院 A kind of packet copy method and the new network adapter for supporting message copy function

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7502474B2 (en) * 2004-05-06 2009-03-10 Advanced Micro Devices, Inc. Network interface with security association data prefetch for high speed offloaded security processing
US20090086729A1 (en) * 2007-09-28 2009-04-02 Parthasarathy Sarangam User datagram protocol (UDP) transmit acceleration and pacing
US8565065B2 (en) * 2008-06-23 2013-10-22 Qualcomm Incorporated Methods and systems for utilizing a multicast/broadcast CID scheduling MAC management message

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6327615B1 (en) * 1998-09-30 2001-12-04 Stmicroelectronics, Inc. Method and system of controlling transfer of data by updating descriptors in descriptor rings
US7787481B1 (en) * 2004-07-19 2010-08-31 Advanced Micro Devices, Inc. Prefetch scheme to minimize interpacket gap
CN102065568A (en) * 2009-11-17 2011-05-18 中国科学院微电子研究所 Data descriptor-based medium access control (MAC) software and hardware interaction method and hardware realization device
CN103034599A (en) * 2012-12-12 2013-04-10 深圳国微技术有限公司 Security DMA (Direct Memory Access) controller, SOC (System-on-a-Chip) system and data transportation method of SOC system
CN107707546A (en) * 2017-09-29 2018-02-16 江苏农林职业技术学院 A kind of packet copy method and the new network adapter for supporting message copy function

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Frame descriptor tables for minimized signaling overhead in beyond 3G MAC protocols;O.Klein;《Joint IST Workshop on Mobile Future,2006 and the Symposium on Trends in Communicaitons. SympoTIC"06》;20061009;全文 *
基于DMA的双通道千兆以太网MAC设计与验证;刘浩;《计算机计算与发张》;20160531;第26卷(第5期);132-134,138 *

Also Published As

Publication number Publication date
CN110602166A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN110602166B (en) Method, terminal device and storage medium for solving problem of repeated data transmission
US10860511B1 (en) Integrated network-attachable controller that interconnects a solid-state drive with a remote server computer
US6279051B1 (en) Host adapter having paged payload buffers for simultaneously transferring data between a computer bus and a peripheral bus
CN107766270B (en) Data reading management method and device for PCIe (peripheral component interface express) equipment
EP1896965B1 (en) Dma descriptor queue read and cache write pointer arrangement
US7937447B1 (en) Communication between computer systems over an input/output (I/O) bus
US20050235072A1 (en) Data storage controller
US10901838B2 (en) Predictive caching for check word snooping in high performance ficon
US20140068134A1 (en) Data transmission apparatus, system, and method
CN109710548A (en) A kind of DMA control data transmission method, system and equipment
US8312187B2 (en) Input/output device including a mechanism for transaction layer packet processing in multiple processor systems
US9390036B2 (en) Processing data packets from a receive queue in a remote direct memory access device
CN103562895B (en) It is easy to route by selective polymerisation adjacent data cell
EP1934760A1 (en) Parallel processing of frame based data transfers
CN111641566B (en) Data processing method, network card and server
CN106487896A (en) Method and apparatus for processing remote direct memory access request
US10229084B2 (en) Synchronous input / output hardware acknowledgement of write completions
CN115396527B (en) PCIE and SRIO protocol conversion system and method based on FPGA
CN115934625B (en) Doorbell knocking method, equipment and medium for remote direct memory access
CN115113977A (en) Descriptor reading apparatus and device, method and integrated circuit
CN109857545A (en) A kind of data transmission method and device
US10097658B2 (en) Traffic control of packet transfer
CN104123173A (en) Method and device for achieving communication between virtual machines
EP1899831A1 (en) Frame order processing apparatus, systems, and methods
JP5904948B2 (en) The system that allows direct data transfer between memories of several components of the system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant