[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2016146008A1 - Data parsing method, apparatus and system - Google Patents

Data parsing method, apparatus and system Download PDF

Info

Publication number
WO2016146008A1
WO2016146008A1 PCT/CN2016/075941 CN2016075941W WO2016146008A1 WO 2016146008 A1 WO2016146008 A1 WO 2016146008A1 CN 2016075941 W CN2016075941 W CN 2016075941W WO 2016146008 A1 WO2016146008 A1 WO 2016146008A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
client
parsed
server
nfc card
Prior art date
Application number
PCT/CN2016/075941
Other languages
French (fr)
Chinese (zh)
Inventor
安光霖
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016146008A1 publication Critical patent/WO2016146008A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data analysis method, apparatus, and system.
  • NFC Near Field Communication
  • NFC applications various NFC-related applications (referred to as NFC applications) have emerged.
  • the client of the NFC application (referred to as the client) needs to have the function of parsing the NFC data, that is, to be able to read the NFC data from the NFC card and parse the NFC data into data recognizable by the NFC application.
  • NFC cards Due to the increasing variety of NFC cards, in order to be able to parse data from more NFC cards, the client needs to be continuously updated and upgraded. Because client upgrades are usually time-consuming and cumbersome, many users will not upgrade the client in time, resulting in failure to parse NFC data in time.
  • aspects of the present application provide a data analysis method, apparatus, and system for parsing NFC data in time.
  • An aspect of the present application provides a data parsing method, including:
  • the client reads the data to be parsed from the NFC card
  • the client sends the data to be parsed to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns;
  • the client receives the structured data returned by the server.
  • Another aspect of the present application provides a data parsing method, including:
  • the server receives the data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card;
  • the server parses the data to be parsed, and encapsulates the successfully parsed result data into structured data recognizable by the client;
  • the server sends the structured data to the client.
  • a client including:
  • a reading module configured to read data to be parsed from the NFC card
  • a sending module configured to send the data to be parsed to the server, where the server parses the data to be parsed into structured data recognizable by the client and returns;
  • the first receiving module is configured to receive the structured data returned by the server.
  • a server including:
  • a receiving module configured to receive data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card;
  • a parsing module configured to parse the data to be parsed, and encapsulate the successfully parsed result data into structured data recognizable by the client;
  • a sending module configured to send the structured data to the client.
  • a further aspect of the present application provides a data parsing system, including: a client and a server;
  • the client is configured to read data to be parsed from the NFC card, send the data to be parsed to the server, and receive structured data recognizable by the client returned by the server ;
  • the server is configured to receive data to be parsed sent by the client, parse the data to be parsed, and encapsulate the successfully parsed result data into the structured data, and configure the structure Data is sent to the client.
  • the client reads the data to be parsed from the NFC, and sends the data to be parsed to the server, and the data to be parsed by the server is parsed and the structured data recognizable by the client is generated and returned to the client.
  • FIG. 1 is a schematic flowchart diagram of a data parsing method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a data structure of a data read command according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a data parsing method according to another embodiment of the present application.
  • FIG. 3b is a schematic structural diagram of a cloud card displayed by an os life service to a user according to an embodiment of the present disclosure
  • FIG. 4 is a schematic structural diagram of a client according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a client according to another embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a server provided by another embodiment of the present application.
  • FIG. 1 is a schematic flowchart diagram of a data parsing method according to an embodiment of the present application. As shown in Figure 1, the method includes:
  • the client reads the data to be parsed from the NFC card.
  • the client sends the data to be parsed to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns.
  • the client receives the structured data returned by the server.
  • This embodiment provides a data parsing method, which can be executed by a client (referred to as a client) of an NFC application.
  • the method provided by this embodiment can be used in various NFC-based applications; correspondingly, the client of this embodiment can be a client of various NFC-based applications.
  • the method in this embodiment can be applied to an NFC-based payment application, and the client is a client of an NFC-based payment application.
  • the method of the embodiment can be applied to a card reading application of various information cards (such as a traffic card, an access card, and a ticket) implemented by NFC; the client can be a card reading application corresponding to various information cards implemented by NFC. Client.
  • various information cards such as a traffic card, an access card, and a ticket
  • the method of this embodiment can be applied to an NFC-based file transfer application; the client can be based on NFC.
  • the client of the file transfer class application can be applied to an NFC-based file transfer application; the client can be based on NFC.
  • the method of this embodiment can be applied to an NFC-based electronic information exchange application; the client can be a client of an NFC-based electronic information exchange application.
  • the method of the embodiment can be applied to an NFC-based short-distance online game application; the client can be a client of an NFC-based short-distance online game application.
  • the client needs to perform corresponding operations based on the data in the NFC card.
  • the client needs to complete the payment operation according to the data in the NFC card.
  • the client needs to complete the file transfer operation according to the data in the NFC card.
  • the data format used by the NFC card is not directly related to the data format supported by the client, meaning that the client may not be able to directly recognize the data read from the NFC card.
  • the client has the function of parsing the data in the NFC card, and the client can parse the data in the NFC card into data recognizable by the client, and perform corresponding operations based on the identifiable data.
  • the client may face different types of NFC cards at any time, and the data format adopted by the NFC cards may be different, which means that the client needs to be able to parse NFC data of various data formats. This requires the client to be constantly updated as the NFC card type evolves.
  • the client upgrade is usually time-consuming and cumbersome, many users will not upgrade the client in time, that is, the user conversion rate cannot reach 100%, and the NFC data cannot be recognized in time.
  • the embodiment provides a data parsing method, and the data parsing function is transferred to the server, and the client is freed from data parsing, so that the NFC data can be parsed in time.
  • the client reads the data to be parsed from the NFC card, sends the data to be parsed to the server, parses the data to be parsed by the server, and encapsulates the successfully parsed result data into structured data that the client can recognize. And returning to the client, the client receives the structured data returned by the server, and then can perform corresponding operations according to the structured data.
  • the client may display the data to the user through the terminal where the client is located, so that the user can learn related information through the structured data.
  • the client may send a data read command to the NFC card; the NFC card receives the data read command of the client, and reads the corresponding data according to the data read command, and returns the read data to the client.
  • the client receives the data returned by the NFC card, and validates the data returned by the NFC card. When the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed.
  • the client can judge whether the data is valid data through the last two bytes of data returned by the NFC card. For example, if the value of the check digit is set to 0x9000 in advance, the client can check whether the last two bytes of data returned by the NFC card are 0x9000.
  • the client may perform XOR processing on the data value in the data returned by the NFC card to obtain an XOR result, and the XOR result is obtained.
  • the value of the last two bytes of the data returned by the NFC card is compared. If they match, it is determined that the data returned by the NFC card is valid data; if not, it is determined that the data returned by the NFC card is invalid data.
  • NFC cards can be classified according to different standards, and are generally classified into several categories.
  • NFC cards can be classified into several major categories such as IsoDep, NFCA, ..., NFCV. See IsoDep, NFCA, ..., NFCV for a description of the prior art.
  • each major category can be divided into different small categories.
  • the IsoDep category can also be divided into Iso7816 and Iso14443. For Iso7816 and Iso14443, it can be further subdivided.
  • This embodiment does not limit how to classify NFC cards, but for the same category of NFC cards, the instruction types and instruction codes used are the same.
  • the instruction category is used to indicate instruction code information used by different types of NFC cards; the instruction code information used by each type of NFC includes reading NFC card field values (such as NFC card ID, NFC).
  • NFC card field values such as NFC card ID, NFC.
  • the same instruction code may correspond to multiple parameters, one parameter corresponding to the next specific NFC card in the category.
  • the parameter corresponding to the instruction code and the instruction code under each type of NFC card can be managed by the parameter instruction mapping table.
  • the client can store the parameter mapping table locally, which is beneficial to improving the efficiency of obtaining parameters corresponding to the instruction code, and does not need to be requested to the server every time, which is beneficial to save traffic resources.
  • the client may update the parameter instruction mapping table, for example, periodically send an update request to the server, receive an update instruction sent by the server, and update the parameter instruction mapping table according to the update instruction.
  • the server may also send an update instruction to the client actively, and the client receives the update instruction sent by the server, and updates the parameter instruction mapping table according to the update instruction.
  • the above update instruction may include a mapping relationship between all parameters and the instruction code, and the client may directly replace the mapping relationship between the parameter and the instruction code in the parameter instruction mapping table by using the mapping relationship between the parameter and the instruction code in the update instruction. , to achieve full updates.
  • the above update instruction may only include parameters and instructions that have changed.
  • the mapping relationship between the code the client can directly replace the mapping relationship between the parameter and the instruction code in the update instruction by the mapping relationship between the corresponding parameter and the instruction code in the parameter instruction mapping table, or directly update the parameter and the instruction code in the instruction instruction.
  • the mapping relationship is added to the parameter instruction mapping table to implement incremental update.
  • the client can generate a data read command in the following manner before sending a data read command to the NFC card:
  • the service requirement generally refers to the requirement of reading the NFC data, and pre-defines the mapping relationship between the service requirement and the read field, that is, once the business requirement is determined, It also knows which field of NFC data needs to be read. It can be seen from the above that different fields use different instruction codes, so the instruction code used can be determined directly according to the service requirement; according to the parameter instruction mapping table under the category of the NFC card, the parameter corresponding to the instruction code corresponding to the service requirement is determined; The instruction code corresponding to the business requirement and the parameter corresponding to the instruction code generate a data read instruction.
  • the instruction code in the above data read instruction is used to indicate which field of the NFC data is to be read; the parameter corresponding to the instruction code is used to indicate which NFC card data is to be read.
  • one instruction code may correspond to multiple parameters.
  • the client can generate data read commands to read data from the NFC card in an exhaustive manner. Briefly speaking, the client obtains a parameter corresponding to the instruction code each time, and generates a data reading instruction according to the instruction code and the parameter corresponding to the instruction code, and sends the data reading instruction to the NFC card, when receiving the data returned by the NFC card.
  • the transportation cards under each category of Iso7816 and Iso14443 include: Beijing transportation card, Shanghai transportation card, Tianjin transportation card, Shenzhen transportation card, and so on.
  • the readable data includes the balance of the traffic card, the name of the bus company, the ID of the transportation card, and the recent transaction record.
  • the different fields correspond to different instruction codes. Further, the same instruction code may correspond to a traffic card in a different place, and may be distinguished by parameters corresponding to the instruction code.
  • the format and content of the data read instructions used by the client will be different.
  • the data read command sent by the client may be an Application Protocol Data Unit (APDU) request.
  • the format of the APDU request is as shown in FIG. 2, including: a header and a body part.
  • the header includes several fields such as CLA, INS, P1, and P2;
  • CLA indicates the instruction class, INS indicates the instruction code; and
  • P1 and P2 are two parameters.
  • the body portion includes a data length Lc field, a data field, and a length Le field of the response data.
  • a code for a client to read data from a traffic card is as follows:
  • the INS is a byte in the APDU command protocol, and defines the operation type of the instruction code.
  • the correspondence between the value of the INS and the operation type is shown in Table 1.
  • a binary bit stream can be read, and the value of sfi is different, and the read data is different. For example, if you want to read the data in the Shanghai transportation card, you need to pass the sfi value to 21. If you want to read the data in the Beijing traffic card, you need to pass the sfi value to 4. For the client, since it is not possible to directly identify which bus card, it is possible to try to read the data to the traffic card with a value of 21, and if the data cannot be validated, continue to The traffic card has an incoming value of 4 sfi for data reading until valid data is read.
  • the terminal device itself may provide an NFC system framework, which may be referred to as an NFC card identification application, and the NFC card identification application may automatically sense when the NFC card is close to the NFC-enabled terminal device.
  • NFC card identification application may automatically sense when the NFC card is close to the NFC-enabled terminal device.
  • the label of the NFC card is identified and the category to which the NFC card belongs is identified, and the information is provided to the client.
  • the NFC card identification application may include a sensing unit, an Activity, an Activity Manager, and the like.
  • the sensing unit automatically senses the label of the NFC card when the NFC card is close to the NFC-enabled terminal device; the Activity Manager is used to manage the registered Activity; the Activity is used to process the NFC tag corresponding to the Activity, mainly to identify the NFC tag.
  • Category attribute information of the identified NFC card When the Activity Manager has an already registered Activity and can process the NFC card sensed by the sensing unit, the Activity Manager identifies the category attribute information of the NFC card identified by the NFC tag, and encapsulates the category attribute information into the Intent and transmits it to the corresponding Activity; Activity sends the Intent to the client.
  • the above Activity is a commonly used component in the Android system, usually as a screen carrier.
  • Intent is a link between different components in the Android system, which encapsulates the condition information of each other.
  • the client can receive the category attribute information of the NFC card sent by the NFC card identification application, and the category attribute information is used to indicate the category to which the NFC card belongs.
  • the client can determine the parameter instruction mapping table used to send the data read command to the NFC card.
  • the client may encode the data to be parsed before sending the data to be parsed to the server.
  • the data to be parsed may be encoded into a byte stream by using a Base64 encoding method.
  • Base64 is a kind of encoding method in which a bit stream is converted into a byte stream.
  • the client sends the encoded byte stream to the server through HTTP.
  • the server may perform decoding processing on the parsed data, and then parse the decoded data.
  • the client itself also has the capability to parse NFC data. Based on this, the client can determine whether the data to be parsed can be parsed before sending the data to be parsed to the server. If the local device can resolve the data, the client can directly parse the data to be parsed locally. The data is parsed into a data structure recognizable by the client; if the local device cannot be parsed, the client sends the data to be parsed to the server, so that the server parses the data to be parsed into the structured data recognizable by the client and return.
  • This embodiment preferentially analyzes the data to be parsed by the client locally, which can reduce the processing load of the server on the one hand, and improve the analysis efficiency on the other hand.
  • FIG. 3 is a schematic flowchart of a data parsing method according to an embodiment of the present application. As shown in Figure 3a, the method includes:
  • the server receives the data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card.
  • the server parses the data to be parsed, and encapsulates the successfully parsed result data into a client. Structured data that is identifiable by the end.
  • the server sends the foregoing structured data to the client.
  • This embodiment provides a data parsing method, which can be executed by a server (referred to as a server) of an NFC application.
  • the method provided in this embodiment can be used in various NFC-based applications; correspondingly, the client in this embodiment can be a client of various NFC-based applications; the server can be a server of various NFC-based applications. .
  • the server has the ability to parse various NFC cards.
  • the method in this embodiment can be applied to an NFC-based payment application, and the client is a client of an NFC-based payment application; and the server can be a server in an NFC-based payment application.
  • the method of the embodiment can be applied to a card reading application of various information cards (such as a traffic card, an access card, and a ticket) implemented by NFC;
  • the client can be a card reading application corresponding to various information cards implemented by NFC.
  • the client may be a server of a card reading application corresponding to various information cards implemented by NFC.
  • the method in this embodiment can be applied to an NFC-based file transfer application; the client can be a client of an NFC-based file transfer application; and the server can be a server of an NFC-based file transfer application.
  • the method in this embodiment can be applied to an NFC-based electronic information exchange application; the client can be a client of an NFC-based electronic information exchange application; and the server can be an NFC-based electronic information exchange application. end.
  • the method of the embodiment can be applied to an NFC-based short-distance online game application; the client can be a client of an NFC-based short-distance online game application; and the server can be an NFC-based close-range online game class.
  • the server side of the application can be applied to an NFC-based short-distance online game application; the client can be a client of an NFC-based short-distance online game application; and the server can be an NFC-based close-range online game class.
  • the client needs to perform corresponding operations based on the data in the NFC card.
  • the client needs to complete the payment operation according to the data in the NFC card.
  • the client needs to complete the file transfer operation according to the data in the NFC card.
  • the data format used by the NFC card is not directly related to the data format supported by the client, meaning that the client may not be able to directly recognize the data read from the NFC card.
  • the client has the function of parsing the data in the NFC card, and the client can parse the data in the NFC card into data recognizable by the client, and perform corresponding operations based on the identifiable data.
  • the client may face different types of NFC cards at any time, and the data format adopted by the NFC cards may be different, which means that the client needs to be able to parse NFC data of various data formats. This requires the client to be constantly updated as the NFC card type evolves.
  • the upgrade package of the client is generally issued by the server according to a certain frequency, the update is not very timely, and the NFC data cannot be recognized in time.
  • the embodiment provides a data parsing method, and the data parsing function is transferred to the server, and the client is freed from data parsing, so that the NFC data can be parsed in time.
  • the client reads the data to be parsed from the NFC card, and sends the data to be parsed to the server.
  • the server receives the data to be parsed sent by the client, and parses the data to be parsed by the server, and the result is successfully parsed.
  • the data is encapsulated into structured data that the client can recognize; after that, the structured data is sent to the client, so that the client can perform corresponding operations according to the structured data.
  • the server pre-stores a mapping relationship between the data structures recognizable by the client and the client. Based on this, the client can also send the identifier of the client to the server, and the server queries the stored mapping between the client and the data structure identifiable by the client according to the identifier of the client, and learns the data supported by the client. The structure, in turn, parses the data to be parsed into structured data recognizable by the client.
  • the client may send the data structure information recognizable by the client to the server.
  • the server receives the data structure information recognizable by the client and sends the data to be parsed into the structured data recognizable by the client according to the data structure information identifiable by the client.
  • the server includes an analysis algorithm corresponding to various NFC cards, and as the number of NFC cards increases, the server adds a corresponding parsing algorithm in time. Based on this, an implementation manner in which the server parses the parsed data includes: the server determines an analysis algorithm corresponding to the NFC card, and uses the determined parsing algorithm to parse the data to be parsed.
  • the client sends the category attribute information of the NFC card to the server in addition to the data to be parsed.
  • the server can determine the category to which the NFC card belongs according to the category attribute information of the NFC card.
  • the analysis algorithm corresponding to the category is selected, and the data to be parsed is parsed using the analysis algorithm.
  • the client can also send the data reading instruction used to read the data to be parsed to the server, and the server can simultaneously combine the category attribute information of the NFC card and the data used to read the data to be parsed. Information such as instructions and data to be parsed to determine the parsing algorithm used.
  • NFC cards there will be many manufacturers of corresponding NFC cards. Some NFC card manufacturers are not in accordance with the standard protocol, so the server can access the official website of the manufacturer or other public relations channels to understand the specific protocol documents, and then obtain the parsing algorithm needed to parse the data to be parsed.
  • the server needs to decode the parsed data before parsing the data to be parsed.
  • the client and the server may pre-agreed the codec algorithm used, for example, may be a Base64 algorithm, but is not limited thereto.
  • the server may not have The parsing algorithm corresponding to the NFC card may not successfully parse the result data.
  • the server may generate an analysis algorithm corresponding to the NFC card according to the parsed data and the related data of the data to be parsed.
  • the server may store the parsing algorithm to parse the data of the subsequently received NFC card.
  • the data related to the data to be parsed includes, but is not limited to, a data read instruction used by the client to acquire data to be parsed, information about the NFC card input by the user, and the like.
  • the process of generating the resolution algorithm corresponding to the NFC card may be different from the manufacturer, and the overall process is similar to or the same as the prior art.
  • the cloud os life service determines the instruction code according to the service requirement, and determines the parameter corresponding to the instruction code based on the locally stored parameter instruction mapping table, according to The instruction code and the parameter corresponding to the instruction code generate an APDU request, and send the APDU request to the NFC card; receive the data returned by the NFC card according to the APDU request; and check the last two bytes of the data according to the data returned by the NFC card.
  • the parsing algorithm parses the decoded data by using the determined parsing algorithm, and if the result data is successfully parsed, the result data is encapsulated into
  • the structured data identifiable by the cloud os life service that is, the form of a cloud card (CloudCard) is returned to the cloud os life service; the cloud os life service presents the data to the user in the form of a CloudCard.
  • CloudCard cloud card
  • the cloud os life service is generally embedded in the cloud os system desktop, compared with other desktop applications, the update frequency of the cloud os life service is relatively low.
  • the data analysis method provided by the present application will have obvious advantages. Users can analyze the data in various NFC cards without upgrading the entire cloud os life service, and then encapsulate the data in the NFC card into the CloudCard form in the cloud os life service to display to the user. Further, as shown in FIG. 3b, the cloud os life service can also accurately push corresponding intelligent related services through an associated service system connected to the living service, for example, based on the user information and balance information of the user's NFC card, and can be sent to the user. Pushing related services such as nearby bus stations and recharge centers is conducive to expanding the service of living services and improving the user experience.
  • FIG. 4 is a schematic structural diagram of a client according to an embodiment of the present application. As shown in FIG. 4, the client includes a reading module 41, a transmitting module 42, and a first receiving module 43.
  • the reading module 41 is configured to read data to be parsed from the NFC card.
  • the sending module 42 is configured to send the data to be parsed read by the reading module 41 to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns.
  • the first receiving module 43 is configured to receive structured data returned by the server.
  • the reading module 41 is specifically configured to:
  • the validity of the data returned by the NFC card is verified. When the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed.
  • the client further includes: a determining module 44 and a generating module 45.
  • the determining module 44 is configured to determine an instruction code corresponding to the service requirement, and determine a parameter corresponding to the instruction code according to the parameter instruction mapping table under the category to which the NFC card belongs.
  • the generating module 45 is configured to generate a data read instruction according to the instruction code determined by the determining module 44 and the parameter corresponding to the instruction code.
  • the client further includes: a second receiving module 46, configured to determine, according to the parameter instruction mapping table of the category to which the NFC card belongs, the determining module corresponding to the instruction code Before the parameter, the NFC card is used to identify the category attribute information of the NFC card sent by the application, and the category attribute information is used to indicate the category to which the NFC card belongs.
  • a second receiving module 46 configured to determine, according to the parameter instruction mapping table of the category to which the NFC card belongs, the determining module corresponding to the instruction code Before the parameter, the NFC card is used to identify the category attribute information of the NFC card sent by the application, and the category attribute information is used to indicate the category to which the NFC card belongs.
  • the client further includes: a third receiving module 47 and an updating module 48.
  • the third receiving module 47 is configured to receive an update instruction sent by the server.
  • the updating module 48 is configured to update the parameter instruction mapping table according to the update instruction received by the third receiving module 47.
  • the update module 48 is operative to provide the updated module 44 with an updated parameter instruction map.
  • the client further includes: an encoding module 49, configured to perform encoding processing on the data to be parsed before the sending module 42 sends the data to be parsed to the server.
  • an encoding module 49 configured to perform encoding processing on the data to be parsed before the sending module 42 sends the data to be parsed to the server.
  • the client further includes: a determining module 50.
  • the determining module 50 is configured to determine whether the data to be parsed can be parsed locally, and when the determination result is no, the trigger sending module 42 sends the data to be parsed to the server, so that the server will The data to be parsed is parsed into the structured data recognizable by the client and returned.
  • the client further includes: a display module 51.
  • the display module 51 is configured to display the structured data received by the first receiving module 43 to the user through the terminal where the client is located.
  • the client reads the data to be parsed from the NFC, and sends the data to be parsed to the server.
  • the data to be parsed by the server is parsed and the structured data recognizable by the client is generated and returned to the client.
  • the NFC data is parsed, and since the parsing process is completed by the server, the NFC data can be parsed in a timely manner without waiting for the update of the client.
  • FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application. As shown in FIG. 6, the server includes a receiving module 61, a parsing module 62, and a sending module 63.
  • the receiving module 61 is configured to receive data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card.
  • the parsing module 62 is configured to parse the data to be parsed received by the receiving module 61, and encapsulate the successfully parsed result data into structured data recognizable by the client.
  • the sending module 63 is configured to send the structured data parsed by the parsing module 62 to the client.
  • the parsing module 62 is specifically configured to:
  • the successfully parsed result data is encapsulated into structured data recognizable by the client.
  • the server further includes: a generating module 64.
  • the generating module 64 is configured to generate an analysis algorithm corresponding to the NFC card according to the data to be parsed and the related data of the data to be parsed when the parsing module 62 cannot successfully parse the result data.
  • the server further includes: a decoding module.
  • the decoding module 65 is configured to perform decoding processing on the data to be parsed before the parsing module 62 parses the data to be parsed.
  • the server provided in this embodiment cooperates with the client provided in the foregoing embodiment to receive data to be parsed from the NFC card sent by the client, parses the data to be parsed, and generates a structure recognizable by the client. Chemical The data is returned to the client to implement the analysis of the NFC data. At the same time, since the parsing process is completed by the server of the embodiment, the NFC data can be parsed in a timely manner without waiting for the update and upgrade of the client.
  • An embodiment of the present application further provides a data parsing system, including: a client and a server.
  • the client is configured to read data to be parsed from the NFC card, send the data to be parsed to the server, and receive structured data recognizable by the client returned by the server;
  • the server is configured to receive the data to be parsed sent by the client, parse the data to be parsed, and encapsulate the successfully parsed result data into structured data, and send the structured data to the client.
  • the server cooperates with the client to receive the data to be parsed from the NFC card sent by the client, parses the data to be parsed, and generates a structure recognizable by the client.
  • the data is returned to the client to implement the analysis of the NFC data.
  • the server of the embodiment since the parsing process is completed by the server of the embodiment, the NFC data can be parsed more timely without waiting for the update and upgrade of the client.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the above integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage In the medium.
  • the software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods described in various embodiments of the present application. Part of the steps.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

Provided are a data parsing method, apparatus and system. The method comprises: a client reading data to be parsed from an NFC card; the client sending the data to be parsed to a server, so that the server parses the data to be parsed to structured data which can be recognized by the client and returns the structured data; and the client receiving the structured data returned by the server. In the present application, data in an NFC card is parsed by a server, thereby parsing NFC data in time.

Description

数据解析方法、装置及系统Data analysis method, device and system

本申请要求2015年03月17日递交的申请号为201510115672.1、发明名称为“数据解析方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application Serial No. No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No

技术领域Technical field

本申请涉及通信技术领域,尤其涉及一种数据解析方法、装置及系统。The present application relates to the field of communications technologies, and in particular, to a data analysis method, apparatus, and system.

背景技术Background technique

近距离无线通信(Near Field Communication,NFC)是一种短距离的高频无线通信技术,允许电子设备之间进行非接触式点对点数据传输(在十厘米内)。NFC技术主要用于手机、平板等手持设备中。基于近场通信的安全性和手持终端的普及,NFC技术具有很大的应用前景。Near Field Communication (NFC) is a short-range, high-frequency wireless communication technology that allows non-contact point-to-point data transmission (within ten centimeters) between electronic devices. NFC technology is mainly used in handheld devices such as mobile phones and tablets. Based on the security of near field communication and the popularity of handheld terminals, NFC technology has great application prospects.

随着NFC技术的应用,出现了各种与NFC有关的应用(简称为NFC应用)。其中,NFC应用的客户端(简称为客户端)需要具备解析NFC数据的功能,即要能够从NFC卡中读取NFC数据并将NFC数据解析成NFC应用可识别的数据。With the application of NFC technology, various NFC-related applications (referred to as NFC applications) have emerged. Among them, the client of the NFC application (referred to as the client) needs to have the function of parsing the NFC data, that is, to be able to read the NFC data from the NFC card and parse the NFC data into data recognizable by the NFC application.

由于NFC卡的种类越来越多,为了能够对更多NFC卡的数据进行解析,客户端需要不断的更新升级。由于客户端升级通常比较耗时、繁琐,所以很多用户不会及时升级客户端,导致无法及时解析NFC数据。Due to the increasing variety of NFC cards, in order to be able to parse data from more NFC cards, the client needs to be continuously updated and upgraded. Because client upgrades are usually time-consuming and cumbersome, many users will not upgrade the client in time, resulting in failure to parse NFC data in time.

发明内容Summary of the invention

本申请的多个方面提供一种数据解析方法、装置及系统,用以及时解析NFC数据。Aspects of the present application provide a data analysis method, apparatus, and system for parsing NFC data in time.

本申请的一方面,提供一种数据解析方法,包括:An aspect of the present application provides a data parsing method, including:

客户端从NFC卡中读取待解析的数据;The client reads the data to be parsed from the NFC card;

所述客户端将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回;The client sends the data to be parsed to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns;

所述客户端接收所述服务端返回的所述结构化数据。The client receives the structured data returned by the server.

本申请的另一方面,提供一种数据解析方法,包括:Another aspect of the present application provides a data parsing method, including:

服务端接收客户端发送的待解析的数据,所述待解析的数据是所述客户端从NFC卡中读取的; The server receives the data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card;

所述服务端对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述客户端可识别的结构化数据;The server parses the data to be parsed, and encapsulates the successfully parsed result data into structured data recognizable by the client;

所述服务端将所述结构化数据发送给所述客户端。The server sends the structured data to the client.

本申请的又一方面,提供一种客户端,包括:In another aspect of the application, a client is provided, including:

读取模块,用于从NFC卡中读取待解析的数据;a reading module, configured to read data to be parsed from the NFC card;

发送模块,用于将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回;a sending module, configured to send the data to be parsed to the server, where the server parses the data to be parsed into structured data recognizable by the client and returns;

第一接收模块,用于接收所述服务端返回的所述结构化数据。The first receiving module is configured to receive the structured data returned by the server.

本申请的又一方面,提供一种服务端,包括:In another aspect of the application, a server is provided, including:

接收模块,用于接收客户端发送的待解析的数据,所述待解析的数据是所述客户端从NFC卡中读取的;a receiving module, configured to receive data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card;

解析模块,用于对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述客户端可识别的结构化数据;a parsing module, configured to parse the data to be parsed, and encapsulate the successfully parsed result data into structured data recognizable by the client;

发送模块,用于将所述结构化数据发送给所述客户端。And a sending module, configured to send the structured data to the client.

本申请的又一方面,提供一种数据解析系统,包括:客户端和服务端;A further aspect of the present application provides a data parsing system, including: a client and a server;

所述客户端,用于从NFC卡中读取待解析的数据,将所述待解析的数据发送给所述服务端,并接收所述服务端返回的所述客户端可识别的结构化数据;The client is configured to read data to be parsed from the NFC card, send the data to be parsed to the server, and receive structured data recognizable by the client returned by the server ;

所述服务端,用于接收所述客户端发送的待解析的数据,对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述结构化数据,将所述结构化数据发送给所述客户端。The server is configured to receive data to be parsed sent by the client, parse the data to be parsed, and encapsulate the successfully parsed result data into the structured data, and configure the structure Data is sent to the client.

在本申请中,客户端从NFC中读取待解析的数据,将待解析的数据发送给服务端,由服务端对待解析的数据进行解析并生成客户端可识别的结构化数据返回给客户端,实现对NFC数据的解析,同时由于该解析过程是由服务端完成的,无论需要解析数据的NFC卡是新出现的还是已有的,均无需等待客户端的更新升级,可以更加及时的对各种NFC数据进行解析。In the present application, the client reads the data to be parsed from the NFC, and sends the data to be parsed to the server, and the data to be parsed by the server is parsed and the structured data recognizable by the client is generated and returned to the client. To realize the analysis of NFC data, and because the parsing process is completed by the server, whether the NFC card that needs to parse the data is new or existing, there is no need to wait for the client to update and upgrade, and it is possible to more timely NFC data is parsed.

附图说明DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这 些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description are the present application. Some embodiments, according to those skilled in the art, can also be based on this without paying creative labor. These figures take additional figures.

图1为本申请一实施例提供的数据解析方法的流程示意图;FIG. 1 is a schematic flowchart diagram of a data parsing method according to an embodiment of the present application;

图2为本申请一实施例提供的数据读取指令的数据结构示意图;2 is a schematic diagram of a data structure of a data read command according to an embodiment of the present disclosure;

图3a为本申请另一实施例提供的数据解析方法的流程示意图;FIG. 3 is a schematic flowchart of a data parsing method according to another embodiment of the present application;

图3b为本申请一实施例提供的os生活服务向用户展示的云卡片的结构示意图;FIG. 3b is a schematic structural diagram of a cloud card displayed by an os life service to a user according to an embodiment of the present disclosure;

图4为本申请一实施例提供的客户端的结构示意图;FIG. 4 is a schematic structural diagram of a client according to an embodiment of the present disclosure;

图5为本申请另一实施例提供的客户端的结构示意图;FIG. 5 is a schematic structural diagram of a client according to another embodiment of the present disclosure;

图6为本申请一实施例提供的服务端的结构示意图;FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application;

图7为本申请另一实施例提供的服务端的结构示意图。FIG. 7 is a schematic structural diagram of a server provided by another embodiment of the present application.

具体实施方式detailed description

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present application. It is a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.

图1为本申请一实施例提供的数据解析方法的流程示意图。如图1所示,该方法包括:FIG. 1 is a schematic flowchart diagram of a data parsing method according to an embodiment of the present application. As shown in Figure 1, the method includes:

101、客户端从NFC卡中读取待解析的数据。101. The client reads the data to be parsed from the NFC card.

102、客户端将上述待解析的数据发送给服务端,以供服务端将待解析的数据解析成客户端可识别的结构化数据并返回。102. The client sends the data to be parsed to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns.

103、客户端接收服务端返回的结构化数据。103. The client receives the structured data returned by the server.

本实施例提供一种数据解析方法,可由NFC应用的客户端(简称为客户端)来执行。本实施例提供的方法可用于各种基于NFC的应用中;相应的,本实施例的客户端可以是各种基于NFC的应用的客户端。This embodiment provides a data parsing method, which can be executed by a client (referred to as a client) of an NFC application. The method provided by this embodiment can be used in various NFC-based applications; correspondingly, the client of this embodiment can be a client of various NFC-based applications.

举例说明:本实施例的方法可应用于基于NFC的支付应用中,则客户端是基于NFC的支付类应用的客户端。For example, the method in this embodiment can be applied to an NFC-based payment application, and the client is a client of an NFC-based payment application.

本实施例的方法可应用于基于NFC实现的各种信息卡(例如交通卡、门禁卡、车票)的读卡应用中;则客户端可以是基于NFC实现的各种信息卡对应的读卡应用的客户端。The method of the embodiment can be applied to a card reading application of various information cards (such as a traffic card, an access card, and a ticket) implemented by NFC; the client can be a card reading application corresponding to various information cards implemented by NFC. Client.

本实施例的方法可应用于基于NFC的文件传输类应用中;则客户端可以是基于NFC 的文件传输类应用的客户端。The method of this embodiment can be applied to an NFC-based file transfer application; the client can be based on NFC. The client of the file transfer class application.

本实施例的方法可应用于基于NFC的电子信息交换类应用中;则客户端可以是基于NFC的电子信息交换类应用的客户端。The method of this embodiment can be applied to an NFC-based electronic information exchange application; the client can be a client of an NFC-based electronic information exchange application.

本实施例的方法可应用于基于NFC的近距离联机游戏类应用中;则客户端可以是基于NFC的近距离联机游戏类应用的客户端。The method of the embodiment can be applied to an NFC-based short-distance online game application; the client can be a client of an NFC-based short-distance online game application.

在上述各种应用场景中,客户端都需要基于NFC卡中的数据执行相应操作。例如,在支付应用场景中,客户端需要根据NFC卡中的数据完成支付操作。又例如,在文件传输应用场景中,客户端需要根据NFC卡中的数据完成文件传输操作。In the above various application scenarios, the client needs to perform corresponding operations based on the data in the NFC card. For example, in the payment application scenario, the client needs to complete the payment operation according to the data in the NFC card. For another example, in the file transfer application scenario, the client needs to complete the file transfer operation according to the data in the NFC card.

通常,NFC卡使用的数据格式与客户端所支持的数据格式没有直接关系,意味着客户端可能无法直接识别从NFC卡读取的数据。在现有技术中,客户端具有对NFC卡中的数据进行解析的功能,客户端可以将NFC卡中的数据解析成客户端可识别的数据,进而基于可识别的数据执行相应操作。但是,NFC卡的种类越来越多,客户端可能随时面对不同种类的NFC卡,并且NFC卡采用的数据格式可能不同,意味着客户端要能够对各种数据格式的NFC数据进行解析,这就要求客户端能够随着NFC卡种类的发展而不断更新。但是,由于客户端升级通常比较耗时、繁琐,所以很多用户不会及时升级客户端,即用户转化率无法达到100%,导致无法及时识别NFC数据。Generally, the data format used by the NFC card is not directly related to the data format supported by the client, meaning that the client may not be able to directly recognize the data read from the NFC card. In the prior art, the client has the function of parsing the data in the NFC card, and the client can parse the data in the NFC card into data recognizable by the client, and perform corresponding operations based on the identifiable data. However, there are more and more types of NFC cards, and the client may face different types of NFC cards at any time, and the data format adopted by the NFC cards may be different, which means that the client needs to be able to parse NFC data of various data formats. This requires the client to be constantly updated as the NFC card type evolves. However, since the client upgrade is usually time-consuming and cumbersome, many users will not upgrade the client in time, that is, the user conversion rate cannot reach 100%, and the NFC data cannot be recognized in time.

为解决上述问题,本实施例提供一种数据解析方法,将数据解析功能转移到服务端,将客户端从数据解析中解放出来,使得NFC数据能够及时被解析。具体的:To solve the above problem, the embodiment provides a data parsing method, and the data parsing function is transferred to the server, and the client is freed from data parsing, so that the NFC data can be parsed in time. specific:

客户端从NFC卡中读取待解析的数据,将待解析的数据发送给服务端,由服务端对待解析的数据进行解析,将成功解析出的结果数据封装成客户端可以识别的结构化数据并返回给客户端,客户端接收服务端返回的结构化数据,进而可以根据该结构化数据执行相应操作。The client reads the data to be parsed from the NFC card, sends the data to be parsed to the server, parses the data to be parsed by the server, and encapsulates the successfully parsed result data into structured data that the client can recognize. And returning to the client, the client receives the structured data returned by the server, and then can perform corresponding operations according to the structured data.

可选的,客户端在接收到服务端返回的结构化数据之后,可以通过客户端所在终端展示给用户,以便于用户通过该结构化数据了解相关信息。Optionally, after receiving the structured data returned by the server, the client may display the data to the user through the terminal where the client is located, so that the user can learn related information through the structured data.

在一可选实施方式中,客户端可以向NFC卡发送数据读取指令;NFC卡接收客户端的数据读取指令,并根据数据读取指令读取相应数据,将所读取的数据返回给客户端;客户端接收NFC卡返回的数据,对NFC卡返回的数据进行有效性验证,当NFC卡返回的数据是有效数据时,将NFC卡返回的数据作为待解析的数据。In an optional implementation manner, the client may send a data read command to the NFC card; the NFC card receives the data read command of the client, and reads the corresponding data according to the data read command, and returns the read data to the client. The client receives the data returned by the NFC card, and validates the data returned by the NFC card. When the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed.

一般来说,在数据存储和传输过程中,基于数据完整性或有效性等考虑,会在数据字节中额外增加一个或几个比特位作为校验位,以用来检验数据是否完整或有效。可选 的,校验位的取值可以是预先设定的,例如0x900];或者,校验位的取值也可以是对数据值做异或处理等方式计算出来的。对NFC数据来说,可以将最后两字节作为校验位。基于此,客户端可以通过NFC卡返回的数据的最后两字节来判断该数据是否是有效数据。例如,若预先设定校验位的取值为0x9000,则客户端可以校验NFC卡返回的数据的最后两字节是不是0x9000,如果是,确定NFC卡返回的数据是有效数据;如果否,确定NFC卡返回的数据是无效数据。又例如,若校验位的取值是采用数据值做异或处理获得的,则客户端可以将NFC卡返回的数据中的数据值做异或处理,获得异或结果,将该异或结果与NFC卡返回的数据的最后两字节的取值进行比较,若一致,则确定NFC卡返回的数据是有效数据;若不一致,则确定NFC卡返回的数据是无效数据。Generally speaking, during data storage and transmission, based on data integrity or validity, one or more bits are added to the data byte as check digits to check whether the data is complete or valid. . Optional The value of the check digit may be preset, for example, 0x900]; or the value of the check digit may be calculated by performing an exclusive OR processing on the data value. For NFC data, the last two bytes can be used as check digits. Based on this, the client can judge whether the data is valid data through the last two bytes of data returned by the NFC card. For example, if the value of the check digit is set to 0x9000 in advance, the client can check whether the last two bytes of data returned by the NFC card are 0x9000. If yes, it is determined that the data returned by the NFC card is valid data; , to determine that the data returned by the NFC card is invalid data. For another example, if the value of the check digit is obtained by performing XOR processing on the data value, the client may perform XOR processing on the data value in the data returned by the NFC card to obtain an XOR result, and the XOR result is obtained. The value of the last two bytes of the data returned by the NFC card is compared. If they match, it is determined that the data returned by the NFC card is valid data; if not, it is determined that the data returned by the NFC card is invalid data.

进一步,虽然NFC卡的种类很多,所应用的场景也很广泛,但是可以按照不同标准对NFC卡进行分类,并从总体上分为几大类别。例如,NFC卡可被分为IsoDep、NFCA、…、NFCV等几大类别。关于IsoDep、NFCA、…、NFCV可参见现有技术的描述。其中,每一大类别又可以划分为不同的小类别。例如,按照具体的传输协议划分,IsoDep类别还可以分为Iso7816和Iso14443。对于Iso7816和Iso14443来说,还可以进一步细分。Further, although there are many types of NFC cards and the application scenarios are wide, the NFC cards can be classified according to different standards, and are generally classified into several categories. For example, NFC cards can be classified into several major categories such as IsoDep, NFCA, ..., NFCV. See IsoDep, NFCA, ..., NFCV for a description of the prior art. Among them, each major category can be divided into different small categories. For example, according to the specific transmission protocol, the IsoDep category can also be divided into Iso7816 and Iso14443. For Iso7816 and Iso14443, it can be further subdivided.

本实施例并不限定具体如何对NFC卡分类,但是对于同一类别的NFC卡来说,所使用的指令类别以及指令码等都相同。在本实施例中,指令类别用于指示不同类别的NFC卡所使用的指令码信息;每种类别的NFC所使用的指令码信息包括读取NFC卡各字段值(如NFC卡的ID、NFC卡中的余额、NFC卡的发卡公司的名称等)的指令码,即不同字段对应不同指令码。值得说明的,同一指令码可能会对应多个参数,一个参数对应该类别下一个具体的NFC卡。This embodiment does not limit how to classify NFC cards, but for the same category of NFC cards, the instruction types and instruction codes used are the same. In this embodiment, the instruction category is used to indicate instruction code information used by different types of NFC cards; the instruction code information used by each type of NFC includes reading NFC card field values (such as NFC card ID, NFC). The instruction code of the balance in the card, the name of the card issuing company of the NFC card, etc., that is, different fields correspond to different instruction codes. It is worth noting that the same instruction code may correspond to multiple parameters, one parameter corresponding to the next specific NFC card in the category.

在一可选实施方式中,可以通过参数指令映射表来管理每类NFC卡下的指令码和指令码对应的参数。进一步,客户端可以将该参数映射表存储在本地,有利于提高获取指令码对应的参数的效率,并且不需要每次都向服务端请求,有利于节约流量资源。In an optional implementation, the parameter corresponding to the instruction code and the instruction code under each type of NFC card can be managed by the parameter instruction mapping table. Further, the client can store the parameter mapping table locally, which is beneficial to improving the efficiency of obtaining parameters corresponding to the instruction code, and does not need to be requested to the server every time, which is beneficial to save traffic resources.

进一步可选的,客户端可以对该参数指令映射表进行更新,例如定时向服务端发送更新请求,接收服务端发送的更新指令,根据更新指令,更新参数指令映射表。或者,服务端也可以主动向客户端发送更新指令,客户端接收服务端发送的更新指令,根据更新指令,更新参数指令映射表。Further optionally, the client may update the parameter instruction mapping table, for example, periodically send an update request to the server, receive an update instruction sent by the server, and update the parameter instruction mapping table according to the update instruction. Alternatively, the server may also send an update instruction to the client actively, and the client receives the update instruction sent by the server, and updates the parameter instruction mapping table according to the update instruction.

值得说明的是,上述更新指令可以包括全部参数与指令码的映射关系,则客户端可以直接用更新指令中的参数与指令码的映射关系替换参数指令映射表中的参数与指令码的映射关系,实现全量更新。或者,上述更新指令也可以仅包括发生变化的参数与指令 码的映射关系,则客户端可以直接将更新指令中的参数与指令码的映射关系替换参数指令映射表中相应的参数与指令码的映射关系,或者直接将更新指令中的参数与指令码的映射关系添加到参数指令映射表中,实现增量更新。It should be noted that the above update instruction may include a mapping relationship between all parameters and the instruction code, and the client may directly replace the mapping relationship between the parameter and the instruction code in the parameter instruction mapping table by using the mapping relationship between the parameter and the instruction code in the update instruction. , to achieve full updates. Alternatively, the above update instruction may only include parameters and instructions that have changed. The mapping relationship between the code, the client can directly replace the mapping relationship between the parameter and the instruction code in the update instruction by the mapping relationship between the corresponding parameter and the instruction code in the parameter instruction mapping table, or directly update the parameter and the instruction code in the instruction instruction. The mapping relationship is added to the parameter instruction mapping table to implement incremental update.

基于上述,客户端在向NFC卡发送数据读取指令之前,可以按照以下方式生成数据读取指令:Based on the above, the client can generate a data read command in the following manner before sending a data read command to the NFC card:

确定业务需求对应的指令码,在NFC应用中,业务需求一般是指读取NFC数据的需求,预先定义了业务需求与读取字段之间的映射关系,也就是说,业务需求一旦确定了,也就知道需要读取NFC数据的哪个字段。由上述可知,不同字段使用不同指令码,因此可以直接根据业务需求,确定所使用的指令码;根据NFC卡所属的类别下的参数指令映射表,确定业务需求对应的指令码对应的参数;根据业务需求对应的指令码和该指令码对应的参数,生成数据读取指令。Determining the instruction code corresponding to the business requirement. In the NFC application, the service requirement generally refers to the requirement of reading the NFC data, and pre-defines the mapping relationship between the service requirement and the read field, that is, once the business requirement is determined, It also knows which field of NFC data needs to be read. It can be seen from the above that different fields use different instruction codes, so the instruction code used can be determined directly according to the service requirement; according to the parameter instruction mapping table under the category of the NFC card, the parameter corresponding to the instruction code corresponding to the service requirement is determined; The instruction code corresponding to the business requirement and the parameter corresponding to the instruction code generate a data read instruction.

上述数据读取指令中的指令码用于指示要读取NFC数据的哪个字段;指令码对应的参数用于指示要读取哪张NFC卡中的数据。The instruction code in the above data read instruction is used to indicate which field of the NFC data is to be read; the parameter corresponding to the instruction code is used to indicate which NFC card data is to be read.

值得说明的是,一个指令码可能对应多个参数。对于这种情况,客户端可以采用穷举的方式,生成数据读取指令以从NFC卡中读取数据。简单来说,客户端每次获取指令码对应的一个参数,并根据该指令码和该指令码对应的参数生成一个数据读取指令,并发送给NFC卡,当接收到NFC卡返回的数据时,通过对NFC卡返回的数据进行校验来判断NFC卡是否返回了有效数据,也意味着是否使用了正确的参数;如果NFC卡返回的数据是有效数据,意味着使用的参数是正确的,则可以停止尝试其他参数;反之,继续获取指令码对应的下一个参数,并生成数据读取指令发送给NFC卡继续读取NFC卡中的数据。It is worth noting that one instruction code may correspond to multiple parameters. In this case, the client can generate data read commands to read data from the NFC card in an exhaustive manner. Briefly speaking, the client obtains a parameter corresponding to the instruction code each time, and generates a data reading instruction according to the instruction code and the parameter corresponding to the instruction code, and sends the data reading instruction to the NFC card, when receiving the data returned by the NFC card. By verifying the data returned by the NFC card to determine whether the NFC card returns valid data, it also means that the correct parameters are used; if the data returned by the NFC card is valid data, it means that the parameters used are correct, Then, other parameters can be stopped; otherwise, the next parameter corresponding to the instruction code is continuously obtained, and a data read command is generated and sent to the NFC card to continue reading the data in the NFC card.

以基于NFC的交通卡为例,按照地理位置进一步划分,则Iso7816和Iso14443中每个类别下的交通卡包括:北京交通卡、上海交通卡、天津交通卡、深圳交通卡等等。对于每张交通卡来说,可读取的数据包括交通卡中的余额、公交公司的名称、交通卡的ID、以及最近交易记录等字段值,不同字段对应不同的指令码。进一步同一指令码可能对应不同地方的交通卡,则可以通过指令码对应的参数来区分。Taking the NFC-based transportation card as an example, according to the geographical location, the transportation cards under each category of Iso7816 and Iso14443 include: Beijing transportation card, Shanghai transportation card, Tianjin transportation card, Shenzhen transportation card, and so on. For each transportation card, the readable data includes the balance of the traffic card, the name of the bus company, the ID of the transportation card, and the recent transaction record. The different fields correspond to different instruction codes. Further, the same instruction code may correspond to a traffic card in a different place, and may be distinguished by parameters corresponding to the instruction code.

对不同交通卡来说,客户端所使用的数据读取指令的格式和内容都会有所不同。例如,客户端发送的数据读取指令可以是应用协议数据单元(Application Protocol Data Unit,APDU)请求。该APDU请求的格式如图2所示,包括:头部和主体部分。头部包括CLA、INS、P1和P2等几个字段;CLA表示指令类别,INS表示指令码;P1和P2是两个参数。 主体部分包括:数据长度Lc字段、数据字段和响应数据的长度Le字段。For different transportation cards, the format and content of the data read instructions used by the client will be different. For example, the data read command sent by the client may be an Application Protocol Data Unit (APDU) request. The format of the APDU request is as shown in FIG. 2, including: a header and a body part. The header includes several fields such as CLA, INS, P1, and P2; CLA indicates the instruction class, INS indicates the instruction code; and P1 and P2 are two parameters. The body portion includes a data length Lc field, a data field, and a length Le field of the response data.

一种客户端从交通卡中读取数据的代码如下:A code for a client to read data from a traffic card is as follows:

Figure PCTCN2016075941-appb-000001
Figure PCTCN2016075941-appb-000001

按照基本的行业间规定,INS是APDU命令协议中的一个字节,定义该指令码的操作类型,INS的取值与操作类型的对应关系如表1所示。According to the basic inter-industry regulations, the INS is a byte in the APDU command protocol, and defines the operation type of the instruction code. The correspondence between the value of the INS and the operation type is shown in Table 1.

表1Table 1

INS的取值INS value 操作类型Operation type     ‘0E’‘0E’ ERASE BINARYERASE BINARY ‘20’‘20’ VERIFYVERIFY ‘70’‘70’ MANAGE CHANNELMANAGE CHANNEL ‘82’‘82’ EXTERNAL AUTHENTICATEEXTERNAL AUTHENTICATE ‘84’‘84’ GET CHALLENGEGET CHALLENGE ‘88’‘88’ INTERNAL AUTHENTICATEINTERNAL AUTHENTICATE ‘A4’‘A4’ SELECT FILESELECT FILE ‘BO’‘BO’ READ BINARYREAD BINARY ‘CO’‘CO’ GET RESPONSEGET RESPONSE

其中,INS为B0时可以读取到二进制(binary)的比特流,且sfi的取值不同,所读取到的数据也会不同。比如,若要读取上海交通卡中的数据,则需要传入sfi值为21,若要读取北京交通卡中的数据,则需要传入的sfi值为4。对客户端来说,由于无法直接识别出是哪的公交卡,所以可以尝试先向交通卡传入值为21的sfi进行数据读取,如果读取的数据无法通过有效性验证,则继续向交通卡传入值为4的sfi进行数据读取,直到读取到有效数据为止。Wherein, when the INS is B0, a binary bit stream can be read, and the value of sfi is different, and the read data is different. For example, if you want to read the data in the Shanghai transportation card, you need to pass the sfi value to 21. If you want to read the data in the Beijing traffic card, you need to pass the sfi value to 4. For the client, since it is not possible to directly identify which bus card, it is possible to try to read the data to the traffic card with a value of 21, and if the data cannot be validated, continue to The traffic card has an incoming value of 4 sfi for data reading until valid data is read.

在一可选实施方式中,终端设备自身可以提供一NFC系统框架,可称为NFC卡识别应用,该NFC卡识别应用可以在NFC卡贴近具有NFC功能的终端设备时,自动感应 到该NFC卡的标签并识别出NFC卡所属的类别,将这些信息提供给上述客户端。In an optional implementation manner, the terminal device itself may provide an NFC system framework, which may be referred to as an NFC card identification application, and the NFC card identification application may automatically sense when the NFC card is close to the NFC-enabled terminal device. The label of the NFC card is identified and the category to which the NFC card belongs is identified, and the information is provided to the client.

对于NFC卡识别应用来说,可以包括感应单元、Activity、Activity Manager等。感应单元在NFC卡贴近具有NFC功能的终端设备时,自动感应到该NFC卡的标签;Activity Manager用于管理已经注册的Activity;Activity用于处理该Activity对应的NFC标签,主要是识别出NFC标签所标识的NFC卡的类别属性信息。当Activity Manager存在已经注册的Activity,并且可以处理感应单元感应到的NFC卡时,Activity Manager识别出NFC标签所标识的NFC卡的类别属性信息,将该类别属性信息封装到Intent里面传给相应的Activity;Activity将Intent发送给客户端。For the NFC card identification application, it may include a sensing unit, an Activity, an Activity Manager, and the like. The sensing unit automatically senses the label of the NFC card when the NFC card is close to the NFC-enabled terminal device; the Activity Manager is used to manage the registered Activity; the Activity is used to process the NFC tag corresponding to the Activity, mainly to identify the NFC tag. Category attribute information of the identified NFC card. When the Activity Manager has an already registered Activity and can process the NFC card sensed by the sensing unit, the Activity Manager identifies the category attribute information of the NFC card identified by the NFC tag, and encapsulates the category attribute information into the Intent and transmits it to the corresponding Activity; Activity sends the Intent to the client.

上述Activity是安卓系统中常用组件,通常作为一个屏幕的载体。Intent是安卓系统中不同组件之间相互导航的纽带,封装了互相查找的条件信息。The above Activity is a commonly used component in the Android system, usually as a screen carrier. Intent is a link between different components in the Android system, which encapsulates the condition information of each other.

基于上述,客户端可以接收NFC卡识别应用发送的NFC卡的类别属性信息,该类别属性信息用于指示NFC卡所属的类别。在获得NFC卡所属的类别的情况下,客户端可以确定向NFC卡发送数据读取指令所使用的参数指令映射表。Based on the above, the client can receive the category attribute information of the NFC card sent by the NFC card identification application, and the category attribute information is used to indicate the category to which the NFC card belongs. In the case where the category to which the NFC card belongs is obtained, the client can determine the parameter instruction mapping table used to send the data read command to the NFC card.

在一可选实施方式中,客户端在将待解析的数据发送给服务端之前,可以对待解析的数据进行编码处理,例如可以采用Base64编码方式,将待解析的数据编码成字节流,以便于传输。其中,Base64是一种比特流转化为字节流的一种编码方式。进一步,客户端通过HTTP方式将编码成的字节流发送到服务端。对服务端来说,在接收到待解析的数据之后,可以先对待解析的数据进行解码处理,再对解码后的数据进行解析处理。In an optional implementation manner, the client may encode the data to be parsed before sending the data to be parsed to the server. For example, the data to be parsed may be encoded into a byte stream by using a Base64 encoding method. For transmission. Among them, Base64 is a kind of encoding method in which a bit stream is converted into a byte stream. Further, the client sends the encoded byte stream to the server through HTTP. After receiving the data to be parsed, the server may perform decoding processing on the parsed data, and then parse the decoded data.

在一可选实施方式中,客户端本身也具有解析NFC数据的功能。基于此,客户端在将待解析的数据发送给服务端之前,可以先判断本地是否可以解析待解析的数据;若本地可以解析,则客户端可以直接在本地对待解析的数据进行解析处理,将其解析成客户端可识别的数据结构;若本地无法解析,则客户端再将待解析的数据发送给服务端,以供服务端将待解析的数据解析成客户端可识别的结构化数据并返回。该实施方式优先在客户端本地对待解析的数据进行解析,一方面可以降低服务端的处理负担,另一方面有利于提高解析效率。In an alternative embodiment, the client itself also has the capability to parse NFC data. Based on this, the client can determine whether the data to be parsed can be parsed before sending the data to be parsed to the server. If the local device can resolve the data, the client can directly parse the data to be parsed locally. The data is parsed into a data structure recognizable by the client; if the local device cannot be parsed, the client sends the data to be parsed to the server, so that the server parses the data to be parsed into the structured data recognizable by the client and return. This embodiment preferentially analyzes the data to be parsed by the client locally, which can reduce the processing load of the server on the one hand, and improve the analysis efficiency on the other hand.

图3a为本申请一实施例提供的数据解析方法的流程示意图。如图3a所示,该方法包括:FIG. 3 is a schematic flowchart of a data parsing method according to an embodiment of the present application. As shown in Figure 3a, the method includes:

301、服务端接收客户端发送的待解析的数据,该待解析的数据是客户端从NFC卡中读取的。301. The server receives the data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card.

302、服务端对上述待解析的数据进行解析,并将成功解析出的结果数据封装成客户 端可识别的结构化数据。302. The server parses the data to be parsed, and encapsulates the successfully parsed result data into a client. Structured data that is identifiable by the end.

303、服务端将上述结构化数据发送给客户端。303. The server sends the foregoing structured data to the client.

本实施例提供一种数据解析方法,可由NFC应用的服务端(简称为服务端)来执行。本实施例提供的方法可用于各种基于NFC的应用中;相应的,本实施例的客户端可以是各种基于NFC的应用的客户端;服务端可以是各种基于NFC的应用的服务端。在本实施例中,服务端具有解析各种NFC卡的能力。This embodiment provides a data parsing method, which can be executed by a server (referred to as a server) of an NFC application. The method provided in this embodiment can be used in various NFC-based applications; correspondingly, the client in this embodiment can be a client of various NFC-based applications; the server can be a server of various NFC-based applications. . In this embodiment, the server has the ability to parse various NFC cards.

举例说明:本实施例的方法可应用于基于NFC的支付应用中,则客户端是基于NFC的支付类应用的客户端;则服务端可以是基于NFC的支付应用中服务端。For example, the method in this embodiment can be applied to an NFC-based payment application, and the client is a client of an NFC-based payment application; and the server can be a server in an NFC-based payment application.

本实施例的方法可应用于基于NFC实现的各种信息卡(例如交通卡、门禁卡、车票)的读卡应用中;则客户端可以是基于NFC实现的各种信息卡对应的读卡应用的客户端;则服务端可以是基于NFC实现的各种信息卡对应的读卡应用的服务端。The method of the embodiment can be applied to a card reading application of various information cards (such as a traffic card, an access card, and a ticket) implemented by NFC; the client can be a card reading application corresponding to various information cards implemented by NFC. The client may be a server of a card reading application corresponding to various information cards implemented by NFC.

本实施例的方法可应用于基于NFC的文件传输类应用中;则客户端可以是基于NFC的文件传输类应用的客户端;则服务端可以是基于NFC的文件传输类应用的服务端。The method in this embodiment can be applied to an NFC-based file transfer application; the client can be a client of an NFC-based file transfer application; and the server can be a server of an NFC-based file transfer application.

本实施例的方法可应用于基于NFC的电子信息交换类应用中;则客户端可以是基于NFC的电子信息交换类应用的客户端;则服务端可以是基于NFC的电子信息交换类应用的服务端。The method in this embodiment can be applied to an NFC-based electronic information exchange application; the client can be a client of an NFC-based electronic information exchange application; and the server can be an NFC-based electronic information exchange application. end.

本实施例的方法可应用于基于NFC的近距离联机游戏类应用中;则客户端可以是基于NFC的近距离联机游戏类应用的客户端;则服务端可以是基于NFC的近距离联机游戏类应用的服务端。The method of the embodiment can be applied to an NFC-based short-distance online game application; the client can be a client of an NFC-based short-distance online game application; and the server can be an NFC-based close-range online game class. The server side of the application.

在上述各种应用场景中,客户端都需要基于NFC卡中的数据执行相应操作。例如,在支付应用场景中,客户端需要根据NFC卡中的数据完成支付操作。又例如,在文件传输应用场景中,客户端需要根据NFC卡中的数据完成文件传输操作。In the above various application scenarios, the client needs to perform corresponding operations based on the data in the NFC card. For example, in the payment application scenario, the client needs to complete the payment operation according to the data in the NFC card. For another example, in the file transfer application scenario, the client needs to complete the file transfer operation according to the data in the NFC card.

通常,NFC卡使用的数据格式与客户端所支持的数据格式没有直接关系,意味着客户端可能无法直接识别从NFC卡读取的数据。在现有技术中,客户端具有对NFC卡中的数据进行解析的功能,客户端可以将NFC卡中的数据解析成客户端可识别的数据,进而基于可识别的数据执行相应操作。但是,NFC卡的种类越来越多,客户端可能随时面对不同种类的NFC卡,并且NFC卡采用的数据格式可能不同,意味着客户端要能够对各种数据格式的NFC数据进行解析,这就要求客户端能够随着NFC卡种类的发展而不断更新。但是,由于客户端的升级包一般是由服务端按照一定频率发布的,所以更新不是很及时,导致无法及时识别NFC数据。 Generally, the data format used by the NFC card is not directly related to the data format supported by the client, meaning that the client may not be able to directly recognize the data read from the NFC card. In the prior art, the client has the function of parsing the data in the NFC card, and the client can parse the data in the NFC card into data recognizable by the client, and perform corresponding operations based on the identifiable data. However, there are more and more types of NFC cards, and the client may face different types of NFC cards at any time, and the data format adopted by the NFC cards may be different, which means that the client needs to be able to parse NFC data of various data formats. This requires the client to be constantly updated as the NFC card type evolves. However, since the upgrade package of the client is generally issued by the server according to a certain frequency, the update is not very timely, and the NFC data cannot be recognized in time.

为解决上述问题,本实施例提供一种数据解析方法,将数据解析功能转移到服务端,将客户端从数据解析中解放出来,使得NFC数据能够及时被解析。具体的:To solve the above problem, the embodiment provides a data parsing method, and the data parsing function is transferred to the server, and the client is freed from data parsing, so that the NFC data can be parsed in time. specific:

客户端从NFC卡中读取待解析的数据,将待解析的数据发送给服务端,服务端接收客户端发送的待解析的数据;服务端对待解析的数据进行解析,将成功解析出的结果数据封装成客户端可以识别的结构化数据;之后,将结构化数据发送给客户端,使得客户端可以根据该结构化数据执行相应操作。The client reads the data to be parsed from the NFC card, and sends the data to be parsed to the server. The server receives the data to be parsed sent by the client, and parses the data to be parsed by the server, and the result is successfully parsed. The data is encapsulated into structured data that the client can recognize; after that, the structured data is sent to the client, so that the client can perform corresponding operations according to the structured data.

在一可选实施方式中,服务端预先存储有客户端及客户端可识别的数据结构之间的映射关系。基于此,客户端还可以将客户端的标识发送给服务端,服务端根据客户端的标识,查询所存储的客户端及客户端可识别的数据结构之间的映射关系,获知客户端所支持的数据结构,进而将待解析的数据解析成客户端可识别的结构化数据。In an optional implementation manner, the server pre-stores a mapping relationship between the data structures recognizable by the client and the client. Based on this, the client can also send the identifier of the client to the server, and the server queries the stored mapping between the client and the data structure identifiable by the client according to the identifier of the client, and learns the data supported by the client. The structure, in turn, parses the data to be parsed into structured data recognizable by the client.

在另一可选实施方式中,客户端可以将客户端可识别的数据结构信息发送给服务端。服务端接收客户端发送的客户端可识别的数据结构信息,根据客户端可识别的数据结构信息,将待解析的数据解析成客户端可识别的结构化数据。In another optional implementation, the client may send the data structure information recognizable by the client to the server. The server receives the data structure information recognizable by the client and sends the data to be parsed into the structured data recognizable by the client according to the data structure information identifiable by the client.

在一可选实施方式中,服务端包括各种NFC卡对应的解析算法,并且随着NFC卡种类的增多,服务端会及时增加相应的解析算法。基于此,服务端对待解析的数据进行解析的一种实施方式包括:服务端确定NFC卡对应的解析算法,采用所确定的解析算法对应待解析的数据进行解析。In an optional implementation manner, the server includes an analysis algorithm corresponding to various NFC cards, and as the number of NFC cards increases, the server adds a corresponding parsing algorithm in time. Based on this, an implementation manner in which the server parses the parsed data includes: the server determines an analysis algorithm corresponding to the NFC card, and uses the determined parsing algorithm to parse the data to be parsed.

其中,客户端除了将待解析的数据发送给服务端之外,通常还会将NFC卡的类别属性信息发送给服务端;服务端可以根据NFC卡的类别属性信息确定NFC卡所属的类别,进而选择该类别对应的解析算法,使用该解析算法对待解析的数据进行解析。进一步,客户端还可以将读取待解析的数据所使用的数据读取指令发送给服务端,则服务端可以同时结合NFC卡的类别属性信息、读取待解析的数据所使用的数据读取指令、以及待解析的数据等信息,来确定所使用的解析算法。The client sends the category attribute information of the NFC card to the server in addition to the data to be parsed. The server can determine the category to which the NFC card belongs according to the category attribute information of the NFC card. The analysis algorithm corresponding to the category is selected, and the data to be parsed is parsed using the analysis algorithm. Further, the client can also send the data reading instruction used to read the data to be parsed to the server, and the server can simultaneously combine the category attribute information of the NFC card and the data used to read the data to be parsed. Information such as instructions and data to be parsed to determine the parsing algorithm used.

值得说明的是,由于NFC卡的种类很多,相应NFC卡的厂商也会很多。部分NFC卡的厂商不是按照标准协议,所以服务端可以通过访问厂商官方网站或者其他公关渠道来了解具体协议文档,进而获得解析该待解析的数据需要使用的解析算法。It is worth noting that due to the variety of NFC cards, there will be many manufacturers of corresponding NFC cards. Some NFC card manufacturers are not in accordance with the standard protocol, so the server can access the official website of the manufacturer or other public relations channels to understand the specific protocol documents, and then obtain the parsing algorithm needed to parse the data to be parsed.

在一可选实施方式中,若客户端对待解析的数据进行了编码处理,则服务端在对待解析的数据进行解析之前,需要先对待解析的数据进行解码处理。其中,客户端和服务端可以预先约定所使用的编解码算法,例如可以是Base64算法,但不限于此。In an optional implementation manner, if the data to be parsed by the client is encoded, the server needs to decode the parsed data before parsing the data to be parsed. The client and the server may pre-agreed the codec algorithm used, for example, may be a Base64 algorithm, but is not limited thereto.

在一可选实施方式中,若待解析的数据来自于新的NFC卡,则服务端有可能还没有 该NFC卡对应的解析算法,则可能无法成功解析出结果数据。对无法成功解析出结果数据的情况,服务端可以根据该解析的数据和待解析的数据的相关数据,生成该NFC卡对应的解析算法。服务端可以存储该解析算法,以便于对后续接收到的该NFC卡的数据进行解析。待解析的数据的相关数据包括但不限于:客户端获取待解析的数据所使用的数据读取指令、以及用户输入的关于该NFC卡的信息等。In an optional implementation manner, if the data to be parsed is from a new NFC card, the server may not have The parsing algorithm corresponding to the NFC card may not successfully parse the result data. In the case that the result data cannot be successfully parsed, the server may generate an analysis algorithm corresponding to the NFC card according to the parsed data and the related data of the data to be parsed. The server may store the parsing algorithm to parse the data of the subsequently received NFC card. The data related to the data to be parsed includes, but is not limited to, a data read instruction used by the client to acquire data to be parsed, information about the NFC card input by the user, and the like.

由于生成NFC卡对应的解析算法的过程会因厂商的不同而有所不同,且整体流程与现有技术相类似或相同,可参见现有技术,本申请不再赘述。The process of generating the resolution algorithm corresponding to the NFC card may be different from the manufacturer, and the overall process is similar to or the same as the prior art.

以云os生活服务为例,(但本申请不限于云os生活服务),云os生活服务根据业务需求确定指令码,并基于本地存储的参数指令映射表,确定该指令码对应的参数,根据该指令码和该指令码对应的参数生成APDU请求,将该APDU请求发送给NFC卡;接收NFC卡根据该APDU请求返回的数据;根据NFC卡返回的数据的最后两字节的校验码校验该数据是否是有效数据;如果不是,则继续获取指令码对应的下一个参数,并根据该指令码和该指令码对应的一下个参数重新生成APDU请求发送给NFC卡,以重新从NFC卡中读取数据;如果判断结果为是,则采用Base64编码方式将该数据编码成字节流,再通过HTTP方式发送到服务端;服务端对接收到的数据进行解码处理,并确定解析使用的解析算法,采用所确定的解析算法对解码后的数据进行解析,若成功解析出结果数据,将该结果数据封装成云os生活服务可识别的结构化数据,即云卡片(CloudCard)的形式返回给云os生活服务;云os生活服务以CloudCard形式将数据展现给用户。Taking the cloud os life service as an example, (but the application is not limited to the cloud os life service), the cloud os life service determines the instruction code according to the service requirement, and determines the parameter corresponding to the instruction code based on the locally stored parameter instruction mapping table, according to The instruction code and the parameter corresponding to the instruction code generate an APDU request, and send the APDU request to the NFC card; receive the data returned by the NFC card according to the APDU request; and check the last two bytes of the data according to the data returned by the NFC card. Check whether the data is valid data; if not, continue to obtain the next parameter corresponding to the instruction code, and regenerate the APDU request according to the instruction code and the next parameter corresponding to the instruction code to send to the NFC card to re-from the NFC card If the judgment result is yes, the data is encoded into a byte stream by using the Base64 encoding method, and then sent to the server through HTTP; the server decodes the received data, and determines the parsing use. The parsing algorithm parses the decoded data by using the determined parsing algorithm, and if the result data is successfully parsed, the result data is encapsulated into The structured data identifiable by the cloud os life service, that is, the form of a cloud card (CloudCard) is returned to the cloud os life service; the cloud os life service presents the data to the user in the form of a CloudCard.

因为云os生活服务一般内嵌于云os系统桌面,与桌面其他应用相比,云os生活服务的更新频率还是比较低的,对于这种情况,本申请提供数据解析方法将具有很明显的优势,用户可以不用升级整个云os生活服务,即可及时解析出各种NFC卡中的数据,进而将NFC卡中的数据封装成云os生活服务里的CloudCard形式展现给用户。进一步,如图3b所示,云os生活服务还可以通过连接该生活服务的关联服务系统精准推送相应的智能化的关联服务,例如基于用户的NFC卡的商户信息、余额信息等,可以向用户推送附近公交车站、充值中心等关联服务,有利于扩展生活服务的业务和提高用户体验。Because the cloud os life service is generally embedded in the cloud os system desktop, compared with other desktop applications, the update frequency of the cloud os life service is relatively low. For this case, the data analysis method provided by the present application will have obvious advantages. Users can analyze the data in various NFC cards without upgrading the entire cloud os life service, and then encapsulate the data in the NFC card into the CloudCard form in the cloud os life service to display to the user. Further, as shown in FIG. 3b, the cloud os life service can also accurately push corresponding intelligent related services through an associated service system connected to the living service, for example, based on the user information and balance information of the user's NFC card, and can be sent to the user. Pushing related services such as nearby bus stations and recharge centers is conducive to expanding the service of living services and improving the user experience.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定 是本申请所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present application is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present application. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily It is required for this application.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.

图4为本申请一实施例提供的客户端的结构示意图。如图4所示,该客户端包括:读取模块41、发送模块42和第一接收模块43。FIG. 4 is a schematic structural diagram of a client according to an embodiment of the present application. As shown in FIG. 4, the client includes a reading module 41, a transmitting module 42, and a first receiving module 43.

读取模块41,用于从NFC卡中读取待解析的数据。The reading module 41 is configured to read data to be parsed from the NFC card.

发送模块42,用于将读取模块41读取的待解析的数据发送给服务端,以供服务端将待解析的数据解析成客户端可识别的结构化数据并返回。The sending module 42 is configured to send the data to be parsed read by the reading module 41 to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns.

第一接收模块43,用于接收服务端返回的结构化数据。The first receiving module 43 is configured to receive structured data returned by the server.

在一可选实施方式中,读取模块41具体用于:In an optional implementation, the reading module 41 is specifically configured to:

向NFC卡发送数据读取指令;Sending a data read command to the NFC card;

接收NFC卡根据数据读取指令返回的数据;Receiving data returned by the NFC card according to the data read command;

对NFC卡返回的数据进行有效性验证,当NFC卡返回的数据是有效数据时,将NFC卡返回的数据作为待解析的数据。The validity of the data returned by the NFC card is verified. When the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed.

在一可选实施方式中,如图5所示,该客户端还包括:确定模块44和生成模块45。In an optional implementation manner, as shown in FIG. 5, the client further includes: a determining module 44 and a generating module 45.

确定模块44,用于确定业务需求对应的指令码,并根据NFC卡所属的类别下的参数指令映射表,确定指令码对应的参数。The determining module 44 is configured to determine an instruction code corresponding to the service requirement, and determine a parameter corresponding to the instruction code according to the parameter instruction mapping table under the category to which the NFC card belongs.

生成模块45,用于根据确定模块44确定的指令码和指令码对应的参数,生成数据读取指令。The generating module 45 is configured to generate a data read instruction according to the instruction code determined by the determining module 44 and the parameter corresponding to the instruction code.

在一可选实施方式中,如图5所示,该客户端还包括:第二接收模块46,用于在确定模块44根据NFC卡所属的类别下的参数指令映射表,确定指令码对应的参数之前,接收NFC卡识别应用发送的NFC卡的类别属性信息,类别属性信息用于指示NFC卡所属的类别。In an optional implementation, as shown in FIG. 5, the client further includes: a second receiving module 46, configured to determine, according to the parameter instruction mapping table of the category to which the NFC card belongs, the determining module corresponding to the instruction code Before the parameter, the NFC card is used to identify the category attribute information of the NFC card sent by the application, and the category attribute information is used to indicate the category to which the NFC card belongs.

在一可选实施方式中,如图5所示,该客户端还包括:第三接收模块47和更新模块48。In an optional implementation manner, as shown in FIG. 5, the client further includes: a third receiving module 47 and an updating module 48.

第三接收模块47,用于接收服务端发送的更新指令;The third receiving module 47 is configured to receive an update instruction sent by the server.

更新模块48,用于根据第三接收模块47接收的更新指令,更新参数指令映射表。更新模块48用于向确定模块44提供更新后的参数指令映射表。The updating module 48 is configured to update the parameter instruction mapping table according to the update instruction received by the third receiving module 47. The update module 48 is operative to provide the updated module 44 with an updated parameter instruction map.

在一可选实施方式中,如图5所示,该客户端还包括:编码模块49,用于在发送模块42将待解析的数据发送给服务端之前,对待解析的数据进行编码处理。 In an optional implementation, as shown in FIG. 5, the client further includes: an encoding module 49, configured to perform encoding processing on the data to be parsed before the sending module 42 sends the data to be parsed to the server.

在一可选实施方式中,如图5所示,该客户端还包括:判断模块50。In an optional implementation manner, as shown in FIG. 5, the client further includes: a determining module 50.

判断模块50,用于判断本地是否可以解析所述待解析的数据,并在判断结果为否时,触发发送模块42执行将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回的操作。The determining module 50 is configured to determine whether the data to be parsed can be parsed locally, and when the determination result is no, the trigger sending module 42 sends the data to be parsed to the server, so that the server will The data to be parsed is parsed into the structured data recognizable by the client and returned.

在一可选实施方式中,如图5所示,该客户端还包括:展示模块51。In an optional implementation manner, as shown in FIG. 5, the client further includes: a display module 51.

展示模块51,用于通过客户端所在终端将第一接收模块43接收的结构化数据展示给用户。The display module 51 is configured to display the structured data received by the first receiving module 43 to the user through the terminal where the client is located.

本实施例提供的客户端,从NFC中读取待解析的数据,将待解析的数据发送给服务端,由服务端对待解析的数据进行解析并生成客户端可识别的结构化数据返回给客户端,实现对NFC数据的解析,同时由于该解析过程是由服务端完成的,不用等待对客户端的更新升级,可以更加及时的对各种NFC数据进行解析。The client provided in this embodiment reads the data to be parsed from the NFC, and sends the data to be parsed to the server. The data to be parsed by the server is parsed and the structured data recognizable by the client is generated and returned to the client. At the same time, the NFC data is parsed, and since the parsing process is completed by the server, the NFC data can be parsed in a timely manner without waiting for the update of the client.

图6为本申请一实施例提供的服务端的结构示意图。如图6所示,该服务端包括:接收模块61、解析模块62和发送模块63。FIG. 6 is a schematic structural diagram of a server provided by an embodiment of the present application. As shown in FIG. 6, the server includes a receiving module 61, a parsing module 62, and a sending module 63.

接收模块61,用于接收客户端发送的待解析的数据,待解析的数据是客户端从NFC卡中读取的。The receiving module 61 is configured to receive data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card.

解析模块62,用于对接收模块61接收的待解析的数据进行解析,并将成功解析出的结果数据封装成客户端可识别的结构化数据。The parsing module 62 is configured to parse the data to be parsed received by the receiving module 61, and encapsulate the successfully parsed result data into structured data recognizable by the client.

发送模块63,用于将解析模块62解析出的结构化数据发送给客户端。The sending module 63 is configured to send the structured data parsed by the parsing module 62 to the client.

在一可选实施方式中,解析模块62具体用于:In an optional implementation, the parsing module 62 is specifically configured to:

确定NFC卡对应的解析算法;Determining an analysis algorithm corresponding to the NFC card;

采用解析算法对待解析的数据进行解析;Parsing the parsed data with an analytical algorithm;

将成功解析出的结果数据封装成客户端可识别的结构化数据。The successfully parsed result data is encapsulated into structured data recognizable by the client.

在一可选实施方式中,如图7所示,该服务端还包括:生成模块64。In an optional implementation manner, as shown in FIG. 7, the server further includes: a generating module 64.

生成模块64,用于在解析模块62无法成功解析出结果数据时,根据待解析的数据和待解析的数据的相关数据,生成NFC卡对应的解析算法。The generating module 64 is configured to generate an analysis algorithm corresponding to the NFC card according to the data to be parsed and the related data of the data to be parsed when the parsing module 62 cannot successfully parse the result data.

在一可选实施方式中,如图7所示,该服务端还包括:解码模块。In an optional implementation manner, as shown in FIG. 7, the server further includes: a decoding module.

解码模块65,用于在解析模块62对待解析的数据进行解析之前,对待解析的数据进行解码处理。The decoding module 65 is configured to perform decoding processing on the data to be parsed before the parsing module 62 parses the data to be parsed.

本实施例提供的服务端,与上述实施例提供的客户端相配合,接收客户端发送的从NFC卡中读取的待解析的数据,对待解析的数据进行解析并生成客户端可识别的结构化 数据返回给客户端,实现对NFC数据的解析,同时由于该解析过程是由本实施例的服务端完成的,不用等待对客户端的更新升级,可以更加及时的对各种NFC数据进行解析。The server provided in this embodiment cooperates with the client provided in the foregoing embodiment to receive data to be parsed from the NFC card sent by the client, parses the data to be parsed, and generates a structure recognizable by the client. Chemical The data is returned to the client to implement the analysis of the NFC data. At the same time, since the parsing process is completed by the server of the embodiment, the NFC data can be parsed in a timely manner without waiting for the update and upgrade of the client.

本申请一实施例还提供一种数据解析系统,包括:客户端和服务端。An embodiment of the present application further provides a data parsing system, including: a client and a server.

其中,客户端,用于从NFC卡中读取待解析的数据,将待解析的数据发送给服务端,并接收服务端返回的客户端可识别的结构化数据;The client is configured to read data to be parsed from the NFC card, send the data to be parsed to the server, and receive structured data recognizable by the client returned by the server;

服务端,用于接收客户端发送的待解析的数据,对待解析的数据进行解析,并将成功解析出的结果数据封装成结构化数据,将结构化数据发送给客户端。The server is configured to receive the data to be parsed sent by the client, parse the data to be parsed, and encapsulate the successfully parsed result data into structured data, and send the structured data to the client.

关于客户端的其他功能以及客户端的实现结构可参见前述相应实施例,在此不再赘述。同理,关于服务端的其他功能以及服务端的实现结构可参见前述相应实施例,在此不再赘述。For the other functions of the client and the implementation structure of the client, refer to the foregoing corresponding embodiments, and details are not described herein again. For the same reason, other functions of the server and the implementation structure of the server can be referred to the foregoing corresponding embodiments, and details are not described herein again.

在本实施例提供的数据解析系统中,服务端与客户端相配合,接收客户端发送的从NFC卡中读取的待解析的数据,对待解析的数据进行解析并生成客户端可识别的结构化数据返回给客户端,实现对NFC数据的解析,同时由于该解析过程是由本实施例的服务端完成的,不用等待对客户端的更新升级,可以更加及时的对各种NFC数据进行解析。In the data parsing system provided by the embodiment, the server cooperates with the client to receive the data to be parsed from the NFC card sent by the client, parses the data to be parsed, and generates a structure recognizable by the client. The data is returned to the client to implement the analysis of the NFC data. At the same time, since the parsing process is completed by the server of the embodiment, the NFC data can be parsed more timely without waiting for the update and upgrade of the client.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储 介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above integrated unit implemented in the form of a software functional unit can be stored in a computer readable storage In the medium. The software functional unit described above is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform the methods described in various embodiments of the present application. Part of the steps. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。 Finally, it should be noted that the above embodiments are only used to explain the technical solutions of the present application, and are not limited thereto; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still The technical solutions described in the foregoing embodiments are modified, or the equivalents of the technical features are replaced by the equivalents. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (25)

一种数据解析方法,其特征在于,包括:A data analysis method, comprising: 客户端从NFC卡中读取待解析的数据;The client reads the data to be parsed from the NFC card; 所述客户端将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回;The client sends the data to be parsed to the server, so that the server parses the data to be parsed into structured data recognizable by the client and returns; 所述客户端接收所述服务端返回的所述结构化数据。The client receives the structured data returned by the server. 根据权利要求1所述的方法,其特征在于,所述客户端从NFC卡中读取待解析的数据,包括:The method according to claim 1, wherein the client reads the data to be parsed from the NFC card, including: 所述客户端向所述NFC卡发送数据读取指令;The client sends a data read instruction to the NFC card; 所述客户端接收所述NFC卡根据所述数据读取指令返回的数据;Receiving, by the client, data returned by the NFC card according to the data read instruction; 所述客户端对所述NFC卡返回的数据进行有效性验证,当所述NFC卡返回的数据是有效数据时,将所述NFC卡返回的数据作为所述待解析的数据。The client performs validity verification on the data returned by the NFC card. When the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed. 根据权利要求2所述的方法,其特征在于,所述客户端向所述NFC卡发送数据读取指令之前,还包括:The method of claim 2, wherein before the client sends the data read command to the NFC card, the method further includes: 所述客户端确定业务需求对应的指令码;Determining, by the client, an instruction code corresponding to the service requirement; 所述客户端根据所述NFC卡所属的类别下的参数指令映射表,确定所述指令码对应的参数;Determining, by the client, a parameter corresponding to the instruction code according to a parameter instruction mapping table under a category to which the NFC card belongs; 所述客户端根据所述指令码和所述指令码对应的参数,生成所述数据读取指令。The client generates the data read instruction according to the instruction code and a parameter corresponding to the instruction code. 根据权利要求3所述的方法,其特征在于,所述客户端根据所述NFC卡所属的类别下的参数指令映射表,确定所述指令码对应的参数之前,还包括:The method according to claim 3, wherein the client further determines, according to the parameter instruction mapping table of the category to which the NFC card belongs, before determining the parameter corresponding to the instruction code, the method further includes: 所述客户端接收NFC卡识别应用发送的所述NFC卡的类别属性信息,所述类别属性信息用于指示所述NFC卡所属的类别。The client receives the category attribute information of the NFC card sent by the NFC card identification application, and the category attribute information is used to indicate the category to which the NFC card belongs. 根据权利要求3所述的方法,其特征在于,还包括:The method of claim 3, further comprising: 所述客户端接收所述服务端发送的更新指令;The client receives an update instruction sent by the server; 所述客户端根据所述更新指令,更新所述参数指令映射表。The client updates the parameter instruction mapping table according to the update instruction. 根据权利要求1-5任一项所述的方法,其特征在于,所述客户端将所述待解析的数据发送给服务端之前,还包括:The method according to any one of claims 1-5, wherein before the client sends the data to be parsed to the server, the method further includes: 所述客户端对所述待解析的数据进行编码处理。The client performs encoding processing on the data to be parsed. 根据权利要求1-5任一项所述的方法,其特征在于,所述客户端将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的 结构化数据并返回之前,还包括:The method according to any one of claims 1 to 5, wherein the client sends the data to be parsed to a server, so that the server parses the data to be parsed into a server. Client identifiable Before structuring the data and returning it, it also includes: 所述客户端判断本地是否可以解析所述待解析的数据;Determining, by the client, whether the data to be parsed can be parsed locally; 若判断结果为否,则执行将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回的操作。If the result of the determination is no, the performing the data to be parsed is sent to the server, so that the server parses the data to be parsed into the structured data recognizable by the client and returns the operation. 根据权利要求1-5任一项所述的方法,其特征在于,所述客户端接收所述服务端返回的所述结构化数据之后,还包括:The method according to any one of claims 1-5, wherein after the client receives the structured data returned by the server, the method further includes: 所述客户端通过所述客户端所在终端将所述结构化数据展示给用户。The client presents the structured data to the user through the terminal where the client is located. 一种数据解析方法,其特征在于,包括:A data analysis method, comprising: 服务端接收客户端发送的待解析的数据,所述待解析的数据是所述客户端从NFC卡中读取的;The server receives the data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card; 所述服务端对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述客户端可识别的结构化数据;The server parses the data to be parsed, and encapsulates the successfully parsed result data into structured data recognizable by the client; 所述服务端将所述结构化数据发送给所述客户端。The server sends the structured data to the client. 根据权利要求9所述的方法,其特征在于,所述服务端对所述待解析的数据进行解析,包括:The method according to claim 9, wherein the server parses the data to be parsed, including: 所述服务端确定所述NFC卡对应的解析算法;Determining, by the server, an analysis algorithm corresponding to the NFC card; 所述服务端采用所述解析算法对所述待解析的数据进行解析。The server uses the parsing algorithm to parse the data to be parsed. 根据权利要求10所述的方法,其特征在于,还包括:The method of claim 10, further comprising: 若无法成功解析出所述结果数据,所述服务端根据所述待解析的数据和所述待解析的数据的相关数据,生成所述NFC卡对应的解析算法。If the result data cannot be successfully parsed, the server generates an analysis algorithm corresponding to the NFC card according to the data to be parsed and the related data of the data to be parsed. 根据权利要求9-11任一项所述的方法,其特征在于,所述服务端对所述待解析的数据进行解析之前,还包括:The method according to any one of claims 9 to 11, wherein before the server parses the data to be parsed, the method further includes: 对所述待解析的数据进行解码处理。Decoding the data to be parsed. 一种客户端,其特征在于,包括:A client, comprising: 读取模块,用于从NFC卡中读取待解析的数据;a reading module, configured to read data to be parsed from the NFC card; 发送模块,用于将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回;a sending module, configured to send the data to be parsed to the server, where the server parses the data to be parsed into structured data recognizable by the client and returns; 第一接收模块,用于接收所述服务端返回的所述结构化数据。The first receiving module is configured to receive the structured data returned by the server. 根据权利要求13所述的客户端,其特征在于,所述读取模块具体用于:The client according to claim 13, wherein the reading module is specifically configured to: 向所述NFC卡发送数据读取指令; Sending a data read command to the NFC card; 接收所述NFC卡根据所述数据读取指令返回的数据;Receiving data returned by the NFC card according to the data read instruction; 对所述NFC卡返回的数据进行有效性验证,当所述NFC卡返回的数据是有效数据时,将所述NFC卡返回的数据作为所述待解析的数据。Validating the data returned by the NFC card, and when the data returned by the NFC card is valid data, the data returned by the NFC card is used as the data to be parsed. 根据权利要求14所述的客户端,其特征在于,还包括:The client according to claim 14, further comprising: 确定模块,用于确定业务需求对应的指令码,并根据所述NFC卡所属的类别下的参数指令映射表,确定所述指令码对应的参数;a determining module, configured to determine an instruction code corresponding to the service requirement, and determining a parameter corresponding to the instruction code according to a parameter instruction mapping table under a category to which the NFC card belongs; 生成模块,用于根据所述指令码和所述指令码对应的参数,生成所述数据读取指令。And a generating module, configured to generate the data read instruction according to the instruction code and a parameter corresponding to the instruction code. 根据权利要求15所述的客户端,其特征在于,还包括:The client according to claim 15, further comprising: 第二接收模块,用于接收NFC卡识别应用发送的所述NFC卡的类别属性信息,所述类别属性信息用于指示所述NFC卡所属的类别。The second receiving module is configured to receive category attribute information of the NFC card sent by the NFC card identification application, where the category attribute information is used to indicate a category to which the NFC card belongs. 根据权利要求15所述的客户端,其特征在于,还包括:The client according to claim 15, further comprising: 第三接收模块,用于接收所述服务端发送的更新指令;a third receiving module, configured to receive an update instruction sent by the server; 更新模块,用于根据所述更新指令,更新所述参数指令映射表。And an update module, configured to update the parameter instruction mapping table according to the update instruction. 根据权利要求13-17任一项所述的客户端,其特征在于,还包括:The client according to any one of claims 13-17, further comprising: 编码模块,用于对所述待解析的数据进行编码处理。And an encoding module, configured to perform encoding processing on the data to be parsed. 根据权利要求13-17任一项所述的客户端,其特征在于,还包括:The client according to any one of claims 13-17, further comprising: 判断模块,用于判断本地是否可以解析所述待解析的数据,并在判断结果为否时,触发所述发送模块执行将所述待解析的数据发送给服务端,以供所述服务端将所述待解析的数据解析成所述客户端可识别的结构化数据并返回的操作。a determining module, configured to determine whether the data to be parsed can be parsed locally, and when the determining result is no, triggering, by the sending module, to send the data to be parsed to the server, so that the server The data to be parsed is parsed into the structured data recognizable by the client and returned. 根据权利要求13-17任一项所述的客户端,其特征在于,还包括:The client according to any one of claims 13-17, further comprising: 展示模块,用于通过所述客户端所在终端将所述结构化数据展示给用户。And a display module, configured to display the structured data to the user by using the terminal where the client is located. 一种服务端,其特征在于,包括:A server, characterized in that it comprises: 接收模块,用于接收客户端发送的待解析的数据,所述待解析的数据是所述客户端从NFC卡中读取的;a receiving module, configured to receive data to be parsed sent by the client, where the data to be parsed is read by the client from the NFC card; 解析模块,用于对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述客户端可识别的结构化数据;a parsing module, configured to parse the data to be parsed, and encapsulate the successfully parsed result data into structured data recognizable by the client; 发送模块,用于将所述结构化数据发送给所述客户端。And a sending module, configured to send the structured data to the client. 根据权利要求21所述的服务端,其特征在于,所述解析模块具体用于:The server according to claim 21, wherein the parsing module is specifically configured to: 确定所述NFC卡对应的解析算法;Determining an analysis algorithm corresponding to the NFC card; 采用所述解析算法对所述待解析的数据进行解析; Parsing the data to be parsed by using the parsing algorithm; 将成功解析出的结果数据封装成所述客户端可识别的结构化数据。The successfully parsed result data is encapsulated into structured data recognizable by the client. 根据权利要求22所述的服务端,其特征在于,还包括:The server according to claim 22, further comprising: 生成模块,用于在所述解析模块无法成功解析出所述结果数据时,根据所述待解析的数据和所述待解析的数据的相关数据,生成所述NFC卡对应的解析算法。And a generating module, configured to generate an analysis algorithm corresponding to the NFC card according to the data to be parsed and the related data of the data to be parsed when the parsing module cannot successfully parse the result data. 根据权利要求21-23任一项所述的服务端,其特征在于,还包括:The server according to any one of claims 21 to 23, further comprising: 解码模块,用于对所述待解析的数据进行解码处理。And a decoding module, configured to perform decoding processing on the data to be parsed. 一种数据解析系统,其特征在于,包括:客户端和服务端;A data analysis system, comprising: a client and a server; 所述客户端,用于从NFC卡中读取待解析的数据,将所述待解析的数据发送给所述服务端,并接收所述服务端返回的所述客户端可识别的结构化数据;The client is configured to read data to be parsed from the NFC card, send the data to be parsed to the server, and receive structured data recognizable by the client returned by the server ; 所述服务端,用于接收所述客户端发送的待解析的数据,对所述待解析的数据进行解析,并将成功解析出的结果数据封装成所述结构化数据,将所述结构化数据发送给所述客户端。 The server is configured to receive data to be parsed sent by the client, parse the data to be parsed, and encapsulate the successfully parsed result data into the structured data, and configure the structure Data is sent to the client.
PCT/CN2016/075941 2015-03-17 2016-03-09 Data parsing method, apparatus and system WO2016146008A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510115672.1 2015-03-17
CN201510115672.1A CN106033551B (en) 2015-03-17 2015-03-17 Data analysis method, apparatus and system

Publications (1)

Publication Number Publication Date
WO2016146008A1 true WO2016146008A1 (en) 2016-09-22

Family

ID=56919567

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/075941 WO2016146008A1 (en) 2015-03-17 2016-03-09 Data parsing method, apparatus and system

Country Status (2)

Country Link
CN (1) CN106033551B (en)
WO (1) WO2016146008A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109346163A (en) * 2018-12-21 2019-02-15 邬超 Data transfer device, equipment and system
WO2020118516A1 (en) * 2018-12-11 2020-06-18 Orange Method for operating a device for selecting a virtual card in a digital wallet
CN112905182A (en) * 2019-12-04 2021-06-04 北京沃东天骏信息技术有限公司 Data analysis method and device

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109410555A (en) * 2018-12-04 2019-03-01 惠州Tcl移动通信有限公司 Terminal control method, device, terminal and storage medium
TWI804849B (en) * 2021-04-15 2023-06-11 美商鏈通科技股份有限公司 Method and system for resolving a target

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120011165A1 (en) * 2010-07-06 2012-01-12 Coker Christopher B A Methods of encapsulating information in records from two or more disparate databases
CN103500391A (en) * 2013-10-12 2014-01-08 江苏恒安方信科技有限公司 Signing system based on NFC (Near Field Communication) mobile terminal and implementation method thereof
CN103581233A (en) * 2012-07-27 2014-02-12 中国电信股份有限公司 Method and system for managing tags in near field communication

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120011165A1 (en) * 2010-07-06 2012-01-12 Coker Christopher B A Methods of encapsulating information in records from two or more disparate databases
CN103581233A (en) * 2012-07-27 2014-02-12 中国电信股份有限公司 Method and system for managing tags in near field communication
CN103500391A (en) * 2013-10-12 2014-01-08 江苏恒安方信科技有限公司 Signing system based on NFC (Near Field Communication) mobile terminal and implementation method thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020118516A1 (en) * 2018-12-11 2020-06-18 Orange Method for operating a device for selecting a virtual card in a digital wallet
CN109346163A (en) * 2018-12-21 2019-02-15 邬超 Data transfer device, equipment and system
CN112905182A (en) * 2019-12-04 2021-06-04 北京沃东天骏信息技术有限公司 Data analysis method and device

Also Published As

Publication number Publication date
CN106033551B (en) 2019-03-01
CN106033551A (en) 2016-10-19

Similar Documents

Publication Publication Date Title
JP6483696B2 (en) Application program update processing method and terminal device
CN103618794B (en) Method, terminal and the server of automated log on
US10387856B2 (en) Online payment method, system, and apparatus
CN103310537B (en) A kind of many application identifications access method, smart card and POS
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
US20160210632A1 (en) Secured payment method and relevant device and system
US10477598B2 (en) Methods and apparatus for registering network identifiers and/or taking different actions based on the type of network identifier being registered or reported
CN103269326A (en) Safety equipment, multi-application system and safety method for ubiquitous networks
CN105592403B (en) NFC-based communication device and method
US12099993B2 (en) Resource transfer method and apparatus, computer device, and storage medium
WO2016146008A1 (en) Data parsing method, apparatus and system
CN102402744A (en) Data processing method and system of mobile equipment and mobile equipment
CN102469081A (en) Smart card operation method, device and system
WO2020156152A1 (en) Payment information binding method, apparatus, mobile terminal and system
KR20130128924A (en) Apparatus and method for charging a product in a near field communication device
US20130179499A1 (en) Method, apparatus and system for displaying radio frequency identification application information
CN107969003B (en) Wireless access authentication method
CN103580726B (en) User identification card, Bluetooth device and method for accessing user identification card
CN104717599A (en) NFC event reporting method for mobile terminal and device
JP2015184692A (en) Information processor, information processing method and information processing program
CN117941295A (en) Data transmission method, device and system
KR102417060B1 (en) User equipment supporting benefit management based on image parsing, a service providing method including the same, and computer readable medium having computer program recorded thereon
CN114580451A (en) Antenna parameter configuration method, device, storage medium and electronic device
KR102425940B1 (en) Method for managing virtual account and apparatus therefor
CN108521646A (en) A near-field communication method, device, and computer-readable storage medium

Legal Events

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

Ref document number: 16764189

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16764189

Country of ref document: EP

Kind code of ref document: A1