CN115604366A - Method and device for data transmission, near field communication chip and storage medium - Google Patents

Method and device for data transmission, near field communication chip and storage medium Download PDF

Info

Publication number
CN115604366A
CN115604366A CN202211577523.3A CN202211577523A CN115604366A CN 115604366 A CN115604366 A CN 115604366A CN 202211577523 A CN202211577523 A CN 202211577523A CN 115604366 A CN115604366 A CN 115604366A
Authority
CN
China
Prior art keywords
data
frame
target
host
byte 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.)
Granted
Application number
CN202211577523.3A
Other languages
Chinese (zh)
Other versions
CN115604366B (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.)
Beijing Unigroup Tsingteng Microsystems Co Ltd
Original Assignee
Beijing Unigroup Tsingteng Microsystems 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 Beijing Unigroup Tsingteng Microsystems Co Ltd filed Critical Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority to CN202211577523.3A priority Critical patent/CN115604366B/en
Publication of CN115604366A publication Critical patent/CN115604366A/en
Application granted granted Critical
Publication of CN115604366B publication Critical patent/CN115604366B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/72Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for local intradevice communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

The application relates to the technical field of near field communication, and discloses a method for data transmission, which is applied to a near field communication chip and comprises the following steps: determining whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data domain, wherein the frame header comprises a set number of byte data, and the frame data domain comprises a plurality of byte data; under the condition that at least one data frame exists in the memory, target byte data are obtained from the data frame; inserting target byte data between the frame header and the frame data domain to obtain a target data frame; the target data frame is transmitted to the host using direct memory access. Therefore, under the condition that the byte data is lost in the process of reading the data by the host, the integrity of the data frame read by the host is not influenced because the lost byte data is the target byte data, and the host can read correct data. The application also discloses a device, a near field communication chip and a storage medium for data transmission.

Description

Method and device for data transmission, near field communication chip and storage medium
Technical Field
The present application relates to the field of near field communication technologies, and for example, to a method and an apparatus for data transmission, a near field communication chip, and a storage medium.
Background
A Communication protocol between the NFC chip and the host is called as an NCI (Near Field Communication Controller interface), and the NFC chip transmits a data frame to the host by using DMA (Direct Memory Access). That is, a DMA is used to retrieve a data frame from the memory and then transmit the retrieved data frame to the host via the data bus. For example, chinese patent publication No. CN109075815A discloses an on-chip system, comprising: a system bus, at least one processor coupled to the system bus, and a secure processor system coupled to the system bus; a secure isolation exists between the secure processor system and the at least one processor; the at least one processor comprises at least one central processing unit, and the at least one central processing unit is used for running general-purpose operating system software and communicating with the safety processor system through the system bus under the action of the general-purpose operating system software; the secure processor system comprises a secure processor, a first memory, a plurality of interfaces, and a secure bus, the secure processor, first memory, and plurality of interfaces all coupled to the secure bus, and the secure bus coupled to the system bus; wherein the secure processor is configured to run secure operating system software and at least one secure application software based on the secure operating system software, the at least one secure application software including mobile payment software configured to implement mobile payment; the first memory is used for providing a storage space required by the safety processor to run the safety operating system software and the at least one safety application software; the plurality of interfaces includes a Near Field Communication (NFC) interface and a biometric input interface; the NFC interface is used for interacting NFC information related to the mobile payment with an NFC opposite terminal through an NFC processor; the biometric input interface to receive biometric data from a biometric sensor, the biometric data being used in the mobile payment for biometric-based user authentication; the secure processor system further includes a Direct Memory Access (DMA) controller coupled to the secure bus, for reading data from the first Memory and outputting the data to the secure bus or writing the data to the first Memory through the secure bus. Chinese patent document No. CN207115461U discloses a SIM card, which includes: the system comprises a main control circuit, a near field communication circuit and an interface circuit which are hung on a system bus and perform communication interaction through the system bus, and further comprises a power management circuit for supplying power to the main control circuit, the near field communication circuit and the interface circuit; the near field communication circuit realizes near field communication through at least one external near field communication antenna. The interface controller includes: a bridge controller and/or a DMA (Direct Memory Access) controller.
In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
the host generally reads the data frame sent by the near field communication chip in a segmented mode, that is, the header of the data frame is read first, and then the frame data field of the data frame is read. But after reading the frame header, the host sends a stop signal to the NFC chip. However, at this time, the NFC chip has already acquired the first byte data of the frame data field from the data frame by using DMA, and only temporarily stores the byte data in the register of the host through the data bus. At this time, the NFC chip receives the stop signal and stops transmitting the byte data to the host through the data bus. I.e. the transmission of the first byte of data of the frame data field to the host is stopped. When the host starts to read the frame data field, a start signal is sent to the nfc chip, and the nfc chip obtains the second byte data of the frame data field by using DMA. Resulting in the loss of the first byte of data of the frame data field. Thereby causing the host to read the data incorrectly.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview and is intended to neither identify key/critical elements nor delineate the scope of such embodiments, but is intended to be a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method and a device for data transmission, a near field communication chip and a storage medium, so as to ensure that a host can read correct data.
In some embodiments, the method for data transmission is applied to a near field communication chip, where the near field communication chip includes a memory, and the method includes: determining whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data domain, wherein the frame header comprises a set number of byte data, and the frame data domain comprises a plurality of byte data; under the condition that at least one data frame exists in the memory, acquiring target byte data in the data frame; inserting the target byte data between the frame header and the frame data domain to obtain a target data frame; transmitting the target data frame to a host using direct memory access.
In some embodiments, transmitting the target data frame to a host using direct memory access includes: acquiring byte data to be transmitted from the target data frame by utilizing direct memory access; determining whether a stop signal sent by the host is received; under the condition that a stop signal sent by the host computer is not received, the byte data to be transmitted are stored in a register of the host computer by using a serial communication bus; and/or stopping storing the byte data to be transmitted into a register of the host by using the serial communication bus under the condition of receiving a stop signal sent by the host.
In some embodiments, obtaining target byte data in the data frame comprises: and determining the first byte data of the frame data field as target byte data.
In some embodiments, obtaining target byte data in the data frame comprises: and determining any one byte data in the data frame as target byte data.
In some embodiments, the apparatus for data transmission is applied to a near field communication chip, where the near field communication chip includes a memory, and the apparatus includes: a determining module configured to determine whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data domain, wherein the frame header comprises a set number of byte data, and the frame data domain comprises a plurality of byte data; the acquisition module is configured to acquire target byte data in the data frame under the condition that at least one data frame exists in the memory; the inserting module is configured to insert the target byte data between the frame header and the frame data domain to obtain a target data frame; a transmission module configured to transmit the target data frame to a host using direct memory access.
In some embodiments, the transmission module comprises: a direct memory access unit configured to acquire byte data to be transmitted from the target data frame by using direct memory access; a determination unit configured to determine whether a stop signal transmitted by the host is received; the serial communication bus unit is configured to store the byte data to be transmitted into a register of the host by using a serial communication bus under the condition that a stop signal sent by the host is not received; and/or stopping storing the byte data to be transmitted into a register of the host by using the serial communication bus under the condition of receiving a stop signal sent by the host.
In some embodiments, the obtaining module is configured to obtain the target byte data in the data frame by determining a first byte data of the frame data field as the target byte data.
In some embodiments, the acquisition module is configured to acquire the target byte data in the data frame by: and determining any one byte data in the data frame as target byte data.
In some embodiments, the near field communication chip comprises a processor and a memory storing program instructions, the processor being configured to perform the above-mentioned method for data transmission when executing the program instructions.
In some embodiments, the storage medium stores program instructions that, when executed, perform the method for data transmission described above.
The method, the device, the near field communication chip and the storage medium for data transmission provided by the embodiment of the disclosure can realize the following technical effects: the target data frame is obtained by inserting target byte data between a header of the data frame and a frame data field before transmitting the data frame to the host, and then transmitting the target data frame to the host. Therefore, under the condition that the byte data is lost in the process of reading the data by the host, the integrity of the data frame read by the host is not influenced because the lost byte data is the target byte data, and the host can read the correct data.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
fig. 1 is a schematic diagram of a first method for data transmission provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a second method for data transmission according to an embodiment of the disclosure;
fig. 3 is a schematic diagram of a third method for data transmission according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a fourth method for data transmission provided by an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an apparatus for data transmission according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a near field communication chip provided in an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged as appropriate for the embodiments of the disclosure described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. E.g., a and/or B, represents: a or B, or A and B.
The term "correspond" may refer to an association or binding relationship, and a corresponds to B refers to an association or binding relationship between a and B.
In order to ensure that the host can read correct data, the method inserts target byte data between a frame header and a frame data domain of the data frame before transmitting the data frame to the host to obtain a target data frame, and then transmits the target data frame to the host. Therefore, under the condition that the byte data is lost in the process of reading the data by the host, the integrity of the data frame read by the host is not influenced because the lost byte data is the target byte data, and the technical effect of ensuring that the host reads the correct data is further achieved.
Referring to fig. 1, an embodiment of the present disclosure provides a method for data transmission, which is applied to a near field communication chip, where the near field communication chip includes a memory, and the method includes:
step S101, the near field communication chip determines whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data field, wherein the frame header comprises a set number of byte data, and the frame data field comprises a plurality of byte data.
Step S102, when the nfc chip has at least one data frame in the memory, obtaining target byte data in the data frame.
Step S103, the near field communication chip inserts the target byte data between the frame head and the frame data domain of the data frame to obtain the target data frame.
In step S104, the nfc chip transmits the target data frame to the host using direct memory access.
By adopting the method for data transmission provided by the embodiment of the disclosure, before the data frame is transmitted to the host, the target byte data is inserted between the frame header and the frame data domain of the data frame to obtain the target data frame, and then the target data frame is transmitted to the host. Because the host computer adopts a segmented reading method to read the target data frame sent by the near field communication chip, the first byte data of the frame data field of the target data frame, namely the target byte data, can be lost when the host computer reads the target data frame. The difference between the data frame and the target data frame is one target byte data, so that the host finally reads the data frame after the host loses the target byte data. I.e. to enable the host to read the correct data.
In some embodiments, the set number is 3.
In some embodiments, the host is a mobile phone, a computer, a tablet computer, or the like.
Optionally, transmitting the target data frame to the host using direct memory access, comprising: acquiring byte data to be transmitted from a target data frame by utilizing direct memory access; it is determined whether a stop signal transmitted by the host is received. And under the condition that a stop signal sent by the host is not received, storing the byte data to be transmitted into a register of the host by using the serial communication bus. And/or stopping storing the byte data to be transmitted into a register of the host by using the serial communication bus under the condition of receiving a stop signal sent by the host. After the host reads the header of the frame, that is, after reading the set number of byte data, the host sends a stop signal to the nfc chip, and the nfc chip already obtains the byte data to be transmitted, that is, the target byte data, when receiving the stop signal. At this time, the storage of the target byte data into the register of the host using the serial communication bus is stopped. It is possible to make the byte data stored in the register not include the target byte data.
The byte data in the target data frame are arranged according to a preset sequence. Acquiring byte data to be transmitted from a target data frame by using direct memory access, comprising the following steps: and acquiring byte data to be transmitted from the target data frame according to a preset sequence.
In some embodiments, the direct memory access determines each byte data in the target data frame as the byte data to be transmitted in turn according to a preset sequence.
With reference to fig. 2, an embodiment of the present disclosure provides a method for data transmission, which is applied to a near field communication chip, where the near field communication chip includes a memory, and the method includes:
step S201, the nfc chip determines whether there is at least one data frame in the memory; the data frame comprises a frame head and a frame data domain, wherein the frame head comprises a set number of byte data, and the frame data domain comprises a plurality of byte data.
Step S202, when the nfc chip has at least one data frame in the memory, the target byte data is obtained in the data frame.
Step S203, the nfc chip inserts the target byte data between the frame header and the frame data field of the data frame to obtain a target data frame.
Step S204, the near field communication chip determines the byte data in the target data frame as the byte data to be transmitted in sequence according to a preset sequence.
In step S205, the nfc chip determines whether a stop signal sent by the host is received. If not, step S206 is performed. If so, step S207 is performed.
In step S206, the nfc chip stores the byte data to be transmitted into the register of the host using the serial communication bus.
In step S207, the nfc chip stops storing the byte data to be transmitted into the register of the host using the serial communication bus.
By adopting the method for data transmission provided by the embodiment of the disclosure, before the data frame is transmitted to the host, the target byte data is inserted between the frame header and the frame data domain of the data frame to obtain the target data frame, and then the target data frame is transmitted to the host. Because the host computer adopts a segmented reading method to read the target data frame sent by the near field communication chip, the first byte data of the frame data field of the target data frame, namely the target byte data, can be lost when the host computer reads the target data frame. The difference between the data frame and the target data frame is one target byte data, and after the host loses the target byte data, the host finally reads the data frame. I.e. to enable the host to read the correct data.
Optionally, after stopping storing the byte data to be transmitted into the register of the host by using the serial communication bus, the method further includes: and under the condition of receiving a starting signal sent by the host, sequentially storing all byte data positioned behind the byte data to be transmitted in the target data frame into a register of the host. This ensures that the data stored in the register is accurate.
Further, the register is a shift register.
Referring to fig. 3, an embodiment of the present disclosure provides a method for data transmission, which is applied to a near field communication chip, where the near field communication chip includes a memory, and the method includes:
step S301, the near field communication chip determines whether at least one data frame exists in the memory; the data frame comprises a frame head and a frame data domain, wherein the frame head comprises a set number of byte data, and the frame data domain comprises a plurality of byte data.
Step S302, when the nfc chip has at least one data frame in the memory, the target byte data is acquired in the data frame.
Step S303, the near field communication chip inserts the target byte data between the frame header and the frame data field of the data frame to obtain the target data frame.
Step S304, the nfc chip determines each byte data in the target data frame as the byte data to be transmitted in sequence according to a preset sequence.
In step S305, the near field communication chip determines whether a stop signal sent by the host is received. If not, go to step S306. If so, step S307 is executed.
Step S306, the nfc chip stores the byte data to be transmitted into the register of the host through the serial communication bus until the last byte data in the target data frame is stored into the register of the host. And then ends.
In step S307, the nfc chip stops storing the byte data to be transmitted into the register of the host using the serial communication bus. Then, step S308 is executed.
In step S308, the nfc chip receives the start signal sent by the host, and then performs step S304.
By adopting the method for data transmission provided by the embodiment of the disclosure, before the data frame is transmitted to the host, the target byte data is inserted between the frame header and the frame data domain of the data frame to obtain the target data frame, and then the target data frame is transmitted to the host. Because the host computer adopts a segmented reading method to read the target data frame sent by the near field communication chip, the first byte data of the frame data field of the target data frame, namely the target byte data, can be lost when the host computer reads the target data frame. The difference between the data frame and the target data frame is one target byte data, and after the host loses the target byte data, the host finally reads the data frame. I.e. so that the host can read the correct data.
Optionally, acquiring the target byte data in the data frame includes: the first byte data of the frame data field is determined as the target byte data.
With reference to fig. 4, an embodiment of the present disclosure provides a method for data transmission, which is applied to a near field communication chip, where the near field communication chip includes a memory, and the method includes:
step S401, the near field communication chip determines whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data field, wherein the frame header comprises a set number of byte data, and the frame data field comprises a plurality of byte data.
Step S402, when the nfc chip has at least one data frame in the memory, determining the first byte data of the frame data field of the data frame as the target byte data.
Step S403, the nfc chip inserts the target byte data between the frame header and the frame data field of the data frame to obtain a target data frame.
In step S404, the nfc chip transmits the target data frame to the host using direct memory access.
By adopting the method for data transmission provided by the embodiment of the disclosure, before the data frame is transmitted to the host, the target byte data is inserted between the frame header and the frame data domain of the data frame to obtain the target data frame, and then the target data frame is transmitted to the host. Since the host reads the target data frame sent by the nfc chip by using a segmented reading method, the host may lose the first byte data of the frame data field of the target data frame, that is, the target byte data, when reading the target data frame. The difference between the data frame and the target data frame is one target byte data, and after the target byte data is lost by the host, the host finally reads the data frame. I.e. so that the host can read the correct data.
In some embodiments, the data frames are 1, 2, 3, 4, 5, 6. In which byte data 1, 2, 3 constitute a frame header. The byte data 4, 5, 6 belong to the frame data field. The first byte data "4" of the frame data field is determined as the target byte data, and the target byte data "4" is inserted between the frame headers "1, 2, 3" and the frame data fields "4, 5, 6" to obtain the target data frames "1, 2, 3, 4, 5, 6". The target data frame is then transmitted to the host, since the host would lose the first byte of data "4" after the frame header when reading the target data frame. The byte data read by the host thus includes "1, 2, 3, 4, 5, 6". I.e. to ensure that the host can read the correct data.
Optionally, acquiring the target byte data in the data frame includes: any one byte data in the data frame is determined as the target byte data.
In some embodiments, the data frames are 1, 2, 3, 4, 5, 6. In which byte data 1, 2, 3 constitute a frame header. The byte data 4, 5, 6 belong to the frame data field. Any byte data "2" of the data frame is determined as target byte data, the target byte data "2" is inserted between the frame headers "1, 2, 3" and the frame data fields "4, 5, 6", and the target data frame "1, 2, 3, 2, 4, 5, 6" is obtained. The target data frame is then transmitted to the host, since the host will lose the first byte data "2" after the frame header when reading the target data frame. The byte data read by the host thus includes "1, 2, 3, 4, 5, 6". I.e. the host has read the correct data.
With reference to fig. 5, an embodiment of the present disclosure provides an apparatus 500 for data transmission, which is applied to a near field communication chip, where the near field communication chip includes a memory, and the apparatus includes a determining module 501, an obtaining module 502, an inserting module 503, and a transmitting module 504. The determining module 501 is configured to determine whether at least one data frame exists in the memory; the data frame comprises a frame head and a frame data domain, wherein the frame head comprises a set number of byte data, and the frame data domain comprises a plurality of byte data. The obtaining module 502 is configured to obtain the target byte data in the data frame if there is at least one data frame in the memory. The inserting module 503 is configured to insert the target byte data between the frame header and the frame data field to obtain the target data frame. The transmission module 504 is configured to transmit the target data frame to the host using direct memory access.
By using the apparatus for data transmission provided by the embodiment of the present disclosure, before transmitting a data frame to a host, target byte data is inserted between a frame header and a frame data field of the data frame to obtain a target data frame, and then the target data frame is transmitted to the host. Since the host reads the target data frame sent by the nfc chip by using a segmented reading method, the host may lose the first byte data of the frame data field of the target data frame, that is, the target byte data, when reading the target data frame. The difference between the data frame and the target data frame is one target byte data, and after the host loses the target byte data, the host finally reads the data frame. I.e. to enable the host to read the correct data.
Optionally, the transmission module comprises: a direct memory access unit configured to acquire byte data to be transmitted from the target data frame using direct memory access. A determination unit configured to determine whether a stop signal transmitted by the host is received. The serial communication bus unit is configured to store byte data to be transmitted into a register of the host by using the serial communication bus under the condition that a stop signal sent by the host is not received; and/or stopping storing the byte data to be transmitted into the register of the host by using the serial communication bus under the condition of receiving a stop signal sent by the host.
Optionally, the obtaining module is configured to obtain the target byte data in the data frame by: the first byte data of the frame data field is determined as the target byte data.
Optionally, the obtaining module is configured to obtain the target byte data in the data frame by: any one byte data in the data frame is determined as the target byte data.
As shown in fig. 6, an embodiment of the present disclosure provides a near field communication chip 600, which includes a processor (processor) 601 and a memory (memory) 602. Optionally, the apparatus may also include a Communication Interface 603 and bus 604. The processor 601, the communication interface 603, and the memory 602 may communicate with each other via the bus 604. Communication interface 603 may be used for information transfer. The processor 601 may call logic instructions in the memory 602 to perform the method for data transmission of the above-described embodiment.
By adopting the near field communication chip provided by the embodiment of the disclosure, the target byte data is inserted between the frame header and the frame data domain of the data frame before the data frame is transmitted to the host, so as to obtain the target data frame, and then the target data frame is transmitted to the host. Because the host computer adopts a segmented reading method to read the target data frame sent by the near field communication chip, the first byte data of the frame data field of the target data frame, namely the target byte data, can be lost when the host computer reads the target data frame. The difference between the data frame and the target data frame is one target byte data, and after the host loses the target byte data, the host finally reads the data frame. I.e. to enable the host to read the correct data.
Furthermore, the logic instructions in the memory 602 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products.
The memory 602 is a computer-readable storage medium and can be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 601 executes the program instructions/modules stored in the memory 602 to execute the functional applications and data processing, i.e., to implement the method for data transmission in the above-described embodiments.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 602 may include high speed random access memory and may also include non-volatile memory.
The embodiment of the disclosure provides a storage medium, which stores program instructions, and when the program instructions are executed, the method for data transmission is executed.
The computer-readable storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, where the computer software product is stored in a storage medium and includes one or more instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description for example only and are not limiting upon the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising one of 8230," does not exclude the presence of additional like elements in a process, method or device comprising the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would 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 may depend upon the particular application and design constraints imposed on the technical solution. 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 disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be merely a logical division, and in actual implementation, there may be another division, for example, multiple 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 implement the present embodiment. In addition, functional units in the embodiments of the present disclosure 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 flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for data transmission, applied to a near field communication chip, wherein the near field communication chip includes a memory, the method comprising:
determining whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data domain, wherein the frame header comprises a set number of byte data, and the frame data domain comprises a plurality of byte data;
under the condition that at least one data frame exists in the memory, acquiring target byte data in the data frame;
inserting the target byte data between the frame header and the frame data domain to obtain a target data frame;
transmitting the target data frame to a host using direct memory access.
2. The method of claim 1, wherein transferring the target data frame to a host using direct memory access comprises:
acquiring byte data to be transmitted from the target data frame by using direct memory access;
determining whether a stop signal sent by the host is received;
under the condition that a stop signal sent by the host is not received, storing the byte data to be transmitted into a register of the host by using a serial communication bus; and/or the presence of a gas in the gas,
and under the condition of receiving a stop signal sent by the host, stopping storing the byte data to be transmitted into a register of the host by using the serial communication bus.
3. The method of claim 1, wherein obtaining target byte data in the data frame comprises:
and determining the first byte data of the frame data field as target byte data.
4. The method of claim 1, wherein obtaining target byte data in the data frame comprises:
and determining any one byte data in the data frame as target byte data.
5. An apparatus for data transmission, applied to a near field communication chip, wherein the near field communication chip includes a memory, the apparatus comprising:
a determining module configured to determine whether at least one data frame exists in the memory; the data frame comprises a frame header and a frame data domain, wherein the frame header comprises a set number of byte data, and the frame data domain comprises a plurality of byte data;
the acquisition module is configured to acquire target byte data in the data frame under the condition that at least one data frame exists in the memory;
the inserting module is configured to insert the target byte data between the frame header and the frame data domain to obtain a target data frame;
a transmission module configured to transmit the target data frame to a host using direct memory access.
6. The apparatus of claim 5, wherein the transmission module comprises:
a direct memory access unit configured to acquire byte data to be transmitted from the target data frame by using a direct memory;
a determination unit configured to determine whether a stop signal transmitted by the host is received;
the serial communication bus unit is configured to store the byte data to be transmitted into a register of the host by using a serial communication bus under the condition that a stop signal sent by the host is not received; and/or stopping storing the byte data to be transmitted into a register of the host by using the serial communication bus under the condition of receiving a stop signal sent by the host.
7. The apparatus of claim 5, wherein the obtaining module is configured to obtain the target byte data in the data frame by:
and determining the first byte data of the frame data field as target byte data.
8. The apparatus of claim 5, wherein the obtaining module is configured to obtain the target byte data in the data frame by:
and determining any one byte data in the data frame as target byte data.
9. A near field communication chip comprising a processor and a memory storing program instructions, characterized in that the processor is configured to perform the method for data transmission according to any one of claims 1 to 4 when executing the program instructions.
10. A storage medium storing program instructions which, when executed, perform a method for data transmission according to any one of claims 1 to 4.
CN202211577523.3A 2022-12-09 2022-12-09 Method and device for data transmission, near field communication chip and storage medium Active CN115604366B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211577523.3A CN115604366B (en) 2022-12-09 2022-12-09 Method and device for data transmission, near field communication chip and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211577523.3A CN115604366B (en) 2022-12-09 2022-12-09 Method and device for data transmission, near field communication chip and storage medium

Publications (2)

Publication Number Publication Date
CN115604366A true CN115604366A (en) 2023-01-13
CN115604366B CN115604366B (en) 2023-02-21

Family

ID=84851975

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211577523.3A Active CN115604366B (en) 2022-12-09 2022-12-09 Method and device for data transmission, near field communication chip and storage medium

Country Status (1)

Country Link
CN (1) CN115604366B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010006525A1 (en) * 1999-12-28 2001-07-05 Yuji Mizuguchi System, method and apparatus for data transmission
US20170264458A1 (en) * 2014-08-05 2017-09-14 Robert Bosch Gmbh User station for a bus system and method for the wideband can communication
CN113411641A (en) * 2021-06-01 2021-09-17 深圳市洲明科技股份有限公司 Data transmission method, receiving method, sending end, receiving end and communication system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010006525A1 (en) * 1999-12-28 2001-07-05 Yuji Mizuguchi System, method and apparatus for data transmission
US20170264458A1 (en) * 2014-08-05 2017-09-14 Robert Bosch Gmbh User station for a bus system and method for the wideband can communication
CN113411641A (en) * 2021-06-01 2021-09-17 深圳市洲明科技股份有限公司 Data transmission method, receiving method, sending end, receiving end and communication system

Also Published As

Publication number Publication date
CN115604366B (en) 2023-02-21

Similar Documents

Publication Publication Date Title
CN113301568B (en) Network distribution method and device and intelligent household equipment
JP3028815B2 (en) Transmission method of portable electronic device and portable electronic device
CN107735802A (en) Electronic unit and the method performed in the electronic unit
CN106372527A (en) Data processing method and terminal
CN110312266B (en) Method and device for realizing WIFI communication by multiple systems of terminal
US20080075102A1 (en) Interface
CN115604366B (en) Method and device for data transmission, near field communication chip and storage medium
CN115834739B (en) Method for receiving variable-length data frames in SPI (serial peripheral interface) communication of intelligent fusion terminal of transformer area
WO2014017761A1 (en) Storage device reader having security function and security method using same
CN116610623A (en) Data reading method and device, electronic equipment and storage medium
CN109542812A (en) Data communication control method, device and terminal device
US11068880B2 (en) Control of applications in a mobile terminal
TW201007440A (en) Method of control in a multimedia data service system and system thereof
CN117176205B (en) Control method for NFC device, NFC device and storage medium
CN117155426B (en) Data transmission method for NFC device, NFC device and storage medium
CN114726407B (en) Method, device, controller and storage medium for acquiring abnormal information
CN100483468C (en) Mobile communication terminal mounting bank safety information card and information handling method thereof
CN115765803B (en) Radio frequency parameter setting method for NFC (near field communication) equipment and NFC equipment
CN108012284B (en) Method for dial-up networking, terminal equipment and computer readable storage medium
CN111490919A (en) Master-slave machine system, equipment terminal and communication verification method thereof
CN115297181B (en) Wiegand signal processing equipment and access control authority verification system
CN114942892B (en) Method and device for communicating with software to be tested, equipment and storage medium
CN115708076A (en) Communication method, device, server and storage medium for single bus
CN117674910A (en) Data receiving method for NFC equipment and NFC equipment
CN117454914A (en) Method and device for opening access control card

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