Software updating method, system, device and medium

Through the subroutine or main program, the version number is compared and the upgrade is solved, the problem of desktop software update interruption and reset, the software is updated and version control within the LAN, and the user experience is improved.

CN116647448BActive Publication Date: 2025-08-22CHONG QING JIN XIN MAI SI CHUAN GAN QI JI SHU YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310580869.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-22
Publication Date
2025-08-22
Estimated Expiration
2043-05-22

AI Technical Summary

Technical Problem

The desktop software program needs to be interrupted during update and cannot be updated by itself. After the update, the user needs to reset it, resulting in an unfriendly user experience.

Method used

Establish a connection with the server through a subroutine or main program, compare version numbers and upgrade, download and decompress files, overwrite the original files, retain user settings information, and realize the software running independently during updates.

Benefits of technology

The software update function is realized in the LAN, so users do not need to reconfigure, shorten the update time and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116647448B_ABST
    Figure CN116647448B_ABST
Patent Text Reader

Abstract

The present application provides a software update method, system, device and medium. The method can provide two software update methods, namely, updating the main program through a subprogram and updating the subprogram through the main program. Not only does it realize the software update function within the local area network, but as long as the administrator releases a new version of the software program on the server side, the user can update to the new version, thereby shortening the time from user demand to implementation to the shortest. In addition, the present application can perform effective version control and record the changes of each version in detail. In addition, when the software update is completed, the present application can retain the user setting information, and the user does not need to reconfigure after completing the software update, thereby saving time for the user and improving the user experience. At the same time, when the software is updated, the present application can allow the software program to run independently during the update, and for the main program of any structure, the update program can be used to update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer and communication technology, and in particular to a software updating method, system, device and medium. Background Art

[0002] Version updates are a crucial feature for desktop software programs, but they cannot update themselves because they need to interrupt themselves during the update process and will stop if the update is interrupted. Furthermore, desktop software programs, due to their complexity, often come with numerous settings that vary by user. Failure to preserve these settings during updates forces users to reconfigure the software, wasting time and creating an unfriendly user experience. Furthermore, to reduce the complexity of software updates, software programs should be able to run independently during updates, and any main program structure should be able to be updated using an updater. Summary of the Invention

[0003] In view of the above-mentioned shortcomings of the prior art, the purpose of this application is to provide a software update method, system, device and medium for solving the technical problems existing in software update in the prior art.

[0004] To achieve the above-mentioned and other related purposes, the present application provides a software updating method, which includes updating a main program through a subprogram. The process of updating the main program through a subprogram includes:

[0005] The update program is opened through the main program, and the main program name is passed to the subprogram using pipe communication. The subprogram generates a simulated identity and establishes a connection with the server. It then checks whether the server directory and the server directory XML file exist based on the provided main program name. If the server directory and the server directory XML file do not exist, the update process of the current software to be updated is exited. If the server directory and the server directory XML file exist, the subprogram checks whether the local main program XML file exists.

[0006] If the local main program xml file does not exist, the version number of the software to be updated is set to the version number indicating that the main program is directly updated, and a sub-thread is started for upgrading;

[0007] If the local main program XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local main program XML file;

[0008] If the version number of the server directory xml file is greater than that of the local main program xml file, a child thread is started to upgrade;

[0009] If the version number of the server directory xml file is less than or equal to the local main program xml file, the subroutine is started and the software update button is not displayed;

[0010] After starting the child thread for upgrade, check whether the local file storage directory exists;

[0011] If the local file storage directory does not exist, create it;

[0012] If the local file storage directory exists, after successfully connecting to the server, the target program compressed package in the server is downloaded to the local file storage directory using file streaming, and the download progress is displayed in real time; and after the download is completed, the existence of the decompressed file directory is checked; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the target program compressed package is decompressed to generate a first decompressed file directory; and all directories and files under the first decompressed file directory are moved to the local main program directory using recursion, and overwritten when the file names are the same; and temporary files during software updates are deleted, and the local main program xml file is updated, and an "Open Program" button is displayed; after the "Open Program" button is triggered, the main program is started first, and then the update program is closed; wherein, when overwriting the same file name in the local main program directory, the directory storing subprograms and program version information and the directory storing custom configurations are not overwritten; the temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

[0013] In one embodiment of the present application, the method further includes updating the sub-program through the main program; the process of updating the sub-program through the main program includes:

[0014] Use the simulated identity to connect to the server and check whether the server directory and the server directory xml file exist; if the server directory and the server directory xml file do not exist, exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, check whether the local subroutine xml file exists;

[0015] If the local subroutine xml file does not exist, the version number of the software to be updated is set to the version number indicating the direct update subroutine, and a sub-thread is started for upgrading;

[0016] If the local subprogram XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local subprogram XML file;

[0017] If the version number of the server directory xml file is greater than that of the local subroutine xml file, a subthread is started for upgrading;

[0018] If the version number of the server directory xml file is less than or equal to the local subroutine xml file, the subroutine is started without displaying the software update button;

[0019] After starting the child thread for upgrade, check whether the local file storage directory exists;

[0020] If the local file storage directory does not exist, create it;

[0021] If the local file storage directory exists, the subprogram compressed package is downloaded to the local file storage directory using file streaming, and after the download is completed, it is checked whether the decompressed file directory exists; and when the decompressed file directory exists, the original decompressed file directory is deleted, and the subprogram compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are moved to the local subprogram directory using recursion, and an overwriting operation is performed when the file names are the same, and temporary files are deleted, and the local subprogram XML file is updated, and the subprogram is started and a software update button is displayed; wherein, the temporary files include the subprogram compressed package and the decompressed file corresponding to the subprogram compressed package.

[0022] In one embodiment of the present application, before updating the main program through the subprogram, the method further includes: setting, in the directory where the main program exe is located, a program main body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files used by the program, a subprogram directory, a directory for storing temporary update files and XML files, a directory for storing main program version information, a directory for storing subprogram version information, and a directory for storing user local information and files;

[0023] When the main program is updated through the subprogram, the subprogram will not update the subprogram directory or the directory storing the user's local information and files.

[0024] In one embodiment of the present application, the process of generating the simulated identity includes: using the main program to start the subroutine, and using the subroutine to try to log in to the server using an account, password, IP address or domain name, and generating the simulated identity when successfully logging in to the server;

[0025] Wherein, when the server is an independent file server, an IP address is provided; when the server is a member server in a domain, a domain name is provided.

[0026] In one embodiment of the present application, the server directory includes: a main directory for storing each program compressed package and program information, and each program compressed package has an independent directory under the server main directory; the independent directory is determined according to the name of the program compressed package, and the independent directory includes the program compressed package and the corresponding xml file.

[0027] The present application further provides a software update system, the system comprising: a first update module for updating a main program through a subprogram; the process of the first update module updating the main program through the subprogram comprises:

[0028] The update program is opened through the main program, and the main program name is passed to the subprogram using pipe communication. The subprogram generates a simulated identity and establishes a connection with the server. It then checks whether the server directory and the server directory XML file exist based on the provided main program name. If the server directory and the server directory XML file do not exist, the update process of the current software to be updated is exited. If the server directory and the server directory XML file exist, the subprogram checks whether the local main program XML file exists.

[0029] If the local main program xml file does not exist, the version number of the software to be updated is set to the version number indicating that the main program is directly updated, and a sub-thread is started for upgrading;

[0030] If the local main program XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local main program XML file;

[0031] If the version number of the server directory xml file is greater than that of the local main program xml file, a child thread is started to upgrade;

[0032] If the version number of the server directory xml file is less than or equal to the local main program xml file, the subroutine is started and the software update button is not displayed;

[0033] After starting the child thread for upgrade, check whether the local file storage directory exists;

[0034] If the local file storage directory does not exist, create it;

[0035] If the local file storage directory exists, after successfully connecting to the server, the target program compressed package in the server is downloaded to the local file storage directory using file streaming, and the download progress is displayed in real time; and after the download is completed, the existence of the decompressed file directory is checked; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the target program compressed package is decompressed to generate a first decompressed file directory; and all directories and files under the first decompressed file directory are moved to the local main program directory using recursion, and overwritten when the file names are the same; and temporary files during software updates are deleted, and the local main program xml file is updated, and an "Open Program" button is displayed; after the "Open Program" button is triggered, the main program is started first, and then the update program is closed; wherein, when overwriting the same file name in the local main program directory, the directory storing subprograms and program version information and the directory storing custom configurations are not overwritten; the temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

[0036] In one embodiment of the present application, the system further includes a second updating module for updating the sub-program through the main program. The process of the second updating module updating the sub-program through the main program includes:

[0037] Use the simulated identity to connect to the server and check whether the server directory and the server directory xml file exist; if the server directory and the server directory xml file do not exist, exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, check whether the local subroutine xml file exists;

[0038] If the local subroutine xml file does not exist, the version number of the software to be updated is set to the version number indicating the direct update subroutine, and a sub-thread is started for upgrading;

[0039] If the local subprogram XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local subprogram XML file;

[0040] If the version number of the server directory xml file is greater than that of the local subroutine xml file, a subthread is started for upgrading;

[0041] If the version number of the server directory xml file is less than or equal to the local subroutine xml file, the subroutine is started without displaying the software update button;

[0042] After starting the child thread for upgrade, check whether the local file storage directory exists;

[0043] If the local file storage directory does not exist, create it;

[0044] If the local file storage directory exists, the subprogram compressed package is downloaded to the local file storage directory using file streaming, and after the download is completed, it is checked whether the decompressed file directory exists; and when the decompressed file directory exists, the original decompressed file directory is deleted, and the subprogram compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are moved to the local subprogram directory using recursion, and an overwriting operation is performed when the file names are the same, and temporary files are deleted, and the local subprogram XML file is updated, and the subprogram is started and a software update button is displayed; wherein, the temporary files include the subprogram compressed package and the decompressed file corresponding to the subprogram compressed package.

[0045] In one embodiment of the present application, before the first update module updates the main program through the subprogram, the first update module further includes: setting, in the directory where the main program exe is located, a program main body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files used by the program, a subprogram directory, a directory for storing temporary update files and XML files, a directory for storing main program version information, a directory for storing subprogram version information, and a directory for storing user local information and files;

[0046] When the main program is updated through the subprogram, the subprogram will not update the subprogram directory or the directory storing the user's local information and files.

[0047] The present application also provides a software update device, comprising:

[0048] processor; and,

[0049] A computer-readable medium storing instructions, when the processor executes the instructions, causes the device to execute any of the software update methods described above.

[0050] The present application also provides a computer-readable medium having instructions stored thereon, wherein the instructions are loaded by a processor and executed by any of the software updating methods described above.

[0051] As described above, the present application provides a software updating method, system, device and medium, which have the following beneficial effects: the present application can provide two software updating methods, namely, updating the main program through the subprogram, and updating the subprogram through the main program; not only does it realize the software updating function within the local area network, but as long as the administrator releases a new version of the software program on the server side, the user can update to the new version, thereby shortening the time from user demand to implementation to the shortest. In addition, the present application can perform effective version control and record the changes of each version in detail. In addition, when the software update is completed, the present application can retain the user setting information, and the user does not need to reconfigure after completing the software update, thereby saving time for the user and improving the user experience. At the same time, when the software is updated, the present application can allow the software program to run independently during the update, and for the main program of any structure, the update program can be used to update. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of an exemplary system architecture for applying the technical solutions in one or more embodiments of this application;

[0053] Figure 2 A schematic diagram of the main program structure provided in an embodiment of this application;

[0054] Figure 3 A schematic diagram of the server directory structure provided in one embodiment of the present application;

[0055] Figure 4 A schematic diagram of a state in which a software program provided in an embodiment of the present application can be updated;

[0056] Figure 5 This is a schematic diagram of a state in which a software program provided in an embodiment of the present application cannot be updated;

[0057] Figure 6 This is a schematic diagram of a server file missing provided in an embodiment of the present application;

[0058] Figure 7 A flowchart of a software update method provided in one embodiment of the present application;

[0059] Figure 8 The figure is a schematic diagram of the hardware structure of a software updating device suitable for implementing one or more embodiments of the present application. DETAILED DESCRIPTION

[0060] The following describes the embodiments of the present application through specific examples. Those skilled in the art can easily understand the other advantages and effects of the present application from the content disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.

[0061] It should be noted that the illustrations provided in this embodiment only illustrate the basic concept of the present application in a schematic manner. Therefore, the illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.

[0062] Figure 1 FIG1 shows a schematic diagram of an exemplary system architecture to which the technical solutions in one or more embodiments of the present application can be applied. Figure 1 As shown, system architecture 100 may include terminal device 110, network 120, and server 130. Terminal device 110 may include various electronic devices such as smartphones, tablet computers, laptop computers, and desktop computers. Server 130 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services. Network 120 may be a communication medium of various connection types capable of providing a communication link between terminal device 110 and server 130, such as a wired communication link or a wireless communication link.

[0063] Depending on implementation needs, the system architecture in the embodiments of the present application can have any number of terminal devices, networks, and servers. For example, server 130 can be a server group consisting of multiple server devices. In addition, the technical solutions provided in the embodiments of the present application can be applied to terminal device 110, server 130, or can be implemented by both terminal device 110 and server 130, and this application does not impose any special restrictions on this.

[0064] In one embodiment of the present application, the terminal device 110 or server 130 of the present application can open the update program through the main program, and use pipeline communication to pass the main program name to the sub-program, and the sub-program generates a simulated identity and establishes a connection with the server, and queries whether the server directory and the server directory xml file exist according to the provided main program name; if the server directory and the server directory xml file do not exist, then exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, then check whether the local main program xml file exists; if the local main program xml file does not exist, then set the version number of the software to be updated to the version number indicating that the main program is directly updated, and start the sub-thread for upgrading; if the local main program xml file exists, then compare and determine whether the version number of the server directory xml file is greater than the version number of the local main program xml file; if the version number of the server directory xml file is greater than the version number of the local main program xml file, then start the sub-thread for upgrading; if the version number of the server directory xml file is less than or equal to the local main program xml file, then start the sub-program and do not display the software update button; start After the child thread is upgraded, it checks whether the local file storage directory exists; if the local file storage directory does not exist, it creates the local file storage directory; if the local file storage directory exists, after successfully connecting to the server, it uses file streaming to download the target program compressed package in the server to the local file storage directory, and displays the download progress in real time; and after the download is completed, it checks whether the decompressed file directory exists; and if the decompressed file directory exists, it deletes the original decompressed file directory and decompresses the target program compressed package to generate a first decompressed file directory; and uses recursion to move all directories and files under the first decompressed file directory to the local main program directory, and overwrites them if the file names are the same; and deletes temporary files during software updates, updates the local main program XML file, and displays an "Open Program" button; after the "Open Program" button is triggered, the main program is started first, and then the update program is closed; wherein, when overwriting the same file name in the local main program directory, the directory storing subprograms and program version information and the directory storing custom configurations are not overwritten; temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

[0065] In another embodiment of the present application, the terminal device 110 or server 130 of the present application can use an impersonation identity to connect to the server and check whether the server directory and the server directory xml file exist; if the server directory and the server directory xml file do not exist, then exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, then check whether the local subroutine xml file exists; if the local subroutine xml file does not exist, then set the version number of the software to be updated to the version number indicating the direct update subroutine, and start a sub-thread for upgrading; if the local subroutine xml file exists, then compare and determine whether the version number of the server directory xml file is greater than the version number of the local subroutine xml file; if the version number of the server directory xml file is greater than the version number of the local subroutine xml file, then start a sub-thread for upgrading; if the version number of the server directory xml file is less than or equal to the local subroutine xml file, the subroutine is started and the software update button is not displayed; after starting the subthread for upgrading, the local file storage directory is checked to see if it exists; if the local file storage directory does not exist, the local file storage directory is created; if the local file storage directory exists, the subroutine compressed package is downloaded to the local file storage directory using the file stream, and after the download is complete, the decompressed file directory is checked to see if it exists; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the subroutine compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are recursively moved to the local subroutine directory, and overwritten when the file names are the same, and temporary files are deleted, and the local subroutine xml file is updated, and the subroutine is started and the software update button is displayed; wherein, the temporary files include the subroutine compressed package and the decompressed file corresponding to the subroutine compressed package.

[0066] It can be seen from this that by using the terminal device 110 or the server 130 to execute the software update method, two software update methods can be provided, namely, updating the main program through the subprogram, and updating the subprogram through the main program. Not only does it realize the software update function within the local area network, but as long as the administrator releases a new version of the software program on the server side, the user can update to the new version, thereby shortening the time from the user's demand to the implementation to the shortest. In addition, the present application can perform effective version control and record the changes of each version in detail. In addition, when the software update is completed, the present application can retain the user setting information, and the user does not need to reconfigure after completing the software update, thereby saving time for the user and improving the user experience. At the same time, when the software is updated, the present application can allow the software program to run independently during the update, and for the main program of any structure, the update program can be used to update. The above section introduces the content of the exemplary system architecture that applies the technical solution of the present application.

[0067] In an exemplary embodiment, this embodiment provides a software update method, which includes the following steps: updating the main program through a subroutine. Specifically, the process of updating the main program through a subroutine in this embodiment includes: opening the update program through the main program, and passing the main program name to the subroutine using pipe communication, the subroutine generates a simulated identity and establishes a connection with the server, and queries whether the server directory and the server directory xml file exist based on the provided main program name; if the server directory and the server directory xml file do not exist, then exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, then check whether the local main program xml file exists; if the local main program xml file does not exist, then set the version number of the software to be updated to the version number indicating direct update of the main program, and start a sub-thread for upgrade; if the local main program xml file exists, then compare and determine whether the version number of the server directory xml file is greater than the version number of the local main program xml file; if the version number of the server directory xml file is greater than the version number of the local main program xml file, then start a sub-thread for upgrade; if the version number of the server directory xml file is less than or equal to the local main program xml file, then start the sub-program and do not display the software update button; start the sub-thread to After the upgrade, check whether the local file storage directory exists; if the local file storage directory does not exist, create the local file storage directory; if the local file storage directory exists, after successfully connecting to the server, use file streaming to download the target program compressed package in the server to the local file storage directory, and display the download progress in real time; and after the download is completed, check whether the decompressed file directory exists; and if the decompressed file directory exists, delete the original decompressed file directory, decompress the target program compressed package, and generate a first decompressed file directory; and use recursion to move all directories and files under the first decompressed file directory to the local main program directory, and overwrite them when the file names are the same; and delete temporary files during software updates, update the local main program xml file, and display the "Open Program" button; after the "Open Program" button is triggered, start the main program first, and then close the update program; among them, when overwriting the same file name in the local main program directory, do not overwrite the directory storing subprograms and program version information and the directory storing custom configurations; temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

[0068] As can be seen, this embodiment not only enables software updates within the local area network, but also allows users to update to new versions as soon as the administrator releases them on the server, minimizing the time it takes for user requests to be fulfilled. Furthermore, this embodiment provides effective version control, recording changes to each version in detail.

[0069] According to the above records, in an exemplary embodiment, this embodiment also provides an implementation method of a software update method, which includes updating a subroutine through a main program. Specifically, the process of updating a subroutine through a main program includes: connecting to a server using a simulated identity, checking whether the server directory and the server directory xml file exist; if the server directory and the server directory xml file do not exist, then exiting the update process of the current software to be updated; if the server directory and the server directory xml file exist, then checking whether the local subroutine xml file exists; if the local subroutine xml file does not exist, then setting the version number of the software to be updated to the version number indicating the direct update of the subroutine, and starting a sub-thread for upgrading; if the local subroutine xml file exists, then comparing and determining whether the version number of the server directory xml file is greater than the version number of the local subroutine xml file; if the version number of the server directory xml file is greater than the version number of the local subroutine xml file, then starting a sub-thread for upgrading; if the version number of the server directory xml file is less than or equal to the version number of the local subroutine xml file, the subroutine is started and the software update button is not displayed; after starting the subthread for upgrading, the local file storage directory is checked to see if it exists; if the local file storage directory does not exist, the local file storage directory is created; if the local file storage directory exists, the subroutine compressed package is downloaded to the local file storage directory using the file stream, and after the download is complete, the decompressed file directory is checked to see if it exists; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the subroutine compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are recursively moved to the local subroutine directory, and overwritten if the file names are the same, and temporary files are deleted, and the local subroutine xml file is updated, and the subroutine is started to display the software update button; wherein, the temporary files include the subroutine compressed package and the decompressed files corresponding to the subroutine compressed package.

[0070] As can be seen, this embodiment not only enables software updates within the local area network, but also allows users to update to new versions as soon as the administrator releases them on the server, minimizing the time it takes for user requests to be fulfilled. Furthermore, this embodiment provides effective version control, recording changes to each version in detail.

[0071] According to the above records, if the update program is to be universal, an independent directory is required under the main program directory to specifically store the update program. In this way, no matter what the main program structure is, as long as the update program directory exists, the main program can be updated. Therefore, in an exemplary embodiment, before updating the main program through a subroutine, this embodiment may also include: setting a program body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files when the program is used, a subroutine directory, a directory for storing update temporary files and xml files, a directory for storing main program version information, a directory for storing subroutine version information, and a directory for storing user local information and files in the directory where the main program exe is located; wherein, when updating the main program through a subroutine, the subroutine will not update the subroutine directory and the directory for storing user local information and files. As an example, if Figure 2 As shown in the figure, a schematic diagram of the main program structure is provided. Assume the following directory structure: the root directory is the directory where the main program (executable) is located; the . / main directory is the main program directory; the . / main / DLL directory stores the dynamic link libraries used by the program; the . / main / File directory stores files used by the program; the . / main / MyUpdate directory is the subroutine directory, and the . / main / MyUpdate / updateFile directory stores temporary update files and XML files. The MainUpdate.xml file stores the main program version information, and the UpdateProcess.xml file stores the subroutine version information. The subroutine itself is in . / main / MyUpdate / updateProgram, where UpdateProcess.exe, UpdateProcess.exe.config, and UpdateProcess.pdb are required files for running the subroutine; and the . / main / Local directory stores the user's local information and files. This means that when the subroutine updates the main program, the subroutine does not update the . / main / MyUpdate and . / main / Local directories.

[0072] According to the above records, in an exemplary embodiment, the process of generating a simulated identity includes: using a main program to start a subroutine, and using an account, password, IP address or domain name through the subroutine to try to log in to the server, and generating a simulated identity when successfully logging in to the server; wherein, when the server is an independent file server, an IP address is provided, and when the server is a member server in a domain, a domain name is provided.

[0073] According to the above description, in an exemplary embodiment, the server directory includes: a main directory for storing each program compressed package and program information, and each program compressed package has an independent directory under the server main directory; the independent directory is determined according to the name of the program compressed package, and the independent directory includes the program compressed package and the corresponding xml file. As an example, Figure 3 As shown, Figure 3 This shows the directory structure on the server. All programs that need to be updated are placed in the server's main directory, with the program name as the folder name. \\172.11.111.111 represents the server's address. The main directory is where the compressed packages and program information are stored. Each compressed package has a separate directory within the main directory, named according to the program name. For example, if there's a ManageTest program, its directory name would be ManageTest, and its compressed package name would be ManageTest.zip. Each separate directory contains the Update.xml file, which stores the current program's version information.

[0074] According to the above description, in a specific embodiment, this embodiment provides a software update method, including updating a main program through a subprogram, and updating a subprogram through the main program. The specific steps of the method are as follows:

[0075] Step 1: The subroutine needs to have a separate directory within the main program directory. Because the software cannot update itself, the subroutine does not operate on this directory during updates; all operations on this directory are completed by the code. This directory stores the subroutine, the XML file that describes the program version, and downloaded temporary files.

[0076] Step 2, enter the subroutine, whether the user chooses to check for updates or the software checks for updates when it starts, tell the subroutine the name of the current main program.

[0077] Step 3: Check whether the main program updates the subprogram, so that the two programs can update each other. Otherwise, the subprogram cannot be updated.

[0078] Step 4: The subroutine searches for the XML (extensible markup language, XML for short) in the corresponding folder of the server according to the name provided by the main program, and compares it with the version of the local XML file. If it is greater than the local version, it can be updated; otherwise, it cannot be updated.

[0079] Step 5: If the update is possible, download the specified file from the server to a temporary directory, then decompress it, overwrite the original main program file, delete the temporary file, update the local XML file, restart the main program, and close the update program.

[0080] Step 6, Figure 2 This shows the structure of a complete program. To make the update program universal, a separate directory within the main program directory is needed to hold the update program. This allows the main program to be updated regardless of its structure, as long as the update program directory exists. Assume the following directory structure: the root directory is the directory where the main program (executable) resides; the . / main directory is the main program directory; the . / main / DLL directory stores dynamic link libraries used by the program; the . / main / File directory stores files used by the program; the . / main / MyUpdate directory is the subprogram directory; the . / main / MyUpdate / updateFile directory stores temporary update files and XML files. The MainUpdate.xml file stores the main program version information, and the UpdateProcess.xml file stores the subprogram version information. The subprogram itself is in . / main / MyUpdate / updateProgram, where UpdateProcess.exe, UpdateProcess.exe.config, and UpdateProcess.pdb are required files to run the subprogram; and the . / main / Local directory stores the user's local information and files. The subprogram does not update the . / main / MyUpdate and . / main / Local directories.

[0081] Step 7, Figure 3 This shows the directory structure on the server. All programs that need to be updated are placed in the server's main directory, with the program name as the folder name. \\172.11.111.111 represents the server's address. The main directory is where the compressed packages and program information are stored. Each compressed package has a separate directory within the main directory, named according to the program name. For example, if there's a ManageTest program, its directory name would be ManageTest, and its compressed package name would be ManageTest.zip. Each separate directory contains the Update.xml file, which stores the current program's version information.

[0082] In step 8, the main program opens the updater and passes the main program name using a pipe. Here, the program name is ManageTest. @".\main" is equivalent to Application.StartupPath + @"\main". The main program does not care about the subprogram's status or version; it is only responsible for starting it. If you need the main program to be able to update the subprogram, see steps 24 through 33.

[0083] Step 9, the subroutine (UpdateProcess) is an additional project. After the project is completed, copy the three files under the release (candidate version) to the @".\main\MyUpdate\updateProgram" directory of the main program. If the main program is capable of updating the subroutine, this is not necessary. The subroutine can be downloaded to the local computer in real time through code. First, modify Program.cs.WaitForConnection() of UpdateProcess to hang until a message is received. In order to prevent the subroutine from entering from an unexpected place and causing the program to freeze, a timer is used here. If a message is received within 5 seconds, the timer is turned off to enter the program, otherwise the entire program is terminated. The subroutine should only run one instance, so a mutex lock is used to determine whether there are multiple instances. If there is an instance, the new instance is terminated and the old instance is brought to the foreground.

[0084] In step 10, the subroutine's constructor receives the main program name. The load method performs custom initialization. Two read-only variables are used to store the server directory and the local directory. A method is defined to write exceptions to the log. Because the update program is launched from the main program, the @".\" reference points to the main program's execution directory, not the updateProgram directory.

[0085] Step 11: During the custom initialization of the subroutine, read the XML file in the server's designated folder and compare the version information with the local XML file. If the server version number is higher, the update can be performed. If the control's visible property is set to false by default, setting visible = true in the code will not display the control. The control to be hidden should have its visible property set to false during initialization. Here, "Open Program" (btnOpenProgram) should be hidden when the interface is displayed. btnOpenProgram.Visible = false should be set during initialization, rather than leaving Visible at its default value of false.

[0086] Step 12: After initialization, the program should have the following three states: can be updated, cannot be updated, and server file is missing. Figure 4 As shown, the status diagram when the software program cannot be updated is as follows Figure 5 As shown, the status diagram when the server file is missing is as follows Figure 6 As shown,

[0087] Step 13: In the code of the update method, the server address and the local file storage address need to be given, and the file at the server specified location is downloaded to the local specified location.

[0088] Step 14. Close the main program when starting the update, and then use Task to start the update.

[0089] Step 15: First check whether the local file storage directory exists, and create it if it does not exist.

[0090] In step 16, establish a connection to the server using an impersonated identity. You must provide a username, password, IP address, or domain name. If the remote server is a standalone file server, provide the IP address; if the remote server is a member server in a domain, provide the domain name.

[0091] Step 17: After successfully connecting to the server, use the file stream to download the specified program compressed package to the local computer, and display the download progress in real time.

[0092] Step 18: After the download is complete, check whether the directory for decompressing the file exists. If it exists, delete the directory and then decompress the file.

[0093] Step 19: Recursively move all directories and files in the unzipped directory to the main program directory. If the file names are identical, they are overwritten. The MyUpdate and Local directories are left alone. MyUpdate stores subroutines and program version information, while Local stores custom configurations, such as logged-in usernames, or files you don't want updated.

[0094] Step 20: Delete the temporary files generated during the update, that is, the downloaded compressed package and the decompressed files.

[0095] Step 21: Update the local main program's XML file. The XML file should describe the version information of the current main program.

[0096] Step 22: Because the update operation is in the child thread, be sure to use try catch to catch the exception, otherwise there will be no prompt when the exception occurs.

[0097] Step 23: After the update is complete, the "Open Program" button will be displayed. "Open Program" starts the main program and then closes the update program. If the update program closes before the main program starts, it will be in the background and not at the front of the z-axis. You can use the SetForegroundWindow() function, but this will not work if the main program starts slowly. In this case, consider using WaitForInputIdle(), which will wait until the associated program starts and enters the idle state before exiting the update program.

[0098] Step 24: If you want the subprogram to be upgradeable, you need to write additional code in the main program specifically for upgrading the subprogram. The advantage of this is that the main program does not need to consider whether the subprogram exists in the directory. No matter whether the subprogram and its directory are deleted for any reason, they can be downloaded to the local computer. Unless there is a problem with the subprogram on the server, the process of updating the subprogram through the main program is as follows: Figure 7 shown.

[0099] In step 25, establish a connection to the server using the impersonation identity. You must provide a username, password, IP address, or domain name. If the remote server is a standalone file server, provide the IP address; if the remote server is a member server in a domain, provide the domain name.

[0100] Step 26, check whether the xml file in the server subroutine directory exists. If not, prompt that the file does not exist and then exit the program.

[0101] Step 27 checks whether the local XML file exists. If the local XML file does not exist, the software version is assumed to be 0.0.0, indicating that the update subroutine will be executed unconditionally. If the local XML file exists, the version number is compared with the server XML file. If the local version number is greater than or equal to the server version number, the subroutine is launched, indicating that the latest version is available and no update is required. If the server version number is greater than the local version number, the subroutine is launched, and an update button is displayed, prompting the user to update.

[0102] Step 28: Check whether the local file storage directory exists. If it does not exist, create it.

[0103] Step 29: Download the subprogram compressed package from the server to the local computer in the form of a stream.

[0104] Step 30: After the download is complete, check whether the directory for decompressing the file exists. If it exists, delete the directory and then decompress the file.

[0105] Step 31: Use recursion to move all directories and files in the decompressed directory to the subroutine directory. If the file names are the same, overwrite them.

[0106] Step 32: Delete the temporary files generated during the update, that is, the downloaded compressed package and the decompressed files.

[0107] Step 33: Update the XML file of the local subroutine. The XML file should describe the version information of the current subroutine.

[0108] In summary, the present application provides a software update method that can provide two software update methods, namely, updating the main program through a subprogram, and updating the subprogram through the main program. It not only realizes the software update function within the local area network, but also as long as the administrator releases a new version of the software program on the server side, the user can update to the new version, thereby shortening the time from user demand to implementation to the shortest possible time. In addition, this method can perform effective version control and record the changes of each version in detail. In addition, when completing the software update, this method can retain user setting information, and does not require the user to reconfigure after completing the software update, thereby saving time for the user and improving the user experience. At the same time, when the software is updated, this method can allow the software program to run independently during the update, and for the main program of any structure, the update program can be used to update.

[0109] In another example embodiment of the present application, the embodiment also provides a software update system, including: a first update module, which is used to update the main program through a sub-program. The process of the first update module updating the main program through the sub-program includes: opening the update program through the main program, and using pipe communication to pass the main program name to the sub-program, the sub-program generates a simulated identity and then establishes a connection with the server, and queries whether the server directory and the server directory xml file exist based on the provided main program name; if the server directory and the server directory xml file do not exist, then exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, then check whether the local main program xml file exists; if the local main program xml file does not exist, then set the version number of the software to be updated to the version number indicating the direct update of the main program, and start a sub-thread for upgrade; if the local main program xml file exists, then compare and determine whether the version number of the server directory xml file is greater than the version number of the local main program xml file; if the version number of the server directory xml file is greater than the version number of the local main program xml file, then start a sub-thread for upgrade; if the version number of the server directory xml file is less than or equal to the local main program xml file, then start the sub-program and do not display the software update button; start the sub-thread for After the upgrade, check whether the local file storage directory exists; if the local file storage directory does not exist, create the local file storage directory; if the local file storage directory exists, after successfully connecting to the server, use file streaming to download the target program compressed package in the server to the local file storage directory, and display the download progress in real time; and after the download is completed, check whether the decompressed file directory exists; and if the decompressed file directory exists, delete the original decompressed file directory, decompress the target program compressed package, and generate a first decompressed file directory; and use recursion to move all directories and files under the first decompressed file directory to the local main program directory, and overwrite them when the file names are the same; and delete temporary files during software updates, update the local main program xml file, and display the "Open Program" button; after the "Open Program" button is triggered, start the main program first, and then close the update program; among them, when overwriting the same file name in the local main program directory, do not overwrite the directory storing subprograms and program version information and the directory storing custom configurations; temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

[0110] As can be seen, this embodiment not only enables software updates within the local area network, but also allows users to update to new versions as soon as the administrator releases them on the server, minimizing the time it takes for user requests to be fulfilled. Furthermore, this embodiment provides effective version control, recording changes to each version in detail.

[0111] According to the above records, in an exemplary embodiment, the software update system also includes a second update module for updating the subprogram through the main program. The process of the second update module updating the subprogram through the main program includes: using a simulated identity to connect to the server, checking whether the server directory and the server directory xml file exist; if the server directory and the server directory xml file do not exist, then exit the update process of the current software to be updated; if the server directory and the server directory xml file exist, then check whether the local subprogram xml file exists; if the local subprogram xml file does not exist, then set the version number of the software to be updated to the version number indicating the direct update of the subprogram, and start the subthread for upgrading; if the local subprogram xml file exists, then compare and determine whether the version number of the server directory xml file is greater than the version number of the local subprogram xml file; if the version number of the server directory xml file is greater than the version number of the local subprogram xml file, then start the subthread for upgrading; if the version number of the server directory xml file is less than or equal to the version number of the local subprogram xml file, xml file, the subroutine is started and the software update button is not displayed; after starting the subthread for upgrading, the local file storage directory is checked to see if it exists; if the local file storage directory does not exist, the local file storage directory is created; if the local file storage directory exists, the subroutine compressed package is downloaded to the local file storage directory using the file stream, and after the download is complete, the decompressed file directory is checked to see if it exists; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the subroutine compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are recursively moved to the local subroutine directory, and overwritten if the file names are the same, and temporary files are deleted, and the local subroutine xml file is updated, and the subroutine is started to display the software update button; wherein, the temporary files include the subroutine compressed package and the decompressed file corresponding to the subroutine compressed package.

[0112] As can be seen, this embodiment not only enables software updates within the local area network, but also allows users to update to new versions as soon as the administrator releases them on the server, minimizing the time it takes for user requests to be fulfilled. Furthermore, this embodiment provides effective version control, recording changes to each version in detail.

[0113] According to the above records, if the update program is to be universal, an independent directory is required under the main program directory to specifically store the update program. In this way, no matter what the main program structure is, as long as the update program directory exists, the main program can be updated. Therefore, in an exemplary embodiment, before updating the main program through a subroutine, this embodiment may also include: setting a program body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files when the program is used, a subroutine directory, a directory for storing update temporary files and xml files, a directory for storing main program version information, a directory for storing subroutine version information, and a directory for storing user local information and files in the directory where the main program exe is located; wherein, when updating the main program through a subroutine, the subroutine will not update the subroutine directory and the directory for storing user local information and files. As an example, if Figure 2 As shown in the figure, a schematic diagram of the main program structure is provided. Assume the following directory structure: the root directory is the directory where the main program (executable) is located; the . / main directory is the main program directory; the . / main / DLL directory stores the dynamic link libraries used by the program; the . / main / File directory stores files used by the program; the . / main / MyUpdate directory is the subroutine directory, and the . / main / MyUpdate / updateFile directory stores temporary update files and XML files. The MainUpdate.xml file stores the main program version information, and the UpdateProcess.xml file stores the subroutine version information. The subroutine itself is in . / main / MyUpdate / updateProgram, where UpdateProcess.exe, UpdateProcess.exe.config, and UpdateProcess.pdb are required files for running the subroutine; and the . / main / Local directory stores the user's local information and files. This means that when the subroutine updates the main program, the subroutine does not update the . / main / MyUpdate and . / main / Local directories.

[0114] According to the above records, in an exemplary embodiment, the process of generating a simulated identity includes: using a main program to start a subroutine, and using an account, password, IP address or domain name through the subroutine to try to log in to the server, and generating a simulated identity when successfully logging in to the server; wherein, when the server is an independent file server, an IP address is provided, and when the server is a member server in a domain, a domain name is provided.

[0115] According to the above description, in an exemplary embodiment, the server directory includes: a main directory for storing each program compressed package and program information, and each program compressed package has an independent directory under the server main directory; the independent directory is determined according to the name of the program compressed package, and the independent directory includes the program compressed package and the corresponding xml file. As an example, Figure 3 As shown, Figure 3 This shows the directory structure on the server. All programs that need to be updated are placed in the server's main directory, with the program name as the folder name. \\172.11.111.111 represents the server's address. The main directory is where the compressed packages and program information are stored. Each compressed package has a separate directory within the main directory, named according to the program name. For example, if there's a ManageTest program, its directory name would be ManageTest, and its compressed package name would be ManageTest.zip. Each separate directory contains the Update.xml file, which stores the current program's version information.

[0116] According to the above description, in a specific embodiment, this embodiment provides a software update system, which includes a first update module and a second update module; the first update module is used to update the main program through the sub-program, and the second update module is used to update the sub-program through the main program. Specifically, the system includes the following process:

[0117] In step 1, the subroutine needs to have a separate directory within the main program's directory. Because the software cannot update itself, the subroutine does not access this directory during updates; all operations on this directory are performed by code. This directory stores the subroutine, an XML file describing the program version, and downloaded temporary files.

[0118] Process 2, enter the subroutine, whether the user chooses to check for updates or the software checks for updates when it starts, tell the subroutine the name of the current main program.

[0119] Step 3: Check whether the main program updates the subprogram, so that the two programs can update each other. Otherwise, the subprogram cannot be updated.

[0120] In step 4, the subroutine queries the XML (Extensible Markup Language, XML for short) in the corresponding folder of the server according to the name provided by the main program, and compares it with the version of the local XML file. If it is greater than the local version, it can be updated; otherwise, it cannot be updated.

[0121] In step 5, if the update is possible, the specified file is downloaded from the server to a temporary directory, then decompressed, the original main program file is overwritten, the temporary file is deleted, the local XML file is updated, the main program is restarted, and the update program is closed.

[0122] Process 6, Figure 2 This shows the structure of a complete program. To make the update program universal, a separate directory within the main program directory is needed to hold the update program. This allows the main program to be updated regardless of its structure, as long as the update program directory exists. Assume the following directory structure: the root directory is the directory where the main program (executable) resides; the . / main directory is the main program directory; the . / main / DLL directory stores dynamic link libraries used by the program; the . / main / File directory stores files used by the program; the . / main / MyUpdate directory is the subprogram directory; the . / main / MyUpdate / updateFile directory stores temporary update files and XML files. The MainUpdate.xml file stores the main program version information, and the UpdateProcess.xml file stores the subprogram version information. The subprogram itself is in . / main / MyUpdate / updateProgram, where UpdateProcess.exe, UpdateProcess.exe.config, and UpdateProcess.pdb are required files to run the subprogram; and the . / main / Local directory stores the user's local information and files. The subprogram does not update the . / main / MyUpdate and . / main / Local directories.

[0123] Process 7, Figure 3 This shows the directory structure on the server. All programs that need to be updated are placed in the server's main directory, with the program name as the folder name. \\172.11.111.111 represents the server's address. The main directory is where the compressed packages and program information are stored. Each compressed package has a separate directory within the main directory, named according to the program name. For example, if there's a ManageTest program, its directory name would be ManageTest, and its compressed package name would be ManageTest.zip. Each separate directory contains the Update.xml file, which stores the current program's version information.

[0124] In step 8, the main program opens the updater and passes the main program name using a pipe. Here, the program name is ManageTest. @".\main" is equivalent to Application.StartupPath + @"\main". The main program does not care about the subprogram's status or version; it is only responsible for starting it. If you need the main program to be able to update subprograms, see steps 24 through 33.

[0125] In process 9, the subroutine (UpdateProcess) is an additional project. After the project is completed, copy the three files under the release (candidate version) to the @".\main\MyUpdate\updateProgram" directory of the main program. If the main program is capable of updating the subroutine, this is not necessary. The subroutine can be downloaded to the local computer in real time through code. First, modify Program.cs.WaitForConnection() of UpdateProcess so that it will hang until a message is received. In order to prevent the subroutine from entering from an unexpected place and causing the program to freeze, a timer is used here. If a message is received within 5 seconds, the timer will be turned off to enter the program, otherwise the entire program will be terminated. The subroutine should only run one instance, so a mutex lock is used to determine whether there are multiple instances. If there is an instance, the new instance will be terminated and the old instance will be brought to the foreground.

[0126] In step 10, the subroutine's constructor receives the main program name. The load method performs custom initialization. Two read-only variables are used to store the server directory and the local directory. A method is defined to write to the exception log. Because the update program is launched from the main program, the @".\" reference points to the main program's execution directory, not the updateProgram directory.

[0127] In process 11, during the custom initialization of the subroutine, read the XML file in the server's designated folder and compare its version information with the local XML file. If the server version number is higher, the update can be performed. If the control's visible property is set to false by default, setting visible = true in the code will not display the control. The control to be hidden should have its visible property set to false during initialization. Here, "Open Program" (btnOpenProgram) should be hidden when the interface is displayed. btnOpenProgram.Visible = false should be set during initialization, rather than leaving Visible at its default value of false.

[0128] Process 12, after initialization, the program should have the following three states: can be updated, cannot be updated, and server file is missing. Among them, the state diagram of the software program can be updated is as follows Figure 4As shown, the status diagram when the software program cannot be updated is as follows Figure 5 As shown, the status diagram when the server file is missing is as follows Figure 6 As shown,

[0129] In process 13, in the code of the update method, the server address and the local file storage address need to be given to download the file from the server specified location to the local specified location.

[0130] In step 14, close the main program when starting the update, and then use Task to start the update.

[0131] In step 15, first check whether the local file storage directory exists, and create it if it does not exist.

[0132] In step 16, you establish a connection to the server using an impersonated identity. You need to provide a username, password, IP address, or domain name. If the remote server is a standalone file server, provide the IP address; if the remote server is a member server in a domain, provide the domain name.

[0133] In step 17, after successfully connecting to the server, the specified program compressed package is downloaded to the local computer using the file stream, and the download progress is displayed in real time.

[0134] Step 18: After the download is complete, check whether the directory to be decompressed exists. If it exists, delete the directory and then decompress the file.

[0135] In step 19, recursively move all directories and files in the unzipped directory to the main program directory. If the file names are identical, they are overwritten. The MyUpdate and Local directories are not affected. MyUpdate stores subroutines and program version information, while Local stores custom configurations, such as logged-in usernames, or files you don't want updated.

[0136] In process 20, temporary files generated during the update are deleted, namely the downloaded compressed package and the decompressed files.

[0137] Process 21: Update the local main program's XML file. The XML file should describe the version information of the current main program.

[0138] In process 22, because the update operation is in the child thread, it is necessary to use try catch to catch the exception, otherwise there will be no prompt when the exception occurs.

[0139] In step 23, after the update is complete, the "Open Program" button appears. "Open Program" starts the main program and then closes the update program. If the update program closes before the main program starts, it will be in the background and not at the front of the z-axis. You can use the SetForegroundWindow() function, but this will not work if the main program starts slowly. In this case, consider using WaitForInputIdle(), which will wait until the associated program starts and enters the idle state before exiting the update program.

[0140] In step 24, if you want the subprogram to be upgradeable, you need to write additional code in the main program specifically for upgrading the subprogram. The advantage of this is that the main program does not need to consider whether the subprogram exists in the directory. No matter whether the subprogram and its directory are deleted for any reason, they can be downloaded to the local computer. Unless there is a problem with the subprogram on the server, the process of updating the subprogram through the main program is as follows: Figure 7 shown.

[0141] In step 25, you establish a connection to the server using an impersonated identity. You must provide a username, password, IP address, or domain name. If the remote server is a standalone file server, provide the IP address; if the remote server is a member server in a domain, provide the domain name.

[0142] Process 26, check whether the xml file in the server subroutine directory exists. If not, it will prompt that the file does not exist and then exit the program.

[0143] Step 27 checks whether the local XML file exists. If the local XML file does not exist, the software version is assumed to be 0.0.0, indicating that the update subroutine is unconditionally executed. If the local XML file exists, the version number is compared with the server XML file. If the local version number is greater than or equal to the server version number, the subroutine is launched, indicating that the latest version is available and no update is required. If the server version number is greater than the local version number, the subroutine is launched, and an update button is displayed, prompting the user to update.

[0144] Step 28: Check whether the local file storage directory exists. If it does not exist, create it.

[0145] In process 29, the subprogram compressed package is downloaded from the server to the local computer in the form of a stream.

[0146] Process 30: After the download is complete, check whether the directory for decompressing the file exists. If it exists, delete the directory and then decompress the file.

[0147] In step 31, all directories and files in the decompressed directory are recursively moved to the subroutine directory. If the file names are the same, they are overwritten.

[0148] Process 32: Delete the temporary files generated during the update, that is, the downloaded compressed package and the decompressed files.

[0149] Process 33: Update the XML file of the local subroutine. The XML file should describe the version information of the current subroutine.

[0150] In summary, the present application provides a software update system that can provide two software update methods, namely, updating the main program through a subprogram, and updating the subprogram through the main program. It not only realizes the software update function within the local area network, but also as long as the administrator releases a new version of the software program on the server side, the user can update to the new version, thereby shortening the time from user demand to implementation to the shortest possible time. In addition, the system can perform effective version control and record the changes of each version in detail. In addition, when the software update is completed, the system can retain the user setting information, and the user does not need to reconfigure after completing the software update, thereby saving time for the user and improving the user experience. At the same time, when the software is updated, the system can allow the software program to run independently during the update, and for the main program of any structure, the update program can be used to update.

[0151] It should be noted that the software update system provided in the above embodiment and the software update method provided in the above embodiment are based on the same concept. The specific manner in which each module performs operations has been described in detail in the method embodiment and will not be repeated here. In actual application, the software update system provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the system into different functional modules to complete all or part of the functions described above, and this is not limited here. Therefore, this application effectively overcomes the various shortcomings of the existing technology and has high industrial application value.

[0152] The embodiment of the present application also provides a software update device, which may include: one or more processors; and one or more machine-readable media having instructions stored thereon, which, when executed by the one or more processors, enable the device to execute Figure 7 The software update method. Figure 8 FIG1 shows a schematic diagram of the structure of a software updating device 1000. Figure 8 As shown, the software updating device 1000 includes a processor 1010 , a memory 1020 , a power supply 1030 , a display unit 1040 , and an input unit 1060 .

[0153] The processor 1010 is the control center of the software update device 1000. It connects various components using various interfaces and lines, and performs various functions of the software update device 1000 by running or executing the software programs and / or data stored in the memory 1020, thereby monitoring the software update device 1000 as a whole. In the embodiment of the present application, when the processor 1010 calls the computer program stored in the memory 1020, it executes the following Figure 7 The software update method described above. Optionally, processor 1010 may include one or more processing units; preferably, processor 1010 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and applications, and the modem processor primarily processes wireless communications. In some embodiments, the processor and memory may be implemented on a single chip; in some embodiments, they may also be implemented on separate chips.

[0154] The memory 1020 may primarily include a program storage area and a data storage area. The program storage area may store an operating system, various applications, and the like; the data storage area may store data created based on the use of the software update device 1000. Furthermore, the memory 1020 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state memory device.

[0155] The software update device 1000 also includes a power supply 1030 (such as a battery) for supplying power to various components. The power supply can be logically connected to the processor 1010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0156] The display unit 1040 can be used to display information input by the user or information provided to the user, as well as various menus of the software update device 1000. In the embodiment of the present application, it is mainly used to display the display interface of each application in the software update device 1000 and objects such as text and images displayed on the display interface. The display unit 1040 may include a display panel 1050. The display panel 1050 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0157] The input unit 1060 can be used to receive information such as numbers or characters input by the user. The input unit 1060 may include a touch panel 1070 and other input devices 1080. The touch panel 1070, also known as a touch screen, can receive user touch operations on or near it (for example, operations performed by the user using a finger, a stylus, or any other suitable object or accessory on or near the touch panel 1070).

[0158] Specifically, the touch panel 1070 can detect user touch operations and the signals generated by the touch operations, convert these signals into touch point coordinates, and send them to the processor 1010. It can also receive and execute commands sent by the processor 1010. In addition, the touch panel 1070 can be implemented using various types, such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 1080 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, a joystick, and the like.

[0159] Of course, the touch panel 1070 can cover the display panel 1050. When the touch panel 1070 detects a touch operation on or near it, it transmits it to the processor 1010 to determine the type of touch event. Then the processor 1010 provides corresponding visual output on the display panel 1050 according to the type of touch event. Figure 8 In the embodiment, the touch panel 1070 and the display panel 1050 are two independent components to implement the input and output functions of the software update device 1000, but in some embodiments, the touch panel 1070 and the display panel 1050 can be integrated to implement the input and output functions of the software update device 1000.

[0160] The software updating device 1000 may further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the software updating device 1000 may further include other components such as a camera.

[0161] The embodiment of the present application further provides a computer-readable storage medium, which stores instructions. When one or more processors execute the instructions, the above-mentioned device can perform the following steps in the present application: Figure 7 The software updating method.

[0162] It will be understood by those skilled in the art that Figure 8This is merely an example of a software update device and does not constitute a limitation of the device. The device may include more or fewer components than shown, or a combination of certain components, or different components. For ease of description, the above sections are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0163] Those skilled in the art should understand that the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be applied to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including the instruction device, which implements the function specified in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0164] It should be understood that although the terms "first," "second," and "third" may be used in the embodiments of the present application to describe preset ranges, etc., these preset ranges should not be limited to these terms. These terms are merely used to distinguish one preset range from another. For example, without departing from the scope of the embodiments of the present application, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.

[0165] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical concepts disclosed in this application shall be covered by the claims of this application.

Claims

1. A software updating method, characterized in that: The method includes updating the main program through the subprogram; the process of updating the main program through the subprogram includes: The update program is opened through the main program, and the main program name is passed to the subprogram using pipe communication. The subprogram generates a simulated identity and establishes a connection with the server. It then checks whether the server directory and the server directory XML file exist based on the provided main program name. If the server directory and the server directory XML file do not exist, the update process of the current software to be updated is exited. If the server directory and the server directory XML file exist, the subprogram checks whether the local main program XML file exists. If the local main program xml file does not exist, the version number of the software to be updated is set to the version number indicating that the main program is directly updated, and a sub-thread is started for upgrading; If the local main program XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local main program XML file; If the version number of the server directory xml file is greater than that of the local main program xml file, a child thread is started to upgrade; If the version number of the server directory xml file is less than or equal to the local main program xml file, the subroutine is started and the software update button is not displayed; After starting the child thread for upgrade, check whether the local file storage directory exists; If the local file storage directory does not exist, create it; If the local file storage directory exists, after successfully connecting to the server, the target program compressed package in the server is downloaded to the local file storage directory using file streaming, and the download progress is displayed in real time; and after the download is completed, the existence of the decompressed file directory is checked; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the target program compressed package is decompressed to generate a first decompressed file directory; and all directories and files under the first decompressed file directory are moved to the local main program directory using recursion, and overwritten when the file names are the same; and temporary files during software updates are deleted, the local main program xml file is updated, and an "Open Program" button is displayed; after the "Open Program" button is triggered, the main program is started first, and then the update program is closed; wherein, when overwriting the same file name in the local main program directory, the directory storing subprograms and program version information and the directory storing custom configurations are not overwritten; the temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

2. The software updating method according to claim 1, wherein: The method further includes updating the subroutine through the main program; The process of updating a subroutine through the main program includes: Connect to the server using the simulated identity and check whether the server subprogram directory and the server subprogram directory xml file exist; if the server subprogram directory and the server subprogram directory xml file do not exist, exit the update process of the current software to be updated; if the server subprogram directory and the server subprogram directory xml file exist, check whether the local subprogram xml file exists; If the local subroutine xml file does not exist, the version number of the software to be updated is set to the version number indicating the direct update subroutine, and a sub-thread is started for upgrading; If the local subprogram XML file exists, then comparing and determining whether the version number of the server subprogram directory XML file is greater than the version number of the local subprogram XML file; If the version number of the server subprogram directory xml file is greater than that of the local subprogram xml file, a subthread is started for upgrading; If the version number of the server subprogram directory xml file is less than or equal to the local subprogram xml file, the subprogram is started without displaying the software update button; After starting the child thread for upgrade, check whether the local file storage directory exists; If the local file storage directory does not exist, create it; If the local file storage directory exists, the subprogram compressed package is downloaded to the local file storage directory using file streaming, and after the download is completed, it is checked whether the decompressed file directory exists; and when the decompressed file directory exists, the original decompressed file directory is deleted, and the subprogram compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are moved to the local subprogram directory using recursion, and an overwriting operation is performed when the file names are the same, and temporary files are deleted, and the local subprogram XML file is updated, and the subprogram is started and a software update button is displayed; wherein, the temporary files include the subprogram compressed package and the decompressed file corresponding to the subprogram compressed package.

3. The software updating method according to claim 1, wherein: Before updating the main program through the subprogram, the method further includes: setting, in the directory where the main program EXE is located, a program main body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files used by the program, a subprogram directory, a directory for storing temporary update files and XML files, a directory for storing main program version information, a directory for storing subprogram version information, and a directory for storing user local information and files; When the main program is updated through the subprogram, the subprogram will not update the subprogram directory or the directory storing the user's local information and files.

4. The software updating method according to claim 1 or 2, characterized in that: The generation process of the simulated identity includes: using the main program to start the sub-program, and using the account, password, IP address or domain name to try to log in to the server through the sub-program, and generating the simulated identity when successfully logging in to the server; Wherein, when the server is an independent file server, an IP address is provided; when the server is a member server in a domain, a domain name is provided.

5. The software updating method according to claim 1, wherein: The server directory includes: a main directory for storing each program compressed package and program information, and each program compressed package has an independent directory under the server main directory; the independent directory is determined according to the program compressed package name, and the independent directory includes the program compressed package and the corresponding xml file.

6. A software updating system, characterized in that: The system includes: a first updating module for updating a main program through a subprogram; The process of the first updating module updating the main program through the subprogram includes: The update program is opened through the main program, and the main program name is passed to the subprogram using pipe communication. The subprogram generates a simulated identity and establishes a connection with the server. It then checks whether the server directory and the server directory XML file exist based on the provided main program name. If the server directory and the server directory XML file do not exist, the update process of the current software to be updated is exited. If the server directory and the server directory XML file exist, the subprogram checks whether the local main program XML file exists. If the local main program xml file does not exist, the version number of the software to be updated is set to the version number indicating that the main program is directly updated, and a sub-thread is started for upgrading; If the local main program XML file exists, then comparing and determining whether the version number of the server directory XML file is greater than the version number of the local main program XML file; If the version number of the server directory xml file is greater than that of the local main program xml file, a child thread is started to upgrade; If the version number of the server directory xml file is less than or equal to the local main program xml file, the subroutine is started and the software update button is not displayed; After starting the child thread for upgrade, check whether the local file storage directory exists; If the local file storage directory does not exist, create it; If the local file storage directory exists, after successfully connecting to the server, the target program compressed package in the server is downloaded to the local file storage directory using file streaming, and the download progress is displayed in real time; and after the download is completed, the existence of the decompressed file directory is checked; and if the decompressed file directory exists, the original decompressed file directory is deleted, and the target program compressed package is decompressed to generate a first decompressed file directory; and all directories and files under the first decompressed file directory are moved to the local main program directory using recursion, and overwritten when the file names are the same; and temporary files during software updates are deleted, the local main program xml file is updated, and an "Open Program" button is displayed; after the "Open Program" button is triggered, the main program is started first, and then the update program is closed; wherein, when overwriting the same file name in the local main program directory, the directory storing subprograms and program version information and the directory storing custom configurations are not overwritten; the temporary files include the target program compressed package and the decompressed file corresponding to the target program compressed package.

7. The software updating system according to claim 6, wherein: The system further includes a second updating module for updating the subprogram via the main program; The process of the second updating module updating the subprogram through the main program includes: Connect to the server using the simulated identity and check whether the server subprogram directory and the server subprogram directory xml file exist; if the server subprogram directory and the server subprogram directory xml file do not exist, exit the update process of the current software to be updated; if the server subprogram directory and the server subprogram directory xml file exist, check whether the local subprogram xml file exists; If the local subroutine xml file does not exist, the version number of the software to be updated is set to the version number indicating the direct update subroutine, and a sub-thread is started for upgrading; If the local subprogram XML file exists, then comparing and determining whether the version number of the server subprogram directory XML file is greater than the version number of the local subprogram XML file; If the version number of the server subprogram directory xml file is greater than that of the local subprogram xml file, a subthread is started for upgrading; If the version number of the server subprogram directory xml file is less than or equal to the local subprogram xml file, the subprogram is started without displaying the software update button; After starting the child thread for upgrade, check whether the local file storage directory exists; If the local file storage directory does not exist, create it; If the local file storage directory exists, the subprogram compressed package is downloaded to the local file storage directory using file streaming, and after the download is completed, it is checked whether the decompressed file directory exists; and when the decompressed file directory exists, the original decompressed file directory is deleted, and the subprogram compressed package is decompressed to obtain a second decompressed file directory; and all directories and files under the second decompressed file directory are moved to the local subprogram directory using recursion, and an overwriting operation is performed when the file names are the same, and temporary files are deleted, and the local subprogram XML file is updated, and the subprogram is started and a software update button is displayed; wherein, the temporary files include the subprogram compressed package and the decompressed file corresponding to the subprogram compressed package.

8. The software updating system according to claim 6, wherein: Before the first update module updates the main program through the subprogram, the module further includes: setting, in the directory where the main program exe is located, a program main body directory, a directory for storing dynamic link libraries used by the program, a directory for storing files used by the program, a subprogram directory, a directory for storing temporary update files and XML files, a directory for storing main program version information, a directory for storing subprogram version information, and a directory for storing user local information and files; When the main program is updated through the subprogram, the subprogram will not update the subprogram directory or the directory storing the user's local information and files.

9. A software updating device, characterized in that: include: processor; and, A computer-readable medium storing instructions, which, when executed by the processor, causes the device to execute the software updating method according to any one of claims 1 to 5.

10. A computer-readable medium, characterized in that Instructions are stored thereon, and the instructions are loaded by a processor to execute the software updating method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Software lightweight updating method, device and equipment

    CN109725923A

  • Software online updating system and method based on xml file list and related device

    CN111008030A