CN116782190A - Data processing method and device, first terminal and second terminal - Google Patents
Data processing method and device, first terminal and second terminal Download PDFInfo
- Publication number
- CN116782190A CN116782190A CN202210243392.9A CN202210243392A CN116782190A CN 116782190 A CN116782190 A CN 116782190A CN 202210243392 A CN202210243392 A CN 202210243392A CN 116782190 A CN116782190 A CN 116782190A
- Authority
- CN
- China
- Prior art keywords
- ndef
- data
- feedback
- instruction
- preset
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 72
- 238000004458 analytical method Methods 0.000 claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 32
- 238000004891 communication Methods 0.000 claims abstract description 30
- 238000000034 method Methods 0.000 claims abstract description 17
- 238000004806 packaging method and process Methods 0.000 claims description 48
- 238000005538 encapsulation Methods 0.000 claims description 44
- 238000004590 computer program Methods 0.000 claims description 21
- 238000012795 verification Methods 0.000 claims description 18
- 230000004044 response Effects 0.000 claims description 4
- 230000006870 function Effects 0.000 description 10
- 230000005540 biological transmission Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 4
- 125000004122 cyclic group Chemical group 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000003068 static effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/22—Parsing or analysis of headers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
A data processing method and device, a first terminal and a second terminal, wherein the method comprises the following steps: receiving near field communication data exchange format NDEF data; analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content; if the type field is a preset first custom application type, taking at least part of the NDEF data content as an instruction to be executed; and executing a preset application program according to the instruction to be executed. The invention can realize the data processing of the received instruction and expand the application scene of the embodiment of the invention.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data processing method and apparatus, a first terminal, and a second terminal.
Background
Near field communication (Near Field Communication, NFC) uses a magnetic field as an information carrier, achieves a communication distance (e.g., a few centimeters) much shorter than that of conventional wireless communication, and has the advantages of passive communication, high security, wide use, and the like. As NFC handset models are loaded more and more, NFC-based applications are also more widespread, such as payment, pairing, peer-to-peer transmission, NFC smart tags, NFC smart locks, etc.
An important part of the NFC standard is the inheritance of the high frequency radio frequency identification (Radio Frequency Identification, RFID) passive interface, allowing communication between the NFC terminal interface and the NFC passive interface.
However, in the prior art, conventional NFC terminals are designed according to a protocol (such as a protocol ISO 14443), and such NFC terminals have no limitation on a local data communication format, and the smart tag protocol only needs to perform data communication according to the protocol. However, some NFC terminals or mobile phone terminals do not support or block the conventional data communication channel by the operating system, and only open the communication function of simply limited data reading and writing (such as NFC type 4). Specifically, when a write command is received, the NFC terminal (such as an NFC tag) stores the received near field communication data exchange format (NFC Data Exchange Format, NDEF) data as file information, and then when a read command is received, reads the stored NDEF file information and sends back the file information, which results in a very limited application scenario of the NFC terminal.
What is needed is a data processing method that can implement data processing on received instructions, and expand the application scenario of the embodiments of the present invention.
Disclosure of Invention
The technical problem solved by the invention is to provide a data processing method and device, a first terminal and a second terminal, which can realize data processing on received instructions and expand the application scene of the embodiment of the invention.
In order to solve the above technical problems, an embodiment of the present invention provides a data processing method, including: receiving near field communication data exchange format NDEF data; analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content; if the type field is a preset first custom application type, taking at least part of the NDEF data content as an instruction to be executed; and executing a preset application program according to the instruction to be executed.
Optionally, parsing the NDEF data to obtain a parsed result includes: performing a first round of parsing on the NDEF data to obtain NDEF header format information and NDEF initial data content, where the NDEF header format information includes a type field of the NDEF data; and carrying out second-round analysis on the NDEF initial data content to obtain an analysis result.
Optionally, the NDEF header format information further includes a length of the NDEF initial data content.
Optionally, the NDEF initial data content includes encryption information; the second round of parsing of the NDEF initial data content includes: decrypting the NDEF initial data content based on the encryption information.
Optionally, the NDEF initial data content includes verification information; the second round of parsing of the NDEF initial data content includes: and verifying the NDEF initial data content based on the verification information.
Optionally, the number of the preset application programs is multiple, and the NDEF initial data content includes a message type; according to the instruction to be executed, executing the preset application program comprises: selecting an application program to be executed from a plurality of preset application programs according to the message type; and executing the instruction to be executed by adopting the application program to be executed.
Optionally, the data processing method further includes: performing NDEF encapsulation on an execution result of executing the application program to obtain an encapsulated NDEF feedback execution result; the type field of the encapsulated NDEF feedback execution result is filled with a preset second custom application type; the second custom application type is the same as or different from the first custom application type.
Optionally, the data processing method further includes: in response to receiving a read instruction, checking a preset instruction mark; if the preset instruction mark is a first instruction, sending the encapsulated NDEF feedback execution result as encapsulated NDEF feedback data; the first instruction marks a preset instruction mark after determining that the type field is a preset first user-defined application type.
Optionally, if the type field is another application type except the preset first custom application type, taking at least a part of the NDEF data content as NDEF file information, the method further includes: if the preset instruction mark is a second instruction, the encapsulated NDEF file information is used as data encapsulated by the NDEF to be sent; the second instruction marks a preset instruction flag after determining that the type field is of an application type other than the preset first custom application type, and the second instruction is different from the first instruction.
Optionally, the data processing method further includes: and after sending the encapsulated NDEF feedback data, setting the instruction flag to a second instruction.
Optionally, performing NDEF encapsulation on an execution result of executing the application program includes: performing first round packaging on the execution result to obtain an initial packaging result; performing a second round of encapsulation on the initial encapsulation result, and adding or updating NDEF header format feedback information to obtain encapsulated NDEF feedback data; the NDEF header format feedback information includes a type field of the encapsulated NDEF feedback data, and the type field is filled with the second custom application type.
Optionally, performing a first round of encapsulation on the execution result to obtain an initial encapsulation result includes: encrypting the execution result by adopting feedback encryption information, and adding the feedback encryption information into the initial encapsulation result; and/or determining feedback check information of the execution result, and adding the feedback check information to the initial packaging result.
Optionally, before the receiving NDEF data, the data processing method further includes: and determining the received instruction as a write instruction.
In order to solve the above technical problems, an embodiment of the present invention provides a data processing method, including: determining a mode to be processed of NDEF data to be sent; if the mode to be processed is to execute a preset application program, carrying out NDEF encapsulation on the instruction to be executed, wherein an encapsulation result comprises a type field of the NDEF data to be sent and the NDEF data content; sending the encapsulated NDEF data; the type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
Optionally, the NDEF packaging the instruction to be executed includes: performing first round packaging on the instruction to be executed to obtain an initial packaging instruction; and carrying out second round encapsulation on the initial encapsulation instruction, and adding or updating NDEF header format information to obtain an encapsulation result, wherein the NDEF header format information comprises a type field of the NDEF data.
Optionally, the NDEF header format information further includes a length of data content in the encapsulated NDEF data.
Optionally, performing a first round of encapsulation on the to-be-executed instruction to obtain an initial encapsulated instruction includes: encrypting the instruction to be executed by adopting encryption information, and adding the encryption information into the data content in the packaged NDEF data; and/or determining the check information of the instruction to be executed, and adding the check information into the data content in the packaged NDEF data.
Optionally, the preset application program is a plurality of application programs; the first round of packaging the to-be-executed instruction to obtain an initial packaged instruction comprises the following steps: and adding a message type into the data content in the encapsulated NDEF data, wherein the message type is used for indicating an application program to be executed in a plurality of preset application programs.
Optionally, the data processing method further includes: sending a reading instruction; receiving encapsulated NDEF feedback data; analyzing the encapsulated NDEF feedback data to obtain a feedback analysis result, wherein the feedback analysis result comprises a type field of the NDEF feedback data and NDEF feedback data content; if the type field of the NDEF feedback data is a preset second custom application type, determining that the NDEF feedback data content includes an NDEF feedback execution result; wherein the second custom application type is the same as or different from the first custom application type.
Optionally, if the mode to be processed is to store NDEF file information, NDEF packaging is performed on the NDEF file information, the packaging result includes a type field of the NDEF file information to be sent and NDEF data content, the type field is another application type except the preset first custom application type, and the NDEF file information is at least a part of the NDEF data content, and the method further includes: and if the type field of the NDEF feedback data is other application types except the preset second custom application type, determining that the NDEF feedback data content comprises NDEF file information.
Optionally, parsing the encapsulated NDEF feedback data to obtain a feedback parsing result includes: performing a first round of parsing on the encapsulated NDEF feedback data to obtain NDEF header format feedback information and NDEF initial data feedback content, where the NDEF header format feedback information includes a type field of the NDEF feedback data; and carrying out second-round analysis on the feedback content of the NDEF initial data to obtain a feedback analysis result.
Optionally, the NDEF header format feedback information further includes a length of the NDEF initial data feedback content.
Optionally, the NDEF initial data feedback content includes feedback encryption information; the second round of parsing of the NDEF initial data feedback content includes: and decrypting the feedback content of the NDEF initial data based on the feedback encryption information.
Optionally, feedback check information is included in the NDEF initial data feedback content; the second round of parsing of the NDEF initial data feedback content includes: and verifying the feedback content of the NDEF initial data based on the feedback verification information.
Optionally, before the sending the encapsulated NDEF data, the data processing method further includes: and sending a write instruction.
To solve the above technical problem, an embodiment of the present invention provides a data processing apparatus, including: the data receiving module is used for receiving the near field communication data exchange format NDEF data; the analysis module is used for analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content; the instruction determining module is used for taking at least one part of the NDEF data content as an instruction to be executed when the type field is a preset first user-defined application type; and the execution module is used for executing a preset application program according to the instruction to be executed.
To solve the above technical problem, an embodiment of the present invention provides a data processing apparatus, including: the processing determining module is used for determining a mode to be processed of the NDEF data to be sent; the packaging module is used for carrying out NDEF packaging on the instruction to be executed when the mode to be processed is to execute the preset application program, wherein the packaging result comprises a type field of the NDEF data to be sent and the NDEF data content; the sending module is used for sending the encapsulated NDEF data; the type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
To solve the above technical problem, embodiments of the present invention provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above data processing method.
To solve the above technical problem, an embodiment of the present invention provides a first terminal, including a memory and a processor, where the memory stores a computer program capable of running on the processor, and the processor executes steps of the data processing method when running the computer program.
Optionally, the first terminal includes a near field communication tag.
To solve the above technical problem, an embodiment of the present invention provides a second terminal, including a memory and a processor, where the memory stores a computer program capable of running on the processor, and the processor executes steps of the data processing method when running the computer program.
Optionally, the second terminal comprises a near field communication terminal.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, the type field of the NDEF data is filled into the first custom application type, so that the existing custom application type field can be multiplexed, and the first terminal knows that the NDEF data contains the instruction to be executed, and further executes the preset application program.
Further, the encapsulated NDEF feedback data is obtained by encapsulating the execution result of the application program, wherein the type field of the encapsulated NDEF feedback data is filled with a preset second custom application type, and the second terminal can be notified that the encapsulated NDEF feedback data is the execution result of the application program, so that the accuracy of judging the data by the second terminal is improved.
Further, after the type field is determined to be the preset first user-defined application type, marking a preset instruction mark as a first instruction, responding to receiving a reading instruction, and if the preset instruction mark is the first instruction, sending the encapsulated NDEF feedback execution result as encapsulated NDEF feedback data, so that when the reading instruction is received, the encapsulated NDEF feedback execution result can be rapidly and accurately determined to be fed back, and effective feedback after data processing of the received instruction is realized, and the application scene of the embodiment of the invention is further expanded.
Further, after the type field is determined to be other application types except the preset first user-defined application type, marking a preset instruction mark as a second instruction, if the preset instruction mark is the second instruction, sending the packaged NDEF file information as data after NDEF packaging, so that when a reading instruction is received, the fact that feedback needs to be performed on the packaged NDEF file information can be quickly and accurately determined can be achieved, multiplexing of an existing NDEF file information transmission mode is achieved to a certain extent, and an existing application scene is reserved while the application scene is expanded.
Drawings
FIG. 1 is a flow chart of a first data processing method in an embodiment of the invention;
FIG. 2 is a partial flow chart of a second data processing method in an embodiment of the invention;
FIG. 3 is a flow chart of a third data processing method in an embodiment of the invention;
FIG. 4 is a partial flow chart of a fourth data processing method in an embodiment of the invention;
FIG. 5 is a flowchart of a fifth data processing method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a sixth data processing method according to an embodiment of the present invention;
FIG. 7 is a partial flow chart of a seventh data processing method in an embodiment of the invention;
FIG. 8 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of another data processing apparatus according to an embodiment of the present invention.
Detailed Description
In the prior art, a conventional NFC terminal is designed according to a preset protocol, the NFC terminal does not limit a local data communication format, and an intelligent tag protocol only needs to perform data communication according to the protocol. However, some NFC terminals or mobile phone terminals do not support or block the conventional data communication channel by the operating system, and only open the communication function of simply limited data reading and writing (such as NFC type 4). Specifically, when a write command is received, the NFC terminal (such as an NFC tag) stores the received NDEF data as a file, and when a read command is received, the stored NDEF file is read and sent back, so that the application scenario of the NFC terminal is very limited.
Specifically, NDEF is a lightweight, compact binary format, where NDEF data consists of various data records (Record), each Record consisting of Header format information (also referred to as Header) and data content (also referred to as Payload), where the data type and size of the NDEF Record is noted by the Header of the Record Payload.
Taking an application protocol data unit (Application Protocol Data Unit, APDU) instruction set for operating an NFC Forum (Forum) Type (Type) 4 tag by an NFC terminal device defined according to an NFC specification as an example, the instruction set only includes three functions of selecting (Select), reading a binary file (ReadBinary) and writing a binary file (updatebinnary), and it is seen that such NFC terminals only support file selection and binary file reading and writing instructions.
The inventor of the present invention has found through research that in the prior art, the NFC terminal (such as an NFC tag) can only store the received NDEF data as a file when receiving a writing instruction, and read and send the stored NDEF data back as file information when receiving a reading instruction, so that the application scenario of the NFC terminal is very limited, and only the selection, reading and writing operations are supported by adopting the file information mode even if executable data exists, such as APDUs.
In the embodiment of the invention, the type field of the NDEF data is filled into the first custom application type, so that the existing custom application type field can be multiplexed, and the first terminal knows that the NDEF data contains the instruction to be executed, and further executes the preset application program.
In order to make the above objects, features and advantages of the present invention more comprehensible, embodiments accompanied with figures are described in detail below.
Referring to fig. 1, fig. 1 is a flowchart of a data processing method according to an embodiment of the present invention. The data processing method may be used for the first terminal, and may further include steps S11 to S14:
step S11: receiving NDEF data;
step S12: analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content;
Step S13: if the type field is a preset first custom application type, taking at least part of the NDEF data content as an instruction to be executed;
step S14: and executing a preset application program according to the instruction to be executed.
It will be appreciated that in a specific implementation, the method may be implemented in a software program running on a processor integrated within a chip or a chip module.
The first terminal may be a near field communication tag, and may include an electronic price tag and an electronic intelligent lock device, for example. It should be noted that the electronic price tag may be a passive electronic price tag, and the electronic intelligent lock device may be a passive intelligent lock, so that the application scenario of the embodiment of the present invention is further expanded without being limited by energy supply.
Opposite to the first terminal, the second terminal may be a terminal supporting a near field communication function, and for example, may include, but not limited to, a mobile phone, a computer, a tablet computer, a server, a cloud platform, and other terminal devices.
In a specific implementation of step S11, the first terminal may receive NDEF data, e.g. from the second terminal.
In the implementation of step S12, the first terminal may parse the NDEF data to obtain a parse result, where the parse result includes a type field of the NDEF data and an NDEF data content.
Referring to table 1, table 1 is an NDEF encapsulated data format.
TABLE 1
NDEF file length | NDEF head | NDEF load |
In the NDEF encapsulated data format shown in table 1, as a non-limiting example, the NDEF file length may occupy 2 bytes, representing the total byte length of the subsequent NDEF header and NDEF payload.
In the NDEF header, a type field of NDEF data may be included. Taking NDEF technical specification (Technical Specification) 1.0 as an example, the NDEF header Format may include a Message Begin (MB) Flag, a Message End (ME) Flag, a Chunk Flag (CF) Flag, a Short Record (SR) Flag, a Type Name Format (TNF) Flag, and the like, and may further include a Type field Length (Type Length), a NDEF data content (Payload) field Length (Payload Length), whether an ID and Length (IL) Flag is present, an Identity (ID), and an ID Length (ID Length), where the NFC Record (Record) may refer to another NFC Record by an ID.
The NDEF header may further include a Type field and represent a Type field of the NDEF data with the Type field. The Type field of the NDEF data may be used to indicate the Type of NDEF data content (Payload), and as one non-limiting example, the Type field may follow the NFC Forum (Forum) record Type definition (Record Type Definition, RTD) specification.
Referring to table 2, table 2 is an RTD specification table.
TABLE 2
In the RTD specification table shown in table 2, the "External Type" is adopted for user-defined use, and in the embodiment of the present invention, the Type field may be set to a preset first custom application Type to indicate that at least a portion of the NDEF data content is an instruction to be executed, so that the instruction may be executed in a subsequent step; the type field may be set to a preset second custom application type to indicate that at least a portion of the NDEF data content is file information, so that the file information may be stored and read in a subsequent step.
In one non-limiting example, the type field is set to a preset first custom application type "NP", the NDEF data content contains "delete", and a delete (delete) instruction may be executed in a subsequent step; setting the type field as a preset second custom application type "NF", wherein the NDEF data content includes "delete", and the "delete" field can be stored and read in a subsequent step.
The NDEF payload may include content that processes the data, which content may be parsed by an application layer, for example.
Further, the NDEF load may include one or more of the following: encryption information, verification information and message type, so that encryption, verification processing and the like can be performed on the transmitted NDEF data.
The encryption information may include, for example, an encryption manner, the check information may include, for example, a cyclic redundancy check code (Cyclic Redundancy Check, CRC), and the message type may be used, for example, to indicate that an application to be executed is selected from a plurality of preset applications.
In a specific implementation, the step of parsing the NDEF data to obtain a parsed result may include: performing a first round of parsing on the NDEF data to obtain NDEF header format information and NDEF initial data content, where the NDEF header format information includes a type field of the NDEF data; and carrying out second-round analysis on the NDEF initial data content to obtain an analysis result.
Further, the NDEF header format information further includes a length of the NDEF initial data content.
In the embodiment of the invention, the setting of the NDEF header format information further includes the length of the NDEF initial data content, which can be used to determine that the received NDEF initial data content is correct, so that the NDEF header format information is obtained in the first round of parsing, and compared with the NDEF header format information re-parsed in the second round of parsing, the order can better determine the accuracy of the received information.
In a specific implementation manner of the embodiment of the present invention, the NDEF initial data content may include encryption information; the step of performing the second round of parsing on the NDEF initial data content may include: decrypting the NDEF initial data content based on the encryption information.
In the embodiment of the invention, the encryption and decryption of the NDEF data can be realized by setting the encryption information contained in the NDEF initial data content, so that the accuracy of data transmission is further improved.
In another specific implementation manner of the embodiment of the present invention, the NDEF initial data content may include verification information; the step of performing the second round of parsing on the NDEF initial data content may include: and verifying the NDEF initial data content based on the verification information.
Still further, the check information may include a cyclic redundancy check code.
In the embodiment of the invention, the NDEF initial data content is set to contain the verification information, so that the verification of the NDEF data can be realized, and the accuracy of data transmission is further improved.
In the implementation of step S13, if the type field is a preset first custom application type, at least a portion of the NDEF data content is used as the instruction to be executed.
Wherein, the NDEF data content can be processed in a virtual file, thereby realizing that at least a part of the NDEF data content is used as an instruction to be executed.
In the embodiment of the present invention, the type field in the NDEF header format information may be set to a preset first custom application type, so as to indicate that at least a portion of the NDEF data content is an instruction to be executed, so that the instruction may be executed in a subsequent step.
The preset first custom application type may be set according to a specific situation, for example, represented by "NP", or represented by other suitable, unambiguous fields.
In the implementation of step S14, the first terminal may execute a preset application program according to the instruction to be executed.
In a specific implementation manner of the embodiment of the present invention, the number of preset application programs may be multiple, and the NDEF initial data content may include a message type; according to the to-be-executed instruction, the step of executing the preset application program may include: and executing the instruction to be executed by adopting the application program to be executed.
In a non-limiting embodiment, the instruction to be executed may be a text segment, and the preset application program may be multiple, for example, the text segment may be displayed by using a display screen display manner, and the text segment may also be played by using a voice broadcast manner.
The message type can be indicated as display screen display, and the text can be displayed in a display screen display mode according to the message type.
In the embodiment of the invention, the number of the preset application programs can be effectively increased by adding the message types, so that the application scene of the embodiment of the invention is further expanded.
In the embodiment of the invention, the type field of the NDEF data is filled into the first custom application type, so that the existing custom application type field can be multiplexed, and the first terminal knows that the NDEF data contains the instruction to be executed, and further executes the preset application program.
Referring to fig. 2, fig. 2 is a partial flowchart of a second data processing method according to an embodiment of the present invention. The second data processing method may be used for the first terminal, and may include step S11 to step S14, step S21, step S22 to step S23, or step S22 and step S24 shown in fig. 1. The respective steps are explained below.
In step S21, NDEF packaging is performed on the execution result of the application program to obtain a packaged NDEF feedback execution result.
The type field of the encapsulated NDEF feedback execution result is filled with a preset second custom application type; the second custom application type is the same as or different from the first custom application type.
In the embodiment of the invention, the encapsulated NDEF feedback data is obtained by encapsulating the execution result of the application program, wherein the type field of the encapsulated NDEF feedback data is filled with the preset second custom application type, and the encapsulated NDEF feedback data is notified to the second terminal as the execution result of the application program, so that the accuracy of judging the data by the second terminal is improved.
Further, the step of performing NDEF encapsulation on the execution result of the application program may include: performing first round packaging on the execution result to obtain an initial packaging result; performing a second round of encapsulation on the initial encapsulation result, and adding or updating NDEF header format feedback information to obtain encapsulated NDEF feedback data; the NDEF header format feedback information includes a type field of the encapsulated NDEF feedback data, and the type field is filled with the second custom application type.
The NDEF header format feedback information may further include a length of data content in the encapsulated NDEF data.
In the embodiment of the invention, the setting of the NDEF header format feedback information may further include the length of the data content in the encapsulated NDEF data, and after the second round of encapsulation, the length of the data content in the encapsulated NDEF data may be determined, and then the NDEF header format feedback information may be added.
Still further, the step of performing a first round of encapsulation on the execution result to obtain an initial encapsulation result may include: encrypting the execution result by adopting feedback encryption information, and adding the feedback encryption information into the initial encapsulation result; and/or determining feedback check information of the execution result, and adding the feedback check information to the initial packaging result.
In the embodiment of the invention, the feedback encryption information is added in the initial encapsulation result through setting; and/or adding the feedback verification information to the initial packaging result can realize decryption and/or verification of the NDEF data by the second terminal, thereby further improving the accuracy of data transmission.
In step S22, in response to receiving the read instruction, a preset instruction flag is checked.
The first instruction marks a preset instruction mark after determining that the type field is a preset first user-defined application type.
It should be noted that after determining the type field, if the type field is a preset first custom application type, the preset instruction flag may be marked as a first instruction, and if the type field is another application type other than the preset first custom application type, the preset instruction flag may be marked as a second instruction.
Wherein the second instruction is different from the first instruction. For example, the same bit may be used to indicate a first instruction when one of the bit values is 1 or 0 and a second instruction when the other bit value is 1 or 0.
In step S23, if the preset command flag is the first command, the encapsulated NDEF feedback execution result is sent as encapsulated NDEF feedback data.
In the embodiment of the invention, after the type field is determined to be the preset first user-defined application type, a preset instruction mark is marked as a first instruction, and in response to receiving a reading instruction, if the preset instruction mark is the first instruction, the encapsulated NDEF feedback execution result is sent as encapsulated NDEF feedback data, so that when the reading instruction is received, the encapsulated NDEF feedback execution result can be rapidly and accurately determined to be fed back, and the effective feedback after the data processing of the received instruction is realized, and the application scene of the embodiment of the invention is further expanded.
In step S24, if the preset instruction flag is the second instruction, the encapsulated NDEF file information is sent as NDEF encapsulated data.
It should be noted that, if the type field is another application type except the preset first custom application type, at least a part of the NDEF data content may be used as NDEF file information in the process of configuring the NDEF data content by the second terminal.
In the embodiment of the invention, after the type field is determined to be other application types except the preset first user-defined application type, the preset instruction mark is marked as the second instruction, if the preset instruction mark is the second instruction, the packaged NDEF file information is sent as data after NDEF packaging, so that the packaged NDEF file information can be rapidly and accurately determined to be fed back when a reading instruction is received through preset instruction mark, the multiplexing of the traditional NDEF file information transmission mode is realized to a certain extent, and the traditional application scene is reserved while the application scene is expanded.
Further, the data processing method may further include: and after sending the encapsulated NDEF feedback data, setting the instruction flag to a second instruction.
In the embodiment of the invention, the instruction mark is set to be the second instruction after the encapsulated NDEF feedback data is sent, so that the instruction mark can be cleared, and the processing can be performed in a mode more similar to the prior art (namely, as file information) under the condition of subsequent uncertain data types, thereby expanding the application scene and reducing the influence caused by erroneous judgment.
Further, before the step of receiving NDEF data, the data processing method may further include: the received instruction is determined to be a write instruction, so that an execution trigger point of the embodiment of the invention can be set.
Referring to fig. 3, fig. 3 is a flowchart of a third data processing method according to an embodiment of the present invention. The third data processing method may be used for the first terminal, and may further include steps S301 to S317, and each step will be described below.
In step S301, it is determined that the received instruction is a write instruction.
In step S302, NDEF data is received.
In step S303, the NDEF data is parsed for the first round to obtain NDEF header format information and NDEF initial data content, where the NDEF header format information includes a type field of the NDEF data.
In step S304, it is determined whether the type field is a preset first custom application type, if yes, step S305 is executed, and if no, step S306 is executed.
In step S305, a preset instruction flag is set as a first instruction.
In step S306, a preset instruction flag is set to the second instruction.
In step S307, the NDEF initial data content is parsed for the second round, so as to obtain a parsing result, where the parsing result includes a message type.
In step S308, according to the message type, an application program to be executed is selected from a plurality of preset application programs.
In step S309, the application program to be executed is used to execute the instruction to be executed.
In step S310, the execution result is encapsulated for the first round to obtain an initial encapsulation result.
In step S311, the second round of encapsulation is performed on the initial encapsulation result, and the encapsulated NDEF feedback data is obtained after the NDEF header format feedback information is added or updated.
In step S312, a status word is determined, the status word indicating whether the data parsing is successful.
Specifically, the method for determining and setting the status word may be implemented by using conventional technology, which is not limited in the embodiment of the present invention.
In step S313, a status word is transmitted.
It is to be noted that steps S312 to S313 may be performed after the data analysis, that is, may be performed after step S307 as shown in fig. 3, and may be performed after any one of steps S308 to S311.
In step S314, the second round of parsing is performed on the NDEF initial data content, so as to obtain a parsing result, where the parsing result includes the NDEF data content.
In step S315, at least a part of the NDEF data content is written into an NDEF file as NDEF file information.
In step S316, a status word is determined, where the status word indicates whether writing the NDEF file information is successful.
Specifically, the method for determining and setting the status word may be implemented by using conventional technology, which is not limited in the embodiment of the present invention.
In step S317, a status word is transmitted.
In the embodiment, the steps S301 to S317 are performed with reference to the foregoing description of the steps in fig. 1 to 2, and are not repeated here.
Referring to fig. 4, fig. 4 is a partial flowchart of a fourth data processing method according to an embodiment of the present invention. The fourth data processing method may be used in the first terminal, and may further include the steps shown in fig. 3, and may further include steps S41 to S44, where each step is described below.
In step S41, it is determined that the received instruction is a read instruction.
In step S42, it is determined whether the preset command flag is the first command, if yes, step S43 is executed, and if no, step S44 is executed.
In step S43, the encapsulated NDEF feedback execution result is transmitted.
In step S44, the encapsulated NDEF file information is transmitted.
In the embodiment, the steps S41 to S44 are performed with reference to the foregoing description of the steps in fig. 1 to 2, and are not repeated here.
Referring to fig. 5, fig. 5 is a flowchart of a fifth data processing method according to an embodiment of the present invention. The fifth data processing method may be used for the second terminal, and may further include steps S51 to S53:
step S51: determining a mode to be processed of NDEF data to be sent;
step S52: if the mode to be processed is to execute a preset application program, carrying out NDEF encapsulation on the instruction to be executed, wherein an encapsulation result comprises a type field of the NDEF data to be sent and the NDEF data content;
step S53: and sending the encapsulated NDEF data.
The type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
In the implementation of step S51, the mode to be processed may be executing a preset application program, or may be storing NDEF file information.
Specifically, if the mode to be processed is to execute a preset application program, the NDEF data to be sent may include an instruction to be executed, so that the first terminal may execute the preset application program after receiving the instruction; if the mode to be processed is to store the NDEF file information, the NDEF file information to be sent may be included in the NDEF data to be sent, so that the first terminal may store the NDEF file information after receiving the NDEF file information.
In the implementation of step S52, if the mode to be processed is to execute the preset application program, the second terminal may perform NDEF encapsulation on the instruction to be executed.
Further, the step of NDEF packaging the to-be-executed instruction may include: performing first round packaging on the instruction to be executed to obtain an initial packaging instruction; and carrying out second round encapsulation on the initial encapsulation instruction, and adding or updating NDEF header format information to obtain an encapsulation result, wherein the NDEF header format information comprises a type field of the NDEF data.
Still further, the NDEF header format information may further include a length of data content in the encapsulated NDEF data.
In the embodiment of the invention, the setting of the NDEF header format information further includes the length of the NDEF initial data content, which can be used to determine that the received NDEF initial data content is correct, so that the NDEF header format information is obtained in the first round of parsing, and compared with the NDEF header format information re-parsed in the second round of parsing, the order can better determine the accuracy of the received information.
Still further, the step of performing a first round of encapsulation on the to-be-executed instruction to obtain an initial encapsulated instruction may include: encrypting the instruction to be executed by adopting encryption information, and adding the encryption information into the data content in the packaged NDEF data; and/or determining the check information of the instruction to be executed, and adding the check information into the data content in the packaged NDEF data.
In the embodiment of the invention, the encryption and/or the decryption and/or the verification of the NDEF data can be realized by setting the encryption information and/or the verification information contained in the NDEF initial data content, so that the accuracy of data transmission is further improved.
Further, the preset application program may be a plurality of application programs; the step of performing a first round of encapsulation on the to-be-executed instruction to obtain an initial encapsulated instruction may include: and adding a message type into the data content in the encapsulated NDEF data, wherein the message type is used for indicating an application program to be executed in a plurality of preset application programs.
In the embodiment of the invention, the number of the preset application programs can be effectively increased by adding the message types, so that the application scene of the embodiment of the invention is further expanded.
In the implementation of step S53, the second terminal may send the encapsulated NDEF data to the first terminal.
In the implementation, the steps S51 to S52 are described in detail with reference to the foregoing description of the steps in fig. 1 to 4, and are not repeated here.
In the embodiment of the invention, the second terminal fills the type field of the NDEF data into the first custom application type, and can multiplex the existing custom application type field, so that the first terminal knows that the NDEF data contains the instruction to be executed and further executes the preset application program.
Referring to fig. 6, fig. 6 is a flowchart of a sixth data processing method according to an embodiment of the present invention. The sixth data processing method may be used for the second terminal, and may further include steps S61 to S68, each of which will be described below.
In step S61, a manner of processing NDEF data to be transmitted is determined.
In step S62, it is determined whether the mode to be processed is to execute the preset application program, if yes, step S63 is executed, and if no, step S64 is executed.
In step S63, the NDEF data is encapsulated for the first round as the instruction to be executed, so as to obtain an initial encapsulated instruction.
In step S64, the NDEF data is used as NDEF file information to perform a first-round NDEF encapsulation.
In step S65, the initial packaging instruction is subjected to a second round of packaging, and the packaging result is obtained after the NDEF header format information is added or updated, where the type field is a preset first custom application type.
In step S66, the encapsulated NDEF data is transmitted.
The encapsulated NDEF data includes an instruction to be executed.
In step S67, the initial packaging instruction is subjected to a second round of packaging, and the NDEF header format information is added or updated to obtain the packaging result, where the type field is other application types except the preset first custom application type.
In step S68, the encapsulated NDEF data is transmitted.
The encapsulated NDEF data includes NDEF file information.
In the implementation, the steps S61 to S68 are described in detail with reference to the foregoing and the descriptions of the steps in fig. 1 to 5, and are not repeated here.
Further, the data processing method may further include: sending a reading instruction; receiving encapsulated NDEF feedback data; analyzing the encapsulated NDEF feedback data to obtain a feedback analysis result, wherein the feedback analysis result comprises a type field of the NDEF feedback data and NDEF feedback data content; if the type field of the NDEF feedback data is a preset second custom application type, determining that the NDEF feedback data content includes an NDEF feedback execution result; wherein the second custom application type is the same as or different from the first custom application type.
In the embodiment of the invention, the first terminal encapsulates the execution result of executing the application program to obtain encapsulated NDEF feedback data, wherein the type field of the encapsulated NDEF feedback data is filled with the preset second custom application type, and the encapsulated NDEF feedback data can be notified to the second terminal as the execution result of executing the application program, so that the second terminal can improve the accuracy of judging the data after receiving the feedback data.
Further, if the mode to be processed is to store NDEF file information, NDEF packaging is performed on the NDEF file information, the packaging result includes a type field of the NDEF file information to be sent and NDEF data content, the type field is another application type except the preset first custom application type, and the NDEF file information is at least a part of the NDEF data content, and the method may further include: and if the type field of the NDEF feedback data is other application types except the preset second custom application type, determining that the NDEF feedback data content comprises NDEF file information.
In the embodiment of the invention, the first terminal performs NDEF encapsulation on the NDEF file information to obtain encapsulated NDEF feedback data, wherein the type field of the encapsulated NDEF feedback data is filled with other application types except the preset second user-defined application type, and the second terminal can be informed that the encapsulated NDEF feedback data is the NDEF file information, so that the second terminal can improve the accuracy of judging the data after receiving the feedback data.
Further, the step of parsing the encapsulated NDEF feedback data to obtain a feedback parsing result may include: performing a first round of parsing on the encapsulated NDEF feedback data to obtain NDEF header format feedback information and NDEF initial data feedback content, where the NDEF header format feedback information includes a type field of the NDEF feedback data; and carrying out second-round analysis on the feedback content of the NDEF initial data to obtain a feedback analysis result.
Still further, the NDEF header format feedback information may further include a length of the NDEF initial data feedback content.
In the embodiment of the invention, the setting of the NDEF header format feedback information may further include the length of the data content in the encapsulated NDEF data, and after the second round of encapsulation, the length of the data content in the encapsulated NDEF data may be determined, and then the NDEF header format feedback information may be added.
Further, feedback encryption information may be included in the NDEF initial data feedback content; the step of performing the second round of parsing on the NDEF initial data feedback content may include: and decrypting the feedback content of the NDEF initial data based on the feedback encryption information.
Further, feedback check information may be included in the NDEF initial data feedback content; the step of performing the second round of parsing on the NDEF initial data feedback content may include: and verifying the feedback content of the NDEF initial data based on the feedback verification information.
In the embodiment of the invention, the decryption and/or verification of the NDEF data by the second terminal can be realized by setting the feedback encryption information and/or the feedback verification information, so that the accuracy of data transmission is further improved.
Referring to fig. 7, fig. 7 is a partial flowchart of a seventh data processing method according to an embodiment of the present invention. The seventh data processing method may be used for the second terminal, may further include the steps shown in fig. 6, and may further include steps S71 to S76, and each step will be described below.
In step S71, a read instruction is transmitted.
In step S72, encapsulated NDEF feedback data is received.
In step S73, the encapsulated NDEF feedback data is parsed to obtain a feedback parsing result.
In step S74, it is determined whether the type field of the NDEF feedback data is the preset second custom application type, if yes, step S75 is performed, and if no, step S76 is performed.
In step S75, it is determined that the NDEF feedback data content includes NDEF feedback execution results.
In step S76, it is determined that the NDEF feedback data content includes NDEF file information.
In the implementation, the steps from step S71 to step S76 are performed with reference to the foregoing descriptions of the steps in fig. 1 to fig. 6, and are not repeated here.
Further, before the sending the encapsulated NDEF data, the data processing method may further include: a write command is sent, so that an execution trigger point of the embodiment of the present invention can be set.
Referring to fig. 8, fig. 8 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention. The data processing apparatus may be included in the first terminal, and may further include:
a data receiving module 81, configured to receive NDEF data in a near field communication data exchange format;
the parsing module 82 is configured to parse the NDEF data to obtain a parsing result, where the parsing result includes a type field of the NDEF data and an NDEF data content;
the instruction determining module 83 is configured to take at least a portion of the NDEF data content as an instruction to be executed when the type field is a preset first custom application type;
and the execution module 84 is configured to execute a preset application program according to the instruction to be executed.
In a specific implementation, the above device may correspond to a chip having a data processing function in the first terminal; or corresponds to a chip module including a chip having a data processing function in the first terminal, or corresponds to the first terminal.
For the principles, specific implementations and advantages of the data processing apparatus, reference should be made to the foregoing related description of the data processing method, which is not repeated herein.
Referring to fig. 9, fig. 9 is a schematic diagram of another data processing apparatus according to an embodiment of the present invention. The other data processing apparatus may be included in the second terminal, and may further include:
a processing determining module 91, configured to determine a mode to be processed of NDEF data to be sent;
the packaging module 92 is configured to perform NDEF packaging on the instruction to be executed when the mode to be processed is to execute the preset application program, where the packaging result includes a type field of the NDEF data to be sent and an NDEF data content;
a transmitting module 93, configured to transmit the encapsulated NDEF data;
the type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
In a specific implementation, the above device may correspond to a chip having a data processing function in the second terminal; or corresponds to a chip module including a chip having a data processing function in the second terminal, or corresponds to the second terminal.
For the principles, specific implementations and advantages of the data processing apparatus, reference should be made to the foregoing related description of the data processing method, which is not repeated herein.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when being run by a processor, performs the steps of the data processing method described above. The storage medium may include ROM, RAM, magnetic or optical disks, and the like. The storage medium may also include a non-volatile memory (non-volatile) or a non-transitory memory (non-transitory) or the like.
The embodiment of the application also provides a first terminal, which comprises a memory and a processor, wherein the memory stores a computer program which can be run on the processor, and the processor executes the steps of the data processing method when running the computer program.
Further, the first terminal may comprise a near field communication tag.
The embodiment of the application also provides a second terminal, which comprises a memory and a processor, wherein the memory stores a computer program which can be run on the processor, and the processor executes the steps of the data processing method when running the computer program.
Further, the second terminal may comprise a near field communication terminal.
It should be appreciated that in the embodiment of the present application, the processor may be a central processing unit (central processing unit, abbreviated as CPU), and the processor may also be other general purpose processors, digital signal processors (digital signal processor, abbreviated as DSP), application specific integrated circuits (application specific integrated circuit, abbreviated as ASIC), off-the-shelf programmable gate arrays (field programmable gate array, abbreviated as FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It should also be appreciated that the memory in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically erasable ROM (electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (random access memory, RAM for short) which acts as an external cache. By way of example but not limitation, many forms of random access memory (random access memory, abbreviated as RAM) are available, such as static random access memory (static RAM), dynamic Random Access Memory (DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, abbreviated as DDR SDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), synchronous Link DRAM (SLDRAM), and direct memory bus random access memory (direct rambus RAM, abbreviated as DR RAM).
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the processes or functions described in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer program may be stored in or transmitted from one computer readable storage medium to another, for example, by wired or wireless means from one website, computer, server, or data center.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus and system may be implemented in other manners. For example, the device embodiments described above are merely illustrative; for example, the division of the units is only one logic function division, and other division modes can be adopted in actual implementation; for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may be physically included separately, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units. For example, for each device or product applied to or integrated on a chip, each module/unit included in the device or product may be implemented in hardware such as a circuit, or at least part of the modules/units may be implemented in software program, where the software program runs on a processor integrated inside the chip, and the rest (if any) of the modules/units may be implemented in hardware such as a circuit; for each device and product applied to or integrated in the chip module, each module/unit contained in the device and product can be realized in a hardware manner such as a circuit, different modules/units can be located in the same component (such as a chip, a circuit module and the like) or different components of the chip module, or at least part of the modules/units can be realized in a software program, the software program runs on a processor integrated in the chip module, and the rest (if any) of the modules/units can be realized in a hardware manner such as a circuit; for each device, product, or application to or integrated with the terminal, each module/unit included in the device, product, or application may be implemented by using hardware such as a circuit, different modules/units may be located in the same component (for example, a chip, a circuit module, or the like) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program, where the software program runs on a processor integrated inside the terminal, and the remaining (if any) part of the modules/units may be implemented by using hardware such as a circuit.
It should be understood that the term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, the character "/" indicates that the front and rear associated objects are an "or" relationship.
The term "plurality" as used in the embodiments of the present application means two or more.
The first, second, etc. descriptions in the embodiments of the present application are only used for illustrating and distinguishing the description objects, and no order is used, nor is the number of the devices in the embodiments of the present application limited, and no limitation on the embodiments of the present application should be construed.
Although the present application is disclosed above, the present application is not limited thereto. Various changes and modifications may be made by one skilled in the art without departing from the spirit and scope of the application, and the scope of the application should be assessed accordingly to that of the appended claims.
Claims (32)
1. A method of data processing, comprising:
receiving near field communication data exchange format NDEF data;
analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content;
If the type field is a preset first custom application type, taking at least part of the NDEF data content as an instruction to be executed;
and executing a preset application program according to the instruction to be executed.
2. The data processing method of claim 1, wherein parsing the NDEF data to obtain a parsed result comprises:
performing a first round of parsing on the NDEF data to obtain NDEF header format information and NDEF initial data content, where the NDEF header format information includes a type field of the NDEF data; and carrying out second-round analysis on the NDEF initial data content to obtain an analysis result.
3. The data processing method of claim 2, wherein the NDEF header format information further comprises a length of the NDEF initial data content.
4. The data processing method according to claim 2, wherein the NDEF initial data content contains encryption information;
the second round of parsing of the NDEF initial data content includes:
decrypting the NDEF initial data content based on the encryption information.
5. The data processing method according to claim 2, wherein the NDEF initial data content includes check information;
The second round of parsing of the NDEF initial data content includes:
and verifying the NDEF initial data content based on the verification information.
6. The data processing method according to claim 2, wherein the plurality of preset application programs are provided, and the NDEF initial data content includes a message type;
according to the instruction to be executed, executing the preset application program comprises:
selecting an application program to be executed from a plurality of preset application programs according to the message type;
and executing the instruction to be executed by adopting the application program to be executed.
7. The data processing method according to claim 1, characterized by further comprising:
performing NDEF encapsulation on an execution result of executing the application program to obtain an encapsulated NDEF feedback execution result;
the type field of the encapsulated NDEF feedback execution result is filled with a preset second custom application type;
the second custom application type is the same as or different from the first custom application type.
8. The data processing method of claim 7, further comprising:
in response to receiving a read instruction, checking a preset instruction mark;
If the preset instruction mark is a first instruction, sending the encapsulated NDEF feedback execution result as encapsulated NDEF feedback data;
the first instruction marks a preset instruction mark after determining that the type field is a preset first user-defined application type.
9. The data processing method of claim 8, wherein if the type field is another application type than the preset first custom application type, taking at least a portion of the NDEF data content as NDEF file information, the method further comprising:
if the preset instruction mark is a second instruction, the encapsulated NDEF file information is used as data encapsulated by the NDEF to be sent;
the second instruction marks a preset instruction flag after determining that the type field is of an application type other than the preset first custom application type, and the second instruction is different from the first instruction.
10. The data processing method according to claim 8, further comprising:
and after sending the encapsulated NDEF feedback data, setting the instruction flag to a second instruction.
11. The data processing method of claim 7, wherein NDEF packaging the execution result of executing the application program comprises:
performing first round packaging on the execution result to obtain an initial packaging result;
performing a second round of encapsulation on the initial encapsulation result, and adding or updating NDEF header format feedback information to obtain encapsulated NDEF feedback data;
the NDEF header format feedback information includes a type field of the encapsulated NDEF feedback data, and the type field is filled with the second custom application type.
12. The method of claim 11, wherein first round packaging the execution result to obtain an initial package result comprises:
encrypting the execution result by adopting feedback encryption information, and adding the feedback encryption information into the initial encapsulation result;
and/or the number of the groups of groups,
and determining feedback check information of the execution result, and adding the feedback check information into the initial packaging result.
13. The data processing method of claim 1, further comprising, prior to the receiving NDEF data:
And determining the received instruction as a write instruction.
14. A method of data processing, comprising:
determining a mode to be processed of NDEF data to be sent;
if the mode to be processed is to execute a preset application program, carrying out NDEF encapsulation on the instruction to be executed, wherein an encapsulation result comprises a type field of the NDEF data to be sent and the NDEF data content;
sending the encapsulated NDEF data;
the type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
15. The data processing method of claim 14, wherein the NDEF packaging of the instructions to be executed comprises:
performing first round packaging on the instruction to be executed to obtain an initial packaging instruction;
and carrying out second round encapsulation on the initial encapsulation instruction, and adding or updating NDEF header format information to obtain an encapsulation result, wherein the NDEF header format information comprises a type field of the NDEF data.
16. The data processing method of claim 15, wherein the NDEF header format information further comprises a length of data content in the encapsulated NDEF data.
17. The method of claim 15, wherein first round packaging the to-be-executed instruction to obtain an initial packaged instruction comprises:
encrypting the instruction to be executed by adopting encryption information, and adding the encryption information into the data content in the packaged NDEF data;
and/or the number of the groups of groups,
and determining the check information of the instruction to be executed, and adding the check information into the data content in the packaged NDEF data.
18. The data processing method according to claim 15, wherein the number of the preset application programs is plural;
the first round of packaging the to-be-executed instruction to obtain an initial packaged instruction comprises the following steps:
and adding a message type into the data content in the encapsulated NDEF data, wherein the message type is used for indicating an application program to be executed in a plurality of preset application programs.
19. The data processing method of claim 14, further comprising:
sending a reading instruction;
receiving encapsulated NDEF feedback data;
analyzing the encapsulated NDEF feedback data to obtain a feedback analysis result, wherein the feedback analysis result comprises a type field of the NDEF feedback data and NDEF feedback data content;
If the type field of the NDEF feedback data is a preset second custom application type, determining that the NDEF feedback data content includes an NDEF feedback execution result;
wherein the second custom application type is the same as or different from the first custom application type.
20. The data processing method of claim 19, wherein if the mode to be processed is to store NDEF file information, NDEF packaging is performed on the NDEF file information, the packaging result includes a type field of the NDEF file information to be sent and NDEF data content, the type field is another application type except the preset first custom application type, and the NDEF file information is at least a part of the NDEF data content, and the method further includes:
and if the type field of the NDEF feedback data is other application types except the preset second custom application type, determining that the NDEF feedback data content comprises NDEF file information.
21. The data processing method of claim 19, wherein parsing the encapsulated NDEF feedback data to obtain feedback parsing results comprises:
Performing a first round of parsing on the encapsulated NDEF feedback data to obtain NDEF header format feedback information and NDEF initial data feedback content, where the NDEF header format feedback information includes a type field of the NDEF feedback data;
and carrying out second-round analysis on the feedback content of the NDEF initial data to obtain a feedback analysis result.
22. The data processing method of claim 21, wherein the NDEF header format feedback information further comprises a length of the NDEF initial data feedback content.
23. The data processing method according to claim 21, wherein the NDEF initial data feedback content includes feedback encryption information;
the second round of parsing of the NDEF initial data feedback content includes:
and decrypting the feedback content of the NDEF initial data based on the feedback encryption information.
24. The data processing method according to claim 21, wherein the NDEF initial data feedback content includes feedback check information;
the second round of parsing of the NDEF initial data feedback content includes:
and verifying the feedback content of the NDEF initial data based on the feedback verification information.
25. The data processing method of claim 14, further comprising, prior to said sending the encapsulated NDEF data:
and sending a write instruction.
26. A data processing apparatus, comprising:
the data receiving module is used for receiving the near field communication data exchange format NDEF data;
the analysis module is used for analyzing the NDEF data to obtain an analysis result, wherein the analysis result comprises a type field of the NDEF data and NDEF data content;
the instruction determining module is used for taking at least one part of the NDEF data content as an instruction to be executed when the type field is a preset first user-defined application type;
and the execution module is used for executing a preset application program according to the instruction to be executed.
27. A data processing apparatus, comprising:
the processing determining module is used for determining a mode to be processed of the NDEF data to be sent;
the packaging module is used for carrying out NDEF packaging on the instruction to be executed when the mode to be processed is to execute the preset application program, wherein the packaging result comprises a type field of the NDEF data to be sent and the NDEF data content;
The sending module is used for sending the encapsulated NDEF data;
the type field is a preset first custom application type, and the instruction to be executed is at least a part of the NDEF data content.
28. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, performs the steps of the data processing method of any one of claims 1 to 13, or performs the steps of the data processing method of any one of claims 14 to 25.
29. A first terminal comprising a memory and a processor, said memory having stored thereon a computer program capable of being run on said processor, characterized in that said processor executes the steps of the data processing method according to any of claims 1 to 13 when said computer program is run on said processor.
30. The first terminal of claim 29, wherein the first terminal comprises a near field communication tag.
31. A second terminal comprising a memory and a processor, the memory having stored thereon a computer program capable of being run on the processor, characterized in that the processor executes the steps of the data processing method according to any of claims 14 to 25 when the computer program is run on the processor.
32. The second terminal according to claim 31, characterized in that the second terminal comprises a near field communication terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210243392.9A CN116782190A (en) | 2022-03-11 | 2022-03-11 | Data processing method and device, first terminal and second terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210243392.9A CN116782190A (en) | 2022-03-11 | 2022-03-11 | Data processing method and device, first terminal and second terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116782190A true CN116782190A (en) | 2023-09-19 |
Family
ID=88010381
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210243392.9A Pending CN116782190A (en) | 2022-03-11 | 2022-03-11 | Data processing method and device, first terminal and second terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116782190A (en) |
-
2022
- 2022-03-11 CN CN202210243392.9A patent/CN116782190A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107612909B (en) | Information interaction method, device and equipment about Internet of things equipment | |
US9286249B2 (en) | USB device communication method, device and system wherein a human interface device (HID) descriptor and report are added to a driver of USB device | |
EP3133852B1 (en) | Nfc device with multiple secure elements | |
KR101799389B1 (en) | Method for identifying and authenticating an rfid tag by a reader | |
CN110740481B (en) | Data processing method, equipment and computer storage medium based on service quality | |
CN108897728B (en) | Short message splicing processing method and device, computer equipment and storage medium | |
CN110808950B (en) | Message processing method, device, computer equipment and storage medium | |
CN113329096B (en) | Message transmission method and device, electronic equipment and storage medium | |
CN107203877B (en) | Method and device for realizing service between accounts in close range | |
CN111242652A (en) | Block chaining method of tracing information and related equipment | |
KR101527185B1 (en) | RFID system and method for transmitting large data of passive RFID | |
CN103987129A (en) | Information push method, apparatus and system | |
CN107204961B (en) | Method and device for processing character to be escape in interface message | |
CN111818492B (en) | Bluetooth beacon, data transmission method thereof, and readable storage medium | |
CN116782190A (en) | Data processing method and device, first terminal and second terminal | |
CN104821982A (en) | Data recovery method | |
CN116722973A (en) | CPK key secure transmission method, storage method and device | |
CN111263350A (en) | Card writing device, system and method | |
CN115982735A (en) | Method, device and storage medium for automatically processing production data | |
KR101012151B1 (en) | System and method for updating smart card using update binary command | |
KR20090106103A (en) | System and Method for Managing Smart Card Information | |
CN114978445A (en) | Data transmission method and equipment thereof | |
JP5535109B2 (en) | Portable electronic devices and IC cards | |
CN108712394B (en) | Radio frequency identification method and label | |
CN113238982A (en) | Data communication method, device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |