A method and device for controlling a tax control device
Through the MQTT long connection and USBIP framework, remote control of tax control equipment is realized, solving the problem of remote operation in the existing technology, reducing operation and maintenance costs and improving the work efficiency of accounting personnel.
Patent Information
- Application Number
- CN202111487195.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-12-07
AI Technical Summary
In the scenario of centralized custody of tax control equipment, the existing technology cannot achieve remote control, resulting in accounting personnel needing to frequently plug and unplug the equipment, increasing the operation and maintenance workload.
Using MQTT long connection technology and USBIP framework, the client establishes a long connection with the server, and remotely controls tax control devices by creating topics and subscription mechanisms, determines device information and paths, and sends control instructions.
The remote use of tax control equipment is realized, reducing the time and management costs of accounting personnel, and improving work efficiency.
Smart Images

Figure CN116244090B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data communication technologies, and particularly relates to a method and device for controlling a tax control device. Background Art
[0002] In the scenario of centralized hosting of tax control devices, the server is generally placed in a computer room. For operations that must use a stand-alone invoicing software, the accountant needs to go to the computer room to plug and unplug the tax control device, which not only takes time and effort but also requires registration of lending / returning the tax control device, increasing the operation and maintenance workload. Summary of the Invention
[0003] This application provides a method and device for controlling a tax control device to solve the problem in the prior art that the tax control device cannot be remotely controlled.
[0004] In a first aspect, this application provides a method for controlling a tax control device, which is applied to a client. The client establishes a long connection with a server through the MQTT long connection technology. The server is connected with a plurality of tax control devices, and a USBIP framework is built between the client and the server. The method includes:
[0005] When the client is initialized and started, a first topic is created, and the second topic created when the server is initialized is subscribed. Wherein, when the server is initialized and started, a second topic is created, and the first topic is subscribed.
[0006] Determine the tax control device to be controlled, and publish the device information of the tax control device to be controlled to the first topic, so that the server obtains the device information of the tax control device to be controlled from the first topic, and determines the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled.
[0007] Receive a target tax control device control instruction, and publish the control instruction to the first topic, so that the server obtains the control instruction from the first topic, and sends the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
[0008] Optionally, when the server is initialized and started, the step of creating the first topic by the client when the client is initialized and started includes:
[0009] When the client is initialized and started, a first topic is created with the tax number and extension number of the tax control device to be controlled as the name.
[0010] Optionally, after the server determines that the control of the target tax control device is completed, a corresponding control result is generated, and the control result is published to the second topic; The method further includes:
[0011] After monitoring that the control result is released in the second topic, obtain the control result from the second topic.
[0012] In a second aspect, the present application provides a method for controlling a tax control device, which is applied to a server. The server establishes a long connection with a client through the MQTT long connection technology. The server is connected to a plurality of tax control devices, and a USBIP framework is built between the server and the client. The method includes:
[0013] When the server is initialized and started, create a second topic and subscribe to the first topic created when the client is initialized. Wherein, when the client is initialized and started, create the first topic and subscribe to the second topic;
[0014] Obtain the device information of the tax control device to be controlled from the first topic, and respectively determine the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled. Wherein, after the client determines the tax control device to be controlled, publish the device information of the tax control device to be controlled to the first topic;
[0015] Obtain the control instruction from the first topic, and send the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device. Wherein, after the client receives the control instruction for the target tax control device, publish the control instruction to the first topic.
[0016] Optionally, the step of creating a second topic when the server is initialized and started includes:
[0017] When the server is initialized and started, create a second topic based on the unique identifier of the server as the name.
[0018] In a third aspect, the present application provides a tax control device control device, which is applied to a client. The client establishes a long connection with a server through the MQTT long connection technology. The server is connected to a plurality of tax control devices, and a USBIP framework is built between the client and the server. The device includes:
[0019] A creation unit, configured to create a first topic when initialized and started, and subscribe to the second topic created when the server is initialized. Wherein, when the server is initialized and started, create the second topic and subscribe to the first topic;
[0020] A determination unit, configured to determine a fiscal control device to be controlled, and publish the device information of the fiscal control device to be controlled to the first topic, so that the server obtains the device information of the fiscal control device to be controlled from the first topic, and respectively determine the USB path information of the fiscal control device to be controlled based on the device information of the fiscal control device to be controlled;
[0021] A receiving unit, configured to receive a target fiscal control device control instruction, and publish the control instruction to the first topic, so that the server obtains the control instruction from the first topic, and sends the control instruction to the target fiscal control device through the USB path corresponding to the determined target fiscal control device.
[0022] Optionally, when the server initializes and starts up and creates the first topic, the creating unit is specifically configured to:
[0023] When the client initializes and starts up, create the first topic based on the tax number and extension number of the fiscal control device to be controlled as the name.
[0024] Optionally, after the server determines that the control of the target fiscal control device is completed, generate a corresponding control result, and publish the control result to the second topic; the device further includes:
[0025] An obtaining unit, configured to obtain the control result from the second topic after monitoring that the second topic publishes the control result.
[0026] In a fourth aspect, the present application provides a fiscal control device control device, which is applied to a server. The server establishes a long connection with a client through the MQTT long connection technology. The server is connected to a plurality of fiscal control devices, and a USBIP framework is built between the server and the client. The device includes:
[0027] A creating unit, configured to create a second topic during initialization startup, and subscribe to the first topic created by the client during initialization. Wherein, when the client initializes and starts up, it creates the first topic and subscribes to the second topic;
[0028] A first obtaining unit, configured to obtain the device information of the fiscal control device to be controlled from the first topic, and respectively determine the USB path information of the fiscal control device to be controlled based on the device information of the fiscal control device to be controlled. Wherein, after the client determines the fiscal control device to be controlled, it publishes the device information of the fiscal control device to be controlled to the first topic;
[0029] A second acquisition unit, configured to acquire the control instruction from the first topic, and send the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device, where after receiving the target tax control device control instruction, the client publishes the control instruction to the first topic.
[0030] Optionally, when the server is initialized and started to create a second topic, the creating unit is specifically configured to:
[0031] When the server is initialized and started, create a second topic based on the unique identifier of the server as the name.
[0032] In a fifth aspect, the present application provides a tax control device control apparatus, which is applied to a client, and the apparatus includes:
[0033] A memory, configured to store program instructions;
[0034] A processor, configured to call the program instructions stored in the memory and execute the steps of the method according to any one of the above first aspects according to the obtained program instructions.
[0035] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause the computer to execute the steps of the method according to any one of the above first aspects.
[0036] In a seventh aspect, the present application provides a tax control device control apparatus, which is applied to a server, and the apparatus includes:
[0037] A memory, configured to store program instructions;
[0038] A processor, configured to call the program instructions stored in the memory and execute the steps of the method according to any one of the above second aspects according to the obtained program instructions.
[0039] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause the computer to execute the steps of the method according to any one of the above second aspects.
[0040] In summary, for the tax control device control method provided in the embodiments of the present application, the client and the server establish a long connection through the MQTT long connection technology. The server is connected to several tax control devices, and a USBIP framework is built between the client and the server. The method includes: when the client is initialized and started, a first topic is created, and the second topic created when the server is initialized is subscribed. Among them, when the server is initialized and started, a second topic is created, and the first topic is subscribed; the tax control device to be controlled is determined, and the device information of the tax control device to be controlled is published to the first topic, so that the server obtains the device information of the tax control device to be controlled from the first topic, and determines the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled; the target tax control device control instruction is received, and the control instruction is published to the first topic, so that the server obtains the control instruction from the first topic, and sends the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
[0041] By adopting the tax control device control method provided in the embodiments of the present application, the MQTT long connection technology and the USBIP mapping technology are organically combined, realizing the wide area network transparent transmission of USB protocol messages, realizing the remote use of tax control devices in the wide area network, reducing the time cost of accounting personnel, the management cost of tax control devices and the operation and maintenance cost of the server computer room, and having the ability to manage N tax control devices by a single client, improving the work efficiency of accounting personnel. Description of the Drawings
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments of the present application or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings in the embodiments of the present application.
[0043] Figure 1 It is a detailed flowchart of a tax control device control method provided in the embodiments of the present application;
[0044] Figure 2 It is a detailed flowchart of another tax control device control method provided in the embodiments of the present application;
[0045] Figure 3 It is a schematic diagram of a USB protocol interaction process provided in the embodiments of the present application;
[0046] Figure 4 It is a schematic diagram of the structure of a tax control device control device provided in the embodiments of the present application;
[0047] Figure 5 A schematic structural diagram of another tax control device control device provided by an embodiment of the present application;
[0048] Figure 6 A schematic structural diagram of a client provided by an embodiment of the present application;
[0049] Figure 7 A schematic structural diagram of a server provided by an embodiment of the present application. Specific embodiments
[0050] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and do not limit the present application. The singular forms "a", "the", and "said" used in the present application and the claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more of the associated listed items.
[0051] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "when" or "when" or "in response to a determination".
[0052] Exemplarily, refer to Figure 1 As shown, a detailed flowchart of a tax control device control method provided by an embodiment of the present application. The method is applied to a client, and the client and the server establish a long connection through the MQTT long connection technology. The server is connected to a number of tax control devices, and a USBIP framework is built between the client and the server. The method includes the following steps:
[0053] Step 100: When the client is initialized and started, create a first topic and subscribe to a second topic created when the server is initialized. Wherein, when the server is initialized and started, create a second topic and subscribe to the first topic.
[0054] In the embodiment of the present application, when the client creates the first topic during initialization and startup, a preferred implementation manner is: when the client is initialized and started, create the first topic based on the tax number and extension number of the tax control device to be controlled as the name.
[0055] In practical applications, a client program and a USBIP driver program are running on the client. When the client program starts, it creates a first topic with the tax number and extension number of the tax control device to be controlled as the name. On the server, a server program and a USBIP system service are running. When the server program starts, it creates a second topic with the unique identifier of the server as the name. The client establishes a USBIP framework based on the USBIP driver program running locally and the BSBIP system service running locally on the server.
[0056] Furthermore, a long connection service is established between the client and the server based on the Message Queuing Telemetry Transport (MQTT) protocol. Then, after the client program creates the first topic and the server program creates the second topic, the client program subscribes to the second topic, and the server program subscribes to the first topic.
[0057] Step 110: Determine the tax control device to be controlled, and publish the device information of the tax control device to be controlled to the first topic, so that the server can obtain the device information of the tax control device to be controlled from the first topic, and respectively determine the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled.
[0058] Specifically, after the client program starts, it creates a first topic with the tax number and extension number of the tax control device to be controlled as the name, and publishes the device information (tax number plus extension number) of the device to be controlled to the first topic. Since the server program subscribes to the first topic, the server program can obtain the device information of the device to be controlled from the first topic.
[0059] Specifically, the way for the server program to obtain the device information of the tax control device to be controlled from the first topic includes: obtaining the device information of the tax control device to be controlled from the first topic by triggering the listening callback function of the server.
[0060] Furthermore, the server program queries the USB path information of the corresponding tax control device according to the tax number plus extension number and sends it to the USBIP service.
[0061] Step 120: Receive the control instruction of the target tax control device, and publish the control instruction to the first topic, so that the server can obtain the control instruction from the first topic, and send the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
[0062] In practical applications, when a user operates the client, the client receives a target tax control device control instruction triggered by the user. It should be noted that the target tax control device is any tax control device among the devices to be controlled. The client service publishes the received target tax control device control instruction to the first topic and obtains the target tax control device control instruction from the first topic by triggering the listening callback function of the server.
[0063] After the server obtains the target tax control device control instruction, it executes the target tax control device control instruction based on the USB path corresponding to the target tax control device, that is, sends the target tax control device control instruction to the target tax control device through the USB path corresponding to the target tax control device.
[0064] After the target tax control device receives the control instruction, it executes the control instruction and generates a corresponding control result. After the server determines that the control of the target tax control device is completed, it generates a corresponding control result and publishes the control result to the second topic.
[0065] Furthermore, since the client program subscribes to the second topic, after the server program publishes the control result to the second topic, that is, after the client monitors that the second topic publishes the control result, the client obtains the control result from the second topic.
[0066] Exemplarily, referring to Figure 2 As shown, it is a detailed flowchart of a tax control device control method provided by an embodiment of the present application. This method is applied to a server. The server and the client establish a long connection through the MQTT long connection technology. The server is connected to several tax control devices, and a USBIP framework is built between the server and the client. This method includes the following steps:
[0067] Step 200: When the server is initialized and started, it creates a second topic and subscribes to the first topic created when the client is initialized. Among them, when the client is initialized and started, it creates the first topic and subscribes to the second topic.
[0068] In the embodiment of the present application, when the server is initialized and started and creates a second topic, a better implementation method is: when the server is initialized and started, it creates a second topic based on the unique identifier of the server as the name.
[0069] Step 210: Obtain the device information of the tax control device to be controlled from the first topic, and respectively determine the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled. Among them, after the client determines the tax control device to be controlled, it publishes the device information of the tax control device to be controlled to the first topic.
[0070] Step 220: Obtain the control instruction from the first topic, and send the control instruction to the target fiscal device through the USB path corresponding to the determined target fiscal device. After receiving the control instruction for the target fiscal device, the client publishes the control instruction to the first topic.
[0071] Next, the control interaction process of the fiscal device based on the USB protocol provided in the embodiments of the present application will be described in detail in combination with specific application scenarios. Exemplarily, refer to Figure 3 As shown, it is a schematic diagram of a USB protocol interaction process provided in an embodiment of the present application. After the client program is started, the name of Topic B (i.e., tax number plus extension number) is published to Topic A in the cloud background, triggering the listening callback function of the server program. In this way, the server program obtains the information of the fiscal device to be mapped. The server program queries the USB path information of the corresponding fiscal device according to the tax number plus extension number and sends it to the USBIP service. The USBIP service assembles a USB interaction message according to the USB protocol and sends it to the server program. The server program publishes the USB interaction message to Topic B in the cloud background, triggering the listening callback function of the client program. In this way, the client program on the user's computer obtains the USB interaction message. The client program sends the USB interaction message to the USBIP driver program to start USB mapping. During the process, the USB data interaction between the USBIP driver program and the USBIP service is all through this method, that is, the client program publishes to Topic A and listens to Topic B, and the server program publishes to Topic B and listens to Topic A.
[0072] Based on the same inventive concept as the method embodiment applied to the client above, exemparily, refer to Figure 4 As shown, it is a schematic structural diagram of a fiscal device control device provided in an embodiment of the present application. The device is applied to the client. The client and the server establish a long connection through the MQTT long connection technology. The server is connected with several fiscal devices, and a USBIP framework is built between the client and the server. The device includes:
[0073] A creation unit 40, configured to create a first topic during initialization startup and subscribe to a second topic created by the server during initialization startup. When the server is initialized and started, the second topic is created and the first topic is subscribed to;
[0074] A determination unit 41, configured to determine the fiscal device to be controlled and publish the device information of the fiscal device to be controlled to the first topic, so that the server obtains the device information of the fiscal device to be controlled from the first topic and determines the USB path information of the fiscal device to be controlled based on the device information of the fiscal device to be controlled;
[0075] The receiving unit 42 is used to receive the control instruction of the target tax control device and publish the control instruction to the first topic, so that the server obtains the control instruction from the first topic and sends the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
[0076] Optionally, when the server is initially started and creates the first topic, the creating unit 41 is specifically configured to:
[0077] When the client is initialized and started, the client creates a first topic based on the tax ID and extension number of the tax control device to be controlled.
[0078] Optionally, after determining that the control of the target fiscal control device is completed, the server generates a corresponding control result and publishes the control result to the second topic; the apparatus further includes:
[0079] The acquiring unit acquires the control result from the second topic after monitoring that the control result is published on the second topic.
[0080] Based on the same inventive concept as the above-mentioned method embodiment applied to the server, for example, refer to Figure 5 As shown, this application provides a tax control device control device, which is applied to a server. The server and the client establish a long connection through the MQTT long connection technology. The server is connected to several tax control devices, and a USBIP framework is built between the server and the client. The device includes:
[0081] A creating unit 50 is configured to create a second topic and subscribe to the first topic created by the client when the client is initialized, wherein the client creates the first topic and subscribes to the second topic when the client is initialized;
[0082] A first acquiring unit 51 is configured to acquire device information of the to-be-controlled fiscal control device from the first topic, and determine USB path information of each of the to-be-controlled fiscal control devices based on the device information of the to-be-controlled fiscal control devices. After determining the to-be-controlled fiscal control device, the client publishes the device information of the to-be-controlled fiscal control device to the first topic.
[0083] The second acquisition unit 52 is used to obtain the control instruction from the first topic, and send the control instruction to the target tax control device through the determined USB path corresponding to the target tax control device, wherein the client publishes the control instruction to the first topic after receiving the control instruction of the target tax control device.
[0084] Optionally, when the server is initialized and started to create a second topic, the creating unit 50 is specifically configured to:
[0085] When the server is initialized and started, create a second topic based on the unique identifier of the server as the name.
[0086] The above units may be one or more integrated circuits configured to implement the above methods. For example: one or more application specific integrated circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), etc. Again, when a certain unit above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. Again, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0087] Furthermore, for the tax control device control device applied to the client provided in the embodiments of the present application, from a hardware level, the schematic diagram of the hardware architecture of the tax control device control device can be seen Figure 6 as shown, the tax control device control device may include: a memory 60 and a processor 61,
[0088] The memory 60 is used to store program instructions; the processor 61 calls the program instructions stored in the memory 60 and executes the above method embodiments applied to the client according to the obtained program instructions. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0089] Optionally, the present application further provides a client, including at least one processing element (or chip) for executing the above method embodiments applied to the client.
[0090] Optionally, the present application further provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions for causing the computer to execute the above method embodiments applied to the client.
[0091] Furthermore, for the tax control device control device applied to the server provided in the embodiments of the present application, from a hardware level, the schematic diagram of the hardware architecture of the tax control device control device can be seen Figure 7As shown, the fiscal control device control apparatus may include: a memory 70 and a processor 71.
[0092] The memory 70 is used to store program instructions; the processor 71 calls the program instructions stored in the memory 70 and executes the method embodiments applied to the server as described above according to the obtained program instructions. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0093] Optionally, the present application further provides a server, including at least one processing element (or chip) for executing the method embodiments applied to the server as described above.
[0094] Optionally, the present application further provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions for causing the computer to execute the method embodiments applied to the server as described above.
[0095] Here, the machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0096] The systems, devices, modules or units illustrated in the above embodiments may be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.
[0097] For convenience of description, when describing the above devices, they are described as various units according to functions. Of course, when implementing the present application, the functions of each unit may be implemented in the same or multiple software and / or hardware.
[0098] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0100] Moreover, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, so that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0102] The above are only the preferred embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for controlling a tax control device, characterized in that Applied to the client, the client and the server establish a long connection through the MQTT long connection technology. The server is connected to a number of tax control devices, and a USBIP framework is built between the client and the server. That is, a client program and a USBIP driver program are running on the client, and a server program and a USBIP system service are running on the server. The method includes: When the client is initialized and started, a first topic is created and the second topic created when the server is initialized is subscribed to. Among them, when the server is initialized and started, a second topic is created and the first topic is subscribed to; Determine the tax control device to be controlled and publish the device information of the tax control device to be controlled to the first topic, so that the server obtains the device information of the tax control device to be controlled from the first topic and determines the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled; Receive the control instruction of the target tax control device and publish the control instruction to the first topic, so that the server obtains the control instruction from the first topic and sends the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
2. The method according to claim 1, wherein When the server is initialized and started, the steps of creating the first topic by the client when the client is initialized and started include: When the client is initialized and started, a first topic is created with the tax number and extension number of the tax control device to be controlled as the name.
3. The method according to claim 1 or 2, characterized in that, After the server determines that the control of the target tax control device is completed, a corresponding control result is generated and the control result is published to the second topic; The method further includes: After monitoring that the control result is published to the second topic, obtain the control result from the second topic.
4. A control method for a tax control device, characterized in that, Applied to the server, the server and the client establish a long connection through the MQTT long connection technology. The server is connected to a number of tax control devices, and a USBIP framework is built between the server and the client. That is, a client program and a USBIP driver program are running on the client, and a server program and a USBIP system service are running on the server. The method includes: When the server is initialized and started, a second topic is created and the first topic created when the client is initialized is subscribed to. Among them, when the client is initialized and started, a first topic is created and the second topic is subscribed to; Obtain the device information of the tax control device to be controlled from the first topic and determine the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled. Among them, after the client determines the tax control device to be controlled, the device information of the tax control device to be controlled is published to the first topic; Obtain the control instruction from the first topic and send the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device. Among them, after the client receives the control instruction of the target tax control device, the control instruction is published to the first topic.
5. The method according to claim 4, characterized in that, When the server is initialized and started, the steps for creating the second topic include: When the server is initialized and started, a second topic is created based on the unique identifier of the server as the name.
6. A control device for a tax control device, characterized in that, Applied to the client, the client and the server establish a long connection through the MQTT long connection technology. The server is connected to a number of tax control devices, and a USBIP framework is built between the client and the server, that is, a client program and a USBIP driver program are running on the client, and a server program and a USBIP system service are running on the server. The device includes: A creation unit, configured to create a first topic during initialization and startup, and subscribe to the second topic created during server initialization, where the server creates the second topic during initialization and startup and subscribes to the first topic; A determination unit, configured to determine the tax control device to be controlled, and publish the device information of the tax control device to be controlled to the first topic, so that the server obtains the device information of the tax control device to be controlled from the first topic, and determines the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled; A receiving unit, configured to receive a target tax control device control instruction, and publish the control instruction to the first topic, so that the server obtains the control instruction from the first topic, and sends the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device.
7. The device according to claim 6, wherein When the server creates the first topic during initialization and startup, the creation unit specifically is used for: When the client is initialized and started, a first topic is created based on the tax number and extension number of the tax control device to be controlled as the name.
8. The device according to claim 6 or 7, characterized in that, After the server determines that the control of the target tax control device is completed, a corresponding control result is generated, and the control result is published to the second topic; the device further includes: An obtaining unit, configured to obtain the control result from the second topic after monitoring that the control result is published to the second topic.
9. A control device for a tax control device, characterized in that, Applied to the server, the server and the client establish a long connection through the MQTT long connection technology. The server is connected to a number of tax control devices, and a USBIP framework is built between the server and the client, that is, a client program and a USBIP driver program are running on the client, and a server program and a USBIP system service are running on the server. The device includes: A creation unit, configured to create a second topic during initialization and startup, and subscribe to the first topic created during client initialization, where the client creates the first topic during initialization and startup and subscribes to the second topic; A first obtaining unit, configured to obtain the device information of the tax control device to be controlled from the first topic, and determine the USB path information of the tax control device to be controlled based on the device information of the tax control device to be controlled, where the client publishes the device information of the tax control device to be controlled to the first topic after determining the tax control device to be controlled; A second acquisition unit, configured to obtain a control instruction from the first topic and send the control instruction to the target tax control device through the USB path corresponding to the determined target tax control device, where after receiving the control instruction of the target tax control device, the client publishes the control instruction to the first topic.
10. The device according to claim 9, characterized in that, When the server initializes and starts up and creates a second topic, the creating unit is specifically configured to: when the server initializes and starts up, create a second topic with the unique identifier of the server as the name.
Citation Information
Patent Citations
Tax control equipment redirection system and method
CN112633997A
Communication terminal, communication system, and data transmission method
US20170264450A1