Peripheral device and data transmission method
By integrating a universal serial bus interface, storage circuit and instruction analysis unit in the peripheral device, simulating it as a virtual disk and receiving custom commands and update data, the problem of installing a variety of tools in the prior art to set or update the peripheral device is solved, and simplified operational flow and parameter updates are achieved.
Patent Information
- Application Number
- CN202410520468.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-09-28
- Filing Date
- 2024-04-28
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the host device needs to install a variety of specific tools to set or update the parameters of the peripheral device, resulting in complexity and inconvenience.
A peripheral device is designed, including a universal serial bus interface, storage circuit and instruction analysis unit, which can be simulated as a virtual disk, receive custom commands and update data, and perform corresponding operations through the instruction analysis unit.
This enables the setting or update of peripheral devices through external hosts without additional tools, simplifying the operation process and reducing the burden on the host devices.
Smart Images

Figure CN119718984A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a peripheral device, in particular to a peripheral device with a universal serial bus (USB) interface. Background Art
[0002] When the host device wants to set the parameters of the peripheral device or wants the peripheral device to perform a specific operation (such as updating the program code), the host device must first install a specific tool and then open the specific tool before setting the peripheral device through the specific tool. However, different peripheral devices may correspond to different specific tools, resulting in the host device having to install multiple specific tools. Summary of the invention
[0003] An embodiment of the present invention provides a peripheral device, including a universal serial bus interface, a storage circuit and a command parsing unit. The universal serial bus interface is used to couple an external host and receive a file data from the external host. The file data includes a custom command and an update data. The storage circuit is used to store a file configuration table and a root directory. The command parsing unit analyzes the custom command and acts according to the analysis result. When the custom command is an update command, the command parsing unit performs an update operation.
[0004] The present invention further provides a data transmission method, comprising determining whether a peripheral device is coupled to an external host; when the peripheral device is coupled to the external host, the peripheral device simulates a virtual disk; and outputting an update file data to the peripheral device to update a specific information of the peripheral device. The update file data includes a file location data and a data content. The data content includes a custom command and an update data.
[0005] The data transmission method of the present invention can be implemented through the operating system of the present invention, which is hardware or firmware that can execute specific functions, or can be recorded in a recording medium in the form of program code and implemented in combination with specific hardware. When the program code is loaded and executed by an electronic device, processor, computer or machine, the electronic device, processor, computer or machine becomes an external host and peripheral device for implementing the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 It is a schematic diagram of the operating system of the present invention.
[0007] Figure 2 It is a schematic diagram of the operation of an external host transmitting a command to a peripheral device according to the present invention.
[0008] Figure 3A and Figure 3B Read the operation diagram of the peripheral device for the external host.
[0009] Figure 4 It is a flow chart of the data transmission method of the present invention.
[0010] Reference numerals:
[0011] 100: Operating System
[0012] 110: External host
[0013] 120: Peripheral devices
[0014] 130: Archival Data
[0015] 131: File location data
[0016] 132: File Contents
[0017] 111, 121: Transmission interface
[0018] 123: Instruction parsing unit
[0019] 122: Storage circuit
[0020] 141: Startup information
[0021] 142: File configuration table
[0022] 143: root directory
[0023] D1~D4: Data content
[0024] 124: Memory controller
[0025] 125: Storage Space
[0026] 126: Data Pool
[0027] S411~S413: Steps DETAILED DESCRIPTION
[0028] In order to make the purpose, features and advantages of the present invention more clearly understood, the following embodiments are specifically cited and described in detail with reference to the accompanying drawings. The present invention specification provides different embodiments to illustrate the technical features of different implementations of the present invention. Among them, the configuration of each element in the embodiment is for illustrative purposes and is not intended to limit the present invention. In addition, some of the figure numbers in the embodiments are repeated for the purpose of simplifying the description and do not mean the correlation between different embodiments.
[0029] Figure 1 Schematic diagram of the operating system of the present invention. Figure 1As shown, the operating system 100 includes an external host 110 and a peripheral device 120. When the peripheral device 120 is connected to the external host 110, the peripheral device 120 is simulated as a virtual disk. Therefore, for the external host 110, the peripheral device 120 is a general disk drive. The external host 110 may directly write an update data to the peripheral device 120, or directly read the settings of the peripheral device 120 without opening any additional tools.
[0030] Taking Microsoft's operating system Windows as an example, when the peripheral device 120 is connected to the external host 110, the peripheral device 120 will simulate a disk G. The user may drag a file content 132 to the peripheral device 120 through the mouse. Therefore, the external host 110 outputs the file data 130 to the peripheral device 120. In this embodiment, the external host 110 generates the file data 130 according to the characteristics of a file allocation table (FAT).
[0031] In one possible embodiment, the file data 130 includes a file location data 131 and a file content 132. In some embodiments, the file content 132 includes a custom command and a data. The peripheral device 120 analyzes the custom command and performs a specific operation according to the analysis result, such as storing the data or using the data to update an internal data (such as a time information).
[0032] The present invention does not limit the architecture of the external host 110. In one possible embodiment, the external host 110 is a personal computer (PC) or a laptop. In some embodiments, the external host 110 includes a transmission interface 111 for coupling the peripheral device 120. The present invention does not limit the type of the transmission interface 111. In one possible embodiment, the transmission interface 111 is a universal serial bus (USB) interface.
[0033] In this embodiment, the peripheral device 120 includes a transmission interface 121. The transmission interface 121 is used to receive the file data 130. The present invention does not limit the type of the transmission interface 121. The type of the transmission interface 121 is the same as the type of the transmission interface 111. In a possible embodiment, the transmission interface 121 is a USB interface.
[0034] In other embodiments, the peripheral device 120 further includes a command parsing unit 123. The command parsing unit 123 analyzes a custom command of the file content 132 and acts according to the analysis result. For example, when the custom command of the file content 132 is an update command, it means that the external host 110 wants to update the settings of the peripheral device 120. Therefore, the command parsing unit 123 performs an update operation.
[0035] In one possible embodiment, when the custom command of the file content 132 is an update command, the command parsing unit 123 updates a time information using the data of the file content 132. For example, the peripheral device 120 may have a real-time clock (not shown). The command parsing unit 123 uses the data of the file content 132 to correct the time information of the real-time clock (RTC). In this example, the peripheral device 120 does not retain the file content 132. Therefore, when the peripheral device 120 is powered on again, the peripheral device 120 does not have the file content 132. In this embodiment, the external host 110 only needs to provide the file content 132 (or the correction time slot) to the peripheral device 120 to achieve the purpose of correcting the time without the need to develop and maintain tools on the USB host side.
[0036] In another possible example, when the custom command of the file content 132 is an update command, the command parsing unit 123 may use the data of the file content 132 to update a desktop screen. For example, after the peripheral device 120 is powered on, it may present a first desktop screen. After updating the desktop screen, the peripheral device 120 presents a second desktop screen. In this example, the external host 110 only needs to write the data of the file content 132 (or update file) to the peripheral device 120 to update the peripheral device 120. In this example, the peripheral device 120 retains the data of the file content 132 (i.e., the second desktop screen).
[0037] In other embodiments, the peripheral device 120 further includes a storage circuit 122. The storage circuit 122 includes a startup information 141, a file allocation table (FAT) 142, a root directory 143, and data contents D1-D4. In one possible embodiment, the storage circuit 122 includes a memory controller 124 and a storage space 125. The memory controller 124 stores the startup information 141 starting from the magnetic sector 0 of the storage space 125. Therefore, the magnetic sector 0 is also called a boot sector. The peripheral device 120 simulates a virtual disk according to the file location data 131, the file allocation table 142, and the root directory 143. In some embodiments, the memory controller 124 stores the file allocation table 142 starting from the magnetic sector 6 of the storage space 125, and stores the root directory 143 starting from the magnetic sector 8. The file allocation table 142 is used to record the storage address, file size, and file name of each external data. The root directory 143 records a root directory and its subdirectories. In a possible embodiment, since the free sectors of the storage space 125 are not continuous, the memory controller 124 divides the file content 132 into data contents D1 - D4 and stores the data contents D1 - D4 in the discontinuous free sectors starting from sector 40 .
[0038] In some embodiments, the external host 110 first reads the root directory 143 to learn which directory a specific data is stored in, and then learns the actual address of the specific data according to the file allocation table 142. In this example, the external host 110 analyzes the root directory 143 and the file allocation table 142 to generate the file location data 131, and provides the file location data 131 to the peripheral device 120. The peripheral device 120 analyzes the file content 132 provided by the external host 110 to determine whether it has a valid command. When the file content 132 has a valid command, the peripheral device 120 provides the specific data required by the external host 110. In some embodiments, even if the specific data is stored in discontinuous magnetic areas, the memory controller 124 can still read the specific data (such as D1 to D4) in the discontinuous magnetic areas according to the file location data 131.
[0039] Figure 2 FIG. 1 is a schematic diagram of the operation of the external host 110 transmitting a command to the peripheral device 120 of the present invention. For the convenience of explanation, it is assumed that the external host 110 uses the Windows operating system. When the peripheral device 120 is connected to the external host 110, the external host 110 regards the peripheral device 120 as a disk G. At this time, the disk G is empty. When the user drags a file (such as CMD_Write_4K.bin) to the disk G, the external host 110 outputs the file (such as CMD_Write_4K.bin) to the peripheral device 120.
[0040] The command parsing unit 123 analyzes the file content 132 of the file data (such as CMD_Write_4K.bin) provided by the external host 110 to determine whether there is a valid command. When the file content 132 has a valid command, the command parsing unit 123 acts according to the file content 132. In a possible embodiment, the command parsing unit 123 performs an update operation according to the data of the file content 132, such as updating a time information or updating a desktop screen. In some embodiments, the peripheral device 120 may replace a specific data (such as a desktop screen) in the storage circuit 122 with the data of the file content 132.
[0041] Figure 3A and Figure 3B The schematic diagram of the operation of the external host 110 reading the peripheral device 120. Figure 3A When the user drags a file data (such as CMD_Read_4K.bin) to disk G, the external host 110 outputs the file location data 131 and the file content 132 to the peripheral device 120. The command parsing unit 123 analyzes whether the file content 132 provided by the external host 110 has a valid command. When the file content 132 has a valid command, the command parsing unit 123 reads the data content required by the external host 110.
[0042] exist Figure 3B In the embodiment, the command parsing unit 123 requests a data pool 126 to return the corresponding data content to the external host 110. The user can use the external host 110 to read the corresponding file from the disk G (i.e., the peripheral device 120). In other embodiments, the command parsing unit 123 requests the storage circuit 122 to provide a specific information (or read data), and outputs the read data to the external host 110 through the universal serial bus interface 121.
[0043] In some embodiments, the external host 110 outputs the file content 132 to the peripheral device 120 to set the specific data to be read, and then reads the corresponding file to obtain the data content. The storage circuit 122 outputs the specific data to the external host 110. In a possible embodiment, the user knows the internal setting value of the peripheral device 120 according to the specific data read by the external host 110. Through the internal setting value, the user knows whether the peripheral device 120 has an abnormality and the reason for the abnormality.
[0044] The present invention does not limit the architecture of the storage circuit 122. In one possible embodiment, the storage circuit 122 includes a volatile memory (not shown) for storing the file allocation table 142 and the root directory 143. The present invention does not limit the type of the volatile memory. In one possible embodiment, the file allocation table 142 and the root directory 143 are stored in a static random access memory (SRAM). In another possible embodiment, the storage circuit 122 further includes a non-volatile memory (not shown). In this example, the non-volatile memory is used to store an update data, such as a desktop screen.
[0045] Figure 4 4 is a flow chart of the data transmission method of the present invention. The data transmission method of the present invention may exist in the form of program code. When the program code is loaded and executed by a machine, the machine becomes an operating system for implementing the present invention. First, it is determined whether a peripheral device is coupled to an external host (step S411). In a possible embodiment, the peripheral device has a USB interface for connecting to an external host.
[0046] When the peripheral device has not yet been coupled to the external host, return to step S411 and continue to detect whether the peripheral device is coupled to an external host. When the peripheral device is coupled to the external host, the peripheral device is simulated as a virtual disk (step S412). Then, the external host outputs an update file data to the peripheral device to update a specific information of the peripheral device (step S413). In some embodiments, the update file data includes a file location data and a data content (or a file content). The data content includes a custom command and an update data. In one possible embodiment, the peripheral device analyzes whether the file content from the host includes a valid instruction. If so, the peripheral device uses the update data to correct a time information. In another possible embodiment, the peripheral device uses the update data to update a specific data, such as a desktop screen. In this example, the peripheral device stores the update data.
[0047] In other embodiments, when the external host wants to read data from the peripheral device, the external host sends a file data to the peripheral device. In this example, after receiving the file data, the peripheral device first determines whether the file content of the file data has a valid command. If so, the peripheral device captures the relevant data and returns the captured data to the external host. The external host may determine whether the operation of the peripheral device is normal or whether the setting of the peripheral device is correct based on the return file provided by the peripheral device.
[0048] It should be understood that when an element or layer is referred to as being "coupled" to another element or layer, it may be directly coupled or connected to the other element or layer, or have other elements or layers interposed therebetween. Conversely, if an element or layer is "connected" to another element or layer, there will be no other elements or layers interposed therebetween.
[0049] The data transmission method of the present invention, or a specific form or part thereof, may exist in the form of program code. The program code may be stored in a physical medium, such as a floppy disk, a CD, a hard disk, or any other machine-readable (such as computer-readable) storage medium, or a computer program product not limited to an external form, wherein when the program code is loaded and executed by a machine, such as a computer, the machine becomes an external host or peripheral device for participating in the present invention. The program code may also be transmitted through some transmission media, such as wires or cables, optical fibers, or any transmission form, wherein when the program code is received, loaded and executed by a machine, such as a computer, the machine becomes an external host or peripheral device for participating in the present invention. When implemented in a general-purpose processing unit, the program code combines with the processing unit to provide a unique device that operates similarly to an application-specific logic circuit.
[0050] Unless otherwise defined, all words (including technical and scientific words) herein are generally understood by those skilled in the art to which the present invention belongs. In addition, unless expressly indicated, the definitions of words in general dictionaries should be interpreted as consistent with the meanings in articles in the relevant technical field, and should not be interpreted as ideal or overly formal. Although the terms "first", "second", etc. can be used to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element.
[0051] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art may make some changes and modifications without departing from the spirit and scope of the present invention. For example, the system, device or method described in the embodiments of the present invention may be implemented in a physical embodiment of hardware, software or a combination of hardware and software. Therefore, the scope of protection of the present invention shall be subject to the scope defined by the attached claims.
Claims
1. A peripheral device, characterized in that: include: A universal serial bus interface, for coupling to an external host and receiving a file data from the external host, wherein the file data includes a custom command and an update data; a storage circuit for storing a file allocation table and a root directory; and A command parsing unit analyzes the user-defined command and takes action according to the analysis result. When the custom command is an update command, the instruction parsing unit performs an update operation.
2. The peripheral device according to claim 1, characterized in that: The updating operation updates time information according to the updating data.
3. The peripheral device according to claim 1, characterized in that: The storage circuit comprises: A volatile memory is used to store the file allocation table and the root directory.
4. The peripheral device according to claim 3, characterized in that: The storage circuit further comprises: A non-volatile memory is used to store the update data.
5. The peripheral device according to claim 4, characterized in that: The storage circuit further comprises: A memory controller reads the file allocation table and the root directory according to a location data of the file data to write the update data into a specific address of the non-volatile memory.
6. The peripheral device according to claim 5, characterized in that: The instruction parsing unit accesses the storage circuit to obtain a read data, and outputs the read data to the external host through the universal serial bus interface.
7. A data transmission method, characterized in that: include: Determining whether a peripheral device is coupled to an external host; When the peripheral device is coupled to the external host, the peripheral device simulates a virtual disk; as well as Outputting an update file data to the peripheral device to update a specific information of the peripheral device, The update file data includes file location data and data content, and the data content includes a custom command and update data.
8. The data transmission method according to claim 7, characterized in that: The update data is used to correct time information of the peripheral device.
9. The data transmission method according to claim 7, characterized in that: Also includes: The updated data is stored in the peripheral device.
10. The data transmission method according to claim 7, characterized in that: Also includes: Sending a second file to the peripheral device via the universal serial bus interface; and Receive a feedback file provided by the peripheral device.