Disclosure of Invention
The invention mainly aims to provide a file downloading method, device, system, equipment and storage medium, and aims to solve the technical problem that the success rate of downloading files by the existing browser based on a non-Trident kernel is low.
In order to achieve the above object, the present invention provides a file downloading method, which comprises the steps of:
when the remote rendering of the page corresponding to the client website is successful and a downloading instruction for downloading the target file is detected, acquiring downloading data corresponding to the downloading instruction;
sending the download data to a rendering server, so that the rendering server downloads the target file from a target website to a file server according to the download data, and returns a storage path of the target file in the file server;
and receiving the storage path, and downloading the target file in the file server according to the storage path.
Optionally, the step of obtaining the download data corresponding to the download instruction after the page corresponding to the client website is remotely rendered successfully and the download instruction for downloading the target file is detected includes:
when the remote rendering of the page corresponding to the client website is successful and an uploading instruction of an uploading target file is detected, uploading data corresponding to the uploading instruction is obtained;
sending the uploading data to a rendering server, so that the rendering server can obtain a storage path of the target file in a file server according to the uploading data and send the storage path to a target website, wherein after the target website receives the storage path, the target file is obtained from the file server according to the storage path;
and if a notification message that the target file is successfully uploaded returned by the rendering server is received and a downloading instruction for downloading the target file is detected, acquiring downloading data corresponding to the downloading instruction.
Optionally, before the step of obtaining the download data corresponding to the download instruction after the page corresponding to the client website is remotely rendered successfully and the download instruction of the download target file is detected, the method further includes:
acquiring prestored configuration data, and determining whether a page corresponding to the client website needs to be remotely rendered according to the configuration data;
and if the page is determined to need remote rendering, calling the rendering server to remotely render the page.
Optionally, before the step of obtaining pre-stored configuration data and determining whether a page corresponding to the client website needs to be remotely rendered according to the configuration data, the method further includes:
when an acquisition request for acquiring configuration data is detected, acquiring a protocol packet name corresponding to the acquisition request;
determining a domain name corresponding to a server according to the protocol packet name, and sending the acquisition request to the server through the domain name so that the server returns configuration data corresponding to the acquisition request;
and receiving the configuration data returned by the server and storing the configuration data.
Optionally, after detecting an obtaining request for obtaining configuration data, before the step of obtaining a protocol packet name corresponding to the obtaining request, the method further includes:
detecting whether the current time is the acquisition time for acquiring the configuration data;
and if the current time is detected to be the acquisition time for acquiring the configuration data, triggering an acquisition request.
Optionally, if it is determined that the page needs to be remotely rendered, the step of invoking the rendering server to remotely render the page includes:
if the page needs remote rendering, detecting whether the page needs remote rendering for the first time;
if the page is detected to be remotely rendered for the first time, acquiring the URL of the page;
sending the URL of the page to a rendering scheduling server for the rendering scheduling server to return connection information of the rendering server;
and establishing communication connection between the client and a rendering server according to the connection information so as to call the rendering server to remotely render the page.
In addition, in order to achieve the above object, the present invention further provides a file downloading method, where the file downloading method includes:
when the remote rendering of the page corresponding to the client website is successful and a downloading instruction for downloading the target file is detected, acquiring downloading data corresponding to the downloading instruction and sending the downloading data to a rendering server;
the rendering server receives the download data and downloads the target file from a target website according to the download data;
storing the target file into a file server, acquiring a storage path of the target file in the file server, and sending the storage path to the client;
and after the client receives the storage path, downloading the target file in the file server according to the storage path.
Optionally, the step of obtaining the download data corresponding to the download instruction after the page corresponding to the client website is remotely rendered successfully and the download instruction for downloading the target file is detected includes:
when the remote rendering of the page corresponding to the client website is successful and an uploading instruction of an uploading target file is detected, uploading data corresponding to the uploading instruction is obtained and sent to a rendering server;
the rendering server receives the uploaded data, acquires a storage path of the target file in a file server according to the uploaded data, and sends the storage path to a target website;
after the target website receives the storage path, acquiring a target file from the file server according to the storage path, storing the target file, generating a notification message that the target file is uploaded successfully, and sending the notification message to the client through the rendering server;
and if the client receives the notification message sent by the rendering server and detects a downloading instruction for downloading the target file, acquiring downloading data corresponding to the downloading instruction.
Optionally, before the step of obtaining the download data corresponding to the download instruction after the page corresponding to the client website is remotely rendered successfully and the download instruction of the download target file is detected, the method further includes:
the client acquires pre-stored configuration data and determines whether a page corresponding to the client website needs to be remotely rendered according to the configuration data;
and if the page is determined to need remote rendering, calling the rendering server to remotely render the page.
Optionally, before the step of obtaining pre-stored configuration data by the client and determining whether a page corresponding to the client website needs to be remotely rendered according to the configuration data, the method further includes:
after receiving an acquisition request for acquiring configuration data sent by a client, a server acquires the configuration data according to the acquisition request;
and sending the configuration data to the client.
Optionally, the file downloading method further includes:
if the server side detects a change instruction for changing the configuration data, changing the configuration data according to the change instruction, wherein the change instruction at least comprises one of the following instructions: add instructions, modify instructions, and delete instructions.
In addition, to achieve the above object, the present invention further provides a file downloading apparatus, including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring download data corresponding to a download instruction after the remote rendering of a page corresponding to a client website is successful and the download instruction of a download target file is detected;
the sending module is used for sending the download data to a rendering server so that the rendering server can download the target file from a target website to a file server according to the download data and return a storage path of the target file in the file server;
a receiving module, configured to receive the storage path;
and the downloading module is used for downloading the target file in the file server according to the storage path.
In addition, in order to achieve the above object, the present invention further provides a file downloading system, where the file downloading system includes a client and a rendering server;
the client is used for acquiring download data corresponding to the download instruction and sending the download data to the rendering server after the remote rendering of the page corresponding to the client website is successful and the download instruction of the download target file is detected;
the rendering server is used for receiving the download data and downloading the target file from a target website according to the download data; storing the target file into a file server, acquiring a storage path of the target file in the file server, and sending the storage path to the client;
and the client is also used for downloading the target file in the file server according to the storage path after receiving the storage path.
In addition, in order to achieve the above object, the present invention further provides a file downloading device, where the file downloading device includes a memory, a processor, and a file downloading program stored in the memory and operable on the processor, and the file downloading program, when executed by the processor, implements a file downloading method corresponding to a federal learning server.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a file downloading program is stored, which, when executed by a processor, implements the steps of the file downloading method as described above.
According to the method and the device, when the page corresponding to the client website is successfully rendered remotely, and the downloading instruction for downloading the target file is detected, the downloading data corresponding to the downloading instruction is sent to the rendering server, so that the rendering server can download the target file from the target website to the file server according to the downloading data, the storage path of the target file in the file server is returned, and the client downloads the target file in the file server according to the storage path. The method and the device have the advantages that the target file is downloaded from the target website of the browser of the real Trident kernel through the rendering server in the file downloading process, the situation that the browser of the non-Trident kernel cannot complete service interaction is avoided, and the file downloading success rate of the browser based on the non-Trident kernel is improved.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a file downloading method according to a first embodiment of the present invention.
In accordance with the file download method provided by the present invention, it should be noted that although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that here.
The file downloading method is applied to a client, and the client may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like. The file downloading method comprises the following steps:
step S11, when the remote rendering of the page corresponding to the client website is successful and a download instruction for downloading the target file is detected, acquiring download data corresponding to the download instruction.
After the client determines that the remote rendering of the page corresponding to the website is successful, the client detects whether a downloading instruction for downloading the target file is detected, wherein the downloading instruction can be triggered in the client by a client user according to needs, and can also be sent to the client by other terminal equipment. In this embodiment, the client is provided with a browser, the website is a website of the business system corresponding to the browser, and each website has a corresponding page. When the client detects a download instruction, the client obtains download data corresponding to the download instruction, where the download data includes, but is not limited to, a name, an Identifier (ID), a size, and an instruction identifier of the target file, and it can be determined whether the current corresponding instruction is a download instruction, an upload instruction, or another instruction through the instruction identifier, which is not limited in the present embodiment. If the client does not detect the downloading instruction for downloading the target file, the client continues to detect whether the downloading instruction for downloading the target file is detected.
Step S13, sending the download data to a rendering server, so that the rendering server downloads the target file from a target website to a file server according to the download data, and returns a storage path of the target file in the file server.
And after the client acquires the download data, the client sends the download data to the rendering server. It should be noted that the rendering server is a server for performing remote rendering on a page corresponding to a client website. And after the rendering server receives the download data, the rendering server downloads the target file from the target website according to the download data. It should be noted that the rendering server can know, according to the downloaded data, that the file to be acquired is specifically the file. The target website is a website for actually storing the target file. And after the rendering server obtains the target file from the target website, the rendering server stores the target file into the file server, acquires a storage path of the target file in the file server and sends the storage path to the client. It is understood that a file server is a server that stores data. Further, the rendering server may also send the download data to the target website, and after the target website receives the download data, the target website determines a target file to be downloaded according to the download data, and sends the target file to the file server. And after receiving the target file, the file server stores the target file and sends the storage path of the target file to the rendering server. And after receiving the storage path, the rendering server sends the storage path to the client.
And step S15, receiving the storage path, and downloading the target file in the file server according to the storage path.
And after the client receives the storage path sent by the rendering server, the client downloads the target file in the file server according to the storage path, namely the target file is downloaded to the local part of the client. It should be noted that, in this embodiment, the client website is a browser website without a Trident kernel, and the target website is a browser website with a Trident kernel.
In the embodiment, when the page corresponding to the client website is successfully rendered remotely and a download instruction for downloading the target file is detected, the download data corresponding to the download instruction is sent to the rendering server, so that the rendering server downloads the target file from the target website to the file server according to the download data and returns a storage path of the target file in the file server, and the client downloads the target file in the file server according to the storage path. The method and the device have the advantages that the target file is downloaded from the target website of the browser of the real Trident kernel through the rendering server in the file downloading process, the situation that the browser of the non-Trident kernel cannot complete service interaction is avoided, and the file downloading success rate of the browser based on the non-Trident kernel is improved.
It should be noted that, when a client needs to access a service system based on an IE kernel, the problem that a page cannot be normally accessed can be solved by the page rendering method in this embodiment, and the operational integrity of the service system is improved; individual users can normally access the business application website with the IE kernel characteristic without selecting the operating system environment of the Wintel framework.
Further, a second embodiment of a file downloading method is proposed. The second embodiment of the method for downloading a file is different from the first embodiment of the method for downloading a file in that the step S11 includes:
step a, when the remote rendering of the page corresponding to the client website is successful and the uploading instruction of the uploading target file is detected, the uploading data corresponding to the uploading instruction is obtained.
And after the page corresponding to the client website is successfully rendered remotely, the client detects whether an uploading instruction for uploading the target file is detected. The uploading instruction can be triggered in the client according to the requirement of the client user, and can also be sent to the client by other terminal equipment. When the client detects the uploading instruction, the client acquires uploading data corresponding to the uploading instruction, wherein the uploading data includes but is not limited to the name, Identification (ID), size and instruction identification of the target file. If the client does not detect the uploading instruction for downloading the target file, the client continues to detect whether the uploading instruction for uploading the target file is detected.
And b, sending the uploading data to a rendering server, so that the rendering server can acquire a storage path of the target file in a file server according to the uploading data and send the storage path to a target website, wherein after the target website receives the storage path, the target file is acquired from the file server according to the storage path.
After the client detects an uploading instruction for uploading the target file, the client sends the target file to the file server. When the file server receives the target file, the target file is stored. And after the client sends the target file to the file server, the client sends the uploaded data to the rendering server. And after receiving the uploaded data, the rendering server acquires a storage path of the target file in the file server according to the uploaded data and sends the storage path to the target website. And after the target website receives the storage path, the target website acquires the target file from the file server according to the storage path, and then stores the target file so as to successfully upload the target file to the target website. Further, the rendering server may also send the upload data to the target website together, and the target website obtains the target file from the file server according to the upload data and the storage path.
And when the target website successfully stores the target file, the target website generates a notification message that the target file is successfully uploaded, and sends the notification message to the rendering server. And after receiving the notification message, the rendering server sends the notification message to the client.
And c, if a notification message that the target file is successfully uploaded returned by the rendering server is received and a downloading instruction for downloading the target file is detected, acquiring downloading data corresponding to the downloading instruction.
And after the client receives a notification message that the target file is successfully uploaded returned by the rendering server, the client detects whether a downloading instruction for downloading the target file is detected. If the client detects a download instruction for downloading the target file, the client acquires download data corresponding to the download instruction. Further, if the client does not detect a download instruction for downloading the target file, the client may continue to detect whether the download instruction is detected and/or detect whether other operation instructions are detected. Further, when the target website fails to store the target file successfully, that is, when the target file fails to be uploaded, the target website also sends a failure message of the failure of the target file to the rendering server, and the rendering server sends the failure message to the client. When the client receives the failure message, the client determines whether to upload the target file again.
In the embodiment, when the page corresponding to the client website is successfully rendered remotely and the uploading instruction of the uploading target file is detected, the uploading data corresponding to the uploading instruction is sent to the rendering server, so that the rendering server acquires the storage path of the target file in the file server according to the uploading data and sends the storage path to the target website, and the target website can acquire the target file according to the storage path to store the target file, so that the target file is uploaded to the target website. The method and the device have the advantages that the target file is uploaded from the target website of the browser of the real Trident kernel through the rendering server in the file uploading process, the situation that the browser of the non-Trident kernel cannot complete service interaction is avoided, and the uploading success rate of the file uploaded by the browser based on the non-Trident kernel is improved.
Further, a third embodiment of a file downloading method is provided. The third embodiment of the method for downloading a file differs from the first and/or second embodiment of the method for downloading a file in that the method for downloading a file further comprises:
and d, acquiring pre-stored configuration data, and determining whether the page corresponding to the client website needs to be remotely rendered according to the configuration data.
The client side obtains pre-stored configuration data, and whether the page corresponding to the client side website needs to be remotely rendered is determined according to the configuration data. Configure data to include, but is not limited to, URL, kernel version, JS (JavaScript) engine version, render scheduler service configuration data, whether ActiveX plug-ins are included, whether files need to be uploaded and downloaded, whether print functionality is needed, and render scheduler service. The kernel version is a version of a browser in the client, and the render tone service configuration data includes a render server IP (Internet Protocol) address, a render server port, connectionless render server release time, and the like. In this embodiment, the kernel may be a Trident kernel, or may be another kernel. The kernel version and the JS engine version both have corresponding version numbers, the ActiveX plugin and the printing function both have corresponding requirement marks, and if the requirement mark corresponding to the ActiveX plugin is '1', the ActiveX plugin is indicated; when the requirement mark corresponding to the ActiveX plug-in is '0', the ActiveX plug-in is not contained. When the requirement mark corresponding to the printing function is '11', indicating that the printing function is required; when the demand flag corresponding to the print function is "00", it indicates that the print function is not required. In this embodiment, the expression form of the requirement identifier is not limited, and the requirement identifiers corresponding to different configuration data may be the same or different.
It should be noted that each web page corresponding to the website has a corresponding URL (Uniform Resource Locator), and in this embodiment, the URL of the web page is denoted as a first URL. In the process of uploading the target file or downloading the target file, the page remote rendering corresponding to the client website is successful, namely the page remote rendering corresponding to the uploaded target file or the page remote rendering corresponding to the downloaded target file is successful. And after the client side acquires the pre-stored configuration data, the client side acquires the URL in the configuration data, and the URL acquired from the configuration data is recorded as a second URL.
After the client obtains the first URL and the second URL, if the client determines that the first URL and the second URL are the same and the second URL has corresponding rendering scheduling service, namely the rendering scheduling service exists in the configuration data, the client determines that the page corresponding to the website needs to be remotely rendered; if the client determines that the first URL is different from the second URL and/or the first URL does not have the corresponding rendering scheduling service, the client determines that remote rendering of the page corresponding to the website is not needed.
And e, if the page is determined to need remote rendering, calling the rendering server to perform remote rendering on the page.
If the client determines that the page needs to be remotely rendered, the client calls a rendering server to remotely render the page through the rendering server. Further, if the client determines that the page does not need remote rendering, the client locally renders the page. It should be noted that the rendering process is actually to go to a corresponding web page through configuration of a customized browser, a set Trident kernel version, a JS engine version, and the like, then encapsulate process data rendered by the web page, return the encapsulated process data to the client through persistent connection, and perform an image processing process, so that response data corresponding to the access request received by the client is displayed in the client. After the page rendering is successful, the client establishes a corresponding data interaction and data display channel to achieve the effect of normal access, and then the access request can be executed normally.
It should be noted that, after the page remote rendering is successful, the client may start to actually access the target website based on the Trident kernel of the IE browser, and return the relevant page data, and return the real-time image (i.e., return the page data in the form of video stream) in the form of Mpeg (Moving Picture Experts Group) video stream through long connection communication with the browser client, and then draw the real-time image into the display interface of the browser client by the Canvas technology. Further, the page data can be in an Mpeg-1 format, the Mpeg-1 format is realized by JS-Mpeg transformation, Mpeg adopts a key frame and difference frame compression technology, and at the moment, after the rendering server obtains the first full image for transmission, the following interface changes are displayed by difference frame superposition, so that the transmission data are greatly reduced, and the transmission efficiency of data transmission between the client and the rendering server is improved.
Further, step e comprises:
step e2, if it is determined that the page needs remote rendering, detecting whether the page is remotely rendered for the first time.
And e4, if the page is detected to be remotely rendered for the first time, acquiring the URL of the page.
If the client determines that the remote rendering needs to be performed on the page, the client detects whether the page is remotely rendered for the first time. Specifically, the client may detect whether a corresponding rendering server exists for the page. If the corresponding rendering server exists in the page, the client determines that the page is not remotely rendered for the first time; and if the page is determined not to have the corresponding rendering server, the client determines that the page is remotely rendered for the first time. And if the client detects that the page is remotely rendered for the first time, the client acquires the URL of the page. It will be appreciated that the URL of the page is the first URL. And when the corresponding relation between the page URL and the rendering server connection information is stored in the client, indicating that the corresponding rendering server exists in the page.
Step e6, sending the URL of the page to the rendering scheduling server for the rendering scheduling server to return the connection information of the rendering server
And e8, establishing communication connection between the client and the rendering server according to the connection information so as to call the rendering server to remotely render the page.
And after the client acquires the URL of the page, the client sends the URL of the page to the rendering scheduling server. It should be noted that the rendering scheduling server corresponds to at least one rendering server, and the rendering servers in this embodiment are a cluster and are managed by the rendering scheduling server. The rendering server can determine that the page needs to be remotely rendered through the URL of the page. And after the rendering scheduling server receives the URL of the page, the rendering scheduling server determines a rendering server for remotely rendering the page, acquires the connection information of the rendering server and sends the connection information to the client. In this embodiment, the user may set a communication protocol corresponding to the connection mode according to specific needs, for example, a public or private communication protocol may be used. After the client acquires the connection information, the client determines a connection address of the rendering server and a connection mode for connecting the rendering server according to the connection information, determines a specific rendering server to be connected according to the connection address, then connects the rendering server determined according to the connection address in the determined connection mode, establishes communication connection with the rendering server, and calls the rendering server to perform remote rendering on the page. The connection mode in this embodiment is long connection, and preferably Websocket long connection.
Specifically, after the rendering scheduling server receives the URL of the page, the rendering scheduling server determines the rendering server in the idle state, and determines the rendering server in the idle state as the rendering server that renders the page. Specifically, the rendering scheduling server may determine, according to the load balancing policy, that the rendering server having the resource utilization rate smaller than the preset value is the rendering server that renders the page. In the present embodiment, the size of the preset value is not limited. When the rendering scheduling server determines that at least two rendering servers with resource utilization rates smaller than the preset value exist, the rendering scheduling server can randomly select one rendering server with resource utilization rate smaller than the preset value according to a load balancing strategy to determine as the rendering server for rendering the page, or select the dyeing server with the minimum resource utilization rate to determine as the rendering server for rendering the page.
Further, if the client detects that the page is not remotely rendered for the first time, that is, the client remotely renders the page before, and the client stores the connection information of the corresponding rendering server when remotely rendering the page. In the client, the connection information of the rendering server is stored in association with the URL of the page, so that the client can acquire the corresponding connection information through the URL of the page, and establish communication connection with the rendering server according to the connection information.
In the page rendering process, the rendering server is called to remotely render the web page, so that the web page of the browser without the Trident kernel can be remotely rendered, and the problem that the browser without the Trident kernel cannot complete service interaction due to page rendering failure is avoided, so that the success rate of the browser service interaction without the Trident kernel is improved, namely the success rate of service data interaction is improved.
Further, the file downloading method further includes:
and f, when an acquisition request for acquiring the configuration data is detected, acquiring a protocol packet name corresponding to the acquisition request.
And g, determining a domain name corresponding to the server according to the protocol packet name, and sending the acquisition request to the server through the domain name so that the server returns configuration data corresponding to the acquisition request.
When the client detects an acquisition request for acquiring configuration data, the client acquires a protocol packet name corresponding to the acquisition request, and it should be noted that a communication protocol between the client and the server can be determined by the protocol packet. The acquisition request can be triggered by the client user as needed or periodically by the client. After the client acquires the protocol packet name, the client acquires a domain name in the protocol packet name, determines the acquired domain name as a domain name corresponding to the server, and establishes a connection relationship with the server through the domain name. After the connection relation between the client and the server is established, the client sends an acquisition request to the server so as to acquire configuration data in the server through the acquisition request. It is understood that the domain name is part of the protocol package name. After the server receives the acquisition request, the server returns configuration data corresponding to the acquisition request to the client according to the acquisition request. In the acquisition request, the URL corresponding to the configuration data to be acquired is carried, and the server side can determine the configuration data to be returned to the client side through the URL.
And h, receiving the configuration data returned by the server and storing the configuration data.
After receiving the configuration data sent by the server, the client stores the configuration data, and specifically, the client may store the configuration data in a JSON (JSON Object Notation) format.
Further, the file downloading method further includes:
and i, detecting whether the current time is the acquisition time for acquiring the configuration data.
And j, if the current time is detected to be the acquisition time for acquiring the configuration data, triggering an acquisition request.
The client detects whether the current time is the acquisition time corresponding to the configuration data at regular time or in real time, in this embodiment, the client acquires the configuration data from the server at regular time, the duration corresponding to the timing may be set according to specific needs, and the duration corresponding to the timing is not specifically limited in this embodiment. Specifically, the client records the historical acquisition time of acquiring the configuration data from the server last time, calculates the time difference between the historical acquisition time and the current time, and if the time difference is equal to or greater than the time length corresponding to the timing, the client can determine that the current time is the acquisition time corresponding to the configuration data; if the time difference is smaller than the time length corresponding to the timing, the client determines that the current time is not the acquisition time corresponding to the configuration data. If the client detects that the current time is the acquisition time corresponding to the configuration data, the client automatically triggers an acquisition request for acquiring the configuration data; and if the client detects that the current time is not the acquisition time corresponding to the configuration data, the client continuously detects whether the current time is the acquisition time corresponding to the configuration data. It is understood that in this embodiment, the client will periodically poll the interface of the server to obtain the latest configuration data.
The client side in the embodiment acquires the configuration data from the server side at regular time, and determines whether the page needs to be remotely rendered according to the configuration data acquired at regular time, so that the success rate of page rendering in the client side is improved.
Further, a fourth embodiment of a file downloading method is proposed. Referring to fig. 2, the file downloading method further includes:
step S42, when the remote rendering of the page corresponding to the client website is successful and the download instruction of the download target file is detected, acquiring the download data corresponding to the download instruction and sending the download data to the rendering server.
Step S44, the rendering server receives the download data, and downloads the target file from the target website according to the download data.
Step S46, storing the target file in a file server, obtaining a storage path of the target file in the file server, and sending the storage path to the client.
Step S48, after the client receives the storage path, downloading the target file in the file server according to the storage path.
And when the remote rendering of the page corresponding to the client website is successful and the downloading instruction of the downloading target file is detected, acquiring the downloading data corresponding to the downloading instruction and sending the downloading data to the rendering server. The rendering server receives the download data sent by the client, downloads the target file from the target website according to the download data, stores the target file into the file server, acquires a storage path of the target file in the file server, and sends the storage path to the client. And after the client receives the storage path, the client downloads the target file in the file server according to the storage path.
It should be noted that the specific implementation processes of step S42, step S44, step S46 and step S48 have been described in detail in the first embodiment, and are not repeated herein.
In the embodiment, when the page corresponding to the client website is successfully rendered remotely and an upload instruction for uploading a target file is detected, upload data corresponding to the upload instruction is sent to the rendering server, the rendering server sends the upload data and the target file acquired from the file server to the target website so as to upload the target file to the target website according to the upload data, and if the client receives a notification message that the upload of the target file is successful returned by the rendering server and detects a download instruction for downloading the target file, download data corresponding to the download instruction is acquired. The method and the device have the advantages that the target file is uploaded from the target website of the browser of the real Trident kernel through the rendering server in the file uploading process, the situation that the browser of the non-Trident kernel cannot complete service interaction is avoided, and the uploading success rate of the file uploaded by the browser based on the non-Trident kernel is improved.
Further, the file downloading method further includes:
and m, when the remote rendering of the page corresponding to the client website is successful and an uploading instruction of the uploading target file is detected, acquiring uploading data corresponding to the uploading instruction and sending the uploading data to the rendering server.
And n, the rendering server receives the uploaded data, acquires a storage path of the target file in a file server according to the uploaded data, and sends the storage path to a target website.
And step o, after the target website receives the storage path, acquiring a target file from the file server according to the storage path, storing the target file, generating a notification message that the target file is uploaded successfully, and sending the notification message to the client through the rendering server.
And p, if the client receives the notification message sent by the rendering server and detects a downloading instruction for downloading the target file, acquiring downloading data corresponding to the downloading instruction.
When the remote rendering of the page corresponding to the client website is successful and the uploading instruction of the uploading target file is detected, the client acquires the uploading data corresponding to the uploading instruction and sends the uploading data to the rendering server. And the rendering server receives the uploaded data, acquires a storage path of the target file in the file server according to the uploaded data, and sends the storage path to the target website. And after receiving the storage path, the target website acquires the target file from the file server according to the storage path, stores the target file, generates a notification message that the target file is successfully uploaded, and sends the notification message to the client through the rendering server. And if the client receives the notification message sent by the rendering server and detects a downloading instruction for downloading the target file, acquiring downloading data corresponding to the downloading instruction.
It should be noted that the specific implementation processes of step m, step n, step o, and step p have been described in detail in the second embodiment, and are not repeated herein.
In the embodiment, when the page corresponding to the client website is successfully rendered remotely and the uploading instruction of the uploading target file is detected, the uploading data corresponding to the uploading instruction is sent to the rendering server, so that the rendering server acquires the storage path of the target file in the file server according to the uploading data and sends the storage path to the target website, and the target website can acquire the target file according to the storage path to store the target file, so that the target file is uploaded to the target website. The method and the device have the advantages that the target file is uploaded from the target website of the browser of the real Trident kernel through the rendering server in the file uploading process, the situation that the browser of the non-Trident kernel cannot complete service interaction is avoided, and the uploading success rate of the file uploaded by the browser based on the non-Trident kernel is improved.
Further, a fifth embodiment of a file downloading method is proposed. The fifth embodiment of the method for downloading a file is different from the fourth embodiment of the method for downloading a file in that the method for downloading a file further includes:
and q, the client acquires pre-stored configuration data and determines whether a page corresponding to the client website needs to be remotely rendered according to the configuration data.
And step w, if the page is determined to need remote rendering, calling the rendering server to remotely render the page.
The method comprises the steps that a client side obtains pre-stored configuration data, whether a page corresponding to a website needs remote rendering or not is determined according to the configuration data, and if the page corresponding to the website needs remote rendering, a rendering server is called to conduct remote rendering on the page. It should be noted that, the specific embodiment processes of step q and step w have been described in detail in the third embodiment, and are not repeated herein.
Further, the file downloading method further includes:
and step y, after the server receives an acquisition request for acquiring the configuration data sent by the client, acquiring the configuration data according to the acquisition request.
And step t, sending the configuration data to the client.
When the server receives an acquisition request for acquiring the configuration data sent by the client, the server acquires the configuration data according to the acquisition request and sends the acquired configuration data to the client. It should be noted that, the acquisition request carries a URL corresponding to the configuration data to be acquired, and the server knows that the configuration data is to be sent to the client according to the URL in the acquisition request.
And when the server side detects a setting instruction for setting the configuration data, the server side sets the configuration data according to the setting instruction, wherein the setting instruction is triggered by a server side user according to specific needs. After the server sets the configuration data according to the setting instruction, the server acquires a second URL in the configuration data, determines the second URL as an index value of the configuration data, and determines other data except the second URL in the configuration data as key values, such as a Trident kernel version, a JS engine version, rendering scheduling service configuration data, whether ActiveX plug-ins are contained, whether files need to be uploaded and downloaded, whether printing functions need to be printed, and rendering scheduling service as key values. After the server determines the index value and the key value, the server establishes a mapping relation corresponding to the configuration data according to the index value and the key value, and stores the mapping relation into a preset database and a preset redis cache so as to store the configuration data. It is to be understood that the configuration data in the present embodiment is stored in the form of a mapping relationship. In this embodiment, the preset database may be a mysql database or other databases. The setting instruction is triggered by the service end user according to specific needs.
Further, after the server sets the configuration data according to the setting instruction, the server acquires a second URL in the configuration data, determines the second URL as an index value of the configuration data, and determines other data except the second URL in the configuration data as key values, such as a kernel version, a JS engine version, rendering scheduling service configuration data, whether an ActiveX plug-in is included, whether a file needs to be uploaded or downloaded, whether a printing function is needed, and rendering scheduling service as key values. After the server determines the index value and the key value, the server establishes a mapping relation corresponding to the configuration data according to the index value and the key value, and stores the mapping relation into a preset database and a preset redis cache so as to store the configuration data. It is to be understood that the configuration data in the present embodiment is stored in the form of a mapping relationship. In this embodiment, the preset database may be a mysql database or other databases. Further, after the server obtains the configuration data, the server stores the configuration data in a redis cache in a JSON array format.
It should be noted that, when the client needs to acquire the configuration data, the server acquires the configuration data from the redis cache and sends the configuration data to the client, and does not need to acquire the configuration data from the preset database and send the configuration data to the client.
Further, the file downloading method further includes:
step r, after the server detects a change instruction for changing the configuration data, changing the configuration data according to the change instruction, wherein the change instruction at least comprises one of the following instructions: add instructions, modify instructions, and delete instructions.
When the server detects a change instruction for changing the configuration data, the server changes the configuration data according to the update instruction, wherein the change instruction at least comprises one of the following instructions: add instructions, modify instructions, and delete instructions. The adding instruction may be to add new configuration data to the configuration data, and if there is no printing function in the configuration data, the server may add the printing function to the configuration data according to the adding instruction. The modification instruction is to modify the original configuration data of the server, for example, the server modifies the rendering scheduling service configuration data in the configuration data according to the modification instruction. The deleting instruction is to delete the data in the configuration data, for example, the server deletes the printing function in the configuration data according to the deleting instruction, and when the configuration data has no updating range, it indicates that the printing function does not exist in the webpage. Further, after the server changes the configuration data, the server stores the changed configuration data into the preset database and the redis cache. Further, after the server obtains the changed configuration data, the server can also directly send the changed configuration data to the client.
The embodiment updates the configuration data by changing the instruction, so that the configuration data is prevented from being changed, the configuration data can be updated regularly, the client can acquire the latest configuration data, and the webpage rendering success rate of the client is further improved.
Further, there is provided a file downloading apparatus, which includes, with reference to fig. 3:
the obtainingmodule 10 is configured to obtain download data corresponding to a download instruction when remote rendering of a page corresponding to a client website is successful and the download instruction for downloading a target file is detected;
a sendingmodule 30, configured to send the download data to a rendering server, so that the rendering server downloads the target file from a target website to a file server according to the download data, and returns a storage path of the target file in the file server;
a receivingmodule 50, configured to receive the storage path;
and adownloading module 70, configured to download the target file in the file server according to the storage path.
Further, the obtainingmodule 10 includes:
the system comprises a first acquisition unit, a second acquisition unit and a third acquisition unit, wherein the first acquisition unit is used for acquiring upload data corresponding to an upload instruction after page remote rendering corresponding to a client website is successful and the upload instruction of an upload target file is detected;
the first sending unit is used for sending the uploading data to a rendering server so that the rendering server can obtain a storage path of the target file in a file server according to the uploading data and send the storage path to a target website, wherein after the target website receives the storage path, the target file is obtained from the file server according to the storage path;
the first obtaining unit is further configured to obtain download data corresponding to the download instruction if receiving a notification message that the target file is successfully uploaded and returned by the rendering server and detecting the download instruction for downloading the target file.
Further, the obtainingmodule 10 is further configured to obtain pre-stored configuration data;
the file downloading device further comprises:
the determining module is used for determining whether a page corresponding to the client website needs to be remotely rendered according to the configuration data;
and the calling module is used for calling the rendering server to perform remote rendering on the page if the page is determined to need remote rendering.
Further, the obtainingmodule 10 is further configured to obtain a protocol packet name corresponding to an obtaining request after the obtaining request for obtaining the configuration data is detected;
the determining module is further used for determining a domain name corresponding to the server according to the protocol packet name;
the sending module is further configured to send the acquisition request to the server through the domain name, so that the server returns configuration data corresponding to the acquisition request;
the receiving module is also used for receiving the configuration data returned by the server;
the file downloading device further comprises:
and the storage module is used for storing the configuration data.
Further, the file downloading device further comprises:
the detection module is used for detecting whether the current time is the acquisition time for acquiring the configuration data;
and the triggering module is used for triggering the acquisition request if the current time is detected to be the acquisition time for acquiring the configuration data.
Further, the calling module comprises:
the detection unit is used for detecting whether the page needs remote rendering for the first time or not if the page needs remote rendering;
the second obtaining unit is used for obtaining the URL of the page if the fact that the page is remotely rendered for the first time is detected;
the second sending unit is used for sending the URL of the page to a rendering scheduling server so that the rendering scheduling server can return the connection information of the rendering server;
and the establishing unit is used for establishing communication connection between the client and the rendering server according to the connection information so as to call the rendering server to remotely render the page.
The specific implementation of the file downloading device according to the present invention is substantially the same as the steps in the first and second embodiments of the file downloading method, and will not be described herein again.
In addition, a file downloading system is also provided, and comprises a client and a rendering server;
the client is used for acquiring download data corresponding to the download instruction and sending the download data to the rendering server after the remote rendering of the page corresponding to the client website is successful and the download instruction of the download target file is detected;
the rendering server is used for receiving the download data and downloading the target file from a target website according to the download data; storing the target file into a file server, acquiring a storage path of the target file in the file server, and sending the storage path to the client;
and the client is also used for downloading the target file in the file server according to the storage path after receiving the storage path.
Further, the downloading system of the file also comprises a target website;
the client is also used for acquiring upload data corresponding to the upload instruction and sending the upload data to the rendering server after the remote rendering of the page corresponding to the client website is successful and the upload instruction of the upload target file is detected;
the rendering server is further used for receiving the uploading data, acquiring a storage path of the target file sent by a file server, acquiring the target file in the file server according to the storage path, and sending the uploading data and the target file to a target website;
the target website is used for storing the target file according to the uploading data and returning a notification message that the target file is uploaded successfully to the rendering server;
the client is further configured to obtain download data corresponding to the download instruction if the notification message sent by the rendering server is received and the download instruction for downloading the target file is detected.
Further, the client is further configured to obtain pre-stored configuration data, and determine whether a page corresponding to the client website needs to be remotely rendered according to the configuration data; and if the page is determined to need remote rendering, calling the rendering server to remotely render the page.
Furthermore, the file downloading system also comprises a server side;
the server is used for acquiring the configuration data according to an acquisition request after receiving the acquisition request for acquiring the configuration data sent by the client; and sending the configuration data to the client.
Further, the server is further configured to, if a change instruction for changing the configuration data is detected, change the configuration data according to the change instruction, where the change instruction at least includes one of the following instructions: add instructions, modify instructions, and delete instructions.
The specific implementation of the file downloading system according to the present invention is substantially the same as the steps in the third embodiment of the file downloading method described above, and will not be described herein again.
In addition, a file downloading device is also provided. As shown in fig. 4, fig. 4 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 4 is a schematic structural diagram of a hardware operating environment of a file downloading device. The downloading device of the file according to the embodiment of the invention can be a terminal device such as a PC, a portable computer and the like.
As shown in fig. 4, the downloading device of the file may include: aprocessor 1001, such as a CPU, amemory 1005, auser interface 1003, anetwork interface 1004, acommunication bus 1002. Wherein acommunication bus 1002 is used to enable connective communication between these components. Theuser interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and theoptional user interface 1003 may also include a standard wired interface, a wireless interface. Thenetwork interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Thememory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). Thememory 1005 may alternatively be a storage device separate from theprocessor 1001.
Those skilled in the art will appreciate that the download device configuration of files shown in fig. 4 does not constitute a limitation of the download device of files, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
As shown in fig. 4, amemory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a download program of a file. Among them, the operating system is a program that manages and controls the download device hardware and software resources of files, supports the download of files, and the running of other software or programs.
In the file downloading apparatus shown in fig. 4, theuser interface 1003 is mainly used for connecting a server, and performing data communication with the server, a rendering server, and the like, for example, obtaining plug-in configuration data from the server; thenetwork interface 1004 is mainly used for the background server and performs data communication with the background server; theprocessor 1001 may be configured to call a download program of a file stored in thememory 1005 and perform the steps of the download method of the file as described above.
The specific implementation of the file downloading device according to the present invention is substantially the same as the embodiments of the file downloading method described above, and will not be described herein again.
Furthermore, a computer-readable storage medium is provided according to an embodiment of the present invention, in which a file downloading program is stored, and the file downloading program implements the steps of the file downloading method when executed by a processor.
The specific implementation of the computer-readable storage medium according to the present invention is substantially the same as the embodiments of the file downloading method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.