A software remote update method, system and storage medium for a site server
By mapping the current running software directory of the site server to a remote terminal, comparing file attributes and copying the update software, the problem of failure to determine the success of the update in the existing technology is solved, and efficient software updates and maintenance are achieved.
Patent Information
- Application Number
- CN202211547109.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-12-05
AI Technical Summary
In the prior art, the update success cannot be effectively determined when the site server software is updated, and the shared folder setting is large and there is network security risk.
By storing the update software to the main control directory of the remote terminal, map the current running software directory of the site server to the remote terminal, compare file attributes, stop running the software, copy the update software, and delete the mapping directory as a new running software. .
Ensures the successful software update, avoids the changes in file version attributes with the modification time, simplifies post-maintenance work, and reduces manpower and material costs.
Smart Images

Figure CN115729598B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software remote updating and upgrading, and in particular to a software remote updating method of a site server, a broadcasting and television site server updating system and a computer-readable storage medium. Background Art
[0002] With the continuous development of the radio and television industry, the number of site servers in various regions has exploded. In the process of deploying the software system of the site server, the same set of software needs to be deployed to many sites in a region. For example, a province may have nearly 400 sites across the country for terrestrial digital television transmission sites, and the application software running on the servers of these sites is the same. During the development and maintenance stages, the software of these site servers may need to be updated.
[0003] At present, there are several methods for updating software on site servers in various places: 1. Update software by logging into the site server through remote desktop, which is time-consuming and laborious; 2. Set shared write permissions for the directory where the site application software is located, and then copy the updated software to the shared directory of the site server through a program; but this method has two problems. First, the workload of setting up a shared folder is large, and second, setting shared write permissions will bring network security risks. 3. The site server runs an update program, which reads the updated software in some way and then writes it to the corresponding directory. The problem with this method is that the version time of the updated software is often changed to the modification time, which is not conducive to confirming whether the site server has been successfully updated through the actual version time, size and other information of the updated software.
[0004] Therefore, it is necessary to provide a method for remotely updating software of a site server to solve the problem in the prior art that it is impossible to effectively determine whether the software of the site server is updated successfully when updating the software by running an update program on the site server. Summary of the invention
[0005] In view of this, it is necessary to provide a method, system and storage medium for remote updating of software of a site server to solve the problem in the prior art that the site server to be updated needs to be set up accordingly and it is impossible to effectively determine whether the software is updated successfully.
[0006] In order to solve the above problem, the present invention provides a software remote update method of a site server, comprising:
[0007] Store the updated software in the master directory of the remote terminal;
[0008] Mapping the site directory where the currently running software of the site server is located to the remote terminal to obtain a mapping directory;
[0009] Determine whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same;
[0010] When the file attributes of the update software and the currently running software are different, the site server stops running the currently running software and copies the update software to the site directory;
[0011] The site server runs the updated software in the site directory as new running software, and deletes the mapping directory on the remote terminal.
[0012] Further, determining whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same includes:
[0013] Traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of corresponding files included in the currently running software in the mapping directory;
[0014] Determine whether the first file attribute and the second file attribute of any file are the same; when the first file attribute and the second file attribute are different, store the path of the file in the master control directory into the list of files to be updated;
[0015] Copy the files in the to-be-updated file list to the site directory.
[0016] Further, traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of corresponding files included in the currently running software in the mapping directory includes:
[0017] The remote terminal determines the first file attribute and the second file attribute of all the files by calling a preset attribute acquisition function.
[0018] Further, when the file attributes of the update software and the currently running software are different, the site server stops running the currently running software, including:
[0019] When the file attributes of the update software and the currently running software are different, the remote terminal sends a stop program instruction to the site server through a preset remote update program;
[0020] The site server receives the stop program instruction through a preset site update program, and terminates the running process of the currently running software according to the stop program instruction.
[0021] Furthermore, before the site server runs the updated software in the site directory as new running software, it also includes:
[0022] Determine whether the third attribute of all files included in the update software in the site directory is the same as the first file attribute of the files corresponding to the update software in the master control directory;
[0023] When the third attribute and the first attribute of any file are the same, it is determined that the update software is copied successfully.
[0024] Further, the site directory where the currently running software of the site server is located is mapped to the remote terminal to obtain a mapping directory, including:
[0025] The remote terminal maps the site directory where the currently running software of the site server is located to the remote terminal by calling a preset mapping function to obtain a mapping directory.
[0026] Further, the site server runs the updated software in the site directory as new running software, including:
[0027] The remote terminal sends a restart program instruction to the site server through a preset remote update program;
[0028] The site server receives the restart program instruction through a preset site update program, and runs the update software in the site directory according to the restart program instruction.
[0029] Further, deleting the mapping directory on the remote terminal includes:
[0030] The remote terminal deletes the mapping directory from the remote terminal by calling a preset mapping deletion function.
[0031] The present invention also provides a broadcast television site server update system, comprising a remote terminal and a plurality of site servers;
[0032] The remote terminal is used to store the update software in the master control directory of the remote terminal, map the site directory where the currently running software of the site server is located to the remote terminal, and obtain a mapping directory; determine whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same; when the file attributes of the update software and the currently running software are different, copy the update software to the site directory; after the site server runs the update software, delete the mapping directory;
[0033] The site server is used to stop running the currently running software and run the update software as the new running software when the file attributes of the update software and the currently running software are different.
[0034] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, a method for remotely updating software of a site server described in any of the above technical solutions is implemented.
[0035] Compared with the prior art, the beneficial effects of the present invention include: first, storing the updated software in the master control directory of the remote terminal, and mapping the site directory where the currently running software of the site server is located to the remote terminal to obtain the mapped directory; second, judging whether the file attributes of the updated software in the master control directory and the currently running software in the mapped directory are the same, when the attributes are different, the site server stops running the currently running software and copies the updated software to the site directory; finally, the site server runs the updated software as the new running software and deletes the mapped directory on the remote terminal. The method of the present invention updates the software of the site server by mapping the site directory where the currently running software of the site server is located to the remote terminal, and ensures the successful update of the software of the site server through the file attributes of the file update software, and also avoids the file version attribute of the updated software from changing with the modification time, which is convenient for the software maintenance work of the site server in the later stage. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flowchart of an embodiment of a method for remotely updating software of a site server provided by the present invention;
[0037] Figure 2 A schematic diagram of a flow chart of an embodiment of remotely updating software on a site server through a remote terminal provided by the present invention;
[0038] Figure 3 A schematic structural diagram of an embodiment of a radio and television site server update system provided by the present invention. DETAILED DESCRIPTION
[0039] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0040] Before describing the embodiments, the inventive concept of the present application is first explained.
[0041] At present, with the continuous increase in the number of site servers in different regions, how to update the software running in many site servers through remote terminals has become a technical problem that needs to be solved urgently. There are usually three methods of software update in the prior art: the first is to update the software by logging into the site server through remote desktop; the second is to write the update program into the shared directory by setting the directory where the site server runs the software as a shared write permission; the third is to update the software by running the update program on the site server.
[0042] However, the first method mentioned above is inefficient because it requires logging into the desktop of each site server; the second method has the problem of large workload in setting up shared folders and poor network security; therefore, the third method is usually used in actual application to update the software of the site server by running the update program, but in this method, since the actual version time of the running software usually changes with the modification time, it is impossible to determine whether the software is successfully updated by checking the version time, size and other information of the software running on the site server, which brings inconvenience to subsequent maintenance.
[0043] The present invention aims at the problem that when the existing update program updates the software of the site server, it is impossible to effectively determine whether the software of the site server is successfully updated. The present invention copies the update program in the remote terminal to the running program directory of the site server by remote mapping, compares the file attributes of the update program and the current running program to ensure that the software in the site server is successfully updated, and the actual file attributes of the update program will not change with the modification time, which provides convenience for later maintenance and saves the manpower and material costs of upgrading the site server software.
[0044] The embodiment of the present invention provides a method for remotely updating software of a site server, such as Figure 1 As shown, Figure 1 It is a flowchart of the software remote update method of the site server, including:
[0045] Step S101: storing the updated software in the main control directory of the remote terminal;
[0046] Step S102: Mapping the site directory where the currently running software of the site server is located to the remote terminal to obtain a mapping directory;
[0047] Step S103: determining whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same;
[0048] Step S104: when the file attributes of the update software and the currently running software are different, the site server stops running the currently running software and copies the update software to the site directory;
[0049] Step S105: the site server runs the updated software in the site directory as new running software, and deletes the mapping directory on the remote terminal.
[0050] The software remote update method of the site server provided in this embodiment first stores the update software in the master control directory of the remote terminal, and maps the site directory where the site server's currently running software is located to the remote terminal to obtain the mapping directory; secondly, it is determined whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same. When the attributes are different, the site server stops running the currently running software and copies the update software to the site directory; finally, the site server runs the update software as the new running software and deletes the mapping directory on the remote terminal. The method of this embodiment updates the software of the site server by mapping the site directory where the currently running software of the site server is located to the remote terminal, and ensures the successful update of the software of the site server through the file attributes of the file update software, while also avoiding the file version attribute of the update software from changing with the modification time, which is convenient for the software maintenance work of the site server in the later stage.
[0051] As a preferred embodiment, in step S102, the site directory where the currently running software of the site server is located is mapped to the remote terminal to obtain a mapping directory, including:
[0052] The remote terminal maps the site directory where the currently running software of the site server is located to the remote terminal by calling a preset mapping function to obtain a mapping directory.
[0053] As a specific embodiment, the preset mapping function is WNetAddConnection2. WNetAddConnection2 is a Windows system function that can be used to map a drive disk of the site server to a drive disk of the remote terminal.
[0054] As a preferred embodiment, in step S103, determining whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same includes:
[0055] Traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of corresponding files included in the currently running software in the mapping directory;
[0056] Determine whether the first file attribute and the second file attribute of any file are the same; when the first file attribute and the second file attribute are different, store the path of the file in the master control directory into the list of files to be updated;
[0057] Copy the files in the to-be-updated file list to the site directory.
[0058] As a preferred embodiment, traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of the corresponding files included in the currently running software in the mapping directory includes:
[0059] The remote terminal determines the first file attribute and the second file attribute of all the files by calling a preset attribute acquisition function.
[0060] As a specific embodiment, the preset attribute acquisition function is a GetFileAttributesEx function, which is used to read the file attributes of a certain file, wherein the file attributes include information such as file size and modification time.
[0061] As a preferred embodiment, in step S104, when the file attributes of the update software and the currently running software are different, the site server stops running the currently running software, including:
[0062] When the file attributes of the update software and the currently running software are different, the remote terminal sends a stop program instruction to the site server through a preset remote update program;
[0063] The site server receives the stop program instruction through a preset site update program, and terminates the running process of the currently running software according to the stop program instruction.
[0064] As a preferred embodiment, before the site server runs the updated software in the site directory as new running software, the process further includes:
[0065] Determine whether the third attribute of all files included in the update software in the site directory is the same as the first file attribute of the files corresponding to the update software in the master control directory;
[0066] When the third attribute and the first attribute of any file are the same, it is determined that the update software is copied successfully.
[0067] As a preferred embodiment, in step S105, the site server runs the updated software in the site directory as new running software, including:
[0068] The remote terminal sends a restart program instruction to the site server through a preset remote update program;
[0069] The site server receives the restart program instruction through a preset site update program, and runs the update software in the site directory according to the restart program instruction.
[0070] As a preferred embodiment, deleting the mapping directory on the remote terminal includes:
[0071] The remote terminal deletes the mapping directory from the remote terminal by calling a preset mapping deletion function.
[0072] As a specific embodiment, the preset mapping deletion function includes the WNetCancelConnection2 function in the Windows system function. The WNetCancelConnection2 function can be used to disconnect and delete the drive disk mapped by the WNetAddConnection2 function on the remote terminal.
[0073] The above solution is described in detail below through a specific embodiment.
[0074] As a specific embodiment, the remote terminal and the site server are both installed with Windows system, the remote terminal and the site server are connected through a network, and there can be one or more site servers; wherein, a preset remote update program is installed on the remote terminal, and a site update program is installed on the site server; after the remote update program is run, it can communicate with the site update program.
[0075] like Figure 2 As shown, Figure 2 The flowchart shows the method of updating the software of any site server through the remote terminal. The specific steps are as follows:
[0076] Step S201: copy one or more update software to a directory of the remote terminal (assuming it is a folder in the C drive), and start the remote update program on the remote terminal.
[0077] Step S202: the remote update program calls WNetAddConnection2 to map the drive disk where the site server running software is located (assuming it is drive D) to a drive disk of the remote terminal (assuming it is drive F).
[0078] It should be noted here that after the remote update program maps the site server's drive disk as the remote terminal's mapping disk, the remote terminal's operation results on the mapping disk will be synchronized to perform the same operation on the site server's drive disk, thereby realizing the remote terminal's software update on the site server.
[0079] Step S203: The remote update program reads the file attributes (file size and modification time) of each file contained in the update software A in the C drive of the remote terminal one by one through GetFileAttributesEx, and then reads the file attributes contained in the corresponding currently running software B in the F drive through GetFileAttributesEx, and compares whether the file attributes of the corresponding files in A and B are the same. If the file attributes of a file contained in the running software B in the F drive are different from the file attributes of the corresponding file in the C drive, the complete path of the file in the C drive is stored in the file list to be updated filelist.
[0080] Step S204: Determine whether filelist is empty. If it is empty, it means that the version B of the software currently running on the site server is exactly the same as the updated software A, and no update is required, and the process goes to step S209; if it is not empty, it means that the two versions are different, and the running software of the site server needs to be updated, and the process goes to step S205;
[0081] Step S205: The remote update program of the remote terminal sends a TCP stop program instruction to the site server. After receiving the instruction, the site update program of the site server ends the running process of the software currently running on the site server. Then the remote terminal uses the CopyFile function to copy the corresponding files in the file list to be updated filelist from the remote terminal's C drive to the mapped disk F drive one by one (at this time, the copying of the corresponding files of the updated software is also synchronously implemented on the drive disk D of the site server).
[0082] Step S206: The remote terminal uses the GetFileAttributesEx function to read the corresponding file information in the C drive and the F drive according to the file information in the file list to be updated filelist, compares the file attributes of each file, and determines whether there is any inconsistency in the file attributes; if the file attributes are inconsistent, it means that the file copying has failed, and the process goes to step S207; if the file attributes are consistent, it means that the copying is successful, and the process goes to step S208.
[0083] Step S207: The remote terminal outputs and records the information of the updating software A that has failed to be updated, and then proceeds to step S209.
[0084] Step S208: the remote terminal sends a TCP restart program instruction including the attributes of the current update software A to the site server through the remote update program. After receiving the instruction through the site update program, the site server restarts the update software A in the D disk.
[0085] Step S209: the remote update program calls WNetCancelConnection2 to delete the drive disk F mapped in the remote terminal, and the process ends.
[0086] It is understandable that the above steps describe the case where there is only one software to be updated. When multiple software need to be updated, each software to be updated in the site server can be updated using the same method.
[0087] At the same time, from the above process, it can be seen that the site update program only needs to implement the two functions of "ending the current running process according to the TCP stop program instruction" and "restarting the update software according to the TCP restart program instruction", and other operations are implemented on the remote terminal. Since the site update program has simple functions, it is very convenient to maintain the site server update program. The focus of software development is on the remote terminal remote update program, which improves maintenance efficiency and reduces later maintenance costs.
[0088] In addition, the method of this embodiment is also effective for software updates of multiple site servers. The site directories of different site servers can be mapped to the mapping directory of the remote terminal, and the software updates can be performed using the same method.
[0089] Through the method of the above embodiment, on the one hand, the remote hot update of the software running on the site server is realized, so that the process of the running software on the site server is stopped and exited by the update program when updating, and restarted by the update program after the update is successful; on the other hand, the file attribute information of the update file of the remote terminal remains unchanged after being copied to the site server, which is convenient for determining the actual information of the software according to the file size and version time; on the other hand, after updating a software, by comparing the attribute information of each file of the update software in the remote terminal and the site server, the update is determined to be successful only when the results are the same, and the determination method is simple and reliable. In addition, the process of updating software files uses Windows underlying functions, which improves the efficiency of software updates compared with the method of transmitting files using the TCP protocol.
[0090] The embodiment of the present invention also provides a radio and television site server update system, such as Figure 3 As shown, the broadcasting and television site server update system 300 includes a remote terminal 301 and a plurality of site servers 302;
[0091] The remote terminal 301 is used to store the update software in the master directory of the remote terminal, map the site directory where the currently running software of the site server is located to the remote terminal, and obtain a mapping directory; determine whether the file attributes of the update software in the master directory and the currently running software in the mapping directory are the same; when the file attributes of the update software and the currently running software are different, copy the update software to the site directory; after the site server runs the update software, delete the mapping directory;
[0092] The site server 302 is used to stop running the currently running software and run the update software as the new running software when the file attributes of the update software and the currently running software are different.
[0093] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for remotely updating software of a site server described in any of the above technical solutions is implemented.
[0094] The computer-readable storage medium and computing device provided according to the above embodiments of the present invention can be implemented with reference to the specific description of the method for remotely updating software of a site server as described above according to the present invention, and have similar beneficial effects as the method for remotely updating software of a site server as described above, which will not be described in detail here.
[0095] The present invention discloses a software remote updating method, system and storage medium of a site server. First, the updating software is stored in the master control directory of the remote terminal, and the site directory where the currently running software of the site server is located is mapped to the remote terminal to obtain the mapping directory; secondly, it is determined whether the file attributes of the updating software in the master control directory and the currently running software in the mapping directory are the same. When the attributes are different, the site server stops running the currently running software and copies the updating software to the site directory; finally, the site server runs the updating software as the new running software and deletes the mapping directory on the remote terminal.
[0096] The method of the present invention updates the software of the site server by mapping the site directory where the software currently running on the site server is located to the remote terminal, and ensures that the software update of the site server is successful by updating the file attributes of the software through files, while also avoiding the file version attributes of the updated software from changing with the modification time, thereby facilitating the software maintenance work on the site server in the later stage.
[0097] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for remotely updating software of a site server, wherein the number of the site servers is several, characterized in that: include: Store the updated software in the master directory of the remote terminal; The remote terminal maps the site directory where the currently running software of the site server is located to the remote terminal by calling a preset mapping function, obtains a mapping directory, copies the updated software to the drive disk of the remote terminal, starts a remote update program on the remote terminal, and the remote update program calls WNetAddConnection2 to map the drive disk where the running software of the site server is located to a drive disk of the remote terminal. The remote terminal performs the same operation on the mapped disk synchronously on the drive disk of the site server, thereby realizing the software update of the site server by the remote terminal; Determine whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same; When the file attributes of the update software and the currently running software are different, the site server stops running the currently running software and copies the update software to the site directory; The site server runs the updated software in the site directory as new running software, and deletes the mapping directory on the remote terminal; Determining whether the file attributes of the update software in the master control directory and the currently running software in the mapping directory are the same includes: Traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of corresponding files included in the currently running software in the mapping directory; Determine whether the first file attribute and the second file attribute of any file are the same; when the first file attribute and the second file attribute are different, store the path of the file in the master control directory into the list of files to be updated, and the remote terminal uses the CopyFile function to copy the corresponding files in the list of files to be updated filelist from the drive disk of the remote terminal to the mapping disk one by one, and the drive disk D of the site server also realizes the copying of the corresponding files of the update software synchronously; Implement copying the files in the to-be-updated file list to the site directory; Traversing the first file attributes of all files included in the update software in the master control directory and the second file attributes of corresponding files included in the currently running software in the mapping directory includes: The remote terminal determines the first file attribute and the second file attribute of all the files by calling a preset attribute acquisition function.
2. A method for remotely updating software of a site server according to claim 1, characterized in that: When the file attributes of the update software and the currently running software are different, the site server stops running the currently running software, including: When the file attributes of the update software and the currently running software are different, the remote terminal sends a stop program instruction to the site server through a preset remote update program; The site server receives the stop program instruction through a preset site update program, and terminates the running process of the currently running software according to the stop program instruction.
3. A method for remotely updating software of a site server according to claim 1, characterized in that: Before the site server runs the updated software in the site directory as new running software, the process further includes: Determine whether the third attribute of all files included in the update software in the site directory is the same as the first file attribute of the files corresponding to the update software in the master control directory; When the third attribute and the first attribute of any file are the same, it is determined that the update software is copied successfully.
4. A method for remotely updating software of a site server according to claim 1, characterized in that: The site server runs the updated software in the site directory as new running software, including: The remote terminal sends a restart program instruction to the site server through a preset remote update program; The site server receives the restart program instruction through a preset site update program, and runs the update software in the site directory according to the restart program instruction.
5. A method for remotely updating software of a site server according to claim 1, characterized in that: Deleting the mapping directory on the remote terminal includes: The remote terminal deletes the mapping directory from the remote terminal by calling a preset mapping deletion function.
6. A broadcasting and television site server update system, implementing the software remote update method according to any one of claims 1 to 5, wherein the number of the site servers is several, characterized in that: Includes remote terminals and multiple site servers; The remote terminal is used to store the updated software in the master directory of the remote terminal, and to map the site directory where the currently running software of the site server is located to the remote terminal by calling a preset mapping function to obtain a mapping directory; Determine whether the file attributes of the update software in the master directory and the currently running software in the mapping directory are the same; if the file attributes of the update software and the currently running software are different, copy the update software to the site directory; After the site server runs the update software, the mapping directory is deleted; The site server is used to stop running the currently running software and run the update software as the new running software when the file attributes of the update software and the currently running software are different.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for remotely updating software of a site server according to any one of claims 1 to 5 is implemented.
