Method and system for pushing SD card file
By automatically switching USB transmission mode and unified configuration reading mechanism, the push process of SD card files is simplified, the problems of cumbersome operation and insufficient security in the existing technology are solved, and efficient and convenient file transfer and data security are achieved.
Patent Information
- Application Number
- CN202411881954.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, the process of pushing SD card files is cumbersome, affecting work efficiency, and requires manual switching of USB transmission mode, resulting in inconvenient operation.
The terminal responds to the file transfer mode enable command sent by the PC tool, reads the configuration value of the file transfer function from the unified configuration, automatically switches the USB transfer mode to the file transfer mode, and pushes files to the terminal's file transfer device through the preset interface, and stores it in the storage area of the SD card.
It simplifies the file transfer operation process, improves the efficiency and convenience of file transfer, reduces the risk of intercepting or tampering during file transfer, and improves data security and user work efficiency.
Smart Images

Figure CN119676231A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for pushing SD card files. Background Art
[0002] With the rapid development of financial digital services, government affairs and police services, intelligent systems such as Android and OpenHarmony are widely used in various devices, including cash registers, law enforcement recorders, government service terminals, etc. These devices usually need to process application parameter files in various formats, such as , , , Users often need to push files of different formats to the SD card or built-in storage directory of the device through the PC. At present, the operation method is to manually operate the terminal to switch the USB transmission mode to "MTP transmission mode" after the device is connected to the PC, and then operate the built-in storage directory of the device on the PC to transfer and manage files. However, this operation method is not only cumbersome, but also affects work efficiency. Therefore, a method and system for pushing SD card files that can solve the above problems are urgently needed. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method and system for pushing SD card files, which can improve the efficiency and convenience of file transmission and improve the overall work efficiency.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is: A method for pushing SD card files, comprising the steps of: S1, the terminal responds to the start transmission command of the file transfer mode sent by the PC tool, and reads the configuration value of the file transfer function from the unified configuration; S2. If the configuration value indicates that the file transfer function is allowed, the terminal returns a state value of allowing the opening to the PC tool, and calls the USB management service to temporarily open the file transfer mode; S3. The PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface. The file transfer device of the terminal stores the pushed files in a storage area of an internal SD card in the file transfer device.
[0005] In order to solve the above technical problems, another technical solution adopted by the present invention is: A system for pushing SD card files includes a terminal and a PC tool. The terminal and the PC tool implement the various steps of the above-mentioned method for pushing SD card files.
[0006] The beneficial effects of the present invention are as follows: a method and system for pushing SD card files provided by the present invention reads the configuration value of the file transfer function from the unified configuration in response to the file transfer mode start transmission command sent by the PC tool, thereby reducing the need for manual configuration and improving the efficiency and accuracy of the configuration process; if the configuration value indicates that the file transfer function is allowed to be used, the terminal returns the allowed start status value to the PC tool, thereby simplifying the operation process and improving the user's work efficiency, and calling the USB management service to temporarily start the file transfer mode, and automatically switching the USB transfer mode to the file transfer mode through the PC tool to meet the file transfer needs and solve the problem of manually switching the transfer mode in the prior art; the PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface, thereby improving the file transfer efficiency, and the file transfer device of the terminal stores the pushed files in the storage area of the internal SD card in the file transfer device, thereby reducing the risk of the file being intercepted or tampered with during the transmission process and improving the security of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 This is a flow chart of a method for pushing SD card files according to an embodiment of the present invention; Figure 2 A schematic diagram of a system for pushing SD card files according to an embodiment of the present invention; Figure 3 Another flow chart of a method for pushing SD card files according to an embodiment of the present invention; Description of labels: 1. A system for pushing SD card files; 2. Terminal; 3. PC tool. DETAILED DESCRIPTION
[0008] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.
[0009] Please refer to Figure 1 The embodiment of the present invention provides a method for pushing SD card files, comprising the steps of: S1, the terminal responds to the start transmission command of the file transmission mode sent by the PC tool, and reads the configuration value of the file transmission function from the unified configuration; S2. If the configuration value indicates that the file transfer function is allowed, the terminal returns a state value of allowing the opening to the PC tool, and calls the USB management service to temporarily open the file transfer mode; S3. The PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface. The file transfer device of the terminal stores the pushed files in a storage area of an internal SD card in the file transfer device. From the above description, it can be seen that the beneficial effects of the present invention are: by responding to the file transfer mode start transmission command sent by the PC tool, the configuration value of the file transfer function is read from the unified configuration, the need for manual configuration is reduced, and the efficiency and accuracy of the configuration process are improved; if the configuration value indicates that the file transfer function is allowed to be used, the terminal returns the allowed start status value to the PC tool, which simplifies the operation process and improves the user's work efficiency, and calls the USB management service to temporarily start the file transfer mode, and automatically switches the USB transfer mode to the file transfer mode through the PC tool to meet the file transfer needs and solve the problem of manual switching of the transfer mode in the prior art; the PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface, thereby improving the file transfer efficiency, and the file transfer device of the terminal stores the pushed files in the storage area of the internal SD card in the file transfer device, thereby reducing the risk of files being intercepted or tampered with during the transmission process and improving the security of data.
[0010] Furthermore, before step S1, the following steps are included: A new tag is added in the terminal, and the PC tool reads the tag from the terminal through the operation and maintenance channel. If the value of the tag indicates that the file transfer mode is not enabled, the PC tool connects to the file transfer device of the terminal and sends a transmission command to enable the file transfer mode through the operation and maintenance channel.
[0011] From the above description, it can be seen that whether the file transfer mode is turned on is identified by a tag to clarify the current file transfer mode status. If the value of the tag indicates that the file transfer mode is not turned on, the PC tool connects to the file transfer device of the terminal and sends a transmission command to turn on the file transfer mode through the operation and maintenance channel. The efficiency and accuracy of the operation are improved through the automated judgment and connection mechanism, avoiding file transfer failure caused by forgetting to turn on the file transfer mode. Furthermore, the step S2 further includes: If the configuration value indicates that the file transfer function is restricted, the terminal returns an error code indicating that the function fails to be enabled to the PC tool.
[0012] From the above description, it can be seen that the configuration value represents information that returns corresponding information to the PC tool so that the PC tool can take corresponding processing measures. If the configuration value indicates that the use of the file transfer function is restricted, the terminal returns an error code of failed activation to the PC tool, providing an error handling mechanism to ensure the stability and security of the system.
[0013] Furthermore, the step S3 further includes: When the PC tool finishes pushing the file, the PC tool sends a file transfer mode close transfer command to the terminal; If the PC tool does not send the file transfer mode closing transmission command to the terminal, the terminal closes the file transfer mode when recognizing that the USB device is disconnected from the PC tool.
[0014] From the above description, it can be seen that when the PC tool finishes pushing the file, the PC tool sends a file transfer mode closing command to the terminal to ensure that all resources are correctly released, which helps to avoid resource leakage and thus improve system stability; if the PC tool does not send the file transfer mode closing command to the terminal, the terminal will recognize that the USB device is disconnected from the PC tool and close the file transfer mode, providing another way to close the file transfer mode and improving the flexibility of the system. Furthermore, the unified configuration includes: The terminal writes configuration file information through a command line, and obtains a first interface for the terminal to call the configuration file information by reading and writing the configuration file information; The terminal generates a second interface for other applications to read configuration file information according to the first interface.
[0015] As can be seen from the above description, the terminal writes configuration file information through the command line, which improves the flexibility and maintainability of configuration management, and by reading and writing the configuration file, a first interface for the terminal to call the configuration file information is obtained, which helps to ensure that the system can correctly read and apply the configuration information during operation, thereby improving the stability and reliability of the system; the terminal generates a second interface for other applications to read the configuration file information based on the first interface, so that other applications can easily access and use the configuration file information, thereby improving the scalability and interoperability of the system.
[0016] Please refer to Figure 2 Another embodiment of the present invention provides a system for pushing SD card files, including a terminal and a PC tool, wherein the terminal and the PC tool implement the various steps of the above-mentioned method for pushing SD card files.
[0017] The method and system for pushing SD card files described above in the present invention are suitable for file transmission, and can solve the problem of manually switching the transmission mode in the prior art. The following is an explanation through specific implementation methods: Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is: A method for pushing SD card files, comprising the steps of: S1. The terminal responds to a start transmission command of the file transmission mode sent by the PC tool and reads a configuration value of the file transmission function from the unified configuration.
[0018] In this embodiment, by responding to the start transfer command of the file transfer mode sent by the PC tool, the configuration value of the file transfer function is read from the unified configuration, thereby reducing the need for manual configuration and improving the efficiency and accuracy of the configuration process. The configuration value of the file transfer function is preferentially represented as 0 or 1. When the configuration value is 0, it indicates that the system disables the file transfer function. When the configuration value is 1, it indicates that the system can use the file transfer function. Whether to turn on the file transfer function is in the USB service. The file transfer system properties are enabled or disabled according to this identifier. In this embodiment, the file transfer is in the media transfer protocol (MTP) mode.
[0019] Furthermore, in this embodiment, the unified configuration includes: the terminal writes configuration file information through a command line, and obtains a first interface for the terminal to call the configuration file information by reading and writing the configuration file information, which helps to ensure that the system can correctly read and apply the configuration information during operation, thereby improving the stability and reliability of the system; the terminal generates a second interface for other applications to read the configuration file information based on the first interface, so that other applications can easily access and use the configuration file information, thereby improving the scalability and interoperability of the system.
[0020] Furthermore, in this embodiment, before step S1, it includes: adding a new tag in the terminal, and the PC tool reads the tag from the terminal through the operation and maintenance channel; if the value of the tag indicates that the file transfer mode is not turned on, the PC tool connects to the file transfer device of the terminal, and sends a transmission command to turn on the file transfer mode through the operation and maintenance channel, thereby improving the efficiency and accuracy of the operation through the automated judgment and connection mechanism, and avoiding file transfer failure caused by forgetting to turn on the file transfer mode.
[0021] S2. If the configuration value indicates that the file transfer function is allowed to be used, the terminal returns the state value of allowing to be turned on to the PC tool, and calls the USB management service to temporarily turn on the file transfer mode. In this embodiment, the corresponding state value is returned to the PC tool through the configuration value information, so that the PC tool can make corresponding processing measures, simplify the operation process, and improve the user's work efficiency. If the configuration value indicates that the file transfer function is allowed to be used, the terminal returns the state value of allowing to be turned on to the PC tool, and calls the USB management service to temporarily turn on the file transfer mode. The PC tool automatically switches the USB transfer mode to the file transfer mode, meets the file transfer requirements, and solves the problem of manually switching the transfer mode in the prior art; if the configuration value indicates that the file transfer function is restricted, the terminal returns the error code of the failed opening to the PC tool, and provides an error handling mechanism to ensure the stability and security of the system.
[0022] S3. The PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface. The file transfer device of the terminal stores the pushed files in a storage area of an internal SD card in the file transfer device.
[0023] In this embodiment, files are pushed to the file transfer device of the terminal through a preset interface to improve file transfer efficiency, and the pushed files are stored in the storage area of the internal SD card in the file transfer device to reduce the risk of files being intercepted or tampered with during transmission and improve data security. The preset interface is preferably a Microsoft WPD interface.
[0024] Furthermore, in this embodiment, the step S3 also includes: when the PC tool finishes pushing the file, the PC tool sends a file transfer mode close transfer command to the terminal to ensure that all resources are correctly released, which helps to avoid resource leakage and thus improve system stability; if the PC tool does not send the file transfer mode close transfer command to the terminal, the terminal recognizes that the USB device is disconnected from the PC tool and closes the file transfer mode, providing another file transfer mode close method to improve system flexibility.
[0025] Please refer to Figure 2 , Embodiment 2 of the present invention is: A system 1 for pushing SD card files includes a terminal 2 and a PC tool 3. The terminal 2 and the PC tool 3 implement various steps of a method for pushing SD card files in embodiment 1.
[0026] In summary, the present invention provides a method and system for pushing SD card files. By adding a new tag in the terminal, the PC reads the tag from the terminal through the operation and maintenance channel. If the value of the tag indicates that the file transfer mode is not turned on, the PC tool connects to the file transfer device of the terminal and sends a transmission command to turn on the file transfer mode through the operation and maintenance channel. The efficiency and accuracy of the operation are improved through the automatic judgment and connection mechanism, and the failure of file transfer caused by forgetting to turn on the file transfer mode is avoided; the terminal responds to the transmission command to turn on the file transfer mode sent by the PC tool, and reads the configuration value of the file transfer function from the unified configuration, reducing the need for manual configuration and improving the efficiency and accuracy of the configuration process. The unified configuration includes: the terminal writes configuration file information through a command line, and obtains a first interface for the terminal to call the configuration file information by reading and writing the configuration file information; the terminal generates a second interface for other applications to read the configuration file information according to the first interface, which helps to ensure that the system can correctly read and apply the configuration information during operation, and improves the stability and reliability of the system; if the configuration value indicates that the file transfer function is allowed to be used, the terminal returns a state value of allowing the opening to the terminal. The PC tool is configured to call the USB management service to temporarily start the file transfer mode, and the USB transfer mode is automatically switched to the MTP transfer mode through the PC tool to meet the file transfer requirements and solve the problem of manually switching the transfer mode in the prior art; if the configuration value indicates that the file transfer function is restricted, the terminal returns an error code indicating that the start-up failed to the PC tool, and an error handling mechanism is provided to ensure the stability and security of the system; the PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface, and the file transfer device of the terminal stores the pushed files in the storage area of the internal SD card in the file transfer device, reducing the risk of the files being intercepted or tampered with during the transmission process and improving the security of the data; when the PC tool finishes pushing the file, the PC tool sends a transfer command to close the file transfer mode to the terminal, ensuring that all resources are correctly released, which helps to avoid resource leakage and thus improves the stability of the system; if the PC tool does not send the transfer command to close the file transfer mode to the terminal, the terminal recognizes that the USB device is disconnected from the PC tool and closes the file transfer mode, providing another file transfer mode closing method and improving the flexibility of the system.
[0027] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for pushing SD card files, characterized in that: Includes steps: S1, the terminal responds to the start transmission command of the file transmission mode sent by the PC tool, and reads the configuration value of the file transmission function from the unified configuration; S2. If the configuration value indicates that the file transfer function is allowed, the terminal returns a state value of allowing the opening to the PC tool, and calls the USB management service to temporarily open the file transfer mode; S3. The PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface. The file transfer device of the terminal stores the pushed files in a storage area of an internal SD card in the file transfer device.
2. A method for pushing SD card files according to claim 1, characterized in that: Before step S1, the method includes: A new tag is added in the terminal, and the PC tool reads the tag from the terminal through the operation and maintenance channel. If the value of the tag indicates that the file transfer mode is not enabled, the PC tool connects to the file transfer device of the terminal and sends a transmission command to enable the file transfer mode through the operation and maintenance channel.
3. The method for pushing SD card files according to claim 1, characterized in that: The step S2 further includes: If the configuration value indicates that the file transfer function is restricted, the terminal returns an error code indicating that the function fails to be enabled to the PC tool.
4. The method for pushing SD card files according to claim 1, characterized in that: The step S3 further includes: When the PC tool finishes pushing the file, the PC tool sends a file transfer mode close transfer command to the terminal; If the PC tool does not send the file transfer mode closing transmission command to the terminal, the terminal closes the file transfer mode when recognizing that the USB device is disconnected from the PC tool.
5. The method for pushing SD card files according to claim 1, characterized in that: The unified configuration includes: The terminal writes configuration file information through a command line, and obtains a first interface for the terminal to call the configuration file information by reading and writing the configuration file information; The terminal generates a second interface for other applications to read configuration file information according to the first interface.
6. A system for pushing SD card files, including a terminal and a PC tool, characterized in that: The terminal and the PC tool implement the following steps: S1, the terminal responds to the start transmission command of the file transmission mode sent by the PC tool, and reads the configuration value of the file transmission function from the unified configuration; S2. If the configuration value indicates that the file transfer function is allowed, the terminal returns a state value of allowing the opening to the PC tool, and calls the USB management service to temporarily open the file transfer mode; S3. The PC tool monitors the file transfer device of the terminal and pushes files to the file transfer device of the terminal through a preset interface. The file transfer device of the terminal stores the pushed files in a storage area of an internal SD card in the file transfer device.
7. A system for pushing SD card files according to claim 6, characterized in that: Before step S1, the method includes: A new tag is added in the terminal, and the PC tool reads the tag from the terminal through the operation and maintenance channel. If the value of the tag indicates that the file transfer mode is not enabled, the PC tool connects to the file transfer device of the terminal and sends a transmission command to enable the file transfer mode through the operation and maintenance channel.
8. The system for pushing SD card files according to claim 6, characterized in that: The step S2 further includes: If the configuration value indicates that the file transfer function is restricted, the terminal returns an error code indicating that the function fails to be enabled to the PC tool.
9. The system for pushing SD card files according to claim 6, characterized in that: The step S3 further includes: When the PC tool finishes pushing the file, the PC tool sends a file transfer mode close transfer command to the terminal; If the PC tool does not send the file transfer mode closing transmission command to the terminal, the terminal closes the file transfer mode when recognizing that the USB device is disconnected from the PC tool.
10. The system for pushing SD card files according to claim 6, characterized in that: The unified configuration includes: The terminal writes configuration file information through a command line, and obtains a first interface for the terminal to call the configuration file information by reading and writing the configuration file information; The terminal generates a second interface for other applications to read configuration file information according to the first interface.