CN110311968B - Method and device for loading file in streaming mode and intelligent equipment - Google Patents

Method and device for loading file in streaming mode and intelligent equipment Download PDF

Info

Publication number
CN110311968B
CN110311968B CN201910563041.4A CN201910563041A CN110311968B CN 110311968 B CN110311968 B CN 110311968B CN 201910563041 A CN201910563041 A CN 201910563041A CN 110311968 B CN110311968 B CN 110311968B
Authority
CN
China
Prior art keywords
file
loaded
uri
fast application
uniform resource
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.)
Active
Application number
CN201910563041.4A
Other languages
Chinese (zh)
Other versions
CN110311968A (en
Inventor
杨亮
祁建斌
陈胤立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201910563041.4A priority Critical patent/CN110311968B/en
Publication of CN110311968A publication Critical patent/CN110311968A/en
Application granted granted Critical
Publication of CN110311968B publication Critical patent/CN110311968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The disclosure relates to a method and a device for loading files in a streaming mode and intelligent equipment. The method comprises the following steps: in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally; if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded; and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI. According to the method and the device, the follow-up fast application program can execute the streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, so that the defect that the streaming loading cannot be carried out due to the fact that the file to be loaded is not completely downloaded can be avoided, the streaming loading can be carried out smoothly, the streaming loading efficiency is improved, and further the user experience can be improved.

Description

Method and device for loading file in streaming mode and intelligent equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for streaming loading a file, and an intelligent device.
Background
At present, when fast application streaming loading is performed, streaming loading can be performed only by ensuring that all files in a fast application image package are downloaded to the local. If the image package contains the files which are not downloaded, the loading process needs to be suspended, the downloading of the files is completed, and then the loading process is restarted. Therefore, the scheme can reduce the efficiency of the streaming loading of the fast application, so that the running of the fast application is stopped, and the experience of a user is influenced.
Disclosure of Invention
In order to overcome the problems in the related art, embodiments of the present disclosure provide a method and an apparatus for loading a file in a streaming manner, and an intelligent device, so as to solve the defects in the related art.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for streaming loading a file, which is applied to a fast application framework, the method including:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
In an embodiment, the method further comprises:
and if the fast application program is detected to execute the streaming loading operation, performing block on the streaming loading operation.
In an embodiment, after the block of the streaming load operation, the method further includes:
and if the file to be loaded is detected to be completely downloaded, sending a real Uniform Resource Identifier (URI) of the file to be loaded to the fast application program.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for streaming loading a file, which is applied to a fast application program, the method including:
sending identification information of a file to be loaded to a fast application framework;
receiving a simulated Uniform Resource Identifier (URI) of the file to be loaded, wherein the simulated URI comprises a URI generated by the fast application framework for the file to be loaded when the fast application framework responds to the received identification information and the file to be loaded is not found locally;
and executing streaming loading operation on the file to be loaded based on the simulation Uniform Resource Identifier (URI).
In an embodiment, the performing a streaming load operation on the file to be loaded based on the emulated uniform resource identifier URI includes:
and executing the open file OpenFile in the file content provider based on the simulation uniform resource identifier URI.
In an embodiment, after the performing the streaming load operation on the file to be loaded based on the emulated uniform resource identifier URI, the method further includes:
receiving a real Uniform Resource Identifier (URI) of the file to be loaded, which is sent by the fast application framework, wherein the real URI comprises a URI which is obtained by the fast application framework when the fast application framework detects that the file to be loaded is downloaded and is used for identifying the resource of the file to be loaded;
and loading the file to be loaded based on the real uniform resource identifier URI.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for streaming loading a file, which is applied to a fast application framework, the apparatus including:
the loading file searching module is used for responding to the received identification information of the file to be loaded sent by the fast application program and searching the file to be loaded locally;
the simulation identifier generation module is used for generating a simulation Uniform Resource Identifier (URI) of the file to be loaded when the file to be loaded is not found;
and the simulation identifier sending module is used for sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
In one embodiment, the apparatus further comprises:
and the loading operation block module is used for carrying out block on the streaming type loading operation when the fast application program is detected to execute the streaming type loading operation.
In one embodiment, the apparatus further comprises:
and the real identifier sending module is used for sending the real uniform resource identifier URI of the file to be loaded to the fast application program when the file to be loaded is detected to be completely downloaded.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for streaming loading a file, which is applied to a fast application, the apparatus including:
the identification information sending module is used for sending the identification information of the file to be loaded to the fast application framework;
the simulation identifier receiving module is used for receiving a simulation uniform resource identifier URI of the file to be loaded, wherein the simulation uniform resource identifier URI comprises a URI which is generated by the fast application framework in response to the fact that the identification information is received and the file to be loaded is not found locally;
and the first loading execution module is used for executing the streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
In an embodiment, the first load execution module is further configured to execute an open file OpenFile in a file content provider based on the emulated uniform resource identifier URI.
In one embodiment, the apparatus further comprises a second load execution module;
the second load execution module includes:
a real identifier receiving unit, configured to receive a real uniform resource identifier URI of the to-be-loaded file sent by the fast application framework, where the real uniform resource identifier URI includes a URI, obtained by the fast application framework when it is detected that the to-be-loaded file is downloaded, and used for identifying a resource of the to-be-loaded file;
and the second loading execution unit is used for loading the file to be loaded based on the real uniform resource identifier URI.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a smart device, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the present disclosure can realize that a subsequent fast application program performs a streaming loading operation on a file to be loaded based on a simulated uniform resource identifier URI when the file to be loaded is not found locally, since the simulated uniform resource identifier URI is generated for the file to be loaded and sent to the fast application program, the subsequent fast application program can perform the streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, and thus the disadvantage that the streaming loading cannot be performed because the file to be loaded is not downloaded completely can be avoided, the method and the device can ensure smooth running of stream loading, improve the efficiency of stream loading and further improve the user experience. Moreover, the intrusion of the fast application framework of the embodiment is small, and the feasibility of the scheme can be enhanced to a certain extent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a flowchart illustrating a method of streaming a file according to a first exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of streaming a file according to a second exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of streaming a file according to a third exemplary embodiment.
Fig. 4 is a flowchart illustrating a method of streaming a file according to a fourth exemplary embodiment.
Fig. 5 is a flowchart illustrating a method of streaming a file according to a fifth exemplary embodiment.
Fig. 6 is a flowchart illustrating a method of streaming a file according to a sixth exemplary embodiment.
FIG. 7 is a block diagram illustrating an apparatus for streaming a file in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating another apparatus for streaming a file in accordance with an illustrative embodiment.
FIG. 9 is a block diagram illustrating an apparatus for streaming a file in accordance with an illustrative embodiment.
FIG. 10 is a block diagram illustrating another apparatus for streaming a file in accordance with an illustrative embodiment.
FIG. 11 is a block diagram illustrating a smart device in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments identical to the present invention. Rather, they are merely examples of the same apparatus and methods as some aspects of the invention, as detailed in the appended claims.
FIG. 1 is a flow diagram illustrating a method of streaming a file in accordance with a first exemplary embodiment; the method for loading the file in the streaming mode can be applied to a fast application Framework (such as Hybrid Framework).
As shown in fig. 1, the method comprises the following steps S101-S104:
in step S101: and in response to receiving the identification information of the file to be loaded sent by the fast application program, locally searching the file to be loaded.
In an embodiment, the fast application may include a fast application client running on a fast application Framework in the terminal device. The terminal device may include a smart phone, a tablet computer, a desktop computer, or the like, which is not limited in this embodiment.
In an embodiment, when the fast application program needs to perform streaming loading, the identification information of the file to be loaded may be sent to the fast application framework, so that the fast application framework searches for the uniform resource identifier URI of the file to be loaded based on the identification information, and then the subsequent step of performing streaming loading based on the URI may be implemented.
In an embodiment, the identification information of the file to be loaded may include a name or a number of the file to be loaded, which is not limited in this embodiment.
In an embodiment, after the fast application framework receives the identification information of the file to be loaded sent by the fast application program, the file to be loaded may be searched locally in response to the received identification information. The local may include a local of the terminal device having the fast application framework, which is not limited in this embodiment.
In step S102: and if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded.
In an embodiment, after the file to be loaded is locally searched in response to receiving the identification information of the file to be loaded sent by the fast application program, if the file to be loaded is not searched, a simulated uniform resource identifier URI may be generated for the file to be loaded.
In an embodiment, the fast application framework may not find the to-be-loaded file due to "the to-be-loaded file is not downloaded completely", and the like, which is not limited in this embodiment.
In an embodiment, the fast application framework may generate the simulated uniform resource identifier URI of the file to be loaded in multiple ways according to actual business needs of developers, and the specific generation way is not limited in this embodiment.
For example, the preset string may be "wrapped" based on existing URI generation methods to generate the simulated URI that conforms to the universal URI format.
It is worth noting that the simulated URI is not a true URI (i.e., not a resource that uniquely identifies the file to be loaded), but rather is formally consistent with the URI format.
In step S103: and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
In an embodiment, after the fast application framework generates the simulated uniform resource identifier URI of the file to be loaded, the simulated uniform resource identifier URI may be sent to the fast application program, so that the fast application program performs a streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI.
It should be noted that the manner of the fast application executing the streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI is different from the manner of loading the to-be-loaded file based on the real URI of the to-be-loaded file, that is, the to-be-loaded file is not loaded really, but the file content provider corresponding to the simulated uniform resource identifier URI is executed, so that the disadvantage that the streaming loading cannot be performed due to incomplete downloading of the to-be-loaded file can be avoided, the streaming loading can be performed smoothly, and the streaming loading efficiency can be improved.
In an embodiment, the manner in which the fast application performs the streaming load operation on the file to be loaded based on the emulated uniform resource identifier URI may be referred to the following embodiment shown in fig. 5, and will not be described in detail here.
As can be seen from the above description, in this embodiment, in response to receiving identification information of a to-be-loaded file sent by a fast application, the to-be-loaded file is locally searched, and when the to-be-loaded file is not found, a simulated uniform resource identifier URI of the to-be-loaded file is generated, and then the simulated uniform resource identifier URI is sent to the fast application, so that the fast application performs a streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI, because when the to-be-loaded file is not found locally, the simulated uniform resource identifier URI is generated for the to-be-loaded file and sent to the fast application, a subsequent fast application can perform a streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI, and therefore, the disadvantage that the streaming loading cannot be performed because the to-be-loaded file is not downloaded completely can be avoided, the method and the device can ensure smooth running of stream loading, improve the efficiency of stream loading and further improve the user experience. Moreover, the intrusion of the fast application framework of the embodiment is small, and the feasibility of the scheme can be enhanced to a certain extent.
Fig. 2 is a flowchart illustrating a method of streaming a file according to a second exemplary embodiment. The method for loading the file in the streaming mode can be applied to a fast application Framework (such as Hybrid Framework).
As shown in fig. 2, the method comprises the following steps S201-S204:
in step S201: and in response to receiving the identification information of the file to be loaded sent by the fast application program, locally searching the file to be loaded.
In step S202: and if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded.
In step S203: and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
For the explanation and description of steps S201 to S203, reference may be made to the above embodiments, which are not described herein again.
In step S204: and if the fast application program is detected to execute the streaming loading operation, performing block on the streaming loading operation.
In an embodiment, after the fast application framework sends the simulated uniform resource identifier URI to the fast application program, it may be detected whether the fast application program performs a streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, and if it is detected that the fast application program performs the streaming loading operation, block may be performed on the streaming loading operation.
In an embodiment, the purpose of blocking the streaming load operation may include "pausing" the streaming load operation and not affecting the streaming load of other files to ensure the progress of the streaming load.
Further, after the file to be loaded is downloaded, the file to be loaded may be returned to the block performing position to reload the file to be loaded.
The above manner for performing block on the streaming load operation may refer to explanation and description in the prior art, which is not limited in this embodiment.
As can be seen from the above description, in this embodiment, when it is detected that the fast application executes the streaming loading operation, the streaming loading operation is blocked, so that the streaming loading operation can be suspended, streaming loading of other files can not be affected, the progress of streaming loading can be ensured, and then, after downloading of a file to be loaded is completed, the file to be loaded can be reloaded based on the position of the block.
Fig. 3 is a flowchart illustrating a method of streaming a file according to a third exemplary embodiment. The method for loading the file in the streaming mode can be applied to a fast application Framework (such as Hybrid Framework).
As shown in fig. 3, the method comprises the following steps S301-S305:
in step S301: and in response to receiving the identification information of the file to be loaded sent by the fast application program, locally searching the file to be loaded.
In step S302: and if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded.
In step S303: and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
In step S304: and if the fast application program is detected to execute the streaming loading operation, performing block on the streaming loading operation.
For the explanation and explanation of steps S301 to S304, reference may be made to the above embodiments, which are not described herein again.
In step S305: and if the file to be loaded is detected to be completely downloaded, sending a real Uniform Resource Identifier (URI) of the file to be loaded to the fast application program.
In an embodiment, after the fast application framework performs block on the streaming loading operation, whether the file to be loaded is completely downloaded may be detected, and if the file to be loaded is completely downloaded, the real uniform resource identifier URI of the file to be loaded may be obtained and sent to the fast application program.
In an embodiment, after the download of each file to be loaded is completed, a prompt message may be sent to the fast application framework, so that the fast application framework may determine that the download of the file to be loaded is completed based on the received prompt message.
In one embodiment, the real uniform resource identifier URI is different from the simulated uniform resource identifier URI, which is a real URI (i.e., a resource that can be used to uniquely identify a file to be loaded).
In an embodiment, reference may be made to explanation and description in the prior art for a manner of obtaining, by a fast application framework, a real uniform resource identifier URI of a file to be loaded, which is not limited in this embodiment.
As can be seen from the above description, in this embodiment, by sending the real uniform resource identifier URI of the to-be-loaded file to the fast application program when it is detected that the to-be-loaded file is completely downloaded, the subsequent fast application program can truly load the to-be-loaded file based on the real uniform resource identifier URI, so that streaming loading of the fast application file can be completed, and since it is not necessary to wait for the to-be-loaded file to be completely downloaded and then perform streaming loading, smooth streaming loading can be ensured, efficiency of streaming loading is improved, and user experience can be further improved.
Fig. 4 is a flowchart illustrating a method of streaming a file according to a fourth exemplary embodiment. The method for loading the file in a streaming mode can be applied to fast application programs.
As shown in fig. 4, the method comprises the following steps S401-S403:
in step S401: and sending the identification information of the file to be loaded to the fast application framework.
In an embodiment, the fast application may include a fast application client running on a fast application Framework in the terminal device. The terminal device may include a smart phone, a tablet computer, a desktop computer, or the like, which is not limited in this embodiment.
In an embodiment, when the fast application program needs to perform streaming loading, the identification information of the file to be loaded may be sent to the fast application framework, so that the fast application framework locally searches for the uniform resource identifier URI of the file to be loaded based on the identification information, and then the subsequent step of performing streaming loading based on the URI may be implemented.
In an embodiment, the identification information of the file to be loaded may include a name or a number of the file to be loaded, which is not limited in this embodiment.
In step S402: and receiving a simulated Uniform Resource Identifier (URI) of the file to be loaded, wherein the simulated URI comprises a URI which is generated by the fast application framework in response to the received identification information and is not found in the local place for the file to be loaded.
In an embodiment, after the fast application framework receives the identification information of the file to be loaded sent by the fast application program, the file to be loaded may be searched locally in response to the received identification information. The local may include a local of the terminal device having the fast application framework, which is not limited in this embodiment. When the file to be loaded is not found, a simulated Uniform Resource Identifier (URI) can be generated for the file to be loaded.
In an embodiment, the fast application framework may not find the to-be-loaded file due to "the to-be-loaded file is not downloaded completely", and the like, which is not limited in this embodiment.
In an embodiment, the fast application framework may generate the simulated uniform resource identifier URI of the file to be loaded in multiple ways according to actual business needs of developers, and the specific generation way is not limited in this embodiment. For example, the preset string may be "wrapped" based on existing URI generation methods to generate the simulated URI that conforms to the universal URI format.
It is worth noting that the simulated URI is not a true URI (i.e., not a resource that uniquely identifies the file to be loaded), but rather is formally consistent with the URI format.
In step S403: and executing streaming loading operation on the file to be loaded based on the simulation Uniform Resource Identifier (URI).
In an embodiment, after the fast application program receives the simulated uniform resource identifier URI of the file to be loaded, a streaming loading operation may be performed on the file to be loaded based on the simulated uniform resource identifier URI.
In an embodiment, the fast application executes the streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI in a different manner from the loading of the real URI based on the to-be-loaded file, that is, the to-be-loaded file is not loaded really, but the preset file corresponding to the simulated uniform resource identifier URI is executed, so that the disadvantage that the streaming loading cannot be performed due to incomplete downloading of the to-be-loaded file can be avoided, the streaming loading can be performed smoothly, and the streaming loading efficiency can be improved.
In an embodiment, the manner in which the fast application performs the streaming load operation on the file to be loaded based on the emulated uniform resource identifier URI may be referred to the following embodiment shown in fig. 5, and will not be described in detail here.
As can be seen from the above description, in this embodiment, by sending the identification information of the file to be loaded to the fast application framework, receiving the simulated uniform resource identifier URI of the file to be loaded, and then performing a streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, because the simulated uniform resource identifier URI is generated for the file to be loaded when the fast application framework does not find the file to be loaded locally, and is sent to the fast application program, it is possible to implement a subsequent fast application program performing the streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, so that a drawback that the streaming loading cannot be performed due to the fact that the file to be loaded is not downloaded is avoided, smooth streaming loading can be ensured, efficiency of streaming loading is improved, and user experience can be improved.
Fig. 5 is a flowchart illustrating a method of streaming a file according to a fifth exemplary embodiment. The method for loading the file in a streaming mode can be applied to fast application programs. As shown in fig. 5, the method includes the following steps S501 to S503:
in step S501: sending identification information of a file to be loaded to a fast application framework;
in step S502: receiving a simulated Uniform Resource Identifier (URI) of the file to be loaded, wherein the simulated URI comprises a URI generated by the fast application framework for the file to be loaded when the fast application framework responds to the received identification information and the file to be loaded is not found locally;
for the explanation and description of steps S501-S502, reference may be made to the above embodiments, which are not repeated herein.
In step S503: and executing the open file OpenFile in the file content provider based on the simulation uniform resource identifier URI.
In an embodiment, after the fast application program receives the simulated uniform resource identifier URI of the file to be loaded, the open file OpenFile in the file content provider may be executed based on the simulated uniform resource identifier URI.
In an embodiment, the file Content Provider may be provided by a Content Provider (one of four major components in android, which may provide a uniform interface for data sharing between different applications), and further, when the fast application program records a file based on the simulated uniform resource identifier URI, the open file in the file Provider may be executed, and a block may be performed in the method, so that the file may be returned when downloading is completed, thereby achieving the purpose of streaming loading.
As can be seen from the above description, in this embodiment, by executing the open file OpenFile in the file content provider based on the simulated uniform resource identifier URI, it is possible to perform processing on resources such as audio, pictures, or video in a normal manner without performing additional modification (only a slight delay may occur during running).
Fig. 6 is a flowchart illustrating a method of streaming a file according to a sixth exemplary embodiment.
The method for loading the file in a streaming mode can be applied to fast application programs. As shown in fig. 6, the method includes the following steps S601-S605:
in step S601: sending identification information of a file to be loaded to a fast application framework;
in step S602: receiving a simulated Uniform Resource Identifier (URI) of the file to be loaded, wherein the simulated URI comprises a URI generated by the fast application framework for the file to be loaded when the fast application framework responds to the received identification information and the file to be loaded is not found locally;
in step S603: and executing streaming loading operation on the file to be loaded based on the simulation Uniform Resource Identifier (URI).
For the explanation and description of steps S601-S603, reference may be made to the above embodiments, which are not repeated herein.
In step S604: and receiving a real Uniform Resource Identifier (URI) of the file to be loaded, which is sent by the fast application framework.
And the real uniform resource identifier URI comprises a URI which is acquired by the fast application framework when the fast application framework detects that the downloading of the file to be loaded is completed and is used for identifying the resource of the file to be loaded.
In an embodiment, after the fast application framework performs block on the streaming loading operation, whether the file to be loaded is completely downloaded may be detected, and if the file to be loaded is completely downloaded, the real uniform resource identifier URI of the file to be loaded may be obtained and sent to the fast application program.
In an embodiment, after the download of each file to be loaded is completed, a prompt message may be sent to the fast application framework, so that the fast application framework may determine that the download of the file to be loaded is completed based on the received prompt message.
In an embodiment, reference may be made to explanation and description in the prior art for a manner of obtaining, by a fast application framework, a real uniform resource identifier URI of a file to be loaded, which is not limited in this embodiment.
In step S605: and loading the file to be loaded based on the real uniform resource identifier URI.
In an embodiment, after the fast application program receives the real uniform resource identifier URI of the file to be loaded sent by the fast application framework, the file to be loaded may be loaded based on the real uniform resource identifier URI.
In one embodiment, the real uniform resource identifier URI is different from the simulated uniform resource identifier URI, which is a real URI (i.e., a resource that can be used to uniquely identify a file to be loaded). Therefore, the fast application program can load the file to be loaded based on the real uniform resource identifier URI, and acquire and run the resource of the file to be loaded.
As can be seen from the above description, in this embodiment, the file to be loaded is loaded really by receiving the real uniform resource identifier URI of the file to be loaded sent by the fast application framework and loading the file to be loaded based on the real uniform resource identifier URI, and since it is not necessary to wait for the file to be loaded to be downloaded and then perform streaming loading, smooth streaming loading can be ensured, streaming loading efficiency is improved, and user experience can be further improved.
FIG. 7 is a block diagram illustrating an apparatus for streaming a file in accordance with an illustrative embodiment; the method for loading the file in the streaming mode can be applied to a fast application Framework (such as Hybrid Framework). As shown in fig. 7, the apparatus includes: a loading file searching module 110, a simulation identifier generating module 120 and a simulation identifier sending module 130, wherein:
the loading file searching module 110 is configured to locally search for a file to be loaded in response to receiving identification information of the file to be loaded sent by the fast application program;
the simulation identifier generation module 120 is configured to generate a simulation uniform resource identifier URI of the file to be loaded when the file to be loaded is not found;
a simulation identifier sending module 130, configured to send the simulation uniform resource identifier URI to the fast application program, so that the fast application program performs a streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
As can be seen from the above description, in this embodiment, in response to receiving identification information of a to-be-loaded file sent by a fast application, the to-be-loaded file is locally searched, and when the to-be-loaded file is not found, a simulated uniform resource identifier URI of the to-be-loaded file is generated, and then the simulated uniform resource identifier URI is sent to the fast application, so that the fast application performs a streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI, because when the to-be-loaded file is not found locally, the simulated uniform resource identifier URI is generated for the to-be-loaded file and sent to the fast application, a subsequent fast application can perform a streaming loading operation on the to-be-loaded file based on the simulated uniform resource identifier URI, and therefore, the disadvantage that the streaming loading cannot be performed because the to-be-loaded file is not downloaded completely can be avoided, the method and the device can ensure smooth running of stream loading, improve the efficiency of stream loading and further improve the user experience. Moreover, the intrusion of the fast application framework of the embodiment is small, and the feasibility of the scheme can be enhanced to a certain extent.
FIG. 8 is a block diagram illustrating another apparatus for streaming a file in accordance with an illustrative embodiment.
The functions of the loaded file searching module 210, the simulation identifier generating module 220, and the simulation identifier sending module 230 are the same as those of the loaded file searching module 110, the simulation identifier generating module 120, and the simulation identifier sending module 130 in the foregoing embodiment shown in fig. 7, and detailed description thereof is omitted here.
In an embodiment, the apparatus may further comprise:
a load operation block module 240, configured to block the streaming load operation when it is detected that the streaming load operation is executed by the fast application.
In an embodiment, the apparatus may further comprise:
a real identifier sending module 250, configured to send, to the fast application program, a real uniform resource identifier URI of the file to be loaded when it is detected that the file to be loaded is downloaded completely.
FIG. 9 is a block diagram illustrating an apparatus for streaming a file in accordance with an illustrative embodiment; the device is applied to the fast application program. As shown in fig. 9, the apparatus may include: an identification information sending module 310, an analog identifier receiving module 320, and a first load executing module 330, wherein:
an identification information sending module 310, configured to send identification information of a file to be loaded to a fast application framework;
a simulation identifier receiving module 320, configured to receive a simulation uniform resource identifier URI of the to-be-loaded file, where the simulation uniform resource identifier URI includes a URI generated by the fast application framework in response to receiving the identification information and for the to-be-loaded file when the to-be-loaded file is not found locally;
a first load execution module 330, configured to execute a streaming load operation on the file to be loaded based on the emulated uniform resource identifier URI.
As can be seen from the above description, in this embodiment, by sending the identification information of the file to be loaded to the fast application framework, receiving the simulated uniform resource identifier URI of the file to be loaded, and then performing a streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, because the simulated uniform resource identifier URI is generated for the file to be loaded when the fast application framework does not find the file to be loaded locally, and is sent to the fast application program, it is possible to implement a subsequent fast application program performing the streaming loading operation on the file to be loaded based on the simulated uniform resource identifier URI, so that a drawback that the streaming loading cannot be performed due to the fact that the file to be loaded is not downloaded is avoided, smooth streaming loading can be ensured, efficiency of streaming loading is improved, and user experience can be improved.
FIG. 10 is a block diagram illustrating another apparatus for streaming a file in accordance with an illustrative embodiment; the device is applied to the fast application program. The identifier sending module 410, the analog identifier receiving module 420, and the first load executing module 430 have the same functions as the identifier sending module 310, the analog identifier receiving module 320, and the first load executing module 330 in the embodiment shown in fig. 9, and are not described herein again.
As shown in fig. 10, the first load execution module 430 may be further configured to execute an open file OpenFile in a file content provider based on the emulated uniform resource identifier URI.
In an embodiment, the apparatus may further include a second load execution module 440;
the second load execution module 440 may include:
a real identifier receiving unit 441, configured to receive a real uniform resource identifier URI of the to-be-loaded file sent by the fast application framework, where the real uniform resource identifier URI includes a URI, obtained by the fast application framework when it is detected that the to-be-loaded file is downloaded, and used for identifying a resource of the to-be-loaded file;
a second load execution unit 442, configured to load the file to be loaded based on the real uniform resource identifier URI.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 11 is a block diagram illustrating an electronic device in accordance with an example embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 11, the apparatus 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 902 may include one or more processors 920 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the device 900. Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 906 provides power to the various components of device 900. The power components 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 900.
The multimedia component 908 comprises a screen providing an output interface between the device 900 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 900 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when apparatus 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing status assessment of various aspects of the apparatus 900. For example, sensor assembly 914 may detect an open/closed state of device 900, the relative positioning of components, such as a display and keypad of device 900, the change in position of device 900 or a component of device 900, the presence or absence of user contact with device 900, the orientation or acceleration/deceleration of device 900, and the change in temperature of device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate communications between the apparatus 900 and other devices in a wired or wireless manner. The apparatus 900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G or 5G or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described lighting methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 904 comprising instructions, executable by the processor 920 of the apparatus 900 to perform the above-described illumination method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (14)

1. A method for streaming a file, the method being applied to a fast application framework, the method comprising:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
2. The method of claim 1, further comprising:
and if the fast application program is detected to execute the streaming loading operation, performing block on the streaming loading operation.
3. The method of claim 2, wherein after the block of the streaming load operation, the method further comprises:
and if the file to be loaded is detected to be completely downloaded, sending a real Uniform Resource Identifier (URI) of the file to be loaded to the fast application program.
4. A method for streaming a file, the method being applied to a fast application, the method comprising:
sending identification information of a file to be loaded to a fast application framework;
receiving a simulated Uniform Resource Identifier (URI) of the file to be loaded, wherein the simulated URI comprises a URI generated by the fast application framework for the file to be loaded when the fast application framework responds to the received identification information and the file to be loaded is not found locally;
and executing streaming loading operation on the file to be loaded based on the simulation Uniform Resource Identifier (URI).
5. The method according to claim 4, wherein said performing a streaming load operation on the file to be loaded based on the emulated uniform resource identifier, URI, comprises:
and executing the open file OpenFile in the file content provider based on the simulation uniform resource identifier URI.
6. The method of claim 4, wherein after the performing the streaming load operation on the file to be loaded based on the emulated Uniform Resource Identifier (URI), the method further comprises:
receiving a real Uniform Resource Identifier (URI) of the file to be loaded, which is sent by the fast application framework, wherein the real URI comprises a URI which is obtained by the fast application framework when the fast application framework detects that the file to be loaded is downloaded and is used for identifying the resource of the file to be loaded;
and loading the file to be loaded based on the real uniform resource identifier URI.
7. An apparatus for streaming a file, the apparatus being applied to a fast application framework, the apparatus comprising:
the loading file searching module is used for responding to the received identification information of the file to be loaded sent by the fast application program and searching the file to be loaded locally;
the simulation identifier generation module is used for generating a simulation Uniform Resource Identifier (URI) of the file to be loaded when the file to be loaded is not found;
and the simulation identifier sending module is used for sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
8. The apparatus of claim 7, further comprising:
and the loading operation block module is used for carrying out block on the streaming type loading operation when the fast application program is detected to execute the streaming type loading operation.
9. The apparatus of claim 8, further comprising:
and the real identifier sending module is used for sending the real uniform resource identifier URI of the file to be loaded to the fast application program when the file to be loaded is detected to be completely downloaded.
10. An apparatus for streaming a file, the apparatus being applied to a fast application, the apparatus comprising:
the identification information sending module is used for sending the identification information of the file to be loaded to the fast application framework;
the simulation identifier receiving module is used for receiving a simulation uniform resource identifier URI of the file to be loaded, wherein the simulation uniform resource identifier URI comprises a URI which is generated by the fast application framework in response to the fact that the identification information is received and the file to be loaded is not found locally;
and the first loading execution module is used for executing the streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
11. The apparatus of claim 10, wherein the first load execution module is further configured to execute an open file OpenFile in a file content provider based on the emulated uniform resource identifier URI.
12. The apparatus of claim 10, further comprising a second load execution module;
the second load execution module includes:
a real identifier receiving unit, configured to receive a real uniform resource identifier URI of the to-be-loaded file sent by the fast application framework, where the real uniform resource identifier URI includes a URI, obtained by the fast application framework when it is detected that the to-be-loaded file is downloaded, and used for identifying a resource of the to-be-loaded file;
and the second loading execution unit is used for loading the file to be loaded based on the real uniform resource identifier URI.
13. A smart device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
14. A computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, carries out the steps of:
in response to receiving identification information of a file to be loaded sent by a fast application program, searching the file to be loaded locally;
if the file to be loaded is not found, generating a simulation Uniform Resource Identifier (URI) of the file to be loaded;
and sending the simulation uniform resource identifier URI to the fast application program so that the fast application program can execute streaming loading operation on the file to be loaded based on the simulation uniform resource identifier URI.
CN201910563041.4A 2019-06-26 2019-06-26 Method and device for loading file in streaming mode and intelligent equipment Active CN110311968B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910563041.4A CN110311968B (en) 2019-06-26 2019-06-26 Method and device for loading file in streaming mode and intelligent equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910563041.4A CN110311968B (en) 2019-06-26 2019-06-26 Method and device for loading file in streaming mode and intelligent equipment

Publications (2)

Publication Number Publication Date
CN110311968A CN110311968A (en) 2019-10-08
CN110311968B true CN110311968B (en) 2022-04-08

Family

ID=68076569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910563041.4A Active CN110311968B (en) 2019-06-26 2019-06-26 Method and device for loading file in streaming mode and intelligent equipment

Country Status (1)

Country Link
CN (1) CN110311968B (en)

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7580972B2 (en) * 2001-12-12 2009-08-25 Valve Corporation Method and system for controlling bandwidth on client and server
CN103309996A (en) * 2013-06-21 2013-09-18 宇龙计算机通信科技(深圳)有限公司 Webpage content processing method and device
CN105306999A (en) * 2014-07-25 2016-02-03 中兴通讯股份有限公司 3D control picture display processing method and device
CN108108089B (en) * 2016-11-24 2021-08-10 中国移动通信有限公司研究院 Picture loading method and device
CN107038219B (en) * 2017-03-17 2019-03-15 武汉斗鱼网络科技有限公司 The method and device of GIF animation is loaded in iOS
CN107025122B (en) * 2017-04-06 2020-12-22 广州市品高软件股份有限公司 Light application access method and system
CN109101513B (en) * 2017-06-21 2020-10-16 武汉斗鱼网络科技有限公司 Method, storage medium, device and system for integrating multiple picture libraries
CN107918552B (en) * 2017-11-02 2021-10-08 阿里巴巴(中国)有限公司 Light application calling method and device, client device and electronic equipment
CN109408136B (en) * 2018-09-12 2021-06-15 Oppo广东移动通信有限公司 Information processing method, information processing apparatus, storage medium, and electronic device
CN109358933A (en) * 2018-09-28 2019-02-19 北京小米移动软件有限公司 The creation method and device applied fastly
CN109582417A (en) * 2018-11-21 2019-04-05 网宿科技股份有限公司 A kind of method for showing interface, client and picture servers

Also Published As

Publication number Publication date
CN110311968A (en) 2019-10-08

Similar Documents

Publication Publication Date Title
RU2647625C2 (en) Application program running method and device
US9870239B2 (en) Method and device for running application program
CN105808305B (en) Static resource loading method and device
JP2017524212A (en) Application installation package processing method, apparatus, program, and recording medium
CN106851695B (en) Method, device and system for testing network speed
CN106547547B (en) data acquisition method and device
CN110839073A (en) Method for acquiring push information, method and device for sending push information
CN111221559A (en) Application updating method and device, storage medium, terminal and server
CN109117144B (en) Page processing method, device, terminal and storage medium
CN110689378A (en) Advertisement position advertisement obtaining method and device and computer readable storage medium
CN112291631A (en) Information acquisition method, device, terminal and storage medium
CN107463372B (en) Data-driven page updating method and device
CN113596175A (en) Scene synchronization method, terminal, server and system
RU2632396C2 (en) Method and device to control router plug-in module
CN110221813B (en) Application data connection establishment method and device, storage medium and electronic equipment
CN107885464B (en) Data storage method, device and computer readable storage medium
CN114430370B (en) Method, device, equipment and storage medium for determining network slice
CN110311968B (en) Method and device for loading file in streaming mode and intelligent equipment
CN111597106A (en) Point burying management method and device
CN112631695A (en) Data verification method and device, electronic equipment and storage medium
CN107257384B (en) Service state monitoring method and device
CN112102009A (en) Advertisement display method, device, equipment and storage medium
CN112083981A (en) Method and device for creating page view component
CN111767063A (en) Resource updating method, device and equipment for application program
CN110995767B (en) Request processing method and device

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
GR01 Patent grant
GR01 Patent grant