CN116489146A - File transmission method, electronic equipment and storage medium - Google Patents
File transmission method, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN116489146A CN116489146A CN202310747737.9A CN202310747737A CN116489146A CN 116489146 A CN116489146 A CN 116489146A CN 202310747737 A CN202310747737 A CN 202310747737A CN 116489146 A CN116489146 A CN 116489146A
- Authority
- CN
- China
- Prior art keywords
- file
- transmitted
- modem
- transmission
- client
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 283
- 238000000034 method Methods 0.000 title claims abstract description 114
- 238000003860 storage Methods 0.000 title claims abstract description 14
- 230000001413 cellular effect Effects 0.000 claims abstract description 74
- 230000002093 peripheral effect Effects 0.000 claims abstract description 26
- 238000012546 transfer Methods 0.000 claims description 30
- 230000008569 process Effects 0.000 claims description 24
- 238000004590 computer program Methods 0.000 claims description 22
- 230000001976 improved effect Effects 0.000 abstract description 22
- 230000006872 improvement Effects 0.000 abstract description 9
- 238000004891 communication Methods 0.000 description 12
- 230000004044 response Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 239000000872 buffer Substances 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 101100392078 Caenorhabditis elegans cat-4 gene Proteins 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 230000004931 aggregating effect Effects 0.000 description 3
- 238000004220 aggregation Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000036541 health Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 101100494773 Caenorhabditis elegans ctl-2 gene Proteins 0.000 description 2
- 101100112369 Fasciola hepatica Cat-1 gene Proteins 0.000 description 2
- 101100005271 Neurospora crassa (strain ATCC 24698 / 74-OR23-1A / CBS 708.71 / DSM 1257 / FGSC 987) cat-1 gene Proteins 0.000 description 2
- 230000003213 activating effect Effects 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000006855 networking Effects 0.000 description 2
- 230000001737 promoting effect Effects 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000005305 interferometry Methods 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000008093 supporting effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/14—Reselecting a network or an air interface
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W36/00—Hand-off or reselection arrangements
- H04W36/16—Performing reselection for specific purposes
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application provides a file transmission method, electronic equipment and a storage medium, wherein the method comprises the following steps: responding to a transmission instruction of a file to be transmitted, and starting a modem to connect a cellular mobile network; switching the class grade of the modem from an initial grade to a preset target grade, wherein the data transmission speed of the preset target grade is greater than that of the initial grade; switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface; after the cellular mobile network is connected, the file to be transmitted is transmitted to the server based on the modem and the universal serial bus interface of the preset target level. Therefore, the client can transmit the file by using cellular mobile data by improving the Cat class of the modem and switching the physical transmission channel at a higher speed, so that the rate of file transmission is obviously improved, and meanwhile, the possibility of transmission failure is reduced due to the improvement of the transmission rate, and the efficiency of file transmission is further improved.
Description
Technical Field
The present disclosure relates to the field of data transmission technologies, and in particular, to a file transmission method, an electronic device, and a storage medium.
Background
At present, when some electronic devices with low memory (such as a smart watch) transmit files, bluetooth connection is usually performed with a mobile phone, the files to be transmitted are transmitted to the mobile phone side through a bluetooth channel, and then the files are transmitted to a server through the mobile phone. However, the transmission rate of bluetooth transmission is about 100KB/s, which requires a lot of time when a file is transmitted, and if the file is transmitted for too long, transmission failure is easily caused, and the efficiency of file transmission is low.
Disclosure of Invention
The application provides a file transmission method, electronic equipment and a storage medium, which can improve the file transmission efficiency of the electronic equipment with lower memory.
In a first aspect, an embodiment of the present application provides a file transmission method, applied to a client, where the method includes: responding to a transmission instruction of a file to be transmitted, and starting a modem to connect a cellular mobile network; switching the class level of the modem from an initial level to a preset target level, wherein the data transmission speed of the preset target level is greater than that of the initial level; switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface; after the cellular mobile network is connected, the file to be transmitted is transmitted to the server based on the modem and the universal serial bus interface of the preset target level.
The client referred to in the technical solution of the present application mainly refers to an electronic device with a low memory and supporting cellular mobile data service, for example, a smart watch, where a RAM (Random Access Memory ) space of the smart watch is generally 32M.
In the technical scheme of the application, the class (Cat) of the Modem (Modem) is improved, and correspondingly, a higher-speed physical transmission channel is switched, so that the client can transmit the file by using the cellular mobile data. Compared with the traditional scheme of transmitting files through Bluetooth, the method and the device can dynamically switch the mode of Bluetooth transmission into cellular transmission when the files to be transmitted are large, the rate of file transmission can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the efficiency of file transmission is further improved.
Optionally, in a possible implementation manner of the first aspect, the switching the class level of the modem from the initial level to the preset target level includes:
the class level of the modem is adjusted to a preset target level;
the modem is restarted to switch the class level of the modem from the initial level to a preset target level.
The Cat class is used to measure the modem technology capability and the supported data transfer speed, among other things. The higher the Cat level, the stronger the wireless connection performance of the client, and the faster the transmission speed. In the embodiment of the present application, the initial level of the modem is generally Cat1, which generally has a low data transmission speed, and is suitable for basic communication requirements. The preset target level is greater than the initial level, and the preset target level is the Cat level supported by the modem. After the Cat level is raised, the modem needs to be restarted to validate the underlying service handoff of the modem, thereby successfully switching the Cat level from the initial level to the preset target level.
Optionally, in another possible implementation manner of the first aspect, the restarting the modem includes:
the modem is restarted by switching the flight mode on and off.
Optionally, in a further possible implementation manner of the first aspect, after the cellular mobile network connection, before the transmitting the file to be transmitted to the server based on the modem and the usb interface of the preset target level, the method further includes:
Acquiring an address of a server;
the modem communicates with the server and establishes a connection according to the address of the server and via the HTTP (Hyper Text Transfer Protocol, hypertext transfer) protocol.
Optionally, in still another possible implementation manner of the first aspect, the transmitting the file to be transmitted to the server includes:
slicing the file to be transmitted to obtain a plurality of subfiles corresponding to the file to be transmitted, wherein the file names of the subfiles comprise file serial numbers, and the file names of the subfiles with the largest file serial numbers also comprise end marks;
and sequentially transmitting each sub-file to the server according to the corresponding file sequence number of each sub-file until the sub-file with the file name including the end mark is transmitted.
Compared with electronic equipment with larger memory, such as a smart phone, the RAM space of the smart phone is generally 8GB or even higher, and the RAM space of the client terminal in the embodiment of the application is smaller, so that the space available for file caching of the client terminal is extremely small. Therefore, when the client needs to transmit the file, the file to be transmitted can be re-sliced, sequentially transmitted, and the server background re-aggregates the sliced files after the transmission is completed to obtain the file to be transmitted. The method for transmitting the file in the slicing mode can effectively solve the problem that the RAM space of the client is insufficient and large files cannot be transmitted.
Optionally, in another possible implementation manner of the first aspect, after the cellular mobile network connects, after the transmitting the file to be transmitted to the server based on the modem and the usb interface of the preset target level, the method further includes:
and switching the class level of the modem from a preset target level to an initial level.
In this case, although raising the Cat level of the modem can increase the file transfer speed, it means that the modem needs to occupy more bandwidth and energy. Therefore, after the file transmission is finished, the Cat grade needs to be reduced in time, so that excessive network bandwidth and the electric quantity of the client can be prevented from being wasted after the file transmission is finished, and the client can operate more reasonably, stably and efficiently.
Optionally, in a further possible implementation manner of the first aspect, after the cellular mobile network connects, after the transmitting the file to be transmitted to the server based on the modem and the usb interface of the preset target level, the method further includes:
the physical transmission channel is switched from the universal serial bus interface to the serial peripheral interface.
Optionally, in a further possible implementation manner of the first aspect, after the transmitting the file to be transmitted to the server, the method further includes:
In the process of transmitting the file to be transmitted, acquiring a file transmission result sent by a server in real time;
and determining and displaying the file transmission progress based on the file transmission result.
In a second aspect, an embodiment of the present application provides another file transmission method, applied to a server, where the method includes:
receiving a file to be transmitted by a client, wherein the file to be transmitted is obtained by the client responding to a transmission instruction of the file to be transmitted, starting a modem to connect a cellular mobile network, switching a class level of the modem from an initial level to a preset target level, switching a physical transmission channel from a serial peripheral interface to a universal serial bus interface, and transmitting the file to be transmitted to a server based on the modem and the universal serial bus interface of the preset target level after the cellular mobile network is connected, wherein the data transmission speed of the preset target level is greater than the data transmission speed of the initial level.
In the technical scheme of the application, the class (Cat) of the Modem (Modem) is improved, and correspondingly, a higher-speed physical transmission channel is switched, so that the client can transmit the file by using the cellular mobile data. Compared with the traditional scheme of transmitting files through Bluetooth, the method and the device can dynamically switch the mode of Bluetooth transmission into cellular transmission when the files to be transmitted are large, the rate of file transmission can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the efficiency of file transmission is further improved.
In a possible implementation manner of the second aspect, the receiving a file to be transmitted by a client includes:
receiving a plurality of subfiles transmitted by a client, wherein the subfiles are obtained by slicing a file to be transmitted by the client, the file names of the subfiles comprise file serial numbers, and the file names of the subfiles with the largest file serial numbers also comprise end marks;
and after the transmission of the subfiles with the file names comprising the ending marks is finished, aggregating all subfiles according to the file serial numbers corresponding to the subfiles to obtain the files to be transmitted.
Optionally, in another possible implementation manner of the second aspect, the method further includes:
generating a file transmission result of the file to be transmitted in real time in the process of receiving the file to be transmitted;
and sending the file transmission result to the client so that the client can determine and display the file transmission progress based on the file transmission result.
In a third aspect, an embodiment of the present application provides a file transmission device, applied to a client, where the device includes:
the starting module is used for responding to a transmission instruction of a file to be transmitted and starting the modem to connect a cellular mobile network;
the class switching module is used for switching the class of the modem from an initial class to a preset target class, wherein the data transmission speed of the preset target class is greater than that of the initial class;
The interface switching module is used for switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface;
and the file transmission module is used for transmitting the file to be transmitted to the server based on the modem and the universal serial bus interface of the preset target grade after the cellular mobile network is connected.
In a fourth aspect, an embodiment of the present application provides another file transmission device, applied to a server, where the device includes:
the file receiving module is used for receiving a file to be transmitted by the client, wherein the file to be transmitted is obtained by the client responding to a transmission instruction of the file to be transmitted, starting a modem to be connected with a cellular mobile network, switching the class level of the modem from an initial level to a preset target level, switching a physical transmission channel from a serial peripheral interface to a universal serial bus interface, and transmitting the file to be transmitted to a server based on the modem and the universal serial bus interface of the preset target level after the cellular mobile network is connected, wherein the data transmission speed of the preset target level is greater than the data transmission speed of the initial level.
In a fifth aspect, embodiments of the present application provide an electronic device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the file transfer method of the first or second aspect described above when the computer program is executed by the processor.
Optionally, the electronic device may be a smart watch, an internet of things (Internet of Things, ioT) device, an embedded system, a vehicle-mounted device, and the like, where the internet of things device further includes an intelligent home device, an intelligent security system, a sensor, and the like; the embedded system further comprises: remote monitoring equipment, traffic signal lamps, intelligent electric meters and the like; the vehicle-mounted equipment also comprises a vehicle navigation system, a vehicle networking system and the like. The memory capacity of the electronic devices is typically small and supports both data connection and communication of cellular mobile data.
In a sixth aspect, embodiments of the present application provide a chip, including a processor, where the processor is configured to read and execute a computer program stored in a memory, and when the computer program is executed by the processor, the method for transmitting a file according to the first aspect or the second aspect is able to be implemented.
Optionally, the chip further comprises a memory, and the memory is electrically connected with the processor.
Optionally, the chip may further comprise a communication interface.
In a seventh aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, which when executed by a processor is capable of implementing the file transfer method of the first aspect or the second aspect.
In an eighth aspect, embodiments of the present application provide a computer program product comprising a computer program capable of implementing the file transfer method of the first or second aspect described above when the computer program is executed by a processor.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a file transmission method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a client promoting Cat class and switching physical transmission channels according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating another file transfer method according to an embodiment of the present disclosure;
FIG. 4 is a schematic flow chart of a slice transmission in a log upload scenario provided in an embodiment of the present application;
FIG. 5 is a schematic diagram illustrating data interaction of a file transfer method according to an embodiment of the present disclosure;
FIG. 6 is a schematic flow chart of a file transmission method in a log uploading scenario according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a document transmission device according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of another document transporting apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
It should be understood that the sequence number of each step in this embodiment does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
In the related art, when transmitting a file, some electronic devices (such as a smart watch) with low memory typically make bluetooth connection with a mobile phone, and transmit the file to be transmitted to the mobile phone side through a bluetooth channel, and then transmit the file to a server through the mobile phone. However, the transmission rate of bluetooth transmission is about 60KB/s, which requires a lot of time when a file is transmitted, and if the file is transmitted for too long, transmission failure is easily caused, and the efficiency of file transmission is low.
In view of this, the embodiments of the present application provide a file transmission method, an electronic device, and a storage medium, where a client may transmit a file by using cellular mobile data by increasing the Cat level of a modem and switching a higher-speed physical transmission channel accordingly. Compared with the traditional scheme of transmitting files through Bluetooth, the method and the device can dynamically switch the mode of Bluetooth transmission into cellular transmission when the files to be transmitted are large, the rate of file transmission can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the efficiency of file transmission is further improved.
The following illustrates an application scenario of the file transmission method provided in the embodiment of the present application;
the method and the device can be applied to a smart watch test (Beta) stage, in the stage, in order to analyze and position the conversation type problem and the stability problem of the modem, the modem log and the Dump (Dump) log are required to be uploaded to the mobile phone through Bluetooth, and the mobile phone can upload log files to a server by utilizing own cellular mobile data. In order to meet the positioning of the modem maintenance problem, at least 60M modem logs and 60M Dump files need to be transmitted, the transmission rate of Bluetooth transmission is very low, meanwhile, other modules of the intelligent watch in the test stage also need to transmit logs through Bluetooth, the logs of other modules can be occupied when the log files are large, secondly, the transmission channel is blocked due to the fact that the log uploading time is too long, and the logs are uploaded by other modules. In order to solve the above problem, the file transmission method provided by the embodiment of the present application may switch the bluetooth transmission mode to cellular transmission, so as to improve the efficiency of log uploading.
The file transmission method provided in the embodiment of the present application is described in detail below by taking a client side and a server side as examples.
First, a detailed description will be given of a file transfer method provided in the embodiment of the present application, taking a client side as an example.
Referring to fig. 1, a flow chart of a file transmission method provided in an embodiment of the present application is shown. As shown in fig. 1, the file transfer method is applied to a client, and may include the following steps:
in step 101, in response to a transmission instruction of a file to be transmitted, the modem is started to connect to the cellular mobile network.
In practical application, the client in the embodiment of the application may be configured in an electronic device with a small memory capacity, such as a smart watch, an internet of things (Internet of Things, ioT) device, an embedded system, and a vehicle-mounted device, and simultaneously support data connection and communication of cellular mobile data. The internet of things equipment further comprises intelligent home equipment, an intelligent safety system, a sensor and the like; the embedded system further comprises: remote monitoring equipment, traffic signal lamps, intelligent electric meters and the like; the vehicle-mounted equipment also comprises a vehicle navigation system, a vehicle networking system and the like.
Among them, a modem is a device for converting digital signals into analog signals (modulation) and converting analog signals into digital signals (demodulation) for implementing functions of client connection to the internet, remote communication, data transmission, etc.
In one possible implementation manner, the transmission instruction may be sent by an instruction client, where a file transmission option may be set on the instruction client, and the user may generate the transmission instruction by clicking on the file transmission option, then instruct the client to send the transmission instruction to a task scheduling module of the client, where the task scheduling module is responsible for coordinating various matters of file transmission in the client, and in a log uploading scenario, the task scheduling module may be a DFX (Design for X, design for each link of a product life cycle). The instruction client may be configured in a mobile phone, a computer, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), and other various electronic devices that are convenient for a user to operate.
In another possible implementation manner, the transmission instruction may be obtained directly by receiving an operation instruction of the user, that is, a file transmission option may be directly set on the client, and the client may directly obtain a transmission instruction generated by the user clicking on the file transmission option, and execute a subsequent file transmission task according to the transmission instruction.
In this embodiment of the present application, when receiving a transmission instruction of a file to be transmitted, the client may start the modem through a corresponding command or setting, for example, a modem control interface provided by an operating system, or by an application program or a device management tool. After the modem is started, the client connects with the cellular mobile network, wherein the processes include the client communicating with the base station of the network operator through the modem, and performing the processes of identity verification, network registration and the like. After establishing a connection with the cellular mobile network, the client may activate the mobile data service by sending a corresponding request through the modem, e.g. sending a specific command or activating a data plan to the network operator, who will verify the client's request and activate the mobile data service according to the subscription plan and the service contract.
Step 102, switching the class level of the modem from the initial level to a preset target level.
The class level, that is, cat class, is a standard defined by 3GPP (3 rd Generation Partnership Project, third generation partnership project) for measuring modem technology capability and supported data transmission speed, and the higher the Cat class, the stronger the wireless connection performance of the client and the faster the transmission speed.
In this embodiment of the present application, the data transmission speed of the preset target level is greater than the data transmission speed of the initial level. The initial level of the modem is typically Cat1, which generally has a low data transmission rate, and is suitable for basic communication requirements. The preset target level is greater than the initial level, and the preset target level is the Cat level supported by the modem. In general, the preset target level is set to Cat4, which is suitable for most file transfer scenarios. It should be noted that, the higher the Cat level is, the greater the power consumption of the client is, so the preset target level cannot be set too high, and the determination needs to be performed in combination with the actual application scenario and the requirement.
As a possible implementation manner, after the Cat level is promoted, the modem needs to be restarted to enable the underlying service handover of the modem to be effective, so that the Cat level is successfully switched from the initial level to the preset target level, that is, in a possible implementation manner of the embodiment of the present application, the step 102 may include: the class level of the modem is adjusted to a preset target level; the modem is restarted to switch the class level of the modem from the initial level to a preset target level. Wherein the modem may be restarted by restarting the client or switching on and off the flight mode. Wherein, it is more convenient, swift to restart the modem through the switch flight mode. It should be noted that, after the flight mode is turned on, the mobile network of the client may wait for several seconds or more to ensure that the mobile network of the client is completely turned off, and then the flight mode is turned off, and the mobile network of the client is re-enabled.
In one possible implementation, the process of switching modem Cat class may be performed by a micro control unit (Microcontroller Unit; MCU) in the client, which comprises a task scheduling module and a cellular dimension module, wherein cellular dimension (Cellular Network Testing) refers to the process of testing and measuring a cellular mobile communication network. Cellular interferometry encompasses the evaluation and analysis of network performance, signal strength, data transmission rate, coverage, etc. After receiving the instruction of the Cat class switching, the micro control unit can call an interface of the cellular maintenance module, and the cellular maintenance module can inform the modem to adjust the Cat class through an AT command (AT commands), and can re-read a Non-Volatile Memory (NV) through a switch flight model after the switching is successful, so that the bottom service switching is effective. Wherein the AT command is a standard command set for communicating with and controlling the modem for configuring and managing the modem, and uses a standard ASCII character format, prefixed with "AT" as a command, followed by a specific command code and parameters. By sending different AT commands to the device, various operations may be performed, such as querying device information, configuring device parameters, sending a short message, making a call, etc., e.g., if the Cat class of the modem is to be switched to Cat4, the AT command may be at+supecat=4. NV is a type of memory commonly used in small electronic devices to store data that remains unchanged after the device is powered down, and thus has very good data retention capabilities, and when the cellular survey re-reads the NV through a switched flight mode, re-reads and loads the device configuration and parameters stored in the NV memory, helping to clear possible network connectivity problems, refresh the device configuration, and re-establish efficient communication between the device and the cellular network.
Step 103, switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface.
It should be noted that, the physical transmission channel corresponding to the initial level of the modem is a serial peripheral interface (Serial Peripheral Interface, SPI), and the physical transmission channel corresponding to the preset target level is a universal serial bus interface (Universal Serial Bus, USB). The serial peripheral interface is a serial communication protocol, which is generally used for short-distance data transmission, the transmission rate of the serial peripheral interface is relatively low, and is generally below tens of MHz, and the serial peripheral interface has the problems of transmission error, interference and the like and is easily influenced by the surrounding environment. The transmission rate and reliability of the serial peripheral interface may be limited in transmission scenarios of large data volumes and in high noise interference environments. In contrast, the universal serial bus interface is a high-speed parallel communication protocol, can support data transmission rates up to 10Gbps, and has good anti-interference capability and transmission reliability. Therefore, after the modem is re-resident, the transmission channel between the micro control unit and the modem is switched from the serial peripheral interface to the universal serial bus interface, so that the data transmission rate and reliability can be obviously improved, and the normal operation of high-speed data transmission can be ensured.
Referring to fig. 2, a schematic flow chart of a client promoting Cat class and switching physical transmission channels is shown. As shown in fig. 2, after receiving a command for switching Cat levels, the task scheduling module in the micro control unit invokes the cellular measurement interface, executes a command of at+supecat=4, modulates the Cat level of the modem into Cat4, switches the modem on and off in a flight mode, re-reads NV to enable the bottom service switching to be effective, further switches the serial peripheral interface to be a universal serial bus interface, queries the current Cat level by executing the command of at+supecat=0 to ensure that the Cat level has been successfully switched, and finally sends a switching result to the task scheduling module.
Step 104, after the cellular mobile network is connected, the file to be transmitted is transmitted to the server based on the modem and the universal serial bus interface of the preset target level.
After the Cat class and the physical transmission channel are switched, the file to be transmitted can be transmitted to the server at a higher rate in a cellular transmission mode.
In the embodiment of the present application, the client has two modes of transmitting files, one is bluetooth transmission, and the second is cellular data transmission. The Bluetooth transmission is a default file transmission mode, and when the files to be transmitted are smaller and the file transmission tasks are fewer, the power consumption of the client can be saved through the Bluetooth transmission mode. However, when the file to be transmitted is large and the file transmission task is more, the bluetooth transmission can be switched to the cellular data transmission by responding to the cellular uploading instruction sent by the user, so that the efficiency of file transmission is improved.
Furthermore, before file transmission, a connection between the client and the server needs to be established, the address of the server may be obtained first, and then the modem and the server may be communicated and a connection may be established according to the address of the server and through the HTTP protocol. Specifically, an HTTP request may be created using software or an application on the modem, then the address of the server is resolved to an IP address, then a network connection is established with the server through a cellular mobile data network (e.g., 2G, 3G, 4G, 5G, etc.) using the network function of the modem, the created HTTP request is further sent to the IP address of the server, and the response of the server is awaited, and the modem processes the response after receiving the response of the server. Through the above steps, the modem can communicate with the server and establish a connection using the HTTP protocol.
In addition, before file transmission, a transmission path of the server needs to be acquired, and the file to be transmitted is read into the memory in a buffer manner so as to be sent to the server later. In the log uploading scenario, after the file to be transmitted is transmitted, the log service (LogService) file is required to be successfully uploaded, and the log service file is used for recording key information such as events, errors, warnings, debugging information and the like generated in the running process of the client so as to facilitate subsequent fault detection, problem analysis and system optimization.
Further, while increasing the Cat level of the modem may increase the speed of file transfer, it also means that the modem needs to occupy more bandwidth and power consumption. Therefore, after the file transmission is finished, the Cat level needs to be reduced in time, so that excessive network bandwidth and electric quantity of the client can be prevented from being wasted after the file transmission is finished, and the client can operate more reasonably, stably and efficiently.
Accordingly, the Cat level of the modem is switched back to the initial level, and the physical transmission channel is the same, and compared with the serial peripheral interface, the power consumption rate of the universal serial bus interface is relatively higher, so that the physical transmission channel can be switched from the universal serial bus interface to the serial peripheral interface when the file to be transmitted is transmitted to the server.
In one possible implementation manner, in order to facilitate the user to obtain the progress of log transmission in real time, the client may obtain the file transmission result sent by the server in real time in the process of transmitting the file to be transmitted, and determine and display the file transmission progress based on the file transmission result. The file transmission progress may be directly displayed on the client, or may be displayed on an instruction client connected to bluetooth of the client, which is not limited in this application.
According to the file transmission method provided by the embodiment of the application, the client side improves the Cat grade of the modem and correspondingly switches the higher-speed physical transmission channel, so that the client side can transmit the file by using the cellular mobile data. According to the method and the device, when the file to be transmitted is large, the Bluetooth transmission mode is dynamically switched to cellular transmission, the file transmission rate can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the file transmission efficiency is further improved.
In one possible implementation manner of the present application, compared to an electronic device with a larger memory, such as a smart phone, a RAM space of the smart phone is generally 8GB or even higher, and a RAM space of a client in the embodiment of the present application is smaller, so that a space available for file caching by the client is very small. Therefore, when the client needs to transmit the file, the file to be transmitted can be re-sliced, sequentially transmitted, and the server background re-aggregates the sliced files after the transmission is completed to obtain the file to be transmitted. The method for transmitting the file in the slicing mode can effectively solve the problem that the RAM space of the client is insufficient and large files cannot be transmitted.
The file transmission method provided in the embodiment of the present application is further described below with reference to fig. 3.
Referring to fig. 3, a flowchart of another file transfer method provided in an embodiment of the present application is shown. As shown in fig. 3, the file transfer method may include the steps of:
in step 301, in response to a transmission instruction of a file to be transmitted, the modem is started to connect to the cellular mobile network.
Step 302, switching the class level of the modem from the initial level to a preset target level.
The data transmission speed of the preset target level is larger than the data transmission speed of the initial level.
Step 303, switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface.
The specific implementation and principles of the steps 301 to 303 may refer to the detailed description of the foregoing embodiments, which is not repeated herein.
And 304, slicing the file to be transmitted to obtain a plurality of subfiles corresponding to the file to be transmitted.
It should be noted that, when the client with larger memory uploads the file through the cellular, the client can implement automatic aggregation in the server background by applying for a plurality of URLs (Uniform Resource Locator, uniform resource locators). The client memory referred to in the embodiment of the present application is small, and the space available for file caching is very small, and the existing uploading mechanism cannot be compatible, so that slicing processing needs to be performed on the file to be transmitted.
The file name of the sub-file comprises a file sequence number, and the file name of the sub-file with the largest file sequence number also comprises an end mark.
In one possible implementation, when the file transfer service module of the client reads a larger file, the file transfer service module may read the larger file in buffers (buffers), each Buffer is a sub-file of the file to be transferred, and the size of the sub-file may be 1M, and then the sub-file is transferred to a modem, and the modem renames the transferred Buffer. Taking a log uploading scenario as an example, the naming rule of the same file to be transmitted when the fragments are named can be as follows: product name_version number_imei_timestamp_single number_device_modemlog_file number log, wherein the file number is: starting with 1, the last file is appended sequentially, e.g., 1,2, 3..100, with an end flag "end" such as "xxx_modemlog_end. Log" appended to the sequence number.
And 305, sequentially transmitting each sub-file to the server according to the file sequence number corresponding to each sub-file until the sub-file with the file name including the end mark is transmitted.
The process of sequentially transmitting each subfile to the server is performed under the condition of the modem and the usb interface of the preset target level after the cellular mobile network is connected, and specific reference may be made to the detailed description of the foregoing embodiments, which is not repeated herein.
In this embodiment of the present application, after each of the segment subfiles is uploaded to the server, the server performs recognition and re-aggregation according to the file name, and finally generates a download link.
Referring to fig. 4, a schematic flow chart of a slice transmission in a log upload scenario is shown. As shown in fig. 4, the completion log file is first sliced to obtain a plurality of subfiles: and the modemLog_1 and the modemLog_2 … … modemLog_N … … modemLog_end are sequentially transmitted to the server according to the file serial numbers until the transmission of the subfiles with the file names including the end mark end is completed, and then the server background aggregates the sliced subfiles to obtain the complete modem log file to be uploaded.
In one possible implementation manner, in order to facilitate the user to obtain the progress of log transmission in real time, the client may generate and display the file transmission progress in real time by obtaining the file transmission result sent by the server for each sub-file in the process of transmitting each sub-file.
According to the file transmission method, when the client needs to transmit the file, the file to be transmitted is re-sliced, sequentially transmitted, and the server background re-aggregates the sliced files after the transmission is completed, so that the file to be transmitted is obtained. The method for transmitting the file in the slicing mode can effectively solve the problem that the RAM space of the client is insufficient and large files cannot be transmitted.
The file transmission method provided in the embodiment of the present application is described in detail below by taking a server side as an example.
Receiving a file to be transmitted by a client, wherein the file to be transmitted is obtained by the client responding to a transmission instruction of the file to be transmitted, starting a modem to connect a cellular mobile network, switching a class level of the modem from an initial level to a preset target level, switching a physical transmission channel from a serial peripheral interface to a universal serial bus interface, and transmitting the file to be transmitted to a server based on the modem and the universal serial bus interface of the preset target level after the cellular mobile network is connected, wherein the data transmission speed of the preset target level is greater than the data transmission speed of the initial level.
Further, because the RAM space of the client is small, the space available for file caching by the client is minimal. Therefore, when the client needs to transmit the file, the file to be transmitted can be re-sliced, sequentially transmitted, and the server background re-aggregates the sliced files after the transmission is completed to obtain the file to be transmitted. That is, in one possible implementation manner of the embodiment of the present application, the receiving the file to be transmitted by the client may include: receiving a plurality of subfiles transmitted by a client, wherein the subfiles are obtained by slicing a file to be transmitted by the client, the file names of the subfiles comprise file serial numbers, and the file names of the subfiles with the largest file serial numbers also comprise end marks; and after the transmission of the subfiles with the file names comprising the ending marks is finished, aggregating all subfiles according to the file serial numbers corresponding to the subfiles to obtain the files to be transmitted.
In one possible implementation manner, in order to facilitate the user to obtain the progress of log transmission in real time, the server may generate the file transmission result of the file to be transmitted in real time in the process of receiving the file to be transmitted; and sending the file transmission result to the client so that the client can determine and display the file transmission progress based on the file transmission result. The server can want the client to return the file transmission result of the sub-file when receiving one sub-file, so that the file transmission progress generated by the client is more accurate; the server may also return the file transmission result of the subfiles received in the period of time at intervals, or return the file transmission result of the fixed number of subfiles once every time a fixed number of subfiles is received, for example 10, so that excessive resource consumption of the client and the server can be avoided.
According to the file transmission method provided by the embodiment of the application, the client side improves the Cat grade of the modem and correspondingly switches the higher-speed physical transmission channel, so that the client side can transmit the file by using the cellular mobile data. According to the method and the device, when the file to be transmitted is large, the Bluetooth transmission mode is dynamically switched to cellular transmission, the file transmission rate can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the file transmission efficiency is further improved.
Fig. 5 is a schematic data interaction diagram of a file transmission method according to an embodiment of the present application.
As shown in fig. 5, the file transfer method includes the steps of:
in step 501, the client starts a modem to connect to a cellular mobile network in response to a transmission instruction of a file to be transmitted.
In step 502, the client switches the class level of the modem from the initial level to a preset target level.
The data transmission speed of the preset target level is larger than the data transmission speed of the initial level.
In step 503, the client switches the physical transmission channel from the serial peripheral interface to the universal serial bus interface.
In step 504, the client transmits the file to be transmitted to the server based on the modem and the usb interface of the preset target level after the cellular mobile network connection.
In step 505, the server receives a file to be transmitted by the client.
In the above process, the client side promotes the Cat level of the modem and accordingly switches the higher-speed physical transmission channel, so that the client side can transmit the file by using the cellular mobile data. According to the method and the device, when the file to be transmitted is large, the Bluetooth transmission mode is dynamically switched to cellular transmission, the file transmission rate can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the file transmission efficiency is further improved.
Referring to fig. 6, a schematic flow chart of a file transfer method in a log uploading scenario is shown. As shown in fig. 6, taking a client side as a smart watch and an instruction client side as a mobile phone as an example, firstly, a user clicks a log uploading button in the mobile phone by using the mobile health APP (because the mobile health APP is strongly related to the smart watch) and checks a cellular uploading switch, a task scheduling module receives the transmission instruction, and performs the operations of powering up a modem, activating cellular mobile data service, switching Cat4, switching a flight mode, reconnecting a network, the task scheduling module further notifies a file transmission service module to transmit a file, the file transmission service module reads the file in fragments, transmits a slicing sub-file to a log server on a server side through the modem, returns a transmission result to the file transmission service module after the slicing sub-file is successfully transmitted, and then transmits the transmission result to the mobile health APP side, so as to display the transmission progress, and after all log transmission is completed, the file transmission service module notifies the task scheduling module to notify the modem to power down, reduce Cat level, and the log server further aggregates fragmented sub-files, links to a log downloading website, wherein the log downloading service can provide visual downloading service, so as to analyze the problems of the log downloading website and the call stability.
In order to achieve the above embodiments, the present application further provides a file transmission device applicable to a client.
Referring to fig. 7, a schematic structural diagram of a file transmission device provided in an embodiment of the present application is applied to a client, and for convenience of explanation, only a portion related to the embodiment of the present application is shown. As shown in fig. 7, the file transfer device 700 includes:
the starting module 701 is configured to start the modem to connect to the cellular mobile network in response to a transmission instruction of a file to be transmitted.
The class switching module 702 is configured to switch the class of the modem from an initial class to a preset target class, where the data transmission speed of the preset target class is greater than the data transmission speed of the initial class.
An interface switching module 703 is configured to switch the physical transmission channel from the serial peripheral interface to the universal serial bus interface.
The file transmission module 704 is configured to transmit, after the cellular mobile network is connected, a file to be transmitted to the server based on the modem and the usb interface of the preset target class.
In practical use, the file transmission device provided in the embodiment of the present application may be configured in an electronic device to execute the foregoing file transmission method.
According to the file transmission device provided by the embodiment of the application, the client side improves the Cat grade of the modem and correspondingly switches the higher-speed physical transmission channel, so that the client side can transmit the file by using the cellular mobile data. According to the method and the device, when the file to be transmitted is large, the Bluetooth transmission mode is dynamically switched to cellular transmission, the file transmission rate can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the file transmission efficiency is further improved.
In one possible implementation manner of the present application, the level switching module 702 may specifically include the following units:
and the first adjusting unit is used for adjusting the class level of the modem to a preset target level.
And the first restarting unit is used for restarting the modem so as to switch the class level of the modem from the initial level to the preset target level.
Further, in another possible implementation manner of the present application, the first restarting unit may specifically be configured to restart the modem by switching on and then off the flight mode.
Further, in still another possible implementation manner of the present application, the file transmitting apparatus 700 may further include the following modules:
The first acquisition module is used for acquiring the address of the server.
And the second communication module is used for communicating the modem with the server and establishing connection according to the address of the server and through the hypertext transfer HTTP protocol.
Further, in still another possible implementation manner of the present application, the file transmission module 704 may specifically include the following units:
the first processing unit is used for slicing the file to be transmitted to obtain a plurality of subfiles corresponding to the file to be transmitted, wherein the file names of the subfiles comprise file serial numbers, and the file names of the subfiles with the largest file serial numbers also comprise end marks.
And the first transmission unit is used for sequentially transmitting each sub-file to the server according to the file sequence number corresponding to each sub-file until the sub-file with the file name comprising the end mark is transmitted.
Further, in another possible implementation manner of the present application, the file transmission apparatus 700 may further include the following modules:
the first switching module is used for switching the class grade of the modem from a preset target grade to an initial grade.
Further, in another possible implementation manner of the present application, the file transmission apparatus 700 may further include the following modules:
And the second switching module is used for switching the physical transmission channel from the universal serial bus interface to the serial peripheral interface.
Further, in another possible implementation manner of the present application, the file transmission apparatus 700 may further include the following modules:
the second acquisition module is used for acquiring a file transmission result sent by the server in real time in the process of transmitting the file to be transmitted.
And the progress display module is used for determining and displaying the file transmission progress based on the file transmission result.
The file transmission device provided in the embodiment of the present application may be applied to the foregoing method embodiment, and details refer to descriptions of the foregoing method embodiment, which are not repeated herein.
It should be noted that the foregoing explanation of the embodiment of the file transfer method shown in fig. 1 to 6 is also applicable to the file transfer apparatus 700 of this embodiment, and will not be repeated here.
In order to achieve the above embodiments, the present application further provides a file transmission device applicable to a server.
Referring to fig. 8, a schematic structural diagram of a file transmission device provided in an embodiment of the present application is applied to a server, and for convenience of explanation, only a portion related to the embodiment of the present application is shown. As shown in fig. 8, the file transfer device 800 includes:
The file receiving module 801 is configured to receive a file to be transmitted from a client, where the file to be transmitted is obtained by the client starting a modem to connect to a cellular mobile network in response to a transmission instruction of the file to be transmitted, switching a class of the modem from an initial class to a preset target class, switching a physical transmission channel from a serial peripheral interface to a universal serial bus interface, and transmitting the file to be transmitted to a server based on the modem and the universal serial bus interface of the preset target class after the cellular mobile network is connected, where a data transmission speed of the preset target class is greater than a data transmission speed of the initial class.
In practical use, the file transmission device provided in the embodiment of the present application may be configured in an electronic device to execute the foregoing file transmission method.
According to the file transmission device provided by the embodiment of the application, the client side improves the Cat grade of the modem and correspondingly switches the higher-speed physical transmission channel, so that the client side can transmit the file by using the cellular mobile data. According to the method and the device, when the file to be transmitted is large, the Bluetooth transmission mode is dynamically switched to cellular transmission, the file transmission rate can be remarkably improved, meanwhile, the possibility of transmission failure is also reduced due to improvement of the transmission rate, and the file transmission efficiency is further improved.
In one possible implementation manner of the present application, the file receiving module 801 may further include the following units;
the first receiving unit is used for receiving a plurality of subfiles transmitted by the client, wherein the subfiles are obtained by slicing a file to be transmitted by the client, the file name of each subfile comprises a file sequence number, and the file name of the subfile with the largest file sequence number also comprises an end mark;
and the file aggregation unit is used for aggregating all the subfiles according to the corresponding file serial numbers of the subfiles after the transmission of the subfiles with the file names including the end marks is completed, so as to obtain the files to be transmitted.
In one possible implementation manner of the present application, the file transmitting apparatus 800 may further include the following modules:
the result generation module is used for generating file transmission results of the files to be transmitted in real time in the process of receiving the files to be transmitted;
and the result sending module is used for sending the file transmission result to the client so that the client can determine and display the file transmission progress based on the file transmission result.
The file transmission device provided in the embodiment of the present application may be applied to the foregoing method embodiment, and details refer to descriptions of the foregoing method embodiment, which are not repeated herein.
It should be noted that the foregoing explanation of the embodiment of the file transfer method shown in fig. 1 to 6 is also applicable to the file transfer apparatus 800 of this embodiment, and will not be repeated here.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 9, the electronic device 900 of this embodiment includes: at least one processor 910 (only one shown in fig. 9), a memory 920, and a computer program 921 stored in the memory 920 and executable on the at least one processor 910, the processor 910 implementing the steps in the above-described embodiments of the file transfer method when executing the computer program 921.
The electronic device 900 may be a computing device such as a desktop computer, a notebook computer, a palm computer, and a cloud server. The electronic device may include, but is not limited to, a processor 910, a memory 920. It will be appreciated by those skilled in the art that fig. 9 is merely an example of an electronic device 900 and is not intended to limit the electronic device 900, and may include more or fewer components than shown, or may combine certain components, or may include different components, such as input-output devices, network access devices, etc.
The processor 910 may be a central processing unit (Central Processing Unit, CPU), the processor 910 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 920 may be an internal storage unit of electronic device 900 in some embodiments, such as a hard disk or memory of electronic device 900. The memory 920 may also be an external storage device of the electronic device 900 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 900. Further, the memory 920 may also include both internal storage units and external storage devices of the electronic device 900. The memory 920 is used to store an operating system, application programs, boot Loader (Boot Loader), data, and other programs, such as program codes of computer programs. The memory 920 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/electronic device and method may be implemented in other manners. For example, the apparatus/electronic device embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The present application implementing all or part of the processes in the methods of the embodiments described above may also be implemented by a computer program product, which when run on an electronic device causes the electronic device to perform the steps in the embodiments of the methods described above.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.
Claims (13)
1. A method for file transfer, applied to a client, the method comprising:
responding to a transmission instruction of a file to be transmitted, and starting a modem to connect a cellular mobile network;
switching the class level of the modem from an initial level to a preset target level, wherein the data transmission speed of the preset target level is greater than the data transmission speed of the initial level;
Switching the physical transmission channel from the serial peripheral interface to the universal serial bus interface;
and after the cellular mobile network is connected, transmitting the file to be transmitted to a server based on the modem of the preset target level and the universal serial bus interface.
2. The method of claim 1, wherein said switching the class level of the modem from an initial level to a preset target level comprises:
adjusting the class level of the modem to the preset target level;
restarting the modem to switch the class level of the modem from the initial level to the preset target level.
3. The method of claim 2, wherein the restarting the modem comprises:
the modem is restarted by switching on and off the flight mode.
4. The method of claim 1, wherein after the cellular mobile network connection, based on the modem of the preset target level and the usb interface, the method further comprises, before transmitting the file to be transmitted to a server:
Acquiring the address of the server;
and according to the address of the server, the modem is communicated with the server and a connection is established through a hypertext transfer HTTP protocol.
5. The method of claim 1, wherein the transmitting the file to be transmitted to a server comprises:
slicing the file to be transmitted to obtain a plurality of subfiles corresponding to the file to be transmitted, wherein the file names of the subfiles comprise file serial numbers, and the file names of the subfiles with the largest file serial numbers also comprise end marks;
and sequentially transmitting each sub-file to the server according to the file sequence number corresponding to each sub-file until the sub-file with the file name including the ending mark is transmitted.
6. The method of claim 1, wherein after the transmitting the file to be transmitted to the server based on the modem of the preset target level and the usb interface after the cellular mobile network connection, the method further comprises:
and switching the class level of the modem from the preset target level to the initial level.
7. The method of claim 1, wherein after the transmitting the file to be transmitted to the server based on the modem of the preset target level and the usb interface after the cellular mobile network connection, the method further comprises:
and switching a physical transmission channel from the universal serial bus interface to the serial peripheral interface.
8. The method according to any one of claims 1-7, further comprising:
in the process of transmitting the file to be transmitted, acquiring a file transmission result sent by the server in real time;
and determining and displaying the file transmission progress based on the file transmission result.
9. A file transfer method, applied to a server, comprising:
receiving a file to be transmitted by a client, wherein the file to be transmitted is obtained by the client responding to a transmission instruction of the file to be transmitted, starting a modem to be connected with a cellular mobile network, switching a class level of the modem from an initial level to a preset target level, switching a physical transmission channel from a serial peripheral interface to a universal serial bus interface, and transmitting the file to be transmitted to the server based on the modem and the universal serial bus interface of the preset target level after the cellular mobile network is connected, wherein the data transmission speed of the preset target level is greater than the data transmission speed of the initial level.
10. The method of claim 9, wherein receiving the file to be transmitted by the client comprises:
receiving a plurality of subfiles transmitted by the client, wherein the subfiles are obtained by slicing the file to be transmitted by the client, the file name of each subfile comprises a file sequence number, and the file name of the subfile with the largest file sequence number also comprises an end mark;
and after the transmission of the subfiles with the file names comprising the ending marks is finished, all the subfiles are aggregated according to the file serial numbers corresponding to the subfiles, so that the file to be transmitted is obtained.
11. The method according to any one of claims 9-10, wherein the method further comprises:
generating a file transmission result of the file to be transmitted in real time in the process of receiving the file to be transmitted;
and sending the file transmission result to the client so that the client determines and displays the file transmission progress based on the file transmission result.
12. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any one of claims 1 to 8 or the method according to any one of claims 9 to 11 when executing the computer program.
13. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method of any one of claims 1 to 8 or implements the method of any one of claims 9 to 11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310747737.9A CN116489146A (en) | 2023-06-25 | 2023-06-25 | File transmission method, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310747737.9A CN116489146A (en) | 2023-06-25 | 2023-06-25 | File transmission method, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116489146A true CN116489146A (en) | 2023-07-25 |
Family
ID=87212307
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310747737.9A Pending CN116489146A (en) | 2023-06-25 | 2023-06-25 | File transmission method, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116489146A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180098286A1 (en) * | 2015-06-12 | 2018-04-05 | Huawei Technologies Co., Ltd. | Power consumption control method for wearable device, and wearable device |
CN109743765A (en) * | 2018-12-29 | 2019-05-10 | 出门问问信息科技有限公司 | Data processing method, device, wearable device and computer readable storage medium |
CN110418387A (en) * | 2019-07-23 | 2019-11-05 | 广东乐之康医疗技术有限公司 | A kind of wearable device data uploading method |
CN110798868A (en) * | 2018-08-02 | 2020-02-14 | 华为技术有限公司 | Network switching method, electronic equipment and chip subsystem |
CN112654031A (en) * | 2020-12-23 | 2021-04-13 | 珠海市魅族科技有限公司 | Method, device, medium and computer equipment for intelligent watch network management |
US20210410036A1 (en) * | 2019-03-14 | 2021-12-30 | Guangdong Genius Technology Co., Ltd. | Network optimization method based on wearable device and wearable device |
CN115002848A (en) * | 2021-11-17 | 2022-09-02 | 荣耀终端有限公司 | Network switching method, medium, program product and electronic device |
-
2023
- 2023-06-25 CN CN202310747737.9A patent/CN116489146A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180098286A1 (en) * | 2015-06-12 | 2018-04-05 | Huawei Technologies Co., Ltd. | Power consumption control method for wearable device, and wearable device |
CN110798868A (en) * | 2018-08-02 | 2020-02-14 | 华为技术有限公司 | Network switching method, electronic equipment and chip subsystem |
CN109743765A (en) * | 2018-12-29 | 2019-05-10 | 出门问问信息科技有限公司 | Data processing method, device, wearable device and computer readable storage medium |
US20210410036A1 (en) * | 2019-03-14 | 2021-12-30 | Guangdong Genius Technology Co., Ltd. | Network optimization method based on wearable device and wearable device |
CN110418387A (en) * | 2019-07-23 | 2019-11-05 | 广东乐之康医疗技术有限公司 | A kind of wearable device data uploading method |
CN112654031A (en) * | 2020-12-23 | 2021-04-13 | 珠海市魅族科技有限公司 | Method, device, medium and computer equipment for intelligent watch network management |
CN115002848A (en) * | 2021-11-17 | 2022-09-02 | 荣耀终端有限公司 | Network switching method, medium, program product and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107612661B (en) | Data communication method and device | |
US20180157562A1 (en) | Virtual machine-based data transmission method, apparatus and system | |
US10474452B2 (en) | Firmware upgrade through GPIO port via UART protocol | |
CN106793007B (en) | Interactive communication method and system of cloud and Bluetooth device and wireless router | |
WO2014183690A1 (en) | Method of processing application program upgrade, and terminal device | |
WO2017049553A1 (en) | Mobile terminal, power supply adapter, and upgrading method thereof | |
WO2013071747A1 (en) | Method and apparatus for obtaining file | |
WO2012097651A1 (en) | Automatic drive test system in a mobile communications network | |
CN109981360B (en) | Internet of things equipment site opening method, device and system and storage medium | |
CN104243271A (en) | Method and system for realizing off-line message pushing through XMPP | |
CN112187921B (en) | Object file downloading method, device, system, server and storage medium | |
CN113014637A (en) | Information display method and information push method | |
CN110912805B (en) | Message reading state synchronization method, terminal, server and system | |
CN110362055A (en) | A kind of industrial data acquisition system that terminal is expansible and method | |
CN110762773A (en) | Upgrading method of air conditioner and air conditioner | |
CN111884938B (en) | Router information acquisition method and device | |
CN116489146A (en) | File transmission method, electronic equipment and storage medium | |
CN113805918A (en) | Data interaction system and method for upgrading TBOX and obtaining TBOX logs | |
CN114996195B (en) | Method, system, device and medium for acquiring carbon footprint data | |
CN103220715A (en) | Method and device for reporting network performance testing result | |
CN107171915B (en) | Communication protocol changing method and device | |
CN112925538B (en) | Equipment updating method, system and device | |
CN112887362B (en) | Equipment access method, equipment access device and server | |
CN116938710A (en) | Terminal firmware upgrading method, device, equipment and storage medium | |
CN114326673A (en) | Vehicle remote diagnosis method and device, connector and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |