File processing method and device for application updating, equipment, medium and program product
By migrating the main program file to a temporary directory and executing a deletion script, the problems of space consumption and file leakage after application updates are solved, achieving efficient and accurate file updates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-04-07
AI Technical Summary
After an application update, existing technologies suffer from the retention of old program files, leading to local space consumption and file leaks, which reduces the accuracy of file processing.
The main program file of the target application is moved to a temporary directory, the application update file is downloaded to the application directory, and a deletion script file is generated and executed to delete the temporary directory. Permission checks and version number comparisons are performed to ensure the accuracy and security of file updates.
It enables the replacement of application update files with main program files, promptly deletes temporary directories, frees up local space, prevents leakage of main program files, and improves the accuracy of file processing and user experience.
Smart Images

Figure CN121808776A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular to an application-updated file processing method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Technology
[0002] As user needs become increasingly diversified and software applications iterate at an ever-accelerating pace, automatic application updates have become a standard requirement in software development.
[0003] Currently, after an application update, files used for the application update and old program files are usually retained. This not only results in unnecessary local space usage but may also lead to the leakage of old program files, which in turn leads to lower accuracy in file processing during application updates. Summary of the Invention
[0004] Therefore, it is necessary to provide an application update file processing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the accuracy of application update file processing in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a file processing method for application updates, the method comprising:
[0006] In response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application;
[0007] Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application;
[0008] Generate a deletion script file and move the deletion script file to the temporary directory;
[0009] The temporary directory is deleted by executing the deletion script file.
[0010] As one embodiment, after deleting the temporary directory, the method further includes:
[0011] If any file in the temporary directory is detected, return to the step of deleting the temporary directory until no file in the temporary directory is detected.
[0012] As one embodiment, before deleting the temporary directory, the method further includes:
[0013] Obtain management permission information for the target application;
[0014] If the management permission information indicates that the user does not have the permission to delete the temporary directory, the management permissions corresponding to the target application are updated, and the step of deleting the temporary directory is executed.
[0015] If the management permission information indicates that the administrator has the permission to delete the temporary directory, then the step of deleting the temporary directory is executed.
[0016] As one embodiment, after downloading the application update file corresponding to the application update instruction to the application directory corresponding to the target application, the method further includes:
[0017] The integrity of the application update file is verified, and the verification result is obtained.
[0018] If the verification result indicates that the application update file has passed verification, the step of generating the deletion script file is executed;
[0019] If the verification result indicates that the application update file verification has failed, delete the application update file corresponding to the application update instruction, and restore the main program file to the application directory.
[0020] As one embodiment, the method further includes:
[0021] Retrieve the first version number information of the latest file of the target application on the server, and the second version number information of the target application on the local machine;
[0022] The first version number information and the second version number information are compared to obtain the comparison result;
[0023] If the comparison result indicates that the version of the latest file is higher than the local version, an application update instruction for the target application is generated.
[0024] As one embodiment, before deleting the temporary directory by executing the deletion script file, the method further includes:
[0025] To prevent the console window from flickering, disable the command echoing for deleting the script file.
[0026] Secondly, this application also provides a file processing apparatus for application updates, comprising:
[0027] The file moving module is used to move the main program file of the target application to the temporary directory corresponding to the target application in response to the application update command of the target application.
[0028] The file download module is used to download the application update file corresponding to the application update instruction to the application directory corresponding to the target application.
[0029] The file generation module is used to generate deletion script files;
[0030] The file moving module is also used to move the deletion script file to the temporary directory;
[0031] The file execution module is used to delete the temporary directory by executing the deletion script file.
[0032] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the processor performs the following steps when executing the computer program:
[0033] In response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application;
[0034] Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application;
[0035] Generate a deletion script file and move the deletion script file to the temporary directory;
[0036] The temporary directory is deleted by executing the deletion script file.
[0037] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0038] In response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application;
[0039] Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application;
[0040] Generate a deletion script file and move the deletion script file to the temporary directory;
[0041] The temporary directory is deleted by executing the deletion script file.
[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0043] In response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application;
[0044] Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application;
[0045] Generate a deletion script file and move the deletion script file to the temporary directory;
[0046] The temporary directory is deleted by executing the deletion script file.
[0047] The above-mentioned application update file processing method, apparatus, computer device, computer-readable storage medium, and computer program product, in response to an application update instruction of a target application, move the main program file of the target application to a temporary directory corresponding to the target application; download the application update file corresponding to the application update instruction to the application directory corresponding to the target application; generate a deletion script file and move the deletion script file to the temporary directory; and delete the temporary directory by executing the deletion script file.
[0048] Thus, upon receiving an application update command from the target application, the main program file of the target application is moved to a temporary directory, which can be added and deleted. The application update file corresponding to the application update command is downloaded to the application directory of the target application, enabling the replacement of the application update file with the main program file, thereby updating the target application's files. By executing the deletion script file, the temporary directory can be promptly deleted after the target application's files are updated. This process not only deletes the main program file from the old version but also the deletion script file, thereby freeing up significant local storage space, preventing the leakage of the main program file, and improving the accuracy of application update file processing. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is an application environment diagram of an embodiment that applies the updated file processing method;
[0051] Figure 2 This is a flowchart illustrating the application of an updated file processing method in one embodiment;
[0052] Figure 3 This is a flowchart illustrating the permission check and update steps performed before deleting the temporary directory in one embodiment.
[0053] Figure 4 This is a structural block diagram of a file processing apparatus that applies an updated method in one embodiment;
[0054] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0057] The application update file processing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on a cloud or other network server. In response to an application update command from the target application, server 104 moves the main program file of the target application to the temporary directory corresponding to the target application; downloads the application update file corresponding to the application update command to the application directory corresponding to the target application; generates a deletion script file and moves the deletion script file to the temporary directory; and deletes the temporary directory by executing the deletion script file. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal 102 can be a device with the target application deployed on it.
[0058] In one exemplary embodiment, such as Figure 2 As shown, a file processing method for application updates is provided, which is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:
[0059] Step 202: In response to the application update command of the target application, move the main program file of the target application to the temporary directory corresponding to the target application.
[0060] In step 202, the target application is the application awaiting an update. Application update commands can be initiated by the user on demand or in response to preset conditions; details can be found in the application update command generation steps below, which will not be elaborated upon here. The temporary directory is a directory that can be deleted and added, and it is stored locally.
[0061] For example, moving the main program file of the target application to the temporary directory corresponding to the target application includes: adding a temporary directory corresponding to the target application in the local storage space corresponding to the target application, querying the main program file of the target application in the application directory corresponding to the target application (the application directory is usually also in the local storage space corresponding to the target application), and moving the main program file from the local storage space corresponding to the target application to the temporary directory corresponding to the target application.
[0062] After moving the main program file from the local storage space corresponding to the target application to the temporary directory corresponding to the target application, the main program file can be renamed. That is, the file name of the main program file in the local application directory corresponding to the target application is different from the file name of the main program file in the temporary directory corresponding to the target application.
[0063] This avoids naming conflicts in the local storage space corresponding to the target application.
[0064] Optionally, generating an application update instruction in response to preset conditions includes: obtaining the first version number information of the latest file of the target application on the server, and the second version number information of the target application locally; comparing the first version number information and the second version number information to obtain a comparison result; and generating an application update instruction for the target application if the comparison result indicates that the version of the latest file is higher than the local version.
[0065] Furthermore, the first version number information of the latest file of the target application in the server is obtained, including: accessing the interface of the latest file of the target application in the server through HTTP (Hypertext Transfer Protocol) commands to obtain the first version number information.
[0066] The comparison method is based on the semantic versioning specification, and the comparison content includes at least one of the major version number, minor version number, and revision number.
[0067] Step 204: Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application.
[0068] In step 204, the application directory is the directory where the application's program files are stored, and the application directory is stored locally.
[0069] For example, step 204 includes: querying the application update file corresponding to the application update instruction from the server, and downloading the application update file to the application directory corresponding to the target application.
[0070] The download method is a resume download method.
[0071] This allows for the resumption of downloads after a network interruption, ensuring that application update files can be downloaded.
[0072] Furthermore, the filename of the application update file when stored in the application directory corresponding to the target application is consistent with the filename of the main program file when stored in the application directory corresponding to the target application.
[0073] It is understandable that during the process of downloading the application update file corresponding to the application update command from the server to the local machine, there may be a risk that the application update file may be tampered with. If the above-mentioned tampering risk is not considered, the downloaded application update file may be inaccurate.
[0074] Optionally, after step 204, the above method further includes: performing an integrity check on the application update file to obtain a check result; if the check result indicates that the application update file has passed the check, performing the step of generating a deletion script file; if the check result indicates that the application update file has failed the check, deleting the application update file corresponding to the application update instruction and restoring the main program file to the application directory.
[0075] The integrity verification methods include, but are not limited to, MD5 (Message-Digest Algorithm) value comparison and SHA (Secure Hash Algorithm) 256 hash value comparison.
[0076] Therefore, considering the risk of application update files being tampered with during the download process from the server to the local machine, an integrity check is performed promptly after the application update files are downloaded. If the check passes, the application file is considered updated, and only then is the temporary directory deleted. If the check fails, the failed application update files are promptly deleted, and the main program files are restored, ensuring that the target application can still be used normally even without being updated. In summary, this ensures the accuracy of the application update files.
[0077] Optionally, after restoring the main program file to the application directory, the above method also includes: displaying application update failure information. Specifically, the application update failure information may also indicate content that failed the integrity check.
[0078] In this way, by indicating that the application update file verification failed, the system administrators can take timely action to ensure that the download of the application update file can be resumed as soon as possible.
[0079] Step 206: Generate a deletion script file and move the deletion script file to a temporary directory.
[0080] In step 206, the script file to be deleted may include a LOOP tag and a goto statement. The LOOP tag is used to implement loop control and traversal, and the goto statement is used to implement loop jump.
[0081] Step 208: Delete the temporary directory by executing the deletion script file.
[0082] For example, step 208 includes: deleting the temporary directory by executing a deletion script file; if any file in the temporary directory is detected, returning to the step of deleting the temporary directory, until no file in the temporary directory is detected.
[0083] In this way, the cyclic deletion process of the temporary directory is realized without the need for complex process monitoring or sleep delay, which is simple and efficient.
[0084] Specifically, the LOOP tag in the script file is used to implement the step of repeatedly deleting the temporary directory, and the goto statement in the script file is used to jump to the LOOP tag when any file in the temporary directory is detected.
[0085] Optionally, after deleting the script file, the above method further includes at least one of the following: controlling the main program of the target application to execute a normal exit process; controlling the main program of the target application to release resources; controlling the main program of the target application to close the file handle; controlling the main program of the target application to terminate the thread.
[0086] Therefore, considering that the main program file cannot be deleted while the target application's main program is running, it is necessary to ensure that the target application's main program stops running after executing the deletion script file in order to ensure that the temporary directory can be deleted.
[0087] Optionally, prior to step 208, the method may further include: disabling command echoing for deleting script files to prevent console window flickering.
[0088] This avoids console window flickering during user interaction with the target application, thus preventing disruption to the user experience and ensuring a better user experience.
[0089] In the above-described application update file processing method, in response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application; the application update file corresponding to the application update command is downloaded to the application directory corresponding to the target application; a deletion script file is generated and moved to the temporary directory; and the temporary directory is deleted by executing the deletion script file. Thus, upon responding to the application update command of the target application, the main program file of the target application is migrated to the temporary directory, which can be added and deleted. The application update file corresponding to the application update command is downloaded to the application directory corresponding to the target application, enabling the replacement of the application update file with the main program file, thereby achieving the file update of the target application. By executing the deletion script file, the temporary directory is promptly deleted after the file update of the target application. This method not only deletes the main program file under the old version but also deletes the deletion script file, thereby freeing up considerable local space, preventing the leakage of the main program file, and improving the accuracy of application update file processing.
[0090] In one exemplary embodiment, such as Figure 3 As shown, before deleting the temporary directory in step 208, the above method also includes steps 302 to 304. Wherein:
[0091] Step 302: Obtain management permission information for the target application.
[0092] In step 302, the management permission information is used to characterize the executable content.
[0093] As an example, step 302 includes: obtaining management permission information for the target application by deleting the permission detection command deployed in the script file.
[0094] The permission detection commands include, but are not limited to, the fltmc command (a command-line tool in Windows used to manage file system filter drivers, supporting operations such as loading / unloading drivers, attaching / detaching volumes, and enumerating driver instances), the net session command (used to manage connections to server computers), the whoami command (a command in the operating system used to view currently valid usernames), and the groups command (a tool in Linux used to display the user groups to which a user belongs, allowing you to view the group membership information of the current user or a specified user).
[0095] If the management permission information indicates that the application does not have permission to delete the temporary directory, proceed to step 304 to update the management permissions corresponding to the target application and then delete the temporary directory.
[0096] If the administrator has the authority to delete the temporary directory, then proceed with the deletion of the temporary directory.
[0097] Optionally, as an embodiment, the above method further includes: if the temporary directory corresponding to the target application represented by the management permission information is readable, determining that the management permission information represents has the permission to delete the temporary directory; if the temporary directory corresponding to the target application represented by the management permission information is not readable, determining that the management permission information represents does not have the permission to delete the temporary directory.
[0098] In another embodiment, the method further includes: executing a permission detection command deployed in a deletion script file; if the permission detection command executes successfully, determining that the management permission information characterizes the permission to delete the temporary directory; if the permission detection command fails to execute, determining that the management permission information characterizes the permission not to delete the temporary directory.
[0099] As an example, updating the management permissions corresponding to the target application includes: updating the management permissions corresponding to the target application by calling PowerShell's RunAs command (a cross-platform command-line shell and scripting language developed by Microsoft, designed for system management and task automation, built on the .NET framework, and supporting object pipeline operations and rich extension functions).
[0100] As another embodiment, updating the management permissions corresponding to the target application includes: updating the management permissions corresponding to the target application by calling the ShellExecute function of the Windows API and passing the RunAs command.
[0101] In this way, the above-described method can be used to request the user to grant administrator privileges. After the administrator privileges are successfully updated, the script file is deleted and re-executed in the new high-privilege process, while the original low-privilege process exits automatically.
[0102] In this embodiment, before deleting the temporary directory, the management permission information for the target application is obtained. If the management permission information indicates that the application does not have the permission to delete the temporary directory, the management permission for the target application is updated, and the step of deleting the temporary directory is executed. If the management permission information indicates that the application has the permission to delete the temporary directory, the step of deleting the temporary directory is executed. If the management permission for the script file is low, the management permission for the target application is updated in a timely manner before the temporary directory deletion step is executed, which ensures that the script file always has the permission to delete the temporary directory.
[0103] As a detailed embodiment, the following steps are taken: First version number information of the latest file of the target application in the server, and second version number information of the target application locally; the first version number information and the second version number information are compared to obtain a comparison result; if the comparison result indicates that the version of the latest file is higher than the local version, an application update instruction for the target application is generated; in response to the application update instruction, the main program file of the target application is moved to the temporary directory corresponding to the target application; the application update file corresponding to the application update instruction is downloaded to the application directory corresponding to the target application; the integrity of the application update file is verified to obtain a verification result; if the verification result indicates that the application update file verification is successful, the step of generating a deletion script file is executed; if the verification result indicates that the application update file verification is unsuccessful, the application update file corresponding to the application update instruction is deleted, and the main program file is restored to the application directory; a deletion script file is generated and moved to the temporary directory; command echoing for the deletion script file is disabled to avoid console window flickering.
[0104] Furthermore, by executing the deletion script file, the management permission information for the target application is obtained; if the management permission information indicates that the application does not have permission to delete the temporary directory, the management permissions for the target application are updated, and the step of deleting the temporary directory is executed; if the management permission information indicates that the application has permission to delete the temporary directory, the step of deleting the temporary directory is executed; if any file in the temporary directory is detected, the step of deleting the temporary directory is returned until no file in the temporary directory is detected.
[0105] Thus, upon receiving an application update command from the target application, the main program file of the target application is moved to a temporary directory, which can be added and deleted. The application update file corresponding to the update command is downloaded to the target application's application directory, allowing for the replacement of the application update file with the main program file, thereby updating the target application's files. By executing a deletion script file, the temporary directory can be promptly deleted after the target application's files are updated. This process not only deletes the main program file from the old version but also the deletion script file, thereby freeing up significant local storage space, preventing the leakage of the main program file, and improving the accuracy of application update file processing.
[0106] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0107] Based on the same inventive concept, this application also provides an application update file processing apparatus for implementing the application update file processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more application update file processing apparatus embodiments provided below can be found in the limitations of the application update file processing method described above, and will not be repeated here.
[0108] In one exemplary embodiment, such as Figure 4 As shown, a file processing device for application updates is provided, comprising: a file moving module, a file generating module, and a file execution module, wherein:
[0109] The file moving module is used to move the main program file of the target application to the temporary directory corresponding to the target application in response to the application update command of the target application.
[0110] The file generation module is used to generate deletion script files.
[0111] The file moving module is also used to move deletion script files to a temporary directory.
[0112] The file execution module is used to delete temporary directories by executing a deletion script file.
[0113] In one embodiment, after deleting the temporary directory, the file execution module is further configured to: if any file in the temporary directory is detected, return to the step of deleting the temporary directory until no file in the temporary directory is detected.
[0114] In one embodiment, before deleting the temporary directory, the application update file processing device further includes: a permission update module, used to obtain management permission information for the target application; if the management permission information indicates that the application does not have permission to delete the temporary directory, the management permission corresponding to the target application is updated, and the process is transferred to the file execution module to perform the step of deleting the temporary directory; if the management permission information indicates that the application has permission to delete the temporary directory, the process is transferred to the file execution module to perform the step of deleting the temporary directory.
[0115] In one embodiment, after downloading the application update file corresponding to the application update instruction to the application directory corresponding to the target application, the application update file processing device further includes: a file verification module, used to perform integrity verification on the application update file and obtain a verification result; if the verification result indicates that the application update file has passed verification, the process is transferred to the file generation module to execute the step of generating a deletion script file; if the verification result indicates that the application update file has failed verification, the application update file corresponding to the application update instruction is deleted, and the main program file is restored to the application directory.
[0116] In one embodiment, the above-mentioned application update file processing device further includes: an instruction generation module, configured to obtain first version number information of the latest file of the target application in the server, and second version number information of the target application locally; compare the first version number information and the second version number information to obtain a comparison result; and generate an application update instruction for the target application if the comparison result indicates that the version of the latest file is higher than the local version.
[0117] In one embodiment, before deleting the temporary directory by executing the deletion script file, the file processing device for application updates further includes a command shutdown module for disabling command echoing of the deletion script file to avoid console window flickering.
[0118] The various modules in the aforementioned updated file processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0119] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an application-updated file processing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0120] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0121] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0122] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0123] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0124] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0126] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0127] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application's patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A file processing method for application updates, characterized in that, The method includes: In response to the application update command of the target application, the main program file of the target application is moved to the temporary directory corresponding to the target application; Download the application update file corresponding to the application update instruction to the application directory corresponding to the target application; Generate a deletion script file and move the deletion script file to the temporary directory; The temporary directory is deleted by executing the deletion script file.
2. The method according to claim 1, characterized in that, After deleting the temporary directory, the method further includes: If any file in the temporary directory is detected, return to the step of deleting the temporary directory until no file in the temporary directory is detected.
3. The method according to claim 1, characterized in that, Before deleting the temporary directory, the method further includes: Obtain management permission information for the target application; If the management permission information indicates that the user does not have the permission to delete the temporary directory, the management permissions corresponding to the target application are updated, and the step of deleting the temporary directory is executed. If the management permission information indicates that the administrator has the permission to delete the temporary directory, then the step of deleting the temporary directory is executed.
4. The method according to claim 1, characterized in that, After downloading the application update file corresponding to the application update instruction to the application directory corresponding to the target application, the method further includes: The integrity of the application update file is verified, and the verification result is obtained. If the verification result indicates that the application update file has passed verification, the step of generating the deletion script file is executed; If the verification result indicates that the application update file has failed verification, delete the application update file corresponding to the application update instruction, and restore the main program file to the application directory.
5. The method according to claim 1, characterized in that, The method further includes: Retrieve the first version number information of the latest file of the target application on the server, and the second version number information of the target application on the local machine; The first version number information and the second version number information are compared to obtain the comparison result; If the comparison result indicates that the version of the latest file is higher than the local version, an application update instruction for the target application is generated.
6. The method according to claim 1, characterized in that, Before deleting the temporary directory by executing the deletion script file, the method further includes: To prevent the console window from flickering, disable the command echoing for deleting the script file.
7. A file processing apparatus with updated applications, characterized in that, The device includes: The file moving module is used to move the main program file of the target application to the temporary directory corresponding to the target application in response to the application update command of the target application. The file download module is used to download the application update file corresponding to the application update instruction to the application directory corresponding to the target application. The file generation module is used to generate deletion script files; The file moving module is also used to move the deletion script file to the temporary directory; The file execution module is used to delete the temporary directory by executing the deletion script file.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.