CN112527346A - Software upgrading method and device, storage medium and electronic device - Google Patents

Software upgrading method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112527346A
CN112527346A CN202011355948.0A CN202011355948A CN112527346A CN 112527346 A CN112527346 A CN 112527346A CN 202011355948 A CN202011355948 A CN 202011355948A CN 112527346 A CN112527346 A CN 112527346A
Authority
CN
China
Prior art keywords
software
instruction
target
notification message
target client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011355948.0A
Other languages
Chinese (zh)
Inventor
徐亚雪
王剑侠
叶建威
简托
凌邦祥
刘锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sunwave Communications Co Ltd
Original Assignee
Sunwave Communications Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sunwave Communications Co Ltd filed Critical Sunwave Communications Co Ltd
Priority to CN202011355948.0A priority Critical patent/CN112527346A/en
Publication of CN112527346A publication Critical patent/CN112527346A/en
Priority to PCT/CN2021/091216 priority patent/WO2022110645A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The embodiment of the invention provides a software upgrading method, a device, a storage medium and an electronic device, wherein the method comprises the following steps: after determining that target session connection is established with a target client, receiving a software upgrading instruction sent by the target client based on the target session connection, wherein the software upgrading instruction comprises parameter information for upgrading target software; performing an upgrade operation on the target software based on the software upgrade instruction; and feeding back an upgrading result of the upgrading operation to the target client. The invention solves the problems that the upgrade abnormal link can not be determined in the software upgrade operation and the upgrade efficiency is low in the related technology, and achieves the effects of sensing the execution result of each software upgrade operation and improving the upgrade efficiency.

Description

Software upgrading method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a software upgrading method, a software upgrading device, a storage medium and an electronic device.
Background
In the related art, common software Management methods, such as traditional southbound Interface protocols like CLI (Command Line Interface) and SNMP (Simple Network Management Protocol), have the disadvantages of poor compatibility, weak configuration Management capability, and the like. For example, when managing file upgrades via SNMP, a first precondition is required. That is, information related to an SFTP server address, a port of the SFTP server, a login user name of the SFTP server, a password, a file to be upgraded, and the like is configured on the device in the form of transmission parameters. Then, a software upgrade command is triggered. Because the software download and update are done together, when a problem arises with the upgrade, it is not possible to distinguish which process is abnormal.
Therefore, the problems that the abnormal upgrading link cannot be determined in the software upgrading operation and the upgrading efficiency is low exist in the related technology.
In view of the above problems in the related art, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a software upgrading method, a device, a storage medium and an electronic device, which are used for at least solving the problems that the upgrading abnormal link cannot be determined in the software upgrading operation and the upgrading efficiency is low in the related technology.
According to an embodiment of the present invention, there is provided a software upgrading method including: after determining that target session connection is established with a target client, receiving a software upgrading instruction sent by the target client based on the target session connection, wherein the software upgrading instruction comprises parameter information for upgrading target software; performing an upgrade operation on the target software based on the software upgrade instruction; and feeding back the upgrading result of the upgrading operation to the target client.
According to another embodiment of the present invention, there is provided a software upgrading apparatus including: the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a software upgrading instruction sent by a target client based on target session connection after the target session connection with the target client is determined, and the software upgrading instruction comprises parameter information for upgrading target software; the upgrading module is used for executing upgrading operation on the target software based on the software upgrading instruction; and the feedback module is used for feeding back the upgrading result of the upgrading operation to the target client.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, after the target session connection with the target client is determined to be established, the software upgrading instruction which is sent by the target client based on the target session connection and comprises the parameter information of the upgrading target software is received, the upgrading operation is executed on the target software based on the software upgrading instruction, and the upgrading result of the upgrading operation is fed back after the upgrading operation is executed. Because the upgrading result is fed back in time after the upgrading operation is executed, the target client can determine the result of each upgrading operation link, so that the problems that the abnormal link of the upgrading cannot be determined in the software upgrading operation and the upgrading efficiency is low in the related technology can be solved, the execution result of each software upgrading operation is sensed, and the upgrading efficiency is improved.
Drawings
Fig. 1 is a block diagram of a hardware structure of a mobile terminal of a software upgrading method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of software upgrade according to an embodiment of the present invention;
FIG. 3 is a timing diagram of a software upgrade method according to an embodiment of the present invention;
fig. 4 is a block diagram of a software upgrading apparatus according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a hardware structure block diagram of the mobile terminal of a software upgrading method according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the software upgrading method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In this embodiment, a software upgrading method is provided, and fig. 2 is a flowchart of a software upgrading method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, after determining to establish target session connection with a target client, receiving a software upgrading instruction sent by the target client based on the target session connection, wherein the software upgrading instruction comprises parameter information for upgrading target software;
step S204, executing upgrading operation on the target software based on the software upgrading instruction;
step S206, feeding back the upgrading result of the upgrading operation to the target client.
Illustratively, the executing subject of the above steps may be a terminal device, such as a computer, a mobile phone, etc., but is not limited thereto.
In the foregoing embodiment, the target client may be a terminal device management device, and before the target client manages the terminal device, the terminal device may establish a target session connection, for example, a Network Configuration Protocol (NETCONF) session connection, with the terminal device. After the target session is connected, the target client can send a software upgrading instruction to the terminal device through the target session, and the terminal device executes upgrading operation on target software based on the software upgrading instruction. After the terminal device upgrades the software based on the software upgrade instruction, the result of the upgrade operation may be fed back to the target terminal. And under the condition that the operation result is successful, the target client can also invent a next software upgrading instruction to the terminal equipment, and the terminal equipment upgrades the target software based on the software upgrading instruction and feeds back the upgrading result. The software upgrading instruction may include different types of obtaining instructions such as a downloading instruction, an installing instruction, an activating instruction, and the like, the software upgrading instruction may include parameter information required by software upgrading operation, and the parameter information included in the software upgrading instructions of different instruction types may be different. For example, in the case that the instruction type of the software upgrade instruction is a download instruction, the parameter information may be an address, a name, and the like of software to be downloaded. When the instruction type of the software upgrade instruction is an installation instruction, the parameter information may be a name, a storage location, an installation location, and the like of the software to be installed. When the instruction type of the software upgrade instruction is an activation instruction, the parameter information may be a name, an installation location, and the like of software to be activated.
In the above embodiment, when the target session is a NETCONF session, the device serving as a NETCONF server may establish the NETCONF session with the client through the processes of clock synchronization, CALL HOME (automatic notification), SSH (secure shell protocol) connection establishment, capability discovery, and the like. That is, the terminal device may report device information of the terminal device by sending a CALL HOME me (automatic notification) to the target client, and the target client may establish an SHH connection with the device after receiving the CALL HOME me, and automatically acquire a device function of the terminal device. The software upgrade instruction may be an XML-formatted RPC (Remote Procedure Call) instruction.
According to the invention, after the target session connection with the target client is determined to be established, the software upgrading instruction which is sent by the target client based on the target session connection and comprises the parameter information of the upgrading target software is received, the upgrading operation is executed on the target software based on the software upgrading instruction, and the upgrading result of the upgrading operation is fed back after the upgrading operation is executed. Because the upgrading result is fed back in time after the upgrading operation is executed, the target client can determine the result of each upgrading operation link, so that the problems that the abnormal link of the upgrading cannot be determined in the software upgrading operation and the upgrading efficiency is low in the related technology can be solved, the execution result of each software upgrading operation is sensed, and the upgrading efficiency is improved.
In one exemplary embodiment, performing an upgrade operation on target software based on the software upgrade instructions comprises: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and first parameter information included in the software upgrading instruction; under the condition that the instruction type of the software upgrading instruction is determined to be a downloading instruction, determining a first preset condition corresponding to the downloading instruction; under the condition that the first parameter information meets the first preset condition, establishing connection with a target server based on credential information included in the first parameter information; executing a downloading operation in the target server based on first identification information included in the first parameter information to download first software corresponding to the target software; and upgrading the target software based on the first software in the case of successful downloading. In this embodiment, the terminal device may obtain the instruction type of the software upgrade instruction and the first parameter information included in the software upgrade instruction by parsing the software upgrade instruction. When the software upgrading instruction is a downloading instruction, determining a first preset condition corresponding to the downloading instruction, connecting the target server according to certificate information included in the first parameter information under the condition that the first parameter information is determined to meet the first preset condition, downloading first software corresponding to first identification information included in the first parameter information in the target server after the target server is connected, and upgrading the target software based on the first software after the downloading is successful. The first parameter information may include a name, a download address, and download credential information of the software to be downloaded. The credential information may be an address of a server that downloads the software, an access user name that accesses the server, a password, and the like. The first preset condition is used for judging whether the result of analyzing the software upgrading instruction is normal or not. That is, whether the first parameter information is correct or not can be determined according to the first predetermined condition. For example, the first predetermined condition may be a length, a format, and the like of the character. That is, whether each parameter included in the first parameter information is correct or not can be determined by the length, format, and the like of the character.
In the above embodiment, when the target session is a NETCONF session, the network manager (corresponding to the target client) issues, through the established NETCONF session, an RPC command to start downloading to the device end (corresponding to the terminal device) through a NETCONF protocol; the terminal equipment receives software-download RPC (software download instruction) issued by the target client through the established NETCONF session. The terminal equipment analyzes the software-download RPC command to obtain an SFTP server (file transfer server) address, an access user name and password, a software package file name and the like. And the terminal equipment determines the analysis result, and if the analysis result is correct, the software is downloaded. And the terminal equipment establishes connection with the SFTP server through the certificate and finishes software downloading.
In an exemplary embodiment, after determining the first predetermined condition corresponding to the download instruction, the method further comprises: judging whether the first parameter information meets the first preset condition or not; under the condition that the first parameter information is determined to meet the first preset condition, sending a first notification message to the target client, wherein the first notification message is used for notifying the target client that the downloading operation starts to be executed and a first time required for executing the downloading operation so as to indicate the target client to judge whether the downloading operation is overtime or not based on the time when the target client receives the first notification message and the first time; and sending a second notification message to the target client under the condition that the first parameter information is determined not to meet the first preset condition, wherein the second notification message is used for notifying the target client that the downloading operation is terminated. In this embodiment, after determining the first predetermined condition corresponding to the download instruction, the terminal device may determine whether the first parameter information satisfies the first predetermined condition, and send a result of the determination to the target client through the target session. And sending a second notification message to the target client under the condition that the first parameter information is determined not to meet the first preset condition. The first notification message may include a notification that the downloading operation starts to be executed, and a first time required for executing the downloading operation. The target client may start counting when receiving the first notification, and may consider that the downloading has failed when the first time is exceeded without receiving the instruction of completing the downloading. The second notification message may include a notification of the failure to resolve. And after receiving the second notification message, the target client can send a downloading instruction to the terminal device again.
In the above embodiment, when the target session is a NETCONF session, the terminal device may reply rpc-reply according to the data model structure defined in the YANG model via the NETCONF protocol. The terminal equipment responds to the target client according to the RPC analysis result, if the analysis is normal, responds to the STARTED state and the reporting time of the completion of the current downloading, and prepares for downloading; if there is error, respond to FAILED and terminate the download.
In an exemplary embodiment, feeding back the upgrade result of the upgrade operation to the target client includes: determining an execution result of the downloading operation; sending a third notification message to the target client when the execution result is that the downloading operation is successfully executed, wherein the third notification message is used for indicating that the downloading operation is successfully executed; and sending a fourth notification message to the target client when the execution result is that the execution of the downloading operation fails, wherein the fourth notification message is used for indicating that the execution of the downloading operation fails, and the fourth notification message comprises first reason information of the execution failure of the downloading operation. In this embodiment, after the downloading is completed, the terminal device may feed back the downloading result to the target client. And if the downloading is successful, sending a third notification message that the downloading operation is successfully executed to the target client. If the downloading fails, a fourth notification message of the downloading operation execution failure is sent to the target client, wherein the fourth notification message further includes the reason of the downloading operation execution failure, and after receiving the fourth notification message, the target client can maintain the terminal device according to the reason of the downloading operation execution failure included in the fourth message, can also send the reason of the downloading operation failure to the operation and maintenance personnel, and can also send the downloading instruction again.
In the above embodiment, when the target session is NETCONF, the software download may be triggered by NETCONF RPC, that is, a download command is received through a NETCONF protocol, and the actual software package download is completed by SFTP; and establishing connection with the SFTP server through the certificate, and completing software downloading. And after downloading, sending the download-event notification to the target client. If the downloading process is correct and the software package is correct, the state in the notification is COMPLETED, and if the downloading is wrong, the state is the reason of the downloading error.
In one exemplary embodiment, performing an upgrade operation on target software based on the software upgrade instructions comprises: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and second parameter information included in the software upgrading instruction; determining a second predetermined condition corresponding to the installation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the installation instruction; determining second software based on second identification information included in the second parameter information under the condition that the second parameter information meets the second preset condition, wherein the second software is software which is acquired in advance and corresponds to the target software; and executing installation operation on the second software to upgrade the target software. In this embodiment, the software upgrading instruction may also be an installation instruction, and after the software upgrading instruction is analyzed, in the case that the software upgrading instruction is determined to be the installation instruction, a second predetermined condition corresponding to the installation instruction is determined, and in the case that the second parameter information satisfies the second predetermined condition, the second software is determined according to the second identification information included in the second parameter information. The second software is software which is obtained in advance and corresponds to the target software. That is, the second software may be software downloaded by the download instruction or software stored in the terminal device in advance. The second parameter information may include installation information such as a software installation slot (i.e., a software installation address), a software package file name, and the like, and the second identification information may be the software package file name.
In one exemplary embodiment, performing an installation operation on the second software to upgrade the target software comprises: determining first installation address information included in the second parameter information; and executing the installation operation on the second software to install the second software into the address corresponding to the first installation address information. In this embodiment, the first installation address information included in the second parameter information is determined, the installation operation is performed on the second software, and the software package corresponding to the second software is installed in the specified software slot after a series of processing, so that the software package installation is completed.
In one exemplary embodiment, after determining the second predetermined condition corresponding to the installation instruction, the method further comprises: judging whether the second parameter information meets the second preset condition or not; under the condition that the second parameter information is determined to meet the second preset condition, sending a fifth notification message to the target client, wherein the fifth notification message is used for notifying the target client that the installation operation starts to be executed; and sending a sixth notification message to the target client when the second parameter information is determined not to meet the second predetermined condition, wherein the sixth notification message is used for notifying the target client that the installation operation is terminated. In the present embodiment, after the second predetermined condition corresponding to the installation instruction is determined, it may be determined whether the second parameter information satisfies the second predetermined condition. And when the second parameter information meets a second predetermined condition, sending a fifth notification message to the target client, where the fifth notification message may include a notification that the analysis is successful, and when the second parameter information does not meet the predetermined condition, sending a sixth notification message to the target client, where the sixth notification message may include a notification that the analysis is failed. Wherein the second predetermined condition may be character length, format, etc. That is, whether each parameter included in the second parameter information is correct or not can be judged by the length, format, and the like of the character.
In the above embodiment, when the target session is a NETCONF session, the device receives software-install RPC (corresponding to the installation instruction) issued by the client through the NETCONF session. And analyzing the software-instruction RPC command to obtain installation information such as a software installation slot, a software package file name and the like. The equipment responds to the client according to the RPC analysis result, and if the analysis is normal, the equipment responds to the STARTED state and prepares for installation; if the error exists, responding to FAILED and terminating the installation.
In an exemplary embodiment, feeding back the upgrade result of the upgrade operation to the target client includes: determining an execution result of the installation operation; sending a seventh notification message to the target client when the execution result is that the installation operation is successfully executed, wherein the seventh notification message is used for indicating that the installation operation is successfully executed; and sending an eighth notification message to the target client when the execution result is that the execution of the installation operation fails, wherein the eighth notification message is used for indicating that the execution of the installation operation fails, and the eighth notification message includes second reason information of the execution failure of the installation operation. In the present embodiment, after the installation is completed, the execution result of the installation operation is determined. And sending a seventh notification message to the target client when the installation is successful, and sending an eighth notification message to the target client when the installation is failed. The seventh notification message may include a notification of successful installation, and the eighth notification message may include a reason for installation failure and a second reason for installation failure. When the target client receives the eighth notification message, the terminal device may be maintained according to the reason of the installation failure, or the reason of the installation failure may be sent to the operation and maintenance personnel, and the installation instruction may be sent again.
In the above embodiment, when the target session is a NETCONF session, after the installation is completed, the terminal device may send an instance-event notification to the client. If the installation process is correct, the state in the notification is complete, and if the installation is wrong, the state is the reason of the installation error.
In one exemplary embodiment, performing an upgrade operation on target software based on the software upgrade instructions comprises: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and third parameter information included in the software upgrading instruction; determining a third predetermined condition corresponding to the activation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the activation instruction; and executing activation operation on third software based on second installation address information included in the third parameter information under the condition that the third parameter information meets the third preset condition, wherein the third software is software installed in an address corresponding to the second installation address information. In this embodiment, the software upgrade instruction may be an activation instruction, where the activation operation may be performed after the installation operation, that is, the target client sends the activation operation instruction to the terminal device after receiving the notification message that the installation is successful. After receiving the software upgrading instruction, the terminal device can analyze the software and determine the type of the instruction and the third parameter information. And under the condition that the software upgrading instruction is determined to be the activating instruction, determining a third preset condition corresponding to the activating instruction, and under the condition that the third parameter information is determined to meet the third preset condition, executing activating operation on third software corresponding to second installation address information included in the third parameter information. The second installation address may be an address of a software slot, that is, an activation operation is performed on software installed in the software slot.
In the above embodiment, when the target session is a NETCONF session, the terminal device receives a software-activate RPC command issued by the target client through the NETCONF session. And analyzing the software-activate RPC command to obtain a software slot to be activated, and activating software installed in the software slot.
In one exemplary embodiment, after determining a third predetermined condition corresponding to the activation instruction, the method further comprises determining whether the third parameter information satisfies the third predetermined condition; in a case that it is determined that the third parameter information satisfies the third predetermined condition, sending a ninth notification message to the target client, where the ninth notification message is used to notify the target client that the activation operation starts to be executed and a second time required for executing the activation operation, so as to instruct the target client to determine whether the activation operation is overtime based on the time when the target client receives the ninth notification message and the second time; sending a tenth notification message to the target client when it is determined that the third parameter information does not satisfy the third predetermined condition, wherein the tenth notification message is used for notifying the target client that the activation operation is terminated. In the present embodiment, after determining the third predetermined condition corresponding to the activation instruction, it is determined whether the third parameter information satisfies the third predetermined condition. And in the case that the third preset condition is met, sending a ninth notification message to the target client, wherein the ninth notification message can comprise the second time required by the activation operation to start execution and the activation operation to be executed. The target client may start timing when receiving the ninth notification message, and when the timing time exceeds the second time, the target client may send the activation instruction to the terminal device again. In a case that the third parameter information does not satisfy the third predetermined condition, a tenth notification message may be sent to the target client, where the tenth notification message may include a notification of the activation failure. After receiving the tenth notification message, the target client may send the activation instruction to the terminal device again. Wherein the third predetermined condition may be character length, format, etc. That is, whether each parameter included in the third parameter information is correct or not can be determined by the length, format, and the like of the character.
In the above embodiment, when the target session is a NETCONF session, the terminal device responds to the client according to the RPC analysis result, and if the analysis is normal, responds to the STARTED state and the time required for completion of activation, and prepares for activation; if the fault exists, responding to FAILED and terminating the activation.
In one exemplary embodiment, feeding back the upgrade result of the upgrade operation to the target client includes determining an execution result of the activation operation; if the execution result is that the execution of the activation operation is successful, sending an eleventh notification message to the target client, wherein the eleventh notification message is used for indicating that the execution of the activation operation is successful; and sending a twelfth notification message to the target client when the execution result is that the execution of the activation operation fails, wherein the twelfth notification message is used for indicating that the execution of the activation operation fails, and the twelfth notification message includes third cause information of the execution failure of the activation operation. In this embodiment, after the activation operation is completed, the execution result may be sent to the target client. And sending an eleventh notification message to the target client when the execution of the activation operation is successful, and sending a twelfth notification message to the target client when the execution of the activation operation is failed. The eleventh notification message may include a notification of successful execution, and the twelfth notification message may include third cause information of failed execution. After receiving the twelfth notification message, the target client may maintain the terminal device according to the reason of the activation failure, or send the reason of the activation failure to the operation and maintenance staff, or may send the activation instruction again.
In the above embodiment, when the target session is a NETCONF session, the terminal device activates a software package that has been installed in a software slot. After activation is completed, an activation-event notification may be sent to the target client. If the installation process is correct, the state in the notification is complete, and if the installation is wrong, the state is the reason of the installation error.
In one exemplary embodiment, after sending the eleventh notification message to the target client, the method further comprises: receiving a restart instruction sent by the target client; and disconnecting the target session based on the restart instruction, and executing restart operation to complete the upgrade operation. In this embodiment, after the notification message that activation is successful is sent to the target client, a restart instruction sent by the target client may also be received, the target session connection is disconnected according to the restart instruction, and a restart operation is executed, so that the software is upgraded. And when the target session is the NETCONF session, the terminal equipment waits for the client to send a restart RPC command after correctly activating the software. The command is answered after receipt of the restart RPC. Closing the NETCONF session, executing the restart and finishing the upgrade of the whole software package.
In one exemplary embodiment, the target session connection comprises a network configuration NETCONF session connection; the software upgrade instruction comprises a Remote Procedure Call (RPC) instruction with a preset format. In this embodiment, NETCONF is a network management protocol based on XML with a YANG model as a data model, and provides a programmable method for configuring and managing network devices. The SSHv2 based on TCP is adopted for transmission, and the operation and control are realized in an RPC mode. The user can set parameters, obtain parameter values and obtain statistical information through the NETCONF protocol. NETCONF has the advantages of strong data modeling capability, filtering capability, configuration management capability, expandability and the like. The upgrading management is realized through a NETCONF protocol and is divided into several processes of downloading, installing, activating and restarting, each process is independent, and the state of each process can be monitored. And the upgrading integrity and stability are ensured. And because of the strong configuration management capability, the information required by downloading and upgrading is only required to be sent to the equipment end in an XML form without any need of being firstly made on the equipment. The NETCONF strong configuration capability (RPC and XML) is applied to realize software upgrading management, each parameter does not need to be set through an interface, different processes can be realized only through different XML configuration files, and the software upgrading efficiency is improved. The RPC instruction may be a download instruction, such as "user-RPC-content download. xml", an install instruction, such as "user-RPC-content install. xml", and an activate instruction, such as "user-RPC-content activate. xml".
In the above embodiment, the software, the system, and the like that have been installed in the terminal device may be upgraded by using the software upgrading method, and new software or a system may also be installed in the terminal device, that is, the target software may be software that has been installed in the terminal device, or may also be software that is not installed in the terminal device.
The following describes a software upgrading method with reference to a specific embodiment:
fig. 3 is a sequence diagram of a software upgrading method according to a specific embodiment of the present invention, and as shown in fig. 3, a software upgrading process of the software upgrading method based on a NETCONF protocol may include software downloading, installation, activation, and restart, where each process is started by receiving an RPC from a client and ended by reporting a notification by a device. Each process has correctness verification and response, the next process can be carried out only when the current process is completed correctly, otherwise, the upgrade is terminated, and the completeness and correctness of the software upgrade are ensured. Each upgrading process is independently completed, the state of the process is given, and the whole updating process can be tracked.
It should be noted that the whole process can be divided into three independent processes, namely downloading, installation and activation, which are convenient for independent management through the client.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a software upgrading apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a software upgrading apparatus according to an embodiment of the present invention, as shown in fig. 4, the apparatus including:
a receiving module 42, configured to receive a software upgrade instruction sent by the target client based on the target session connection after determining that the target session connection is established with the target client, where the software upgrade instruction includes parameter information for upgrading target software;
an upgrade module 44 configured to perform an upgrade operation on the target software based on the software upgrade instruction;
a feedback module 46, configured to feed back an upgrade result of the upgrade operation to the target client.
In an exemplary embodiment, the upgrade module 44 may perform an upgrade operation on the target software based on the software upgrade instruction by: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and first parameter information included in the software upgrading instruction; under the condition that the instruction type of the software upgrading instruction is determined to be a downloading instruction, determining a first preset condition corresponding to the downloading instruction; under the condition that the first parameter information meets the first preset condition, establishing connection with a target server based on credential information included in the first parameter information; executing a downloading operation in the target server based on first identification information included in the first parameter information to download first software corresponding to the target software; and upgrading the target software based on the first software in the case of successful downloading.
In an exemplary embodiment, the apparatus may be configured to determine whether the first parameter information satisfies a first predetermined condition after determining the first predetermined condition corresponding to the download instruction; under the condition that the first parameter information is determined to meet the first preset condition, sending a first notification message to the target client, wherein the first notification message is used for notifying the target client that the downloading operation starts to be executed and a first time required for executing the downloading operation so as to indicate the target client to judge whether the downloading operation is overtime or not based on the time when the target client receives the first notification message and the first time; and sending a second notification message to the target client under the condition that the first parameter information is determined not to meet the first preset condition, wherein the second notification message is used for notifying the target client that the downloading operation is terminated.
In an exemplary embodiment, the feedback module 46 may implement the feedback of the upgrade result of the upgrade operation to the target client by: determining an execution result of the downloading operation; sending a third notification message to the target client when the execution result is that the downloading operation is successfully executed, wherein the third notification message is used for indicating that the downloading operation is successfully executed; and sending a fourth notification message to the target client when the execution result is that the execution of the downloading operation fails, wherein the fourth notification message is used for indicating that the execution of the downloading operation fails, and the fourth notification message comprises first reason information of the execution failure of the downloading operation.
In an exemplary embodiment, the upgrade module 44 may perform an upgrade operation on the target software based on the software upgrade instruction by: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and second parameter information included in the software upgrading instruction; determining a second predetermined condition corresponding to the installation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the installation instruction; determining second software based on second identification information included in the second parameter information under the condition that the second parameter information meets the second preset condition, wherein the second software is software which is acquired in advance and corresponds to the target software; and executing installation operation on the second software to upgrade the target software.
In one exemplary embodiment, the apparatus may be configured to perform an installation operation on the second software to upgrade the target software, including: determining first installation address information included in the second parameter information; and executing the installation operation on the second software to install the second software into the address corresponding to the first installation address information.
In an exemplary embodiment, the apparatus may be configured to determine whether the second parameter information satisfies a second predetermined condition after determining the second predetermined condition corresponding to the installation instruction; under the condition that the second parameter information is determined to meet the second preset condition, sending a fifth notification message to the target client, wherein the fifth notification message is used for notifying the target client that the installation operation starts to be executed; and sending a sixth notification message to the target client when the second parameter information is determined not to meet the second predetermined condition, wherein the sixth notification message is used for notifying the target client that the installation operation is terminated.
In an exemplary embodiment, the feedback module 46 may implement the feedback of the upgrade result of the upgrade operation to the target client by: determining an execution result of the installation operation; sending a seventh notification message to the target client when the execution result is that the installation operation is successfully executed, wherein the seventh notification message is used for indicating that the installation operation is successfully executed; and sending an eighth notification message to the target client when the execution result is that the execution of the installation operation fails, wherein the eighth notification message is used for indicating that the execution of the installation operation fails, and the eighth notification message includes second reason information of the execution failure of the installation operation.
In an exemplary embodiment, the upgrade module 44 may perform an upgrade operation on the target software based on the software upgrade instruction by: analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and third parameter information included in the software upgrading instruction; determining a third predetermined condition corresponding to the activation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the activation instruction; and executing activation operation on third software based on second installation address information included in the third parameter information under the condition that the third parameter information meets the third preset condition, wherein the third software is software installed in an address corresponding to the second installation address information.
In an exemplary embodiment, the apparatus may be configured to determine whether the third parameter information satisfies a third predetermined condition after determining the third predetermined condition corresponding to the activation instruction; in a case that it is determined that the third parameter information satisfies the third predetermined condition, sending a ninth notification message to the target client, where the ninth notification message is used to notify the target client that the activation operation starts to be executed and a second time required for executing the activation operation, so as to instruct the target client to determine whether the activation operation is overtime based on the time when the target client receives the ninth notification message and the second time; sending a tenth notification message to the target client when it is determined that the third parameter information does not satisfy the third predetermined condition, wherein the tenth notification message is used for notifying the target client that the activation operation is terminated.
In an exemplary embodiment, the feedback module 46 may implement the feedback of the upgrade result of the upgrade operation to the target client by determining the execution result of the activation operation; if the execution result is that the execution of the activation operation is successful, sending an eleventh notification message to the target client, wherein the eleventh notification message is used for indicating that the execution of the activation operation is successful; and sending a twelfth notification message to the target client when the execution result is that the execution of the activation operation fails, wherein the twelfth notification message is used for indicating that the execution of the activation operation fails, and the twelfth notification message includes third cause information of the execution failure of the activation operation.
In an exemplary embodiment, the apparatus may be configured to receive a restart instruction sent by the target client after sending the eleventh notification message to the target client; and disconnecting the target session based on the restart instruction, and executing restart operation to complete the upgrade operation.
In one exemplary embodiment, the target session connection comprises a network configuration NETCONF session connection; the software upgrade instruction comprises a Remote Procedure Call (RPC) instruction with a preset format.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A method of upgrading software, comprising:
after determining that target session connection is established with a target client, receiving a software upgrading instruction sent by the target client based on the target session connection, wherein the software upgrading instruction comprises parameter information for upgrading target software;
performing an upgrade operation on the target software based on the software upgrade instruction;
and feeding back the upgrading result of the upgrading operation to the target client.
2. The method of claim 1, wherein performing an upgrade operation on target software based on the software upgrade instructions comprises:
analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and first parameter information included in the software upgrading instruction;
under the condition that the instruction type of the software upgrading instruction is determined to be a downloading instruction, determining a first preset condition corresponding to the downloading instruction;
under the condition that the first parameter information meets the first preset condition, establishing connection with a target server based on credential information included in the first parameter information;
executing a downloading operation in the target server based on first identification information included in the first parameter information to download first software corresponding to the target software;
and upgrading the target software based on the first software in the case of successful downloading.
3. The method of claim 2, wherein after determining the first predetermined condition corresponding to the download instruction, the method further comprises:
judging whether the first parameter information meets the first preset condition or not;
under the condition that the first parameter information is determined to meet the first preset condition, sending a first notification message to the target client, wherein the first notification message is used for notifying the target client that the downloading operation starts to be executed and a first time required for executing the downloading operation so as to indicate the target client to judge whether the downloading operation is overtime or not based on the time when the target client receives the first notification message and the first time;
and sending a second notification message to the target client under the condition that the first parameter information is determined not to meet the first preset condition, wherein the second notification message is used for notifying the target client that the downloading operation is terminated.
4. The method of claim 2, wherein feeding back the upgrade result of the upgrade operation to the target client comprises:
determining an execution result of the downloading operation;
sending a third notification message to the target client when the execution result is that the downloading operation is successfully executed, wherein the third notification message is used for indicating that the downloading operation is successfully executed;
and sending a fourth notification message to the target client when the execution result is that the execution of the downloading operation fails, wherein the fourth notification message is used for indicating that the execution of the downloading operation fails, and the fourth notification message comprises first reason information of the execution failure of the downloading operation.
5. The method of claim 1, wherein performing an upgrade operation on target software based on the software upgrade instructions comprises:
analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and second parameter information included in the software upgrading instruction;
determining a second predetermined condition corresponding to the installation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the installation instruction;
determining second software based on second identification information included in the second parameter information under the condition that the second parameter information meets the second preset condition, wherein the second software is software which is acquired in advance and corresponds to the target software;
and executing installation operation on the second software to upgrade the target software.
6. The method of claim 5, wherein performing an installation operation on the second software to upgrade the target software comprises:
determining first installation address information included in the second parameter information;
and executing the installation operation on the second software to install the second software into the address corresponding to the first installation address information.
7. The method of claim 5, wherein after determining a second predetermined condition corresponding to the installation instruction, the method further comprises:
judging whether the second parameter information meets the second preset condition or not;
under the condition that the second parameter information is determined to meet the second preset condition, sending a fifth notification message to the target client, wherein the fifth notification message is used for notifying the target client that the installation operation starts to be executed;
and sending a sixth notification message to the target client when the second parameter information is determined not to meet the second predetermined condition, wherein the sixth notification message is used for notifying the target client that the installation operation is terminated.
8. The method of claim 5, wherein feeding back the upgrade result of the upgrade operation to the target client comprises:
determining an execution result of the installation operation;
sending a seventh notification message to the target client when the execution result is that the installation operation is successfully executed, wherein the seventh notification message is used for indicating that the installation operation is successfully executed;
and sending an eighth notification message to the target client when the execution result is that the execution of the installation operation fails, wherein the eighth notification message is used for indicating that the execution of the installation operation fails, and the eighth notification message includes second reason information of the execution failure of the installation operation.
9. The method of claim 1, wherein performing an upgrade operation on target software based on the software upgrade instructions comprises:
analyzing the software upgrading instruction to acquire the instruction type of the software upgrading instruction and third parameter information included in the software upgrading instruction;
determining a third predetermined condition corresponding to the activation instruction under the condition that the instruction type of the software upgrading instruction is determined to be the activation instruction;
and executing activation operation on third software based on second installation address information included in the third parameter information under the condition that the third parameter information meets the third preset condition, wherein the third software is software installed in an address corresponding to the second installation address information.
10. The method of claim 9, wherein after determining a third predetermined condition corresponding to the activation instruction, the method further comprises:
judging whether the third parameter information meets the third preset condition or not;
in a case that it is determined that the third parameter information satisfies the third predetermined condition, sending a ninth notification message to the target client, where the ninth notification message is used to notify the target client that the activation operation starts to be executed and a second time required for executing the activation operation, so as to instruct the target client to determine whether the activation operation is overtime based on the time when the target client receives the ninth notification message and the second time;
sending a tenth notification message to the target client when it is determined that the third parameter information does not satisfy the third predetermined condition, wherein the tenth notification message is used for notifying the target client that the activation operation is terminated.
11. The method of claim 9, wherein feeding back the upgrade result of the upgrade operation to the target client comprises:
determining a result of execution of the activation operation;
if the execution result is that the execution of the activation operation is successful, sending an eleventh notification message to the target client, wherein the eleventh notification message is used for indicating that the execution of the activation operation is successful;
and sending a twelfth notification message to the target client when the execution result is that the execution of the activation operation fails, wherein the twelfth notification message is used for indicating that the execution of the activation operation fails, and the twelfth notification message includes third cause information of the execution failure of the activation operation.
12. The method of claim 11, wherein after sending an eleventh notification message to the target client, the method further comprises:
receiving a restart instruction sent by the target client;
and disconnecting the target session based on the restart instruction, and executing restart operation to complete the upgrade operation.
13. The method according to any one of claims 1 to 12,
the target session connection comprises a network configuration NETCONF session connection;
the software upgrade instruction comprises a Remote Procedure Call (RPC) instruction with a preset format.
14. A software upgrading apparatus, comprising:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a software upgrading instruction sent by a target client based on target session connection after the target session connection with the target client is determined, and the software upgrading instruction comprises parameter information for upgrading target software;
the upgrading module is used for executing upgrading operation on the target software based on the software upgrading instruction;
and the feedback module is used for feeding back the upgrading result of the upgrading operation to the target client.
15. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 13 when executed.
16. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 13.
CN202011355948.0A 2020-11-26 2020-11-26 Software upgrading method and device, storage medium and electronic device Pending CN112527346A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011355948.0A CN112527346A (en) 2020-11-26 2020-11-26 Software upgrading method and device, storage medium and electronic device
PCT/CN2021/091216 WO2022110645A1 (en) 2020-11-26 2021-04-29 Software upgrade method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011355948.0A CN112527346A (en) 2020-11-26 2020-11-26 Software upgrading method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN112527346A true CN112527346A (en) 2021-03-19

Family

ID=74994033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011355948.0A Pending CN112527346A (en) 2020-11-26 2020-11-26 Software upgrading method and device, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN112527346A (en)
WO (1) WO2022110645A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022110645A1 (en) * 2020-11-26 2022-06-02 三维通信股份有限公司 Software upgrade method and device, storage medium and electronic device
CN115291862A (en) * 2022-10-10 2022-11-04 深圳华锐分布式技术股份有限公司 Tool calling method, device, equipment and medium based on preset tool library

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184212A (en) * 2007-11-01 2008-05-21 中兴通讯股份有限公司 Method to update monitoring front end of video monitoring system
WO2013078951A1 (en) * 2011-12-01 2013-06-06 腾讯科技(深圳)有限公司 Method and system for upgrading software
CN107026753A (en) * 2017-02-15 2017-08-08 金钱猫科技股份有限公司 The method and system that software version distribution is downloaded in a kind of EPON
CN109144523A (en) * 2017-06-19 2019-01-04 中兴通讯股份有限公司 Software deployment management method and server, management client, normal client end
CN109388419A (en) * 2018-10-17 2019-02-26 阳光电源股份有限公司 A kind of photovoltaic plant equipment software upgrading system, method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527346A (en) * 2020-11-26 2021-03-19 三维通信股份有限公司 Software upgrading method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101184212A (en) * 2007-11-01 2008-05-21 中兴通讯股份有限公司 Method to update monitoring front end of video monitoring system
WO2013078951A1 (en) * 2011-12-01 2013-06-06 腾讯科技(深圳)有限公司 Method and system for upgrading software
CN107026753A (en) * 2017-02-15 2017-08-08 金钱猫科技股份有限公司 The method and system that software version distribution is downloaded in a kind of EPON
CN109144523A (en) * 2017-06-19 2019-01-04 中兴通讯股份有限公司 Software deployment management method and server, management client, normal client end
CN109388419A (en) * 2018-10-17 2019-02-26 阳光电源股份有限公司 A kind of photovoltaic plant equipment software upgrading system, method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022110645A1 (en) * 2020-11-26 2022-06-02 三维通信股份有限公司 Software upgrade method and device, storage medium and electronic device
CN115291862A (en) * 2022-10-10 2022-11-04 深圳华锐分布式技术股份有限公司 Tool calling method, device, equipment and medium based on preset tool library

Also Published As

Publication number Publication date
WO2022110645A1 (en) 2022-06-02

Similar Documents

Publication Publication Date Title
CN109451021B (en) Internet of things edge side multi-heterogeneous network access system and method
WO2015117527A1 (en) Upgrade method and device
US20140208307A1 (en) Method and System for Upgrading CPE Firmware
CN110912728B (en) Operating system patch batch automatic update management method and system
WO2022110645A1 (en) Software upgrade method and device, storage medium and electronic device
CN111901419B (en) Method, device and equipment for upgrading household appliance bottom plate
WO2011079615A1 (en) Method for network element version management and network system thereof
CN104811979A (en) Pressure testing method and device based on FOTA upgrading
CN103685530A (en) Automatic upgrade control method and system for WLAN current network APs
CN112737847B (en) Node upgrading method and device, storage medium and electronic device
CN111934956B (en) Equipment configuration method and device, storage medium and electronic device
CN112764803A (en) Version upgrading method and device, storage medium and electronic device
CN112733062A (en) Internet of things application management system and method
CN112423322A (en) Model information sending method, device, storage medium and electronic device
CN115357308A (en) Docker-based edge Internet of things proxy device, system and application method
CN114938329A (en) MQTT-based router gateway device management method and system
WO2017124741A1 (en) Method and device for synchronizing apparatus version
CN103491557B (en) The processing method and processing device of upgrading base station data
CN111988376B (en) Control program distribution updating method based on intelligent gateway edge calculation
CN112527344B (en) Collaborative updating method and device for distributed AI model and program
CN113986289A (en) Firmware upgrading method and device for edge computing gateway
CN113032054A (en) Service execution method, device, storage medium and electronic device
CN113204492A (en) Android application testing method and device
CN112203170A (en) Upgrading method, device, medium and equipment of optical network unit
CN114172832A (en) Internet of things testing method and device, central control equipment and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination