Data file updating method and device of browser, electronic equipment and storage medium
By enabling interaction between the browser and storage through target services, the high cost problem caused by the diversity of client devices and browser types is solved, and unified file updates and efficient responses across browsers are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2023-01-04
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the diversity of client devices and browser types necessitates the writing of a large amount of adaptive code, increasing development and maintenance costs, and resulting in longer request response times.
The target file is obtained through the target service, and interaction occurs between the browser and the storage device. The target service is used to decrypt and update the file, and a unified calling interface is established, which is suitable for multiple browsers and client devices.
It enables unified file updates across browsers and client devices, reducing coding workload, lowering development and maintenance costs, and improving response efficiency.
Smart Images

Figure CN116010740B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information security technology, specifically to a method, apparatus, electronic device, and storage medium for updating data files in a browser. Background Technology
[0002] With the rapid development of the financial industry, financial institutions generally use centralized processing systems to handle requests from multiple clients. For example, multiple clients send browser requests to the centralized processing system to load data, and the centralized processing system processes the browser requests and returns the corresponding data files.
[0003] In related technologies, data files are typically pre-stored on the client to avoid excessively long request response times. However, due to the diverse types of client devices deployed in multiple regions and the various types of browsers installed on those clients, it is necessary to incur high costs in developing file reading and updating methods adapted to different client devices and browser types. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a method, apparatus, electronic device and storage medium for updating browser data files.
[0005] According to a first aspect of this disclosure, a method for updating a browser's data file is provided, applied to a client device, the method comprising:
[0006] In response to the detection of an update command for the browser, the target file is obtained through the target service. The target service interacts with both the browser and the storage. The target file is stored at a preset storage address in the storage, including the resource file corresponding to the update command.
[0007] Decrypt the target file returned by the target service to obtain plaintext information; and
[0008] Update the browser interface based on plaintext information.
[0009] According to embodiments of this disclosure, in response to detecting an update instruction for a browser, obtaining a target file through a target service includes:
[0010] In response to determining that a first connection has been established between the browser and the target service, a read request is generated according to the update instruction. The first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service. The read request is used to request the target service to read the target file.
[0011] Using the target service, the target file is retrieved from the preset storage address based on the read request.
[0012] According to embodiments of this disclosure, retrieving a target file from a preset storage address based on a read request using a target service includes:
[0013] Based on the read request, determine the read method within the target service;
[0014] Based on the request parameters in the read request, the read method is invoked to retrieve the target file from the preset storage address; and
[0015] Return the target file to the browser.
[0016] According to embodiments of this disclosure, in response to detecting an update instruction for the browser, obtaining the target file through the target service further includes:
[0017] In response to the determination that no initial connection has been established between the browser and the target service, the system uses pre-defined execution code associated with the browser to determine the API call corresponding to the target protocol. This API call is used to establish a connection between various types of browsers and the target service.
[0018] Based on the API call, an initial connection is established between the browser and the target service.
[0019] According to embodiments of this disclosure, the target file includes a file in which the resource file is encrypted on an application server, the application server being used to support various application functions of the browser;
[0020] The target file is decrypted to obtain plaintext information, including:
[0021] In response to receiving the target file returned by the target service, obtain the decryption key, wherein the decryption key corresponds to the encryption key used by the application server; and
[0022] The target file is decrypted using the decryption key to obtain the plaintext information.
[0023] According to embodiments of this disclosure, before obtaining the target file through the target service in response to detecting an update instruction for the browser, the method further includes:
[0024] In response to detecting that the user's login status is logged in, a download request is sent to the application server. The download request is used to download M update files and the update dates of the update files from the application server. The update files include the target file, and M is greater than or equal to 1.
[0025] Receive M update files and M update dates, and return the M update files and M update dates to the browser, wherein the update dates represent the dates on which the application server configured the update files; and
[0026] Using the target service, update files are stored to a preset storage address based on the update date.
[0027] According to embodiments of this disclosure, storing M update files to a preset storage address based on the update date using a target service includes:
[0028] After receiving the update date and the update file, the target service uses the target component to compare the update dates of M update files with the update dates of the M most recently updated files, obtains the comparison result, and stores the most recently updated files in a preset storage address; and
[0029] In response to the comparison results indicating that the update dates of M updated files are later than the update date of the most recently updated file, the most recently updated file is replaced with the updated file.
[0030] According to embodiments of this disclosure, before storing M update files to a preset storage address based on the update date using the target service, the process includes:
[0031] The API call corresponding to the target protocol is determined by using the pre-defined execution code associated with the browser; and
[0032] Based on the API call, a second connection is established between the browser and the target service to store the updated file to a preset storage address. The second connection is based on the target protocol.
[0033] A second aspect of this disclosure provides a method for updating data files in a browser, applied to an application server, the method comprising:
[0034] Receive download requests from client devices and obtain the identifiers of M resource files added from the preset update date to the current time, where M is greater than or equal to 1;
[0035] A target download task is generated based on the M resource file identifiers, and the target download task is added to the execution queue;
[0036] Execute the target download task to download M resource files and the update dates of the M resource files;
[0037] Using the encryption key, encrypt the M resource files to obtain M updated files; and
[0038] The encrypted M update files and M update dates are returned to the client device.
[0039] 9. According to an embodiment of this disclosure, the step of generating a target download task based on the M resource file identifiers and adding the target download task to the execution queue includes:
[0040] Get the number of users executing download tasks in the queue;
[0041] If the number of users does not exceed a preset threshold, the target download task is generated and added to the execution queue.
[0042] If the number of users exceeds a preset threshold, a waiting task is generated based on the M resource file identifiers, and the waiting task is added to the waiting queue; and
[0043] If the sum of the number of users before the waiting task and the number of users in the execution queue is less than or equal to the preset threshold, the waiting task will be added to the execution queue as the target download task.
[0044] A third aspect of this disclosure provides a browser data file updating device applied to a client device, the device comprising:
[0045] The acquisition module is used to obtain the target file through the target service in response to the detection of an update command for the browser. The target service interacts with both the browser and the storage. The target file is stored in a preset storage address of the storage, including the resource file corresponding to the update command.
[0046] The decryption module is used to decrypt the target file to obtain plaintext information; and
[0047] The update module is used to update the browser interface based on plaintext information.
[0048] A fourth aspect of this disclosure provides a browser data file updating apparatus for use on an application server, the apparatus comprising:
[0049] The receiving module is used to receive download requests from client devices and obtain the identifiers of M resource files added from the preset update date to the current time, where M is greater than or equal to 1;
[0050] The generation module is used to generate target download tasks based on the M resource file identifiers and add the target download tasks to the execution queue;
[0051] An execution module is used to execute the target download task, downloading M resource files and the update dates of the M resource files; and
[0052] An encryption module is used to encrypt M resource files using an encryption key to obtain M updated files; and
[0053] The return module is used to return the encrypted M update files and M update dates to the client device.
[0054] A fifth aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the data file update method of the browser described above.
[0055] A sixth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the aforementioned browser data file update method.
[0056] The seventh aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for updating data files in a browser.
[0057] The embodiments of this disclosure, in response to the detection of an update command for a browser, obtain a target file through a target service; decrypt the target file to obtain plaintext information; and update the browser interface based on the plaintext information, thus achieving file updates applicable to multiple client devices and browser types. By setting up a target service between the browser and local files, and utilizing the unified file processing operations of the target service, file reading and updating can be achieved. This eliminates the need to write multiple update methods for different browser types and client devices, and also eliminates the need to set up multiple maintenance methods for diverse update methods, achieving the technical effect of reducing coding workload and lowering browser development and maintenance costs.
[0058] Furthermore, the embodiments of this disclosure indirectly realize the interaction between the browser and the local storage through the target service, and a unified calling interface can still be established in different browser environments, realizing cross-browser data file updates. Attached Figure Description
[0059] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0060] Figure 1 This illustration schematically depicts an application scenario of a browser data file update method according to an embodiment of the present disclosure;
[0061] Figure 2 A flowchart illustrating a browser data file update method according to an embodiment of the present disclosure is shown schematically;
[0062] Figure 3 A flowchart illustrating a method for obtaining a target file according to an embodiment of the present disclosure is shown schematically.
[0063] Figure 4A flowchart illustrating a target file decryption method according to an embodiment of the present disclosure is shown schematically.
[0064] Figure 5 A flowchart illustrating a target file storage method according to an embodiment of the present disclosure is shown schematically.
[0065] Figure 6 This illustration schematically shows a data file downloading diagram of a browser according to a specific embodiment of the present disclosure;
[0066] Figure 7 This schematically illustrates a structural block diagram of a browser data file update apparatus according to an embodiment of the present disclosure; and
[0067] Figure 8 A block diagram of an electronic device for a browser-friendly data file update method according to an embodiment of the present disclosure is illustrated schematically. Detailed Implementation
[0068] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0069] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0070] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0071] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0072] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals.
[0073] Centralized processing systems can handle browser requests from multiple clients in parallel. However, in practical applications, as financial transactions increase, the number of client devices connected to the centralized processing system also gradually increases, leading to problems such as long request response times.
[0074] In related technologies, data files are typically stored on the client side and retrieved through local loading operations. For example, for Internet Explorer, read and write operations on local files on the client side are achieved by embedding an OCX component based on ActiveX technology within the browser; for browsers such as Chrome and Firefox, read and write operations on local files on the client side are achieved by embedding NPAPI or PPAPI components within the browser.
[0075] Since OCX components are only applicable to client devices running Windows, and NPAPI and PPAPI components have stringent application requirements, implementing local read operations requires writing read code applicable to various client devices and browser types, which increases code development costs.
[0076] Furthermore, due to the different control permissions of various client devices and browser types, it is impossible to adapt to multiple browsers through a unified execution code. Instead, corresponding execution code must be developed for each browser, which further increases development and subsequent maintenance costs.
[0077] The embodiments of this disclosure provide a method for updating a browser's data file, applied to a client device. The method responds to the detection of an update command for the browser by obtaining a target file through a target service. The target service interacts with both the browser and a storage device. The target file is stored at a preset storage address in the storage device and includes resource files corresponding to the update command. The method then decrypts the target file to obtain plaintext information and updates the browser based on the plaintext information.
[0078] Figure 1 The illustration depicts an application scenario of a browser data file update method according to an embodiment of the present disclosure.
[0079] like Figure 1As shown, application scenario 100 according to this embodiment includes interactive operations between the server and the client. Specifically, application scenario 100 includes an application server 101 and a file storage device 102 set on the server, and a browser 103, a target service 105, and a local file storage device 104 set on the client device.
[0080] File storage 102 may include multiple servers or server clusters different from application server 101, for storing various types of files such as browser version files, configuration files, or static resource files used for deploying or updating the browser. File storage 102 may also be located within application server 101.
[0081] Application server 101 is used to receive requests from browser 103, retrieve the file requested by browser 103 from file storage 102, and return the retrieved file to browser 103. Application server 101 can receive requests from multiple browsers through multiple servers or a server cluster and return the corresponding data files.
[0082] Client devices can be various electronic devices with a display screen and web browsing capabilities, including but not limited to smartphones, tablets, laptops, desktop computers, self-service devices, etc.
[0083] The client device can have various types of execution engines installed, such as Windows, Linux, or Android systems. The browser 103 installed on the client device can include various execution engines, such as various browsers based on the Chrome kernel.
[0084] The target service 105 interacts with the browser 103 and the local file storage 104 to perform file transfer operations between the browser 103 and the local file storage 104. The target service 105 includes a JavaScript runtime environment, implementing event-driven operations through JavaScript code.
[0085] The local file storage 104 may include various types of storage, such as virtual storage devices or physical storage devices.
[0086] It should be noted that the browser data file update method provided in this disclosure can generally be executed by a client device. Accordingly, the browser data file update device provided in this disclosure can generally be installed in the client device.
[0087] It should be understood that Figure 1The number of client devices, storage, and application servers shown is merely illustrative. Depending on implementation needs, any number of client devices, storage, and application servers can be included.
[0088] The following will be based on Figure 1 The described scene, through Figures 2-6 The browser data file update method according to the disclosed embodiments will be described in detail.
[0089] Figure 2 A flowchart illustrating a browser data file update method according to an embodiment of the present disclosure is shown schematically.
[0090] like Figure 2 As shown, the method includes operations S210~S230.
[0091] In operation S210, in response to the detection of an update command for the browser, the target file is obtained through the target service, which interacts with both the browser and the storage.
[0092] According to embodiments of this disclosure, a browser can interact with the user through its interface and interact with the client device or application browser through a browser background service. When the user performs an operation on the browser interface, the browser generates an update instruction corresponding to that operation; the browser background service generates a read request based on the update instruction and loads the target file to update the browser interface. The target file loaded by the browser can be various types of data files, such as video files, page files, or audio files.
[0093] According to embodiments of this disclosure, in response to a detected update command, the browser background service initiates a read request to the target service, thereby retrieving the target file from the storage via the target service. The target service interacts with both the browser and the storage, indirectly enabling file transfer between the browser and the storage.
[0094] According to embodiments of this disclosure, the target service may include a JavaScript runtime environment that uses the same JavaScript coding system as the browser and uses JavaScript to achieve interaction with the browser and storage.
[0095] For example, the target service could be a JavaScript runtime environment based on the Chrome V8 engine, such as a Node.js service. Node.js services interact with the browser and memory using an event-driven, non-blocking I / O model.
[0096] The target file is stored at a preset storage address in the memory, including resource files corresponding to the update instructions. For example, the target file can be an access history file or an operation log; it can also be a version file used to update browser functionality.
[0097] In operation S220, the target file returned by the target service is decrypted to obtain plaintext information.
[0098] According to embodiments of this disclosure, after obtaining the target file through the target service, the browser receives the target file returned by the target service. Since the target file stored locally is an encrypted file, after receiving the target file, a decryption method is used to decrypt the target file to obtain plaintext information.
[0099] According to embodiments of this disclosure, the target file is pre-downloaded from the application server to the client device in order to reduce command response time in multi-client, high-concurrency scenarios.
[0100] According to embodiments of this disclosure, when the application server returns a resource file to the client device, it encrypts the resource file using an encryption method to obtain the aforementioned target file. Specifically, the application server can employ various encryption methods to encrypt the file, and the browser can employ various decryption methods to decrypt the target file. The encryption and decryption methods correspond to each other to ensure that the client device cannot modify the target file stored locally on the client.
[0101] When operating S230, the browser interface is updated based on plaintext information.
[0102] According to embodiments of this disclosure, after the browser decrypts the target file and obtains plaintext information, it can call the corresponding browser component to update the browser interface based on the plaintext information.
[0103] For example, taking the target file as a bookmarks information example, the plaintext information includes the bookmarks information and the display parameters of the browser interface. After the browser decrypts the target file to obtain the plaintext information, it processes the display parameters and bookmarks information through the rendering component, updates the browser interface, and displays the specific bookmarks information on the browser interface.
[0104] The embodiments of this disclosure, in response to the detection of an update command for a browser, obtain a target file through a target service; decrypt the target file to obtain plaintext information; and update the browser interface based on the plaintext information, thus achieving file updates applicable to multiple client devices and browser types. By setting up a target service between the browser and local files, and utilizing the unified file processing operations of the target service, file reading and updating can be achieved. This eliminates the need to write multiple update methods for different browser types and client devices, and also eliminates the need to set up multiple maintenance methods for diverse update methods, achieving the technical effect of reducing coding workload and lowering browser development and maintenance costs.
[0105] Furthermore, the embodiments of this disclosure indirectly realize the interaction between the browser and the local storage through the target service, and a unified calling interface can still be established in different browser environments, realizing cross-browser data file updates.
[0106] Figure 3 A flowchart illustrating a method for obtaining target files according to an embodiment of the present disclosure is shown schematically.
[0107] like Figure 3 As shown, the target file acquisition method of this embodiment includes operations S311 to S312, which can be used as a specific embodiment of operation S210.
[0108] In operation S311, in response to determining that a first connection has been established between the browser and the target service, a read request is generated according to the update instruction, wherein the first connection is a connection based on the target protocol, which is used to allow interaction between the browser and the target service.
[0109] According to embodiments of this disclosure, the browser and the target service communicate based on a target protocol. Therefore, a first connection based on the target protocol needs to be established before the browser and the target service can interact.
[0110] The target protocols include communication protocols applicable between applications, including the Transmission Control Protocol (TCP) and other protocols derived from TCP. For example, the WebSocket protocol enables full-duplex communication over a single TCP connection.
[0111] According to embodiments of this disclosure, during the process of obtaining a target file through a target service, it is first determined whether a first connection has been established between the browser and the target service. If it is determined that a first connection has been established, a read request is generated according to an update instruction. Specifically, the read request can be generated according to the update instruction based on the transmission format specified in the target protocol.
[0112] According to embodiments of this disclosure, a read request is used to request the target service to read a target file. After generating the read request, the browser sends the read request to the target service so that the target service can retrieve the target file from storage based on the read request.
[0113] According to embodiments of this disclosure, when it is determined that no first connection has been established between the browser and the target service, a call interface corresponding to the target protocol is determined by a preset execution code associated with the browser. The call interface is used to establish a connection between various types of browsers and the target service; and a first connection is established between the browser and the target service according to the call interface.
[0114] Specifically, if it is determined that no initial connection has been established between the browser and the target service, the browser uses JavaScript to determine the API call used to establish the WebSocket connection. The browser then establishes a WebSocket connection with the target service by calling this API call.
[0115] The calling interface can be an application programming interface (API).
[0116] According to embodiments of this disclosure, various types of browsers can establish connections with the target service by calling the interface. Thus, when various types of browsers obtain local target files through the target service, there is no need to write file reading methods adapted to various types of browsers. The restrictions between the browser and the system can be removed simply by using the target service to achieve the reading and updating of local target files.
[0117] According to embodiments of this disclosure, the preset execution code can be a JavaScript program applicable to multiple browser types, so as to obtain a calling interface applicable to multiple browsers by calling a unified execution code, thereby realizing the interaction between the browser and the target service.
[0118] According to embodiments of this disclosure, if no first connection is established between the target service and the browser, a first connection based on the WebSocket protocol can be established through preset execution code. In subsequent interactions between the target service and the browser, it is not necessary to repeatedly establish the first connection, thereby improving the efficiency of interaction processing between the target service and the browser.
[0119] When operating S312, the target service is used to retrieve the target file from the preset storage address according to the read request.
[0120] According to embodiments of this disclosure, after a browser sends a read request to a target service, the target service can receive the read request and obtain the target file according to a preset storage address within the read request. The preset storage address within the read request can be a URL address.
[0121] According to embodiments of this disclosure, retrieving a target file from a preset storage address using a target service based on a read request includes: determining a read method within the target service based on the read request; invoking the read method to retrieve the target file from the preset storage address based on request parameters within the read request; and returning the target file to the browser.
[0122] According to embodiments of this disclosure, after receiving a read request, the target service determines a read method within the target service based on the read request. Specifically, the fs.readFile() read method is determined from the fs file component based on the read request.
[0123] After determining the `fs.readFile()` method, this method is called to retrieve the target file based on the request parameters in the read request. These request parameters include the target file's default storage address, the read format, and the return result.
[0124] For example, taking a Node.js service as the target service. After receiving a read request, the Node.js service calls the fs file component to read the local target file and sends the read target file back to the browser via a WebSocket connection.
[0125] The embodiments of this disclosure utilize a target service to obtain target files based on a unified read request. This eliminates the need to generate multiple read requests corresponding to different browsers or establish multiple corresponding operations within the target service. While ensuring the target service is compatible with multiple browsers, it significantly reduces the amount of code writing required.
[0126] Figure 4 A flowchart illustrating a target file decryption method according to an embodiment of the present disclosure is shown schematically.
[0127] like Figure 4 As shown, the target file decryption method of this embodiment includes operations S421 to S422, which can be used as a specific embodiment of operation S220.
[0128] In operation S421, in response to receiving the target file returned by the target service, a decryption key is obtained, wherein the decryption key corresponds to the encryption key used by the application server.
[0129] In operation S422, the target file is decrypted using the decryption key to obtain plaintext information.
[0130] According to embodiments of this disclosure, the target file includes a file after the updated file has been encrypted on the application server. The application server can interactively support various application functions of the browser. The application server can encrypt the resource file using an encryption key and return the encrypted target file to the browser.
[0131] Before the browser decrypts the target file, it interacts with the application server to determine the encryption key used by the application server, thus determining the decryption key to be used. When decrypting the target file, the decryption key can be used directly to obtain the plaintext information.
[0132] The decryption key corresponds to the encryption key. The encryption key can be a randomly arranged string sequence, and the decryption key can be the reverse string sequence of the encryption key.
[0133] For example, the encryption key is XYZXYZ123. The browser and application server interact to determine the decryption key by performing a deserialization operation on the encryption key. Therefore, the decryption key can be obtained as 321ZYXZYX.
[0134] According to embodiments of this disclosure, the application server can also generate an encryption key using a preset encryption algorithm to encrypt resource files; the browser can generate a decryption key using a decryption algorithm corresponding to the encryption algorithm to decrypt the target file.
[0135] Since the target file is encrypted, the browser interface is updated only after the plaintext information is obtained through decryption, thus avoiding problems such as accidental modification of the target file on the client's local machine and improving the security of file updates.
[0136] Figure 5 A flowchart illustrating a target file storage method according to an embodiment of the present disclosure is shown schematically.
[0137] like Figure 5 As shown, the target file storage method of this embodiment includes operations S510 to S530, which can be set before operations S210 to S230.
[0138] In operation S510, in response to detecting that the user's login status is logged in, a download request is sent to the application server. The download request is used to download M update files and the update dates of the update files from the application server. The update files include the target file, and M is greater than or equal to 1.
[0139] When operating the S520, receive M update files and M update dates, and return the M update files and M update dates to the browser;
[0140] When operating S530, the target service is used to store M update files to a preset storage address based on the update date.
[0141] According to embodiments of this disclosure, before acquiring the target file and updating the browser interface, the browser can interact with the application server to store resource files or the latest version of the browser update file on the local client.
[0142] According to embodiments of this disclosure, after opening a browser interface and logging in, the client device can detect that the user's login status is "logged in." After confirming the login status, the client device can automatically send batch download requests for update files to the application server in the background, thus performing batch downloads of the target file and other update files.
[0143] When a user performs a corresponding page operation, the browser can directly retrieve the target file from the client device. Since the target file is already stored on the local device, the file retrieval process does not involve network transmission or waiting; therefore, the browser page can be updated quickly when the user performs the page operation.
[0144] According to embodiments of this disclosure, a user can perform a download operation through a browser interface, and the browser generates a download instruction based on the download operation. After detecting the download instruction for the download operation, the browser background service sends a download request, such as an HTTP request, to the application server to download the target file.
[0145] The application server receives an HTTP download request from the browser, reads the file content from the file storage, and obtains M resource files and the update dates configured for these M resource files. The resource files are then encrypted using a preset encryption algorithm, resulting in M updated files. These updated files include the target file. After obtaining the target file, the update dates of the resource files are used as the update dates of the target files, and these files are returned to the browser along with the target files.
[0146] The browser obtains M update files and their update dates based on the results returned by the application server. It then sends the update files and update dates to the target service, which uses the target service to store the M downloaded update files in batches to a preset storage address based on the update dates.
[0147] For scenarios where files are downloaded from an application server, the embodiments of this disclosure still implement target file storage through a target service, enabling multiple file downloads and writes applicable to multiple browsers, reducing the workload of code writing and lowering the manual costs of developing and maintaining file download and write methods.
[0148] According to embodiments of this disclosure, using a target service, M update files are stored to a preset storage address based on their update dates, including:
[0149] After receiving the update date and the update file, the target service uses the target component to compare the update dates of M update files with the update dates of the M most recently updated files, obtains the comparison result, and stores the most recently updated files in a preset storage address; and
[0150] In response to the comparison results indicating that the update dates of the M updated files are later than the update dates of the M most recently updated files, the M updated files are used to replace the M most recently updated files.
[0151] According to embodiments of this disclosure, the most recently updated file is stored at a preset storage address and includes resource files for the application function to which the updated file belongs. Specifically, the most recently updated file may be the previous version file of the updated file.
[0152] For example, recently updated files are resource files used to update browser versions, such as version V1.0. Updated files include target files, which are resource files for the latest browser version, such as version V2.0.
[0153] After receiving the update date and the updated file, the target service calls the fs file component to compare the update dates of the M most recently updated files with the update dates of the M updated files, and obtains the comparison result. The comparison result can be either "the current file is the latest version file" or "the current file is not the latest version file".
[0154] In response to the comparison result indicating that the update date of the target file is later than the update date of the most recently updated file, the target service replaces the M most recently updated files with M files by calling the write method of the target component.
[0155] Specifically, when the update dates of M updated files are later than the update dates of the M most recently updated files, the `fs.writeFile()` method of the `fs` file component is called to overwrite the M most recently updated files in a preset storage address and write the new M updated files. By comparing the update dates of the M updated files with the update dates of the most recently updated files, it is ensured that the storage always stores the latest updated files. Furthermore, overwriting the latest updated files avoids update problems caused by incorrect file version returns.
[0156] According to embodiments of this disclosure, before storing M update files to a preset storage address based on the update date using the target service, the process includes: determining the calling interface corresponding to the target protocol through preset execution code associated with the browser; and
[0157] Based on the API call, a second connection is established between the browser and the target service to store the updated file to a preset storage address. The second connection is based on the target protocol.
[0158] According to embodiments of this disclosure, and in accordance with the file update process type, before storing the updated file to a preset storage address using the target service, a second connection based on the target protocol needs to be established between the target service and the browser.
[0159] Specifically, the browser can call the WebSocket API interface based on a pre-written JavaScript program to establish a WebSocket connection with the target service, i.e., a second connection. After the second connection is established between the browser and the target service, the browser sends the encrypted update file and update date to the target service, so that the target service can store the update file to a preset storage address according to the update date.
[0160] According to embodiments of this disclosure, an application server and an application WAR package are deployed before downloading the target file from the application server. The WAR package contains various browser application functionalities, including system service functions, web pages, and backend service application functionalities. Specifically, the application server can be a Tomcat service installed on the application server.
[0161] Before detecting update commands, the target service needs to be installed on the client device and the client environment parameters need to be configured. Specifically, different versions of the target service can be installed depending on the client device's operating system. For example, for Linux kernel systems, install the `node-v*.*.*-linux-x64.tar.xz` package, and for Windows systems, install the `node-v*.*.*-win-x64.zip` package. It should be noted that although different installation packages exist for different operating systems, all packages support JavaScript programs, and their internal execution logic code is the same or similar.
[0162] According to embodiments of this disclosure, after installing the version package of the target service, the `npm install` command can also be used to install the `ws` and `fs` file components, which are used to start the service that establishes a WebSocket connection and to perform local file read and write operations, respectively.
[0163] According to embodiments of this disclosure, before a download or update command is detected, the target service is started on the client device, and the Tomcat service is started on the application server. After the target service is started, a service that establishes a WebSocket connection can also be started on the client device using the `node server.js` command.
[0164] According to embodiments of this disclosure, during the process of a client device sending a download request to an application server to download M update files and their update dates, the application server receives the download request from the client device, obtains the identifiers of M resource files added from a preset update date to the current time, where M is greater than or equal to 1; generates a target download task based on the M resource file identifiers and adds the target download task to the execution queue; executes the target download task to download the M resource files and their update dates; encrypts the M resource files using an encryption key to obtain the M update files; and returns the encrypted M update files and their update dates to the client device.
[0165] According to embodiments of this disclosure, after receiving a download request from a client device, the application server incrementally acquires M update file identifiers added from a preset update date to the current time in response to the download request. Since the download of update files is a background process on the client device, the number of update files needs to be limited to ensure a seamless update of the browser interface for the user.
[0166] By incrementally acquiring the identifiers of M newly added update files from the preset update date to the current time, the application server can quickly obtain the newer M update file identifiers without having to scan all files.
[0167] Under preset conditions, a target download task corresponding to the current user is generated based on M update file identifiers, and the target download task is added to the execution queue. The application server processes the download tasks in the execution queue according to the first-in, first-out principle, completes the download and encryption of M resource files, and obtains the updated file and update date.
[0168] According to embodiments of this disclosure, generating a target download task based on M update file identifiers and adding the target download task to an execution queue includes: obtaining the number of users with download tasks in the execution queue; generating a target download task and adding it to the execution queue if the number of users does not exceed a preset threshold; generating a waiting task based on M resource file identifiers and adding it to a waiting queue if the number of users exceeds the preset threshold; and adding the waiting task to the execution queue if the sum of the number of users in the waiting queue, before the waiting task, and the number of users in the execution queue is less than or equal to a preset threshold.
[0169] According to embodiments of this disclosure, the application server stores multiple resource files. When multiple users send download requests to the application server through multiple client devices, the application server cannot execute all client device download requests simultaneously due to bandwidth limitations.
[0170] Therefore, after receiving a download request from a client device, the application server, before downloading the update file, obtains the number of users in the execution queue for download tasks. Specifically, the number of users can be determined based on the identifier of the client device, or it can be determined based on the identifier of the download request. A user can download multiple update files. To ensure smooth download flow, and provided the number of users does not exceed a preset threshold, target download tasks are generated based on the identifiers of M resource files, and these download tasks are added to the execution queue. The application server then downloads the resource files according to the order in which the tasks in the execution queue are executed.
[0171] According to embodiments of this disclosure, the preset threshold can be 10 to ensure that download tasks from 10 users are executed simultaneously.
[0172] According to embodiments of this disclosure, when the number of users exceeds a preset threshold, such as when the number of users exceeds 10, waiting tasks can be generated based on M resource file identifiers and added to a waiting queue. The waiting queue can serve as a cache queue for caching download tasks to be added to the execution queue.
[0173] Since the execution queue limits the number of users, by generating waiting tasks in advance in the cached waiting queue, if the total number of users in the waiting queue, before the waiting task, and in the execution queue is less than or equal to a preset threshold, the waiting task can be directly added to the end of the execution queue as the target download task, so that the execution queue can execute the download tasks in order without regenerating the target download task.
[0174] In the face of high-concurrency, multi-user download scenarios, this disclosure first ensures smooth network channels by limiting the number of users; secondly, since tasks have already been generated in the waiting queue, downloads can be started directly when the users in front finish downloading, reducing user waiting time.
[0175] Figure 6 The illustration shows a schematic diagram of a browser downloading a data file according to a specific embodiment of the present disclosure.
[0176] like Figure 6 As shown, file update scenario 600 includes Tomcat service 601 installed on the server, Chrome browser 602 installed on the client device, Node.js service 603, and local folder 604.
[0177] Users can perform download operations and generate download commands within the Chrome browser interface (602). Upon detecting the download command, the browser sends a download request to the Tomcat service (601). The Tomcat service (601), based on the received download request, reads the file, encrypts it, and returns the target file along with its update date. Specifically, the Tomcat service (601) can read resource files based on the download request, encrypt the resource files, and obtain the target file. After obtaining the target file, the Tomcat service (601) returns the target file and its update date to the Chrome browser (602).
[0178] Chrome browser 602 establishes a WebSocket connection with Node.js service 603. After establishing the WebSocket connection, the target file, with its updated date encrypted, is sent to Node.js service 603.
[0179] Node.js service 603 compares the update dates of the most recently updated file and the target file by calling the fs file component, and obtains the comparison result. In response to the comparison result indicating that the update date of the target file is later than the update date of the most recently updated file, Node.js service 603 stores the target file to the local folder 604.
[0180] Figure 7 A schematic block diagram of a browser data file update apparatus according to an embodiment of the present disclosure is shown.
[0181] like Figure 7 As shown, the browser data file update device 700 of this embodiment is applied to a client device and includes an acquisition module 710, a decryption module 720 and an update module 730.
[0182] The acquisition module 710 is used to acquire a target file through a target service in response to detecting an update command for the browser. The target service interacts with both the browser and the storage, and the target file is stored at a preset storage address in the storage. The target file includes resource files corresponding to the update command. In one embodiment, the acquisition module 710 can be used to perform the operation S210 described above, which will not be repeated here.
[0183] The decryption module 720 is used to decrypt the target file returned by the target service to obtain plaintext information. In one embodiment, the decryption module 720 can be used to perform the operation S220 described above, which will not be repeated here.
[0184] The update module 730 is used to update the browser interface based on plaintext information. In one embodiment, the update module 730 can be used to perform the operation S230 described above, which will not be repeated here.
[0185] According to embodiments of this disclosure, the acquisition module 710 includes a first acquisition unit and a second acquisition unit.
[0186] The first acquisition unit is configured to generate a read request based on an update instruction in response to determining that a first connection has been established between the browser and the target service. The first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service. The read request is used to request the target service to read the target file. In one embodiment, the first acquisition unit may be used to perform the operation S311 described above, which will not be repeated here.
[0187] The second acquisition unit is used to obtain a target file from a preset storage address based on a read request using the target service. In one embodiment, the second acquisition unit can be used to perform the operation S312 described above, which will not be repeated here.
[0188] According to embodiments of this disclosure, the second acquisition unit includes a first acquisition subunit, a second acquisition subunit, and a third acquisition subunit.
[0189] The first acquisition subunit is used to determine the reading method within the target service based on the reading request.
[0190] The second acquisition subunit is used to call the read method to obtain the target file from the preset storage address based on the request parameters in the read request.
[0191] The third acquisition subunit is used to return the target file to the browser.
[0192] According to embodiments of this disclosure, the acquisition module 710 further includes an execution unit and a first connection unit.
[0193] The execution unit is used to determine the calling interface corresponding to the target protocol in response to the determination that no first connection has been established between the browser and the target service, through preset execution code associated with the browser. The calling interface is used to establish a connection between various types of browsers and the target service.
[0194] The first connection unit is used to establish the first connection between the browser and the target service based on the API call.
[0195] According to embodiments of this disclosure, the decryption module 720 includes a first decryption unit and a second decryption unit.
[0196] The first decryption unit is used to obtain a decryption key in response to receiving the target file returned by the target service, wherein the decryption key corresponds to the encryption key used by the application server. In one embodiment, the first decryption unit can be used to perform the operation S421 described above, which will not be repeated here.
[0197] The second decryption unit is used to decrypt the target file according to the decryption key to obtain plaintext information. In one embodiment, the second decryption unit can be used to perform the operation S422 described above, which will not be repeated here.
[0198] According to embodiments of this disclosure, the browser's data file update device 700 further includes a download module, a first storage module, and a second storage module.
[0199] The download module, in response to a user's logged-in status, sends a download request to the application server. The download request downloads M update files and their update dates from the application server. The update files include the target file, and M is greater than or equal to 1. In one embodiment, the download module can perform the operation S510 described above, which will not be repeated here.
[0200] The first storage module is used to receive M update files and M update dates, and return the M update files and M update dates to the browser, wherein the update dates represent the date on which the application server configured the update files. In one embodiment, the first storage module can be used to perform the operation S520 described above, which will not be repeated here.
[0201] The second storage module is used to utilize the target service to store M update files to a preset storage address according to the update date. In one embodiment, the second storage module can be used to perform the operation S530 described above, which will not be repeated here.
[0202] According to embodiments of this disclosure, the storage module includes a first storage unit and a second storage unit.
[0203] The first storage unit is used by the target service to compare the update dates of M update files with the update dates of M most recently updated files after receiving the update date and update file, and obtain the comparison result. The most recently updated file is stored in a preset storage address.
[0204] The second storage unit is used to replace the M most recently updated files with the M updated files in response to the comparison result indicating that the update dates of the M updated files are later than the update dates of the M most recently updated files.
[0205] According to embodiments of this disclosure, the storage module further includes a second connection unit and a third connection unit.
[0206] The second connection unit is used to determine the calling interface corresponding to the target protocol through preset execution code associated with the browser.
[0207] The third connection unit is used to establish a second connection between the browser and the target service according to the calling interface, so as to store the updated file to a preset storage address. The second connection is a connection based on the target protocol.
[0208] According to embodiments of this disclosure, any plurality of modules among the acquisition module 710, decryption module 720, and update module 730 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the acquisition module 710, decryption module 720, and update module 730 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 710, decryption module 720, and update module 730 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.
[0209] According to embodiments of this disclosure, a data file update device for a browser applied to an application server includes a receiving module, a generating module, an execution module, an encryption module, and a returning module.
[0210] The receiving module is used to receive download requests from client devices and obtain the identifiers of M resource files added from the preset update date to the current time, where M is greater than or equal to 1;
[0211] The generation module is used to generate target download tasks based on the M resource file identifiers and add the target download tasks to the execution queue;
[0212] An execution module is used to execute the target download task, downloading M resource files and the update dates of the M resource files; and
[0213] An encryption module is used to encrypt M resource files using an encryption key to obtain M updated files; and
[0214] The return module is used to return the encrypted M update files and M update dates to the client device.
[0215] According to embodiments of this disclosure, the generation module includes an acquisition submodule, a first generation submodule, a second generation submodule, and a third generation submodule.
[0216] The `get` submodule is used to retrieve the number of users executing download tasks in the queue.
[0217] The first generation submodule is used to generate the target download task and add the target download task to the execution queue when it is determined that the number of users does not exceed a preset threshold.
[0218] The second generation submodule is used to generate waiting tasks based on the M resource file identifiers when it is determined that the number of users exceeds a preset threshold, and add the waiting tasks to the waiting queue.
[0219] The third generation submodule is used to add the waiting task as the target download task to the execution queue when the sum of the number of users before the waiting task and the number of users in the execution queue is less than or equal to the preset threshold.
[0220] Figure 8 A block diagram of an electronic device for a browser-friendly data file update method according to an embodiment of the present disclosure is illustrated schematically.
[0221] like Figure 8 As shown, an electronic device 800 according to an embodiment of this disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.
[0222] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0223] According to embodiments of this disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0224] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0225] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0226] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the browser data file update method provided in embodiments of this disclosure.
[0227] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0228] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0229] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0230] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0231] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0232] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0233] The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this disclosure. It should be understood that the above descriptions are merely specific embodiments of this disclosure and are not intended to limit this disclosure. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the protection scope of this disclosure.
Claims
1. A method for updating data files in a browser, applied to a client device, the method comprising: In response to detecting that a user is logged in, a download request is sent to the application server. The download request is used to download M update files and the update dates of the update files from the application server. The update files include target files, and M is greater than or equal to 1. Receive M update files and M update dates, and return the M update files and M update dates to the browser, wherein the update dates are used to characterize the date on which the application server configured the update files; Using the target service, store M updated files to a preset storage address according to the update date; In response to the detection of an update command for the browser, a target file is obtained through a target service, which interacts with both the browser and the storage device. The target file is stored at a preset storage address in the storage device and includes resource files corresponding to the update command. The target file returned by the target service is decrypted to obtain plaintext information; the browser interface of the browser is updated according to the plaintext information. The step of obtaining the target file through the target service in response to detecting an update instruction for the browser includes: In response to determining that a first connection has been established between the browser and the target service, a read request is generated according to the update instruction, wherein the first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service, and the read request is used to request the target service to read the target file; using the target service, the target file is obtained from the preset storage address according to the read request; In response to determining that no first connection has been established between the browser and the target service, a call interface corresponding to the target protocol is determined through preset execution code associated with the browser. The call interface is used to establish a connection between various types of browsers and the target service. Based on the call interface, the first connection is established between the browser and the target service.
2. The method according to claim 1, wherein, The step of using the target service to obtain the target file from the preset storage address according to the read request includes: Based on the read request, determine the read method within the target service; Based on the request parameters within the read request, the read method is invoked to retrieve the target file from the preset storage address; and The target file is returned to the browser.
3. The method according to claim 1, wherein, The target file includes a file in which resource files are encrypted on an application server, and the application server is used to support various application functions of the browser; The process of decrypting the target file to obtain plaintext information includes: In response to receiving the target file returned by the target service, a decryption key is obtained, wherein the decryption key corresponds to the encryption key used by the application server; and The target file is decrypted using the decryption key to obtain the plaintext information.
4. The method according to claim 1, wherein, The step of utilizing the target service to store M updated files to the preset storage address according to the update date includes: After receiving the update date and the update file, the target service uses a target component to compare the update dates of M update files with the update dates of M most recently updated files to obtain a comparison result. The most recently updated files are stored at the preset storage address. In response to the comparison result indicating that the update dates of the M updated files are later than the update dates of the M most recently updated files, the M updated files are used to replace the M most recently updated files.
5. The method according to claim 1, wherein, Before using the target service to store the M updated files to the preset storage address according to the update date, the process includes: The calling interface corresponding to the target protocol is determined by using preset execution code associated with the browser; and According to the API call, a second connection is established between the browser and the target service to store the update file to the preset storage address. The second connection is a connection based on the target protocol.
6. A method for updating data files in a browser, applied to an application server, the method comprising: Receive download requests from client devices and obtain the identifiers of M resource files added from the preset update date to the current time, where M is greater than or equal to 1; A target download task is generated based on the M resource file identifiers, and the target download task is added to the execution queue; Execute the target download task to download M resource files and the update dates of the M resource files; The M resource files are encrypted using the encryption key to obtain M updated files; The client device returns the encrypted M update files and M update dates to the client device, so that the client device returns the M update files and M update dates to the browser, wherein the update date is used to characterize the date on which the application server configured the update files; using the target service, the M update files are stored to a preset storage address according to the update date; the client device is further configured to generate a read request according to the update instruction in response to determining that a first connection has been established between the browser and the target service, wherein the first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service, and the read request... The system requests a target file from a target service; uses the target service to retrieve the target file from a preset storage address based on the read request; in response to determining that a first connection has not been established between the browser and the target service, it determines a calling interface corresponding to the target protocol through preset execution code associated with the browser, the calling interface being used to establish a connection between various types of browsers and the target service; establishes the first connection between the browser and the target service according to the calling interface; decrypts the target file returned by the target service to obtain plaintext information; and updates the browser interface based on the plaintext information.
7. The method according to claim 6, wherein, The step of generating a target download task based on the M resource file identifiers and adding the target download task to the execution queue includes: Get the number of users executing download tasks in the queue; If the number of users does not exceed a preset threshold, the target download task is generated and added to the execution queue. If the number of users exceeds a preset threshold, a waiting task is generated based on the M resource file identifiers, and the waiting task is added to the waiting queue; and If the sum of the number of users before the waiting task and the number of users in the execution queue is less than or equal to the preset threshold, the waiting task will be added to the execution queue as the target download task.
8. A browser data file updating device, applied to a client device, the device comprising: The download module is used to send a download request to the application server in response to detecting that the user's login status is logged in. The download request is used to download M update files and the update dates of the update files from the application server. The update files include target files, and M is greater than or equal to 1. The first storage module is configured to receive M update files and M update dates, and return the M update files and M update dates to the browser, wherein the update dates are used to characterize the date on which the application server configured the update files; The second storage module is used to utilize the target service to store M update files to a preset storage address according to the update date; The acquisition module is used to acquire a target file through a target service in response to the detection of an update command for the browser. The target service interacts with both the browser and the storage. The target file is stored at a preset storage address in the storage. The target file includes resource files corresponding to the update command. The decryption module is used to decrypt the target file to obtain plaintext information; An update module is used to update the browser interface of the browser based on the plaintext information; The acquisition module is further configured to, in response to determining that a first connection has been established between the browser and the target service, generate a read request according to the update instruction, wherein the first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service, and the read request is used to request the target service to read the target file; using the target service, obtain the target file from the preset storage address according to the read request; in response to determining that a first connection has not been established between the browser and the target service, determine a calling interface corresponding to the target protocol through preset execution code associated with the browser, the calling interface being used to establish a connection between various types of browsers and the target service; and establish the first connection between the browser and the target service according to the calling interface.
9. A browser data file update device, applied to an application server, the device comprising: The receiving module is used to receive download requests from client devices and obtain the identifiers of M resource files added from the preset update date to the current time, where M is greater than or equal to 1; The generation module is used to generate target download tasks based on the M resource file identifiers and add the target download tasks to the execution queue; The execution module is used to execute the target download task, downloading M resource files and the update dates of the M resource files; An encryption module is used to encrypt M resource files using an encryption key to obtain M updated files; The return module is configured to return the encrypted M update files and M update dates to the client device, so that the client device can return the M update files and M update dates to the browser, wherein the update date is used to characterize the date on which the application server configured the update files; using the target service, the M update files are stored to a preset storage address according to the update date; the client device is further configured to generate a read request according to the update instruction in response to determining that a first connection has been established between the browser and the target service, wherein the first connection is a connection based on the target protocol, used to allow interaction between the browser and the target service. The read request is used to request the read of a target file from the target service; using the target service, the target file is obtained from the preset storage address according to the read request; in response to determining that no first connection has been established between the browser and the target service, a call interface corresponding to the target protocol is determined through preset execution code associated with the browser, the call interface being used to establish a connection between various types of browsers and the target service; according to the call interface, the first connection is established between the browser and the target service; the target file returned by the target service is decrypted to obtain plaintext information; and the browser interface of the browser is updated according to the plaintext information.
10. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 7.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.