CN108257333B - Method and system for communication between tax control equipment and Android platform - Google Patents

Method and system for communication between tax control equipment and Android platform Download PDF

Info

Publication number
CN108257333B
CN108257333B CN201611247883.1A CN201611247883A CN108257333B CN 108257333 B CN108257333 B CN 108257333B CN 201611247883 A CN201611247883 A CN 201611247883A CN 108257333 B CN108257333 B CN 108257333B
Authority
CN
China
Prior art keywords
android platform
tax control
equipment
identified
control equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611247883.1A
Other languages
Chinese (zh)
Other versions
CN108257333A (en
Inventor
彭坚
范丽
王招凯
缪云青
李利
张平
谢宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
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 Aisino Corp filed Critical Aisino Corp
Priority to CN201611247883.1A priority Critical patent/CN108257333B/en
Publication of CN108257333A publication Critical patent/CN108257333A/en
Application granted granted Critical
Publication of CN108257333B publication Critical patent/CN108257333B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G1/00Cash registers
    • G07G1/12Cash registers electronically operated
    • G07G1/14Systems including one or more distant stations co-operating with a central processing unit
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G5/00Receipt-giving machines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72409User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to a method for communication between tax control equipment and an Android platform, which comprises the following steps: identifying the tax-control device; when the application of the Android platform for communicating with the tax control equipment is multi-thread or multi-process, opening a thread lock or a process lock, organizing a SCSI command of a tax control small computer system interface, carrying out data communication between the tax control equipment and the application of the Android platform, releasing the thread lock or the process lock after the communication is finished, and closing the tax control equipment; and when the application of the Android platform for communicating with the tax control equipment is not multi-threaded, directly performing data communication between the tax control equipment and the application of the Android platform, and closing the equipment tax control equipment after the data communication is completed.

Description

Method and system for communication between tax control equipment and Android platform
Technical Field
The invention relates to the field of tax control equipment, in particular to a method and a system for data communication between tax control equipment and an Android platform.
Background
The tax control equipment is special equipment of an anti-counterfeiting tax control system which accords with technical specifications (version 2.0) of invoice tax control disks and transmission disks of the State tax administration, realizes the invoice tax control function under the coordination of invoice invoicing software, meets the management requirements of tax authorities on invoices, and ensures the correct generation, reliable storage and tamper prevention of invoice tax control data. The tax control equipment mainly comprises a gold tax disk, a tax declaration disk and the like, and realizes the functions of: the method comprises the steps of storing taxpayer registration information and monitoring management information, storing invoice codes and invoice numbers, issuing invoices and generating tax control codes, storing invoice details and invoice use information, generating submission data and a summary signature, and transmitting data between an invoicing end and a tax end.
In recent years, the Android platform provides a wide and free environment for third-party developers, the remarkable openness enables the third-party developers to have more developers, and a brand-new platform rapidly matures with the increasing abundance of applications and active use of users. Android is a Linux-based free and open source code operating system, which is mainly used for mobile devices such as smart phones and tablet computers, and the like, and the market share of Android in the world first jumps to the first world in the first year 2011. In the fourth quarter of 2013, the global market share of Android platform phones has reached 78.1%. The Android platform carries the advantages of remarkable openness, abundant hardware selection, strong network application, Android assistance of global IT enterprises and the like, and the Android platform is far beyond other systems in innovation capability and becomes a leading person of the era trend.
At present, tax control equipment of an anti-counterfeiting tax control system is only widely applied to Windows platforms, and a communication method between the tax control equipment and an Android platform is not available in China.
Disclosure of Invention
In order to solve the above problems in the background art, the present invention provides a method for identifying a tax control device, the method comprising:
step 1, mapping equipment to be identified into equipment nodes in an Android platform, and operating the equipment nodes in the Android platform to obtain file descriptors of the connected equipment to be identified;
step 2, the tax control system sends a query command to the Android platform to request basic information of the tax control equipment, and when the basic information is consistent with a file descriptor of the equipment to be identified, the equipment to be identified is determined to be the tax control equipment;
step 3, when the application of the Android platform for communicating with the tax control equipment is multi-thread or multi-process, starting a thread lock or a process lock, and if the application of the Android platform is not multi-thread or multi-process, directly jumping to the step 4;
step 4, organizing a SCSI command of a tax-control small computer system interface, preparing and encrypting data to be sent, setting a transmission direction as sending, and calling input and output operation to send the data;
step 5, reading the processing state of the step 4, performing error processing if the state is wrong, and performing step 6 if the state is correct;
step 6, organizing tax control SCSI commands, initializing received data buffer and size, setting transmission direction as receiving, calling input and output operation to receive data, checking, decrypting and analyzing data;
step 7, when the application of the Android platform for communicating with the tax control equipment is multi-thread or multi-process, releasing a thread lock or a process lock, and if the application of the Android platform is not multi-thread or multi-process, directly jumping to the step 8; and
and 8, closing the tax control equipment.
Further, in step 2, when the basic information is not consistent with the file descriptor of the device to be identified, the device to be identified is determined not to be the tax-controlled device.
Further, before the device to be identified is mapped as a device node in the Android platform, the method further comprises the step of connecting the tax control device and the Android platform through a USB interface.
Further, operating the equipment node in the Android platform means opening a tax control device, an SCSI hard disk and a U disk connected with the Android platform.
Further, the basic information of the tax control device which the tax control system sends the query command request is 36 bytes of data.
According to another aspect of the present invention, the present invention further provides a system for enabling a tax control device to communicate with an Android platform, where the system includes:
the file descriptor acquiring unit is used for mapping the equipment to be identified into equipment nodes in the Android platform and operating the equipment nodes in the Android platform to acquire file descriptors of the connected equipment to be identified;
the tax control equipment determining unit is used for sending a query command to the Android platform to request basic information of the tax control equipment, and when the basic information is consistent with a file descriptor of equipment to be identified, determining that the equipment to be identified is the tax control equipment; and
and the data communication unit is used for carrying out data communication between the tax control equipment and the Android platform through a small computer system interface SCSI communication protocol.
Further, the obtaining of the file descriptor unit maps the device to be identified as the device node in the Android platform, and the method further includes connecting the fiscal device and the Android platform through a USB interface.
Further, the operation of the device node in the Android platform by the file descriptor obtaining unit refers to opening the fiscal device, the SCSI hard disk and the usb disk connected to the Android platform.
Further, the basic information of the fiscal device requested by the fiscal device determination unit sending the inquiry command is 36 bytes of data.
The method and the system for communication between the tax control equipment and the Android platform provide a research and development basis for transplantation and application of the tax control equipment and the anti-counterfeiting tax control system on the Android platform, and are successfully applied to mobile phone invoicing and Android information machine invoicing projects.
Drawings
A more complete understanding of exemplary embodiments of the present invention may be had by reference to the following drawings in which:
fig. 1 is a flowchart of a method for communicating a tax control device with an Android platform according to a specific embodiment of the present invention; and
fig. 2 is a structural diagram of a system for communicating tax control equipment and an Android platform according to a specific embodiment of the present invention.
Detailed Description
The exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for complete and complete disclosure of the present invention and to fully convey the scope of the present invention to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the accompanying drawings is not intended to be limiting of the invention. In the drawings, the same units/elements are denoted by the same reference numerals.
Unless otherwise defined, terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. Further, it will be understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense.
Fig. 1 is a flowchart of a method for communicating tax control equipment and an Android platform according to a specific embodiment of the present invention. As shown in fig. 1, the method 100 for communicating between the fiscal device and the Android platform starts from step S101.
In step S101, the device to be identified is mapped as a device node in the Android platform, and the device node is run in the Android platform to obtain a file descriptor of the connected device to be identified.
In step S102, the tax control system sends a query command to the Android platform to request basic information of the tax control device, and when the basic information is consistent with the file descriptor of the device to be identified, it is determined that the device to be identified is the tax control device.
In step S103, when the application of the Android platform communicating with the tax control device is multi-threaded or multi-process, the thread lock or the process lock is opened, and if the application of the Android platform is not multi-threaded or multi-process, the process directly jumps to step S104;
in step S104, organizing a SCSI command of a tax-control small computer system interface, preparing and encrypting data to be sent, setting a transmission direction as sending, and calling input and output operation to send the data;
in step S105, the processing state of step S104 is read, and if the state is wrong, an error process is performed, and if the state is correct, step S106 is performed;
in step S106, organizing a tax-control SCSI command, initializing received data buffer and size, setting the transmission direction as receiving, calling input and output operations to receive data, verifying, decrypting and analyzing the data;
in step S107, when the application of the Android platform communicating with the tax control device is multi-threaded or multi-process, releasing a thread lock or a process lock, and if the application of the Android platform is not multi-threaded or multi-process, directly jumping to step S108; and
in step S108, the tax control apparatus is turned off.
Preferably, in step S102 of the method, when the basic information is not consistent with the file descriptor of the device to be identified, it is determined that the device to be identified is not a fiscal device.
Preferably, before the device to be identified is mapped as the device node in the Android platform, the method further includes connecting the fiscal device and the Android platform through a USB interface.
Preferably, operating the device node in the Android platform means opening a tax control device, an SCSI hard disk and a usb disk connected to the Android platform.
Preferably, the basic information of the tax control device requested by the tax control system sending the query command is 36 bytes of data.
Fig. 2 is a structural diagram of a system for communicating tax control equipment and an Android platform according to a specific embodiment of the present invention. As shown in fig. 2, the system 200 for communicating the fiscal device with the Android platform includes a file descriptor obtaining unit 201, a fiscal device determining unit 202, and a data communication unit 203.
A file descriptor obtaining unit 201, configured to map the device to be identified as a device node in the Android platform, and run the device node in the Android platform to obtain a file descriptor of the connected device to be identified.
The tax control equipment determining unit 202 is configured to send a query command to the Android platform to request for basic information of the tax control equipment, and determine that the equipment to be identified is the tax control equipment when the basic information is consistent with a file descriptor of the equipment to be identified; and
and the data communication unit 203 is used for enabling the tax control equipment to receive the tax control command sent by the tax control system through a small computer system interface SCSI communication protocol and carrying out data communication between the tax control equipment and the tax control system.
Further, the obtaining a file descriptor unit 201 maps the device to be identified as a device node in the Android platform, and further includes connecting the fiscal device and the Android platform through a USB interface.
Further, the obtaining of the file descriptor unit 201 running the device node in the Android platform refers to opening a fiscal device, an SCSI hard disk, and a usb disk connected to the Android platform.
Further, the basic information of the fiscal device requested by the query command sent by the fiscal device determining unit 203 is 36 bytes of data.
The present invention has been described through the above embodiments. However, other embodiments of the invention than the one disclosed above are equally possible within the scope of the invention, as would be apparent to a person skilled in the art from the appended patent claims.
Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a/an/the [ means, component, etc. ] are to be interpreted openly as referring to at least one instance of said means, component, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.

Claims (9)

1. A method for communication between tax control equipment and an Android platform is characterized by comprising the following steps:
step 1, mapping equipment to be identified into equipment nodes in an Android platform, and operating the equipment nodes in the Android platform to obtain file descriptors of the connected equipment to be identified;
step 2, the tax control system sends a query command to the Android platform to request basic information of the tax control equipment, and when the basic information is consistent with a file descriptor of the equipment to be identified, the equipment to be identified is determined to be the tax control equipment;
step 3, when the application of the Android platform for communicating with the tax control equipment is multi-thread or multi-process, starting a thread lock or a process lock, and if the application of the Android platform is not multi-thread or multi-process, directly jumping to the step 4;
step 4, organizing the tax control SCSI command, preparing and encrypting data to be sent, setting the transmission direction as sending, and calling input and output operation to send the data;
step 5, reading the processing state of the step 4, performing error processing if the state is wrong, and performing step 6 if the state is correct;
step 6, organizing tax control SCSI commands, initializing received data buffer and size, setting transmission direction as receiving, calling input and output operation to receive data, checking, decrypting and analyzing data;
step 7, when the application of the Android platform for communicating with the tax control equipment is multi-thread or multi-process, releasing a thread lock or a process lock, and if the application of the Android platform is not multi-thread or multi-process, directly jumping to the step 8; and
and 8, closing the tax control equipment.
2. The method according to claim 1, wherein in step 2, when the basic information is not consistent with the file descriptor of the device to be identified, the device to be identified is determined not to be a tax-controlled device.
3. The method according to claim 1, wherein before mapping the device to be identified as the device node in the Android platform, the method further comprises connecting the fiscal device and the Android platform through a USB interface.
4. The method according to claim 1, wherein the running of the device node in the Android platform is to open a tax control device, a SCSI hard disk and a U disk connected with the Android platform.
5. The method of claim 1, wherein the basic information of the tax control device that the tax control system sends the query command request is 36 bytes of data.
6. The utility model provides a system that tax control equipment and Android platform communicate which characterized in that, the system includes:
the file descriptor acquiring unit is used for mapping the equipment to be identified into equipment nodes in the Android platform and operating the equipment nodes in the Android platform to acquire file descriptors of the connected equipment to be identified;
the tax control equipment determining unit is used for sending a query command to the Android platform to request basic information of the tax control equipment, and when the basic information is consistent with a file descriptor of equipment to be identified, determining that the equipment to be identified is the tax control equipment; and
and the data communication unit is used for carrying out data communication between the tax control equipment and the Android platform through an SCSI communication protocol.
7. The system according to claim 6, wherein the obtaining the file descriptor unit maps the device to be identified as the device node in the Android platform further comprises connecting the fiscal device and the Android platform through a USB interface.
8. The system according to claim 6, wherein the obtaining of the file descriptor unit running the device node in the Android platform means opening a fiscal device, an SCSI hard disk and a U disk connected to the Android platform.
9. The system of claim 6, wherein the basic information of the fiscal device that the fiscal device determination unit sends the inquiry command request is 36 bytes of data.
CN201611247883.1A 2016-12-29 2016-12-29 Method and system for communication between tax control equipment and Android platform Active CN108257333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611247883.1A CN108257333B (en) 2016-12-29 2016-12-29 Method and system for communication between tax control equipment and Android platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611247883.1A CN108257333B (en) 2016-12-29 2016-12-29 Method and system for communication between tax control equipment and Android platform

Publications (2)

Publication Number Publication Date
CN108257333A CN108257333A (en) 2018-07-06
CN108257333B true CN108257333B (en) 2020-12-22

Family

ID=62720952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611247883.1A Active CN108257333B (en) 2016-12-29 2016-12-29 Method and system for communication between tax control equipment and Android platform

Country Status (1)

Country Link
CN (1) CN108257333B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002062991A (en) * 2000-08-22 2002-02-28 Nec Yonezawa Ltd Floppy (r) disc drive and its detection method
CN103914928B (en) * 2012-12-30 2016-01-20 航天信息股份有限公司 A kind of tax returns system and method utilizing M2M technology based on Android system
US10417717B2 (en) * 2014-11-26 2019-09-17 Intuit Inc. Method and system for generating dynamic user experience
CN104851032A (en) * 2015-05-06 2015-08-19 福建凯盈资讯有限公司 Online anti-fake invoicing method and system
CN105979371A (en) * 2015-07-17 2016-09-28 乐视致新电子科技(天津)有限公司 Method and system for obtaining audio and video information
CN105205714A (en) * 2015-10-14 2015-12-30 浪潮软件集团有限公司 Tax control device and billing system separated tax control method
CN106201525A (en) * 2016-07-15 2016-12-07 浪潮软件集团有限公司 Tax control equipment embedded software design method

Also Published As

Publication number Publication date
CN108257333A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
US11875171B2 (en) Blockchain network transaction processing method, apparatus, device, and storage medium
CN101013379B (en) Method for supporting traditional application program in a multi-threaded environment in intelligent card
US11614926B2 (en) Consensus mechanism deployment method and apparatus
US20030233501A1 (en) Device for transferring from a memory card interface to a universal serial bus interface
WO2017084565A1 (en) Storage data access method, related controller, device, host, and system
WO2021013242A1 (en) Method for starting mini program, device and computer storage medium
CN109240870A (en) A kind of solid state hard disk Fault Locating Method and relevant apparatus
CN102422256A (en) Method for accessing a portable data storage medium with auxiliary module and portable data storage medium
US20210326151A1 (en) Methods, devices and computer-readable storage media for processing a hosted application
CN109951553B (en) Data processing method, system, electronic device and computer readable storage medium
US11212658B2 (en) Method for providing near filed communication device information for user and system therefor
CN114237498B (en) Snapshot generation method and system for cloud primary storage data volume
US8370681B2 (en) Remote backup storage
CN101490700A (en) Smart card terminal side data and management framework
CN101763324B (en) Method for realizing equipment simulating and device thereof
CN109446120B (en) USB device and method for identifying MacOS system by USB device
CN114356846A (en) Image data sending method and device, electronic equipment and storage medium
CN108257333B (en) Method and system for communication between tax control equipment and Android platform
US11449410B2 (en) Universal runtime verification system between source language and language converted through transpiler
US8645586B2 (en) SCSI reservation status information on a SAN disk
CN110175146B (en) Hard disk information acquisition method and device for acquiring hard disk information
CN111371851A (en) Connection method, connection device, electronic equipment and storage medium
US20130097622A1 (en) Framework for system communication for handling data
KR101668441B1 (en) Meddleware Interface System and Method for Data Collection of Heterogeneous Devices
CN104424153B (en) A kind of audio & video equipment data collecting system and its method to USB interface

Legal Events

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