Service data transmission device and method

By distributing time slices between USB host and slave devices through the service data transmission device, the problem of low transmission efficiency of multiple cables is solved, efficient data transmission and cost reduction are achieved, and it is suitable for various scenarios such as face payment and membership registration.

CN114116578BActive Publication Date: 2025-09-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010889413.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-28
Publication Date
2025-09-23
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

In the prior art, when multiple data need to be transmitted between a USB slave device and a USB host device, multiple cables are required, resulting in low transmission efficiency and high hardware costs. It cannot be widely applied to multiple hardware system host platforms, and there are problems with software compatibility and poor hardware universality.

Method used

A service data transmission device is used to allocate time slices in unidirectional and bidirectional paths through a first data conversion module and a first data hub module to achieve data conversion and transmission, aggregate multiple USB paths, and improve transmission efficiency.

Benefits of technology

Through time-slicing multiplexing modules and hubs, efficient data transmission between USB host and slave devices is achieved, reducing costs and improving user experience. It is suitable for various scenarios such as facial recognition payment and membership registration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116578B_ABST
    Figure CN114116578B_ABST
Patent Text Reader

Abstract

The present application provides a service data transmission device and method. The device includes: a first data conversion module for receiving first serial port service data to be transmitted in a unidirectional path, and second serial port service data to be transmitted in a bidirectional path, and receiving third USB service data to be transmitted in a bidirectional path via a first data hub module. The first data hub module is configured to: in a corresponding time slice of the unidirectional path, convert the first serial port service data into first USB service data via the first data conversion module and transmit it to a USB host device; in a corresponding time slice of the bidirectional path, convert the second serial port service data into second USB service data via the first data conversion module and transmit it to the USB host device; and convert the third USB service data into third serial port service data via the first data conversion module and transmit it to a USB slave device. Through the present application, efficient transmission of service data between a USB host device and a slave device can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of communication technology and power electronics technology, and in particular to a service data transmission device and method. Background Art

[0002] The Universal Serial Bus (USB) interface, used for communication between microcontrollers, is widely used in communications, electronics, and industrial control systems due to its hot-swappable and plug-and-play features. USB devices are categorized as either USB host or USB slave devices. However, in practice, a single device can function as either a USB host or a USB slave. For example, a data acquisition device (such as a facial recognition device, barcode scanner, or fingerprint recognition device) uses a USB interface as a USB slave device to connect to a USB host device (such as a POS (Point of Sale) terminal), thereby transmitting service-related data to and from the USB host.

[0003] As service functions become more diverse, multiple data types need to be transmitted between USB slave devices and USB host devices to complete the service process. Therefore, related technologies require multiple cables to be installed between the USB slave and USB host devices to meet the diverse service data transmission requirements. This not only reduces service data transmission efficiency but also increases hardware costs. Summary of the Invention

[0004] The embodiments of the present application provide a service data transmission device, method, system and computer-readable storage medium, which can realize efficient transmission of service data between a USB host device and a slave device.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The embodiment of the present application provides a service data transmission device,

[0007] The device comprises: a first data conversion module and a first data hub module; wherein,

[0008] The first data conversion module is configured to receive first serial port service data to be transmitted in a unidirectional path and second serial port service data to be transmitted in a bidirectional path, and receive third USB service data to be transmitted in the bidirectional path through the first data hub module;

[0009] The first data hub module is configured to:

[0010] In a corresponding time slice of the unidirectional path, converting the first serial port service data into first USB service data by the first data conversion module, and transmitting the data to the USB host device;

[0011] In the time slice corresponding to the bidirectional path, the second serial port service data is converted into second USB service data by the first data conversion module and transmitted to the USB host device; the third USB service data is converted into third serial port service data by the first data conversion module and transmitted to the USB slave device.

[0012] The embodiment of the present application provides a service data transmission system, which includes: a USB host device, a USB slave device, and the above-mentioned service data transmission device; wherein,

[0013] The USB slave device is electrically connected to the service data transmission device, and is used to send basic service data and first extended service data to the service data transmission device; and is also used to receive second extended service data sent by the service data transmission device;

[0014] The USB host device is electrically connected to the service data transmission device, and is used to send the second extended service data to the service data transmission device; and is also used to receive the basic service data and the first extended service data sent by the service data transmission device;

[0015] The service data transmission device is electrically connected to the USB slave device and the USB host device, and is used to send the basic service data and the first extended service data sent by the USB slave device to the USB host device; and is also used to send the second extended service data sent by the USB host device to the USB slave device;

[0016] Wherein, the basic service data includes at least one of the following: fourth USB service data; first serial port service data; first USB service data;

[0017] Wherein, the first extended service data includes at least one of the following: fifth USB service data; second serial port service data; second USB service data;

[0018] The second extended service data includes at least one of the following: sixth USB service data; third serial port service data; and third USB service data.

[0019] An embodiment of the present application provides a service data transmission method, which is applied to a service data transmission device, wherein the service data transmission device includes: a first data conversion module and a first data hub module;

[0020] The method comprises:

[0021] The first data conversion module receives the first serial port service data to be transmitted in the unidirectional path and the second serial port service data to be transmitted in the bidirectional path, and

[0022] receiving, through the first data hub module, third USB service data to be transmitted in the bidirectional path;

[0023] In a corresponding time slice of the unidirectional path, converting the first serial port service data into first USB service data through the first data conversion module, and transmitting the data to the USB host device through the first data hub module;

[0024] In a time slice corresponding to the bidirectional path, converting the second serial port service data into second USB service data through the first data conversion module, and transmitting the data to the USB host device through the first data hub module;

[0025] The third USB service data is converted into third serial port service data by the first data conversion module, and is transmitted to the USB slave device through the first data hub module.

[0026] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to control a service data transmission device to execute the above-mentioned service data transmission method.

[0027] The embodiments of the present application have the following beneficial effects:

[0028] The unidirectional path and the bidirectional path multiplex the first data conversion module and the first data hub module through the allocated time slices to transmit the service data to be transmitted of the corresponding path, so that the USB host device and the USB slave device can implement the corresponding services through the received data; and in the process of data transmission, multiple USB paths are aggregated to improve the transmission efficiency of the service data, thereby improving the efficiency of implementing services between the USB host device and the USB slave device. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 1 is a schematic diagram of the architecture of a service data transmission system 100 provided in an embodiment of the present application;

[0030] Figure 2 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0031] Figure 3 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0032] Figure 44 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0033] Figure 5 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0034] Figure 6 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0035] Figure 7 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0036] Figure 8 4 is a schematic structural diagram of a service data transmission device 400 provided in an embodiment of the present application;

[0037] Figure 9 This is a flow chart of the service data transmission method provided by an embodiment of the present application;

[0038] Figure 10 This is a schematic diagram of the structure of a service data transmission device provided in an embodiment of the present application;

[0039] Figure 11 It is a structural diagram of the service data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0041] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0042] In the following description, the terms "first / second" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0044] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0045] 1) USB: It is an external bus standard used to regulate the connection and communication between computers and external devices. It is an interface technology used in the PC field.

[0046] 2) USB devices: divided into USB host devices (HOST) and USB slave devices (SLAVE). Data transmission can only be achieved when a USB HOST is connected to a USB SLAVE.

[0047] 3) Host: refers to the main body part of the computer excluding the input and output devices. It is also the control box used to place the motherboard and other major components. It usually includes the CPU, memory, motherboard, optical drive, power supply, and other input and output controllers and interfaces. It is a terminal device for sending and receiving information.

[0048] 4) Human Interface Device (HID): A device that interacts directly with humans, such as a keyboard, mouse, and joystick. HID devices do not necessarily have to have a human-machine interface. Any device that meets the HID category specifications is a HID device.

[0049] 5) HID keyboard protocol: It is a communication method in the HID protocol. HID devices can only transmit keyboard data in one direction, that is, the HID device acts as a USB slave device to transmit keyboard data (such as payment code) to the USB host device.

[0050] 6) Serial Communication: Serial ports send and receive bytes bit by bit. Serial communication hardware has transmit (TX) and receive (RX) signals, allowing data to be sent on one line while being received on another.

[0051] 7) USB Communication Device Class (CDC) protocol: The CDC class is a USB subclass defined by the USB organization specifically for use with various communication devices (such as telecommunications equipment and medium-speed network communication equipment).

[0052] 8) USB On-The-Go (OTG): This technology is primarily used to connect and exchange data between various devices or mobile devices (such as mobile phones and consumer electronics). It includes various USB interfaces, including Type-A, Type-B, Type-C, and other evolved interfaces. OTG technology enables data transfer between devices without a host computer.

[0053] 9) Hub: It is a multi-port repeater. When the HUB is the central device, even if a line in the network fails, it will not affect the operation of other lines. It is used to expand the USB interface of the computer. HUBs are divided into passive HUBs, active HUBs and smart HUBs. Passive HUBs do not process the signal in any way, do not extend the transmission distance of the medium, and have a certain impact on the signal. Active HUBs can amplify or regenerate the signal, thus extending the effective transmission distance between the two hosts. In addition to all the functions of an active HUB, a smart HUB also has network management and routing functions. In a smart HUB network, not every machine can receive the signal. Only the computer with the same address port as the destination address of the signal can receive it. Some smart HUBs can choose the best path by themselves and can manage the network well.

[0054] 10) Time-Division Multiplexing (TDM): This technology uses the same physical connection to transmit different signals at different times, achieving multi-channel transmission. TDM uses time as the signal segmentation parameter, so the signals must not overlap on the time axis. TDM divides the time available for channel transmission into several time slices (or time slots) and allocates these time slots to each signal source.

[0055] 11) USB to Serial: Converts a computer's USB port to a universal serial port. Using a USB to Serial device converts a traditional serial device into a plug-and-play USB device. It supports hot-swapping, plug-and-play, and fast transfer speeds.

[0056] 12) PL2303: It is a USB to serial port bridge chip that can be used as a USB / RS232 bidirectional converter. On the one hand, it receives USB data from the host and converts it into RS232 information stream format and sends it to the peripheral device; on the other hand, it receives data from the RS232 peripheral device, converts it into USB data format and sends it back to the host.

[0057] 13) CH9328: This is a serial-to-HID keyboard chip, recognized by computers as a standard USB HID keyboard device. The CH9328 is used for one-way data transmission. It receives data (such as ASCII code) from the serial port and packages it into standard keyboard codes according to the HID keyboard device specification for transmission over the USB interface.

[0058] 14) Unidirectional path and bidirectional path: The former is a data transmission path from a USB slave device to a USB host device, and the latter is a bidirectional data transmission path from a USB slave device to a USB host device; it does not specifically refer to certain hardware in the service data transmission device, but is a data transmission channel carried by the circuit formed by the modules and electrical connections in the service data transmission device. The unidirectional path and the bidirectional path each multiplex the circuit through the allocated time slice to transmit the service data to be transmitted in the corresponding path.

[0059] Related technologies typically use software or hardware to emulate a USB slave device as a HID device, transmitting unidirectional service data via the HID protocol. This allows for driverless reporting of unidirectional service data from the USB slave device to the USB host without modifying the USB host software. There are three ways for a USB slave device to achieve bidirectional communication (i.e., send bidirectional service data) with a USB host: using a physical serial port (e.g., RS-232); emulating a serial port using the USB CDC protocol; or using hardware USB emulation of a serial port. Simultaneously implementing both of these communication methods (unidirectional and bidirectional) requires two cables.

[0060] During the implementation of the embodiments of this application, it was found that the related technologies have the following technical problems:

[0061] 1) Using the USB CDC protocol to emulate USB serial communication can lead to software compatibility issues. Furthermore, most platforms only have a single USB OTG port. If used as a USB host to connect to a peripheral, it cannot connect as a USB slave device to the USB host port of a USB host and simulate serial communication using the USB CDC protocol. Therefore, this protocol is not widely applicable to multiple hardware system platforms (SoC platforms) and is limited to platforms with multiple USB ports.

[0062] 2) Most existing devices do not have physical serial ports (such as RS232), and the hardware universality is poor.

[0063] 3) If you want to implement both the HID keyboard protocol and the serial port bidirectional communication at the same time, you need two cables, which is costly, inconvenient to use, and has a poor user experience.

[0064] In order to solve the above technical problems, the embodiments of the present application provide a service data transmission device, method and system, which can improve the transmission efficiency of one-way service data and two-way service data. The following describes an exemplary application of the service data transmission system provided by the embodiments of the present application, see Figure 1 , Figure 1 1 is a schematic diagram of the architecture of a service data transmission system 100 provided in an embodiment of the present application, wherein the service data transmission system 100 includes: a USB slave device 200, a USB host device 300 and a service data transmission apparatus 400, which will be described separately.

[0065] The USB slave device 200 is configured to send basic service data and first extended service data to the service data transmission apparatus 400 ; and is also configured to receive second extended service data sent by the service data transmission apparatus 400 .

[0066] The USB host device 300 is configured to send the second extended service data to the service data transmission device 400; and is also configured to receive the basic service data and the first extended service data sent by the service data transmission device 400;

[0067] The service data transmission device 400 is used to transmit the basic service data and the first extended service data sent by the USB slave device 200 to the USB host device 300 ; and is also used to transmit the second extended service data sent by the USB host device 300 to the USB slave device 200 .

[0068] For example, the basic service data corresponds to the first sub-service within a service, while the first extended service data and the second extended service data correspond to the second sub-service within the service; the second sub-service is an extension of the first sub-service. In other words, the basic service data is the data required to implement the necessary functions (or required functions) of the service, while the first extended service data and the second extended service data are the data required to implement the extended functions (or optional functions) of the service. The first and second sub-services are described below with examples.

[0069] The embodiments of the present application can be applied to a variety of scenarios, such as face-swiping payment scenarios or member registration scenarios.

[0070] Taking face-scanning payment as an example, face-scanning payment replaces traditional passwords by scanning the user's face during the payment process. This eliminates the need for users to perform specific actions and can intercept attacks such as photos, masks, and videos. This optimizes the payment process, facilitates daily shopping for users, improves transaction efficiency for merchants, and drives the development of the retail industry. The USB slave device 200 can be a face-scanning device, and the USB host device 300 can be a POS terminal.

[0071] As an example of the first sub-service, the face-scanning device collects the user's facial information to generate a corresponding payment code (i.e., basic service data), and sends the payment code to the POS machine through the service data transmission device 400; the POS machine completes the deduction based on the payment code.

[0072] As an example of the second sub-service, the face-scanning device can search for the corresponding user's membership information (i.e., the first extended service data) based on the user's facial information, and send the membership information to the POS machine through the service data transmission device 400; the POS machine deducts the amount of the membership discount based on the membership information and payment code.

[0073] As an example of the second sub-service, after the POS machine completes the deduction, it generates notification information of the completion of the deduction (i.e., the second extended service data), and sends the notification information to the face-scanning device through the service data transmission device 400; the face-scanning device presents the notification information in the human-computer interaction interface.

[0074] As an example of the second sub-service, the POS machine sends advertising information (i.e., second extended service data) to the face-scanning device through the service data transmission device 400; the face-scanning device presents the advertising information in the human-computer interaction interface.

[0075] Taking the member registration scenario as an example, the USB slave device 200 can be a biometric acquisition device (for example, a fingerprint acquisition device, a pupil acquisition device, a voice acquisition device or a biometric acquisition device, etc.), and the USB host device 300 can be a member entry device.

[0076] As an example of the first sub-service, the biometric collection device collects the user's biometrics (such as fingerprints, face, voice or pupils, etc.) to generate corresponding biometric information codes (i.e., basic service data), and sends the biometric information codes to the member entry device through the service data transmission device 400; the member entry device completes member entry based on the biometric information codes.

[0077] As an example of the second sub-service, the biometric collection device searches for membership information corresponding to the user's facial information in the database. When the database already contains membership information corresponding to the user's facial information, it generates prompt information (i.e., first extended service data) to indicate that the user has registered, and sends the prompt information to the member entry device through the service data transmission device 400; the member entry device presents the prompt information in the human-computer interaction interface.

[0078] As an example of the second sub-service, after the member entry device completes the member entry, it generates notification information of the completion of the member entry (i.e., the second extended service data), and sends the notification information to the biometric collection device through the service data transmission device 400; the biometric collection device presents the notification information in the human-computer interaction interface.

[0079] Next, let’s explain Figure 1 The structure of the service data transmission device 400.

[0080] See also Figure 2 , Figure 2 4 is a schematic diagram of the structure of a service data transmission device 400 provided in an embodiment of the present application. Figure 2 The service data transmission device 400 shown includes a first data conversion module 410 and a first data hub module 420 .

[0081] In some embodiments, the first data conversion module 410 is electrically connected to the USB slave device 200 and the first data hub module 420, respectively, and is used to receive the first serial port service data to be transmitted in the unidirectional path and the second serial port service data to be transmitted in the bidirectional path, and receive the third USB service data to be transmitted in the bidirectional path through the first data hub module 420; the first data hub module 420 is electrically connected to the USB host device 300 and the first data conversion module 410, respectively, and is used to: in the corresponding time slice of the unidirectional path, convert the first serial port service data into first USB service data through the first data conversion module 410, and transmit it to the USB host device 300; in the corresponding time slice of the bidirectional path, convert the second serial port service data into second USB service data through the first data conversion module 410, and transmit it to the USB host device 300; and convert the third USB service data into third serial port service data through the first data conversion module 410, and transmit it to the USB slave device 200.

[0082] Here, the electrical connection in this article can be connected through metal wires (such as copper wires or solder wires in a printed circuit board (PCB)), or through USB transmission cables (such as standard USB2.0 cables, standard USB3.0 cables, standard USB3.1 cables, or USB evolution standard cables).

[0083] Here, the service data transmission device 400 is used to carry the unidirectional path and bidirectional path of the service between the USB slave device 200 and the USB host device 300; the first serial port service data and the second serial port service data come from the USB slave device 200, and the third USB service data comes from the USB host device 300.

[0084] Here, as Figure 2As shown, the unidirectional path is a data transmission channel for transmitting the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the unidirectional path and the bidirectional path are data transmission channels carried by the first data hub module 420 and the first data conversion module 410 and the circuit formed by the electrical connection.

[0085] As an example, the first data hub module 420 may be a USB HUB chip.

[0086] In some embodiments, the first serial port service data corresponds to the first sub-service in the service, and the second serial port service data and the third USB service data correspond to the second sub-service in the service; of course, the first USB service data corresponding to the first serial port service data also corresponds to the first sub-service in the service; the second USB service data corresponding to the second serial port service data and the third serial port service data corresponding to the third USB service data also correspond to the second sub-service in the service.

[0087] Here, the second sub-service is an extended service of the first sub-service.

[0088] Taking the face-scanning payment scenario as an example, the first sub-service may be a service in which the POS machine completes the deduction based on the first serial port service data corresponding to the payment code sent by the face-scanning device.

[0089] The second sub-service can be a service in which, after the POS machine completes the deduction, it generates a notification message indicating the completion of the deduction and sends third USB service data corresponding to the notification message to the face-scanning device; and the face-scanning device presents the notification message in the human-computer interaction interface based on the third USB service data.

[0090] The second sub-service can also be a process in which the face-scanning device searches for the corresponding user's membership information based on the collected user's facial information, and sends the second serial port service data of the corresponding membership information to the POS machine; the POS machine deducts the amount of the membership discount based on the second serial port service data and the first serial port service data of the corresponding payment code.

[0091] The second sub-service can also be that the POS machine sends third USB service data corresponding to the advertising information to the face recognition device, and the face recognition device presents the advertising information in the human-computer interaction interface based on the third USB service data.

[0092] The embodiment of the present application transmits unidirectional service data and bidirectional service data through two different paths respectively, so that the USB host device and the USB slave device can implement basic services (i.e., the first sub-service) and extended services (i.e., the second sub-service) through the received data.

[0093] The strategy of allocating time slices by the first data hub module 420 is described in detail below.

[0094] In some embodiments, the first data hub module 420 is further configured to allocate interleaved and equal-length time slices to the unidirectional path and the bidirectional path.

[0095] As an example, the unidirectional path and the bidirectional path alternately transmit data at fixed time intervals.

[0096] For example, the unidirectional path stops transmitting data after 5ms, then the bidirectional path starts transmitting data and stops transmitting data after 5ms, then the unidirectional path starts transmitting data and stops transmitting data after 5ms, and so on.

[0097] In other embodiments, the first data hub module 420 is further used to first allocate time slices to the unidirectional path, and when the amount of data transmitted by the unidirectional path exceeds a quantity threshold, or when the completion ratio of the amount of data transmitted by the unidirectional path exceeds a ratio threshold, allocate crossing and equal-length time slices to the unidirectional path and the bidirectional path.

[0098] As an example, the quantity threshold can be a default value or a user-set value. For example, when the quantity threshold is set to a maximum value (i.e., a value of the amount of data that cannot be reached in a unidirectional path determined based on a priori quantities), it is ensured that the data in the unidirectional path has been transmitted before the data in the bidirectional path is transmitted. This ensures the completion of the basic service and improves the completion time of the basic service. The ratio threshold can be a default value or a user-set value. For example, when the ratio threshold is set to 100%, it ensures that the data in the unidirectional path has been transmitted before the data in the bidirectional path is transmitted. This ensures the completion of the basic service and improves the completion time of the basic service.

[0099] In some other embodiments, the first data hub module 420 is further configured to allocate one or more time slices of equal length to the first receiving path, and to allocate interleaved and equal time slices to the first receiving path and the second receiving path when the amount of data transmitted by the first receiving path exceeds a quantity threshold, or when the completion ratio of the amount of data transmitted by the first receiving path exceeds a ratio threshold.

[0100] Here, the first receiving path is the path where the corresponding data to be transmitted first appears among the unidirectional path and the bidirectional path; the last receiving path is the path where the corresponding data to be transmitted last appears among the unidirectional path and the bidirectional path.

[0101] As an example, the quantity threshold can be a default value or a user-set value. For example, when the quantity threshold is set to a maximum value (i.e., a value that is unattainable in the unidirectional and bidirectional paths based on a priori data quantity), data in the first received path can be guaranteed to be transmitted before data in the second received path is transmitted. This ensures the completion rate of the service corresponding to the data in the first received path and improves the completion time of the service corresponding to the data in the first received path. The ratio threshold can be a default value or a user-set value. For example, when the ratio threshold is set to 100%, data in the first received path can be guaranteed to be transmitted before data in the second received path is transmitted. This ensures the completion rate of the service corresponding to the data in the first received path and improves the completion time of the service corresponding to the data in the first received path.

[0102] In some further embodiments, the first data hub module 420 is further configured to allocate corresponding time slices to the unidirectional path and the bidirectional path according to the amount of data to be transmitted on the unidirectional path and the bidirectional path.

[0103] As an example, the first ratio and the second ratio are equal. The first ratio is the ratio of the number of time slices corresponding to a unidirectional path to the number of equally long time slices corresponding to a bidirectional path, and the second ratio is the ratio of the amount of data to be transmitted on the unidirectional and bidirectional paths. In this way, by assigning time slices to the unidirectional and bidirectional paths that match the amount of data to be transmitted, paths with larger amounts of data to be transmitted can be allocated more time slices, thereby ensuring data transmission efficiency.

[0104] During data transmission, the present embodiment aggregates multiple USB paths into one. Time slices are allocated to the unidirectional path for transmitting unidirectional service data and the bidirectional path for transmitting bidirectional service data in various ways. The data streams of the two paths are dynamically transmitted, improving the transmission efficiency of both unidirectional and bidirectional service data, thereby increasing the speed at which USB host and slave devices can provide services. Furthermore, a single cable can be used to implement both the HID keyboard protocol and the serial port bidirectional communication, reducing costs, increasing data transmission speed, and enhancing the user experience.

[0105] In some embodiments, see Figure 3 , Figure 3 This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 2 , Figure 3 The first data conversion module 410 includes: a first data conversion submodule 411 and a second data conversion submodule 412.

[0106] In some embodiments, the first data conversion submodule 411 is electrically connected to the USB slave device 200 and the first data hub module 420, respectively. The first data conversion submodule 411 includes a first drive information input interface; the first data conversion submodule 411 is used to convert the second serial port service data from the USB slave device 200 into second USB service data in a data packet format when receiving the first drive information through the first drive information input interface, and send it to the first data hub module 420; when receiving the second drive information through the first drive information input interface, the third USB service data from the first data hub module 420 is decoded to convert it into third serial port service data, and send it to the USB slave device 200; the second data conversion submodule 412 is electrically connected to the USB slave device 200 and the first data hub module 420, respectively; the second data conversion submodule 412 is used to convert the first serial port service data into first USB service data in a data packet format according to the humanized interface device HID keyboard protocol, and send it to the first data hub module 420.

[0107] Here, as Figure 3 As shown, the unidirectional path is a data transmission channel for transmitting the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the bidirectional path is a data transmission channel carried by the first data hub module 420 and the first data conversion submodule 411 and the circuit formed by the electrical connection; the unidirectional path is a data transmission channel carried by the first data hub module 420 and the second data conversion submodule 412 and the circuit formed by the electrical connection.

[0108] As an example, the first data conversion submodule 411 may be a PL2303 chip, and the second data conversion submodule 412 may be a CH9328 chip. The PL2303 chip needs to receive driver information during operation, while the CH9328 chip does not. Therefore, the PL2303 chip needs to receive first driver information before converting the second serial port service data into second USB service data. The first driver information may be provided by the USB slave device 200 or the USB host device 300. The PL2303 chip needs to receive second driver information before converting the third USB service data into third serial port service data. The second driver information may be provided by the USB slave device 200 or the USB host device 300.

[0109] For example, the service data transmission device 400 can be integrated into the USB slave device 200 (eg Figure 11), when the service data transmission device 400 is integrated into the USB slave device 200, the first data conversion submodule 411 and the second data conversion submodule 412 can directly receive the serial port service data directly sent by the SOC platform of the USB slave device 200 without going through the USB interface, and no additional USB-to-serial port chip is required for USB data transfer. In this way, not only the number of chips and costs can be saved, but also the data transmission speed can be improved.

[0110] In some embodiments, see Figure 4 , Figure 4 This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 2 , Figure 4 The intermediate service data transmission device 400 further includes: a first USB data interface 430 .

[0111] In some embodiments, the first USB data interface 430 is electrically connected to the USB host device 300 and the first data hub module 420 respectively; the first USB data interface 430 is used to send the first USB service data and the second USB service data sent by the first data hub module 420 to the USB host device 300; and send the third USB service data sent by the USB host device 300 to the first data hub module 420.

[0112] Here, as Figure 4 As shown, the unidirectional path is a data transmission channel for transmitting the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the unidirectional path and the bidirectional path are data transmission channels carried by the first data hub module 420, the first data conversion module 410, the first USB data interface 430 and the circuit formed by the electrical connection.

[0113] As an example, the first USB data interface 430 can be a USB slot or a USB male plug, and the USB host device 300 can be connected to the first USB data interface 430 through an ordinary USB cable (such as a standard USB2.0 cable or a standard USB3.0 cable, etc.). In this way, the service data transmission device 400 can receive the third USB service data sent by the USB host device 300 through the first USB data interface 430, and the USB host device 300 can receive the first USB service data and the second USB service data sent by the service data transmission device 400.

[0114] In some embodiments, see Figure 5 , Figure 5This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 2 , Figure 5 The intermediate service data transmission device 400 further includes: a second data conversion module 440 and a second data hub module 450 .

[0115] In some embodiments, the second data hub module 450 is electrically connected to the USB slave device 200 and the second data conversion module 440, respectively, and the second data conversion module 440 is electrically connected to the first data conversion module 410; the second data hub module 450 is used to: in the corresponding time slice of the unidirectional path, convert the fourth USB service data from the USB slave device 200 into first serial port service data through the second data conversion module 440, and transmit it to the first data conversion module 410; in the time slice corresponding to the bidirectional path, convert the fifth USB service data from the USB slave device 200 into second serial port service data through the second data conversion module 440, and transmit it to the first data conversion module 410; convert the third serial port service data from the first data conversion module 410 into sixth USB service data through the second data conversion module 440, and transmit it to the USB slave device 200.

[0116] Here, as Figure 5 As shown, the unidirectional path is a data transmission channel for transmitting the fourth USB service data, the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the fifth USB service data, the sixth USB service data, the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the unidirectional path and the bidirectional path are data transmission channels carried by the first data hub module 420, the first data conversion module 410, the second data conversion module 440 and the second data hub module 450 and the circuit formed by the electrical connection.

[0117] Here, the second data hub module 450 can adopt the same slicing strategy as the first data hub module 420, that is, the data transmission delay can be ignored during the data transmission process, and the same data transmission timing can be adopted to make the data transmission synchronous. The slicing strategy of the second data hub module 450 will not be repeated here.

[0118] As an example, the second data hub module 450 may be a USB HUB chip.

[0119] In the embodiment of the present application, during the data transmission process, multiple USB paths are aggregated into one through two data hub modules, and time slices with the same timing are assigned to the unidirectional path for transmitting unidirectional service data and the bidirectional path for transmitting bidirectional service data, so that the data streams of the two paths can be synchronized, thereby improving the transmission efficiency of the unidirectional service data and the bidirectional service data, and further improving the speed at which the USB host device and the USB slave device provide services.

[0120] In some embodiments, see Figure 6 , Figure 6 This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 5 , Figure 6 The second data conversion module includes: a third data conversion submodule 441 and a fourth data conversion submodule 442 .

[0121] In some embodiments, the third data conversion submodule 441 is electrically connected to the USB slave device 200 and the first data conversion module 410, respectively, and the third data conversion submodule 441 includes a second drive information input interface; the third data conversion submodule 441 is used to decode the fifth USB service data to convert it into second serial port service data when the third drive information is received through the second drive information input interface, and send it to the first data conversion module 410; when the fourth drive information is received through the second drive information input interface, the third serial port service data is converted into sixth USB service data in a data packet format, and sent to the second data hub module; the fourth data conversion submodule 442 is electrically connected to the second data hub module and the first data conversion module 410, respectively, and the fourth data conversion submodule 442 includes a third drive information input interface; the fourth data conversion submodule 442 is used to decode the fourth USB service data to convert it into first serial port service data when the fifth drive information is received through the third drive information input interface, and send it to the first data conversion module 410.

[0122] Here, as Figure 6As shown, the unidirectional path is a data transmission channel for transmitting the fourth USB service data, the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the fifth USB service data, the sixth USB service data, the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the bidirectional path is a data transmission channel carried by the second data hub module 450, the third data conversion submodule 441, the first data conversion module 410 and the first data hub module 420 and the circuit formed by the electrical connection; the unidirectional path is a data transmission channel carried by the second data hub module 450, the fourth data conversion submodule 442, the first data conversion module 410 and the first data hub module 420 and the circuit formed by the electrical connection.

[0123] As an example, the third data conversion submodule 441 and the fourth data conversion submodule 442 may be PL2303 chips, which require receiving driver information during operation. Therefore, the third data conversion submodule 441 needs to receive third driver information before converting the fifth USB service data into the second serial port service data. The third driver information may be provided by the USB slave device 200 or the USB host device 300. The third data conversion submodule 441 needs to receive fourth driver information before converting the third serial port service data into the sixth USB service data. The fourth driver information may be provided by the USB slave device 200 or the USB host device 300. The fourth data conversion submodule 442 needs to receive fifth driver information before converting the fourth USB service data into the first serial port service data. The fifth driver information may be provided by the USB slave device 200 or the USB host device 300.

[0124] The embodiment of the present application can communicate with the USB slave device directly through USB data, directly convert the USB data sent by the USB slave device into serial port data through the third data conversion sub-module and the fourth data conversion sub-module, and convert the serial port data sent by the first data conversion module into USB data for transmission, which can improve the diversity of sending and receiving data to the USB slave device and improve the universality of the service data transmission device.

[0125] In some embodiments, see Figure 7 , Figure 7 This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 6 , Figure 7 The first data conversion module 410 includes a first data conversion submodule 411 and a second data conversion submodule 412 .

[0126] In some embodiments, the first data conversion submodule 411 is electrically connected to the third data conversion submodule 441 and the first data hub module 420, respectively. The first data conversion submodule 411 includes a first drive information input interface. The first data conversion submodule 411 is configured to, upon receiving first drive information through the first drive information input interface, convert second serial port service data from the third data conversion submodule 441 into second USB service data in a data packet format and send the data to the first data hub module 420. Upon receiving second drive information through the first drive information input interface, the first data conversion submodule 411 decodes the third USB service data from the first data hub module 420 to convert the data into third serial port service data and send the data to the third data conversion submodule 441. The second data conversion submodule 412 is electrically connected to the fourth data conversion submodule 442 and the first data hub module 420, respectively. The second data conversion submodule 412 is configured to, according to the HID keyboard protocol, convert the first serial port service data from the fourth data conversion submodule 442 into first USB service data in a data packet format and send the data to the first data hub module 420.

[0127] Here, as Figure 7 As shown, the unidirectional path is a data transmission channel for transmitting the fourth USB service data, the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the fifth USB service data, the sixth USB service data, the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the bidirectional path is a data transmission channel carried by the second data hub module 450, the third data conversion sub-module 441, the first data conversion sub-module 411 and the first data hub module 420 and the circuit formed by the electrical connection; the unidirectional path is a data transmission channel carried by the second data hub module 450, the fourth data conversion sub-module 442, the second data conversion sub-module 412 and the first data hub module 420 and the circuit formed by the electrical connection.

[0128] As an example, the first data conversion submodule 411 may be a PL2303 chip, and the second data conversion submodule 412 may be a CH9328 chip. The PL2303 chip needs to receive driver information during operation, while the CH9328 chip does not. Therefore, the PL2303 chip needs to receive first driver information before converting the second serial port service data into second USB service data. The first driver information may be provided by the USB slave device 200 or the USB host device 300. The PL2303 chip needs to receive second driver information before converting the third USB service data into third serial port service data. The second driver information may be provided by the USB slave device 200 or the USB host device 300.

[0129] The embodiment of the present application realizes the mutual conversion between USB data and serial port data through the first data conversion submodule 411 and the third data conversion submodule 441, which can improve the accuracy of data transmission between the USB host device and the USB slave device, thereby ensuring the successful implementation of the second sub-service; and realizes the mutual conversion between USB data and serial port data through the second data conversion submodule 412 and the fourth data conversion submodule 442, which can improve the accuracy of data received by the USB host device, thereby ensuring the successful implementation of the first sub-service.

[0130] In some embodiments, see Figure 8 , Figure 8 This is a schematic diagram of the structure of the service data transmission device 400 provided in the embodiment of the present application, based on Figure 5 , Figure 8 The intermediate service data transmission device 400 includes: a second USB data interface 460 .

[0131] In some embodiments, the second USB data interface 460 is electrically connected to the USB slave device 200 and the second data hub module respectively; the second USB data interface 460 is used to send the fourth USB service data and the fifth USB service data sent by the USB slave device 200 to the second data hub module; and to send the sixth USB service data sent by the second data hub module to the USB slave device 200.

[0132] Here, as Figure 8As shown, the unidirectional path is a data transmission channel for transmitting the fourth USB service data, the first serial port service data and the first USB service data; the bidirectional path is a data transmission channel for transmitting the fifth USB service data, the sixth USB service data, the second serial port service data, the second USB service data, the third USB service data, and the third serial port service data; the unidirectional path and the bidirectional path are data transmission channels carried by the second USB data interface 460, the first data hub module 420, the first data conversion module 410, the second data conversion module 440 and the second data hub module 450 and the circuit formed by the electrical connection.

[0133] Here, the second USB data interface 460 may be a USB slot or a USB male plug.

[0134] In some embodiments, the service data transmission device 400 may include a first USB data interface 430 and a second USB data interface 460. In other words, the service data transmission device 400 may be integrated into a USB cable (eg, Figure 10 ), when the USB host device and the USB slave device are connected through the USB cable, the software layer of the USB host device is completely transparent to the hardware circuit, and there is no need to make changes to the underlying driver; the USB slave device only needs to adapt to the corresponding serial port communication to achieve unidirectional and bidirectional communication paths, thereby solving the technical problem in the related technology that "most existing devices do not have physical serial ports and the hardware universality is poor."

[0135] Here, when the service data transmission device 400 includes both the first USB data interface 430 and the second USB data interface 460 , the first USB data interface 430 may be electrically connected to the first data hub module 420 via a USB cable.

[0136] It should be noted that Figure 1 The basic service data in the service data transmission system 100 includes at least one of the following: fourth USB service data; first serial port service data; first USB service data; first extended service data includes at least one of the following: fifth USB service data; second serial port service data; second USB service data; second extended service data includes at least one of the following: sixth USB service data; third serial port service data; third USB service data. The basic service data is the aforementioned unidirectional service data; the first extended service data and the second extended service data are the aforementioned bidirectional service data.

[0137] In some embodiments, see Figure 9 , Figure 9It is a flow chart of the service data transmission method provided in an embodiment of the present application. The service data transmission method provided in an embodiment of the present application is applied to a service data transmission device.

[0138] In step S101 , first serial port service data to be transmitted in a unidirectional path and second serial port service data to be transmitted in a bidirectional path are received by a first data conversion module.

[0139] In step S102, third USB service data to be transmitted in the bidirectional path is received by the first data hub module.

[0140] In step S103 , in a corresponding time slice of the unidirectional path, the first serial port service data is converted into first USB service data by the first data conversion module, and is transmitted to the USB host device by the first data hub module.

[0141] In step S104 , in the time slice corresponding to the bidirectional path, the second serial port service data is converted into second USB service data by the first data conversion module, and is transmitted to the USB host device by the first data hub module.

[0142] In step S105 , the third USB service data is converted into third serial port service data by the first data conversion module, and is transmitted to the USB slave device through the first data hub module.

[0143] In some embodiments, the first data conversion module includes: a first data conversion sub-module and a second data conversion sub-module; the first data conversion sub-module includes a first drive information input interface; when the first drive information is received through the first drive information input interface, the second serial port service data from the USB slave device is converted into second USB service data in a data packet format through the first data conversion sub-module, and sent to the first data hub module; when the second drive information is received through the first drive information input interface, the third USB service data from the first data hub module is decoded to be converted into third serial port service data, and sent to the USB slave device; through the second data conversion sub-module, according to the humanized interface device HID keyboard protocol, the first serial port service data is converted into first USB service data in a data packet format, and sent to the first data hub module.

[0144] In some embodiments, the service data transmission device also includes: a first USB data interface; through the first USB data interface, the first USB service data and the second USB service data sent by the first data hub module are sent to the USB host device, and the third USB service data sent by the USB host device is sent to the first data hub module.

[0145] In some embodiments, the service data transmission device also includes: a second data conversion module and a second data hub module; in the corresponding time slice of the unidirectional path, the fourth USB service data from the USB slave device is converted into first serial port service data through the second data conversion module, and transmitted to the first data conversion module through the second data hub module; in the time slice corresponding to the bidirectional path, the fifth USB service data from the USB slave device is converted into second serial port service data through the second data conversion module, and transmitted to the first data conversion module through the second data hub module; the third serial port service data from the first data conversion module is converted into sixth USB service data through the second data conversion module, and transmitted to the USB slave device through the second data hub module.

[0146] In some embodiments, the second data conversion module includes: a third data conversion submodule and a fourth data conversion submodule; the third data conversion submodule includes a second drive information input interface, and the fourth data conversion submodule includes a third drive information input interface; when the third drive information is received through the second drive information input interface, the fifth USB service data is decoded by the third data conversion submodule to convert it into second serial port service data, and sent to the first data conversion module; when the fourth drive information is received through the second drive information input interface, the third serial port service data is converted into sixth USB service data in data packet format by the third data conversion submodule, and sent to the second data concentrator module; when the fifth drive information is received through the third drive information input interface, the fourth USB service data is decoded by the fourth data conversion submodule to convert it into first serial port service data, and sent to the first data conversion module.

[0147] In some embodiments, the first data conversion module includes: a first data conversion submodule and a second data conversion submodule; the first data conversion submodule includes a first drive information input interface; when the first drive information is received through the first drive information input interface, the second serial port service data from the third data conversion submodule is converted into second USB service data in data packet format through the first data conversion submodule, and sent to the first data hub module; when the second drive information is received through the first drive information input interface, the third USB service data from the first data hub module is decoded through the first data conversion submodule to convert it into third serial port service data, and sent to the third data conversion submodule; through the second data conversion submodule, according to the HID keyboard protocol, the first serial port service data from the fourth data conversion submodule is converted into first USB service data in data packet format, and sent to the first data hub module.

[0148] In some embodiments, the service data transmission device also includes: a second USB data interface; through the second USB data interface, the fourth USB service data and the fifth USB service data sent by the USB slave device are sent to the second data hub module, and the sixth USB service data sent by the second data hub module is sent to the USB slave device.

[0149] As an example, first serial port service data (such as a payment code) is received from a USB slave device, and the first serial port service data is sent to a second data conversion sub-module; through the second data conversion sub-module, the first serial port service data is converted into first USB service data in a data packet format according to the HID keyboard protocol, and sent to the first data hub module; through the first data hub module, the first USB service data is sent to the USB slave device, so that the USB slave device parses the first USB service data to complete the first sub-service.

[0150] As an example, receiving first serial port service data from a USB slave device and sending the first serial port service data to a second data conversion sub-module includes: receiving, through a fourth data conversion sub-module, fourth USB service data sent by the USB slave device through the second data hub module, and when the fourth data conversion sub-module receives fifth drive information sent by the USB slave device, decoding and converting the fourth USB service data into first serial port service data, and sending it to the second data conversion sub-module.

[0151] As an example, the method also includes: receiving second serial port service data from a USB slave device, and sending the second serial port service data (such as membership information) to a first data conversion submodule; through the first data conversion submodule, converting the second serial port service data into second USB service data in a data packet format, and sending it to the USB host device, so that the USB slave device parses the second USB service data to complete the second subservice.

[0152] As an example, receiving the second serial port service data from the USB slave device and sending the second serial port service data to the first data conversion sub-module includes: receiving the fifth USB service data sent by the USB slave device through the second data hub module through the third data conversion sub-module; when the third data conversion sub-module receives the third drive information sent by the USB slave device, decoding the fifth USB service data into the second serial port service data, and sending it to the first data conversion sub-module.

[0153] As an example, the method also includes: receiving third USB service data (such as advertising information) from the USB host device through the first data conversion sub-module, decoding the third USB service data into third serial port service data, and sending it to the USB slave device, so that the USB slave device completes the second sub-service according to the third serial port service data.

[0154] As an example, receiving the third USB service data from the USB host device includes: receiving the third USB service data sent by the USB host device through the first data hub module.

[0155] As an example, decoding and converting the third USB service data into third serial port service data includes: when the first data conversion submodule receives the second drive information sent by the USU master device or the USB slave device, decoding and converting the third USB service data into third serial port service data.

[0156] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.

[0157] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0158] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a hypertext markup language document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0159] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0160] Below, the service data transmission device provided by the embodiment of the present application is explained by taking the USB slave device being a face recognition device and the USB host device being a POS machine as an example.

[0161] The service data transmission device provided in the embodiment of the present application can be applied to the USB Cable design. By connecting the face recognition device and the USB HOST port of the desktop POS machine (i.e., the above-mentioned POS machine) through the Cable, it can achieve: transmitting the payment code according to the HID keyboard protocol; and performing serial port bidirectional data communication through the Cable.

[0162] The service data transmission device provided in the embodiment of the present application can also be integrated into a face-scanning device, which is presented to the outside in the physical form of a standard USB interface. The interface is connected to the USB HOST port of the desktop POS through a standard USB transmission cable, which can realize: transmitting the payment code according to the HID keyboard protocol; and performing serial port two-way data communication.

[0163] The following describes a specific implementation method of applying the service data transmission device provided in the embodiment of the present application to a USB Cable. Figure 10 , Figure 10 It is a structural diagram of the service data transmission device provided in an embodiment of the present application.

[0164] Figure 10 In the figure, VBUS is the power line; USB US (Upstream) is the upstream data; USB DS (Downstream) is the downstream data; USB HUB and HSB HUB1 are hubs; USB APlug1 and USB APlug2 are USB male plugs.

[0165] Figure 10 The USB HUB1 is equivalent to the second data hub module 450 mentioned above; the USB HUB is equivalent to the first data hub module 420 mentioned above; the USB to serial port PL2303 (1) is equivalent to the third data conversion submodule 441 mentioned above; the USB to serial port PL2303 (2) is equivalent to the fourth data conversion submodule 442 mentioned above; the USB to serial port PL2303 (3) is equivalent to the first data conversion submodule 411 mentioned above; the USB HID CH9328 is equivalent to the second data conversion submodule 412 mentioned above; the USBAPlug1 is equivalent to the second USB data interface 460 mentioned above; and the USB APlug2 is equivalent to the first USB data interface 430 mentioned above.

[0166] The following describes a specific implementation method of integrating the service data transmission device provided in the embodiment of the present application into the face recognition device. Figure 11 , Figure 11 is a structural diagram of a service data transmission device provided in an embodiment of the present application, Figure 11 The circuit is integrated on the motherboard of the face recognition device.

[0167] Figure 11In the figure, SOC is the main system platform of the face recognition device; USB US (Upstream) is the upstream data; USB DS (Downstream) is the downstream data; USB HUB is the hub; USB A Socket is the USB interface.

[0168] Figure 11 The USB HUB is equivalent to the first data hub module 420; the USB to serial port PL2303 is equivalent to the first data conversion submodule 411; the USB HID CH9328 is equivalent to the second data conversion submodule 412; and the USB A Socket is equivalent to the first USB data interface 430.

[0169] There are two application methods of the present application embodiment. The first is to realize it through wire (such as Figure 10 As shown), it can be used to be compatible with existing devices that do not adopt this technical solution; the second is to integrate the service data transmission device into the motherboard of the face recognition device (as shown Figure 11 As shown), you can use a common USB cable to connect the face recognition device and the POS machine to realize the corresponding function.

[0170] In some embodiments, the core technology of the service data transmission device is a USB-to-serial port chip PL2303, a USB HID chip CH9328, and a USB hub chip. Through the hardware architecture and circuit design shown above, it is possible to achieve two-way serial port communication and transmit payment codes according to the HID keyboard protocol.

[0171] Here, the key device functions are as follows:

[0172] PL2303: Packs serial port data into USB data packets for transmission, enabling bidirectional data transmission.

[0173] CH9328: Supports converting serial port data that complies with CH9328 rules into HID keyboard protocol data packets in frames, and transmits them to the POS machine in one-way communication.

[0174] USB HUB: Aggregates multiple USB channels into one, uses MultiTRAK™ (Multi-Transaction Translator) technology to time-division multiplex the USB channels, and dynamically allocates bandwidth to transmit USB data streams on two channels.

[0175] In some embodiments, for PL2303 on the host computer side (i.e., face recognition device and POS machine), it is necessary to configure and install the PL2303 device driver, and cooperate with the PL2303 hardware to restore the USB data packet to serial port data, and the corresponding serial port number can be displayed in the system software layer.

[0176] In some embodiments, for CH9328, the chip automatically converts the ASCII code into a data packet that complies with the HID keyboard protocol. Since the face recognition device and the POS host support HID keyboard type devices by default, the driver-free transmission of the payment code on the POS terminal is realized. Among them, CH9328 is driver-free, and PL2303 requires a driver.

[0177] In some embodiments, USB A Plug1 is plugged into the USB HOST port of the face recognition device, and USB A Plug2 is plugged into the USB HOST port of the desktop POS machine.

[0178] In some embodiments, the hardware uses a HUB and a USB-to-serial port chip, and the system software layer on the face recognition device displays two serial port devices (i.e. Figure 10 PL2303(1) and PL2303(2) in the POS machine. What is displayed in the system software layer is a serial port device and a HID keyboard device (i.e. Figure 10 PL2303(3) and HID CH9328).

[0179] In some embodiments, through this hardware solution and circuit, the software layer of the POS machine is completely transparent to the hardware circuit, and no underlying driver changes are required; the face recognition device needs to adapt to the corresponding serial port communication.

[0180] In some embodiments, if the service data transmission device is integrated into the circuit design of the face-scanning device, the USB-to-serial port chip and PL2303 driver on the face-scanning device side can be omitted; the SOC is directly connected to the PL2303 and CH9328 on the POS machine side through the serial port. The technical principle is similar to the technical principle of applying the service data transmission device to the USB Cable, and will not be repeated here.

[0181] The following describes a specific implementation of the service data transmission method provided in the embodiment of the present application.

[0182] 1. Send payment code

[0183] 1) The facial recognition device sends the ASCII code corresponding to the numeric keypad value (i.e., payment code) to CH9328 via the corresponding serial port in the system via PL2303(2).

[0184] (The driver on the face recognition device converts the serial port data into USB data of USB CDC protocol and transmits it to PL2303(2) through the HUB; PL2303(2) restores the USB data into ASCII code sent by the face recognition device through hardware)

[0185] 2) CH9328 converts the ASCII code received through the serial port into HID keyboard data and reports it to the desktop POS machine through the USB HUB.

[0186] 3) The underlying driver of the desktop POS machine parses the HID keyboard data and reports it to the application layer.

[0187] 2. Two-way communication

[0188] 1) The face recognition device sends customized serial port data to the corresponding serial port in the system through PL2303(1).

[0189] (The driver on the face recognition device converts the custom serial port data into USB data of the USB CDC protocol and transmits it to PL2303(1) through the HUB; PL2303(1) restores the USB data into the custom serial port data sent by the face recognition device through hardware, and transmits it to PL2303(3) through the physical serial port)

[0190] 2) PL2303(3) converts the custom serial port data received through the serial port into USB data packets of USB CDC protocol and reports them to the desktop POS machine.

[0191] 3) The software driver of the PL2303 at the bottom layer of the desktop POS machine parses the USB data packet, restores it into custom serial port data, and reports it to the application layer.

[0192] It should be noted that the above-mentioned chips PL2303 and CH9328 are only examples, and other chips can also be used to implement the above-mentioned functions, and this application does not impose any restrictions on this.

[0193] The embodiment of the present application not only solves the compatibility problem of USB CDC protocol simulating serial port, but also realizes the aggregation of two cables, USB HID and serial port line, which reduces costs and improves user experience.

[0194] In summary, the embodiments of the present application have the following beneficial effects:

[0195] (1) One-way service data and two-way service data are transmitted through two different paths, so that the USB host device and the USB slave device can implement basic services and extended services through the received data.

[0196] (2) In the process of data transmission, multiple USB paths are aggregated into one, and time slices are allocated to the unidirectional path for transmitting unidirectional service data and the bidirectional path for transmitting bidirectional service data. The data streams of the two paths are dynamically transmitted, which can improve the transmission efficiency of the unidirectional service data and the bidirectional service data, thereby improving the speed at which the USB host device and the USB slave device can provide services.

[0197] (3) Two-way communication between the HID keyboard protocol and the serial port can be achieved through a single cable, which can reduce usage costs, increase the speed of data transmission, and improve user experience.

[0198] (4) When the service data transmission device is integrated into the USB device, no additional USB-to-serial port chip is required for USB data transfer, which not only saves the number of chips and costs, but also improves the data transmission speed.

[0199] (5) When the service data transmission device can be integrated into a USB cable and the USB host device and the USB slave device are connected via the USB cable, the software layer of the USB host device is completely transparent to the hardware circuit and no underlying driver changes are required; the USB slave device only needs to adapt to the corresponding serial port communication to achieve communication on a unidirectional path and a bidirectional path.

[0200] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.

Claims

1. A service data transmission device, characterized in that: The device comprises: a first data conversion module and a first data hub module; wherein, The first data conversion module is configured to receive first serial port service data to be transmitted in a unidirectional path and second serial port service data to be transmitted in a bidirectional path, and receive third USB service data to be transmitted in the bidirectional path through the first data hub module; The first data hub module is configured to: In a corresponding time slice of the unidirectional path, converting the first serial port service data into first USB service data by the first data conversion module, and transmitting the data to the USB host device; In the time slice corresponding to the bidirectional path, the second serial port service data is converted into second USB service data by the first data conversion module and transmitted to the USB host device; the third USB service data is converted into third serial port service data by the first data conversion module and transmitted to the USB slave device.

2. The device according to claim 1, characterized in that The first serial port service data and the second serial port service data come from the USB slave device, and the third USB service data comes from the USB host device.

3. The device according to claim 1, characterized in that The first serial port service data corresponds to a first sub-service in the service, and the second serial port service data and the third USB service data correspond to a second sub-service in the service; The second sub-service is an extended service of the first sub-service.

4. The device according to claim 1, characterized in that The first data conversion module includes: a first data conversion submodule and a second data conversion submodule; wherein, The first data conversion submodule is electrically connected to the USB slave device and the first data hub module respectively, and the first data conversion submodule includes a first drive information input interface; The first data conversion submodule is configured to, when receiving first drive information through the first drive information input interface, convert the second serial port service data from the USB slave device into the second USB service data in a data packet format and send the data to the first data hub module; and, when receiving second drive information through the first drive information input interface, decode the third USB service data from the first data hub module to convert the data into the third serial port service data and send the data to the USB slave device; The second data conversion submodule is electrically connected to the USB slave device and the first data hub module respectively; The second data conversion submodule is configured to convert the first serial port service data into the first USB service data in a data packet format according to a human interface device (HID) keyboard protocol, and send the data to the first data hub module.

5. The device according to claim 1, characterized in that The device further comprises: a first USB data interface; wherein, The first USB data interface is electrically connected to the USB host device and the first data hub module respectively; The first USB data interface is used to send the first USB service data and the second USB service data sent by the first data hub module to the USB host device; and send the third USB service data sent by the USB host device to the first data hub module.

6. The device according to claim 1, characterized in that The device further comprises: a second data conversion module and a second data hub module; wherein, The second data hub module is electrically connected to the USB slave device and the second data conversion module respectively, and the second data conversion module is electrically connected to the first data conversion module; The second data hub module is configured to: In a corresponding time slice of the unidirectional path, converting the fourth USB service data from the USB slave device into the first serial port service data through the second data conversion module, and transmitting the data to the first data conversion module; In the time slice corresponding to the bidirectional path, the fifth USB service data from the USB slave device is converted into the second serial port service data through the second data conversion module and transmitted to the first data conversion module; the third serial port service data from the first data conversion module is converted into the sixth USB service data through the second data conversion module and transmitted to the USB slave device.

7. The device according to claim 6, characterized in that The second data conversion module includes: a third data conversion submodule and a fourth data conversion submodule; wherein, The third data conversion submodule is electrically connected to the USB slave device and the first data conversion module respectively, and the third data conversion submodule includes a second drive information input interface; the third data conversion submodule is configured to, upon receiving third drive information through the second drive information input interface, decode the fifth USB service data to convert it into the second serial port service data, and send the decoded data to the first data conversion module; and upon receiving fourth drive information through the second drive information input interface, convert the third serial port service data into the sixth USB service data in a data packet format, and send the decoded data to the second data hub module; The fourth data conversion submodule is electrically connected to the second data hub module and the first data conversion module respectively, and the fourth data conversion submodule includes a third driving information input interface; The fourth data conversion submodule is configured to decode the fourth USB service data to convert it into the first serial port service data and send the data to the first data conversion module when receiving the fifth drive information through the third drive information input interface.

8. The device according to claim 7, characterized in that The first data conversion module includes: a first data conversion submodule and a second data conversion submodule; wherein, The first data conversion submodule is electrically connected to the third data conversion submodule and the first data hub module respectively, and the first data conversion submodule includes a first drive information input interface; The first data conversion submodule is configured to, when receiving first drive information through the first drive information input interface, convert the second serial port service data from the third data conversion submodule into the second USB service data in a data packet format and send the data to the first data hub module; and, when receiving second drive information through the first drive information input interface, decode the third USB service data from the first data hub module to convert the data into the third serial port service data and send the data to the third data conversion submodule; The second data conversion submodule is electrically connected to the fourth data conversion submodule and the first data hub module respectively; The second data conversion submodule is configured to convert the first serial port service data from the fourth data conversion submodule into the first USB service data in a data packet format according to the HID keyboard protocol, and send the data to the first data hub module.

9. The device according to claim 6, characterized in that The device further comprises: a second USB data interface; wherein, The second USB data interface is electrically connected to the USB slave device and the second data hub module respectively; The second USB data interface is used to send the fourth USB service data and the fifth USB service data sent by the USB slave device to the second data hub module; and send the sixth USB service data sent by the second data hub module to the USB slave device.

10. The device according to claim 1, characterized in that The first data hub module is further configured to allocate intersecting time slices of equal length to the unidirectional path and the bidirectional path.

11. The device according to claim 1, characterized in that The first data hub module is further configured to first allocate time slices to the unidirectional path, and when the amount of data transmitted by the unidirectional path exceeds a quantity threshold, or when the completion ratio of the amount of data transmitted by the unidirectional path exceeds a ratio threshold, allocate intersecting and equal-length time slices to the unidirectional path and the bidirectional path.

12. The device according to claim 1, characterized in that The first data hub module is further configured to allocate time slices to the first receiving path, and when the amount of data transmitted by the first receiving path exceeds a quantity threshold, or when the completion ratio of the amount of data transmitted by the first receiving path exceeds a ratio threshold, allocate interleaved time slices of equal length to the first receiving path and the second receiving path; The first receiving path is the path where the corresponding data to be transmitted first appears between the unidirectional path and the bidirectional path; the second receiving path is the path where the corresponding data to be transmitted last appears between the unidirectional path and the bidirectional path.

13. The device according to claim 1, characterized in that The first data hub module is further configured to allocate corresponding time slices to the unidirectional path and the bidirectional path according to the amount of data to be transmitted on the unidirectional path and the bidirectional path; The first ratio and the second ratio are equal, the first ratio is the ratio between the number of time slices corresponding to the unidirectional path and the number of time slices corresponding to the bidirectional path, and the second ratio is the ratio between the amount of data to be transmitted on the unidirectional path and the amount of data to be transmitted on the bidirectional path.

14. The device according to any one of claims 4 to 9, characterized in that The electrical connection includes a USB cable.

15. A service data transmission method, applied to a service data transmission device, characterized in that: The service data transmission device includes: a first data conversion module and a first data hub module; The method comprises: The first data conversion module receives the first serial port service data to be transmitted in the unidirectional path and the second serial port service data to be transmitted in the bidirectional path, and receiving, through the first data hub module, third USB service data to be transmitted in the bidirectional path; In a corresponding time slice of the unidirectional path, converting the first serial port service data into first USB service data through the first data conversion module, and transmitting the data to the USB host device through the first data hub module; In a time slice corresponding to the bidirectional path, converting the second serial port service data into second USB service data through the first data conversion module, and transmitting the data to the USB host device through the first data hub module; The third USB service data is converted into third serial port service data by the first data conversion module, and is transmitted to the USB slave device through the first data hub module.

Citation Information

Patent Citations

  • Signal connection device and method

    CN101963945A

  • Communication method and system using bus interface over a network

    CN1976310A