Plug-in upgrading method, plug-in upgrading device, plug-in upgrading system and terminal equipment

By loading the boot program in the plug-in, using the number of hot starts to determine communication with the server, and receiving and applying the target upgrade package, the online upgrade of the plug-in is realized, solving the problem of cumbersome cover removal operation in the existing technology, and improving the upgrade efficiency and success rate.

CN120335846APending Publication Date: 2025-07-18CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410065651.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, software upgrade of plug-ins requires a cover removal operation, which leads to cumbersome and time-consuming upgrade steps, and cannot be upgraded when an application fails.

Method used

By loading the boot program in the plug-in, reading the startup identifier and determining the number of hot starts, establishing a communication connection with the server based on the accumulated times, receiving and applying the target upgrade package, and realizing online upgrades.

Benefits of technology

Simplify the upgrade process without removing the cover product, improve the success rate and efficiency of the upgrade, and solve the upgrade difficulties caused by application failures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335846A_ABST
    Figure CN120335846A_ABST
Patent Text Reader

Abstract

The invention provides a plug-in upgrading method, device and system and terminal equipment, and the plug-in upgrading method is characterized in that a bootstrap program and an application program are loaded on a plug-in; the method comprises the following steps: starting a bootstrap program, reading a starting identifier from a plug-in, and judging the starting identifier; in response to the fact that the starting identification is hot starting, the number of times of hot starting is accumulated; determining that a bootstrap program or an application program in the plug-in establishes communication connection with a server based on the accumulated number of times of the hot start, so as to receive a target upgrade package sent by the server; and the bootstrap program in the plug-in upgrades the application program based on the target upgrade package. Determining that a bootstrap program in the plug-in calls an application program to establish communication connection with a server or the bootstrap program does not call the application program and directly establishes communication connection with the server on the basis of the accumulated number of times of hot start, so that the plug-in obtains a target upgrade package sent by the server; on-line upgrading of the application program is achieved under the condition that a cover of a product is not detached.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of energy storage in power systems, and particularly to a method, device, system, and terminal device for plug-in upgrade. Background Art

[0002] The energy storage valve control protection device adopts a multi-plug design. In order to enable the plug to implement new functions and solve problems encountered in applications, it is inevitable to upgrade the plug. Currently, when upgrading the software of the lower-level microcontroller unit (MCU) plug, the product needs to be disassembled and a simulator is used for upgrading. The upgrade steps are relatively cumbersome and time-consuming. Moreover, when the application program in the plug is in an infinite loop or the application program jump bootloader entry is damaged, the internal plug cannot be upgraded. Summary of the Invention

[0003] The main technical problem to be solved by the present invention is to provide a method, device, system, and terminal device for plug-in upgrade, which solves the problem that the product must be disassembled to upgrade the software in the plug in the prior art.

[0004] In a first aspect, the present application provides a method for plug-in upgrade. A bootloader and an application program are loaded on the plug. The method for plug-in upgrade includes:

[0005] Start the bootloader, read the startup flag from the plug and judge the startup flag;

[0006] In response to the startup flag being a warm start, accumulate the number of warm starts;

[0007] Based on the accumulated number of warm starts, determine that the bootloader or the application program in the plug establishes a communication connection with the server to receive the target upgrade package sent by the server;

[0008] The bootloader in the plug upgrades the application program based on the target upgrade package.

[0009] In the technical solution of the embodiment of the present application, when the startup flag in the plug is a warm start, the number of warm starts is counted and accumulated, and based on the accumulated number of warm starts, it is determined that the bootloader in the plug mobilizes the application program to establish a communication connection with the server, or the bootloader directly establishes a communication connection with the server without mobilizing the application program, so that the plug obtains the target upgrade package sent by the server, and the bootloader upgrades the application program based on the target upgrade package, thereby realizing the online upgrade of the application program without disassembling the product and simplifying the upgrade process.

[0010] In some embodiments, based on the cumulative number of warm boots, determining that the bootloader or application in the plugin establishes a communication connection with the server to receive the target upgrade package sent by the server includes:

[0011] In response to the cumulative number of warm boots reaching a preset number, the bootloader does not need to invoke the application, and the bootloader establishes a communication connection with the server;

[0012] The bootloader in the plugin receives the target upgrade package sent by the server.

[0013] In the technical solution of the embodiments of the present application, when the cumulative number of warm boots reaches the preset number, it indicates that the application has a fault. The bootloader does not need to start the application, and the bootloader can directly establish a communication connection with the server to receive the target upgrade package sent by the server, improving the situation where the application in the plugin has a fault and cannot be upgraded.

[0014] In some embodiments, the plugin upgrade method further includes:

[0015] In response to the startup flag being a cold boot, the bootloader invokes the application, and the application establishes a communication connection with the server;

[0016] Based on the cumulative number of warm boots, determining that the bootloader or application in the plugin establishes a communication connection with the server to receive the target upgrade package sent by the server includes:

[0017] In response to the cumulative number of warm boots not reaching the preset number, the bootloader invokes the application, and the application establishes a communication connection with the server;

[0018] The application queries the current running information of the application;

[0019] Based on the current running information of the application, determine the target upgrade package of the application.

[0020] In the technical solution of the embodiments of the present application, when the startup flag is a cold boot, the bootloader directly invokes the application to establish a communication connection with the server; when the cumulative number of warm boots does not reach the preset number, the bootloader invokes the application, and the application establishes a communication connection with the server, enabling the application to query the current running information, and then obtaining the target upgrade package of the application based on the current running information, facilitating the bootloader to upgrade the application of the plugin based on the target upgrade package, reducing the complexity of the upgrade, and improving the success rate of the upgrade.

[0021] In some embodiments, the current running information includes the current version number;

[0022] The application queries the current running information of the application, including:

[0023] The application programs of each plugin respectively send the feature information of the plugin to the server; the feature information includes the location information of the plugin.

[0024] The application programs of each plugin respectively receive the query instructions sent by the server, and query the current version number of the corresponding application program based on the query instructions.

[0025] The application program of the plugin sends the current version number of the application program to the server for the server to save.

[0026] In the technical solution of the embodiment of the present application, the application programs of each plugin send the feature information of the plugin to the server, so that the server can implement obtaining the current version numbers of the application programs in multiple plugins, which is convenient for subsequent upgrading of multiple plugins; at the same time, the number of plugins can also be adjusted.

[0027] In some embodiments, determining a target upgrade package for an application program based on the current running information of the application program includes:

[0028] Receiving an upgrade package sent by the server; the upgrade package includes files to be upgraded and a verification code; the upgrade package is an installation package obtained by the server according to the current version number of the application program after receiving the upgrade instruction sent by the client.

[0029] In response to the verification code being consistent with the preset information, taking the file to be upgraded as the target upgrade package of the application program.

[0030] The boot program in the plugin upgrades the application program based on the target upgrade package, including:

[0031] The boot program overwrites the application program based on the file to be upgraded to upgrade the application program.

[0032] In the technical solution of the embodiment of the present application, the plugin verifies the verification code in the upgrade package sent by the server to detect whether the file to be upgraded is correct, improving the success rate of the application program upgrade.

[0033] In some embodiments, after the step of the boot program in the plugin upgrading the application program based on the target upgrade package, it further includes:

[0034] The plugin queries the upgrade version number of the upgraded application program.

[0035] In response to not querying the upgrade version number of the application program, it indicates that the application program has fallen into an infinite loop.

[0036] Reset the plugin to start the boot program.

[0037] In the technical solution of the embodiment of the present application, by querying the upgrade version number of the application program, when the upgrade version number of the application program is not queried, it indicates that the upgrade of the application program fails, and the current application program falls into an infinite loop. The plug-in is reset to the bootloader, so that the plug-in can start the bootloader again to upgrade the application program.

[0038] In some embodiments, the current running information includes the current version number;

[0039] After the step of the bootloader in the plug-in upgrading the application program based on the target upgrade package, it further includes:

[0040] In response to querying the upgrade version number of the application program, compare the upgrade version number with the current version number;

[0041] In response to the upgrade version number corresponding to the application program being consistent with the current version number, it indicates that the entry for the application program to jump to the bootloader is damaged;

[0042] Reset the plug-in to the bootloader.

[0043] In the technical solution of the embodiment of the present application, by querying the upgrade version number of the application program in the plug-in and comparing the queried upgrade version number of the application program with the current version number before the upgrade, when the upgrade version number is consistent with the current version number, it indicates that the upgrade of the application program fails, and the entry for the application program to jump to the bootloader is damaged. The plug-in is reset to the bootloader, so that the plug-in can start the bootloader again to upgrade the application program.

[0044] In a second aspect, the present application provides a plug-in upgrade device. A bootloader and an application program are loaded on the plug-in; the plug-in upgrade device includes:

[0045] A start module, configured to start the bootloader, read the start flag from the plug-in and judge the start flag;

[0046] A counting module, configured to accumulate the number of warm starts in response to the start flag being a warm start;

[0047] An analysis module, configured to determine, based on the accumulated number of warm starts, that the bootloader or the application program in the plug-in establishes a communication connection with the server to receive the target upgrade package sent by the server;

[0048] An upgrade module, configured to upgrade the application program by the bootloader in the plug-in based on the target upgrade package.

[0049] In a third aspect, the present application provides a terminal device. A plug-in with an upgrade component is installed in the terminal device, and the upgrade component executes the steps in the above-mentioned plug-in upgrade method when upgrading the plug-in.

[0050] In a fourth aspect, the present application provides a plug-in upgrade system, including a server and the above-mentioned terminal device; the server is communicatively connected to the terminal device, and the server is configured to send a target upgrade package to the terminal device.

[0051] It can be understood that the beneficial effects of the above-mentioned second aspect to the fourth aspect can be referred to the relevant descriptions in the first aspect, and will not be elaborated here.

[0052] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the following specific embodiments of the present application are specifically exemplified. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0054] Figure 1 A flowchart of a plug-in upgrade method provided by an embodiment of the present application;

[0055] Figure 2 For Figure 1 A flowchart of a specific embodiment of step S3 in a provided plug-in upgrade method;

[0056] Figure 3 A framework diagram of an embodiment of a plug-in upgrade device provided by the present invention;

[0057] Figure 4 A framework diagram of an embodiment of a plug-in upgrade system provided by the present invention;

[0058] Figure 5 A framework diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0059] The embodiments of the technical solution of the present application will be described in detail below with reference to the drawings. The following embodiments are only used to illustrate the technical solution of the present application more clearly, and therefore are only examples and cannot be used to limit the protection scope of the present application.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs; the terms used herein are for the purpose of describing specific embodiments only and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.

[0061] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "a plurality of" is more than two, unless otherwise specifically defined.

[0062] Reference to "embodiment" herein means that a particular feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase does not necessarily refer to the same embodiment at every occurrence in the specification, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0063] In the description of the embodiments of this application, the term "and / or" is merely a description of the associated relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " herein generally represents an "or" relationship between the associated objects before and after.

[0064] In the description of the embodiments of this application, the term "a plurality of" means more than two (including two). Similarly, "a plurality of groups" means more than two groups (including two groups), and "a plurality of pieces" means more than two pieces (including two pieces).

[0065] In the description of the embodiments of this application, the orientation or positional relationship indicated by technical terms such as "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the embodiments of this application and simplifying the description, rather than indicating or implying that the indicated device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of this application.

[0066] In the description of the embodiments of the present application, unless otherwise clearly defined and limited, technical terms such as "installation", "connection", "connection", "fixation" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated into one; it can also be a mechanical connection or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific situations.

[0067] In this embodiment, the plug-in refers to a Microcontroller Unit (MCU), also known as a Single Chip Microcomputer or a microcontroller. It appropriately reduces the frequency and specifications of the Central Processing Unit (CPU), and integrates peripherals such as memory, timer, USB, A / D conversion, UART, PLC, DMA, and even the LCD driver circuit on a single chip to form a chip-level computer for different combinations of control in different application scenarios.

[0068] The energy storage valve control protection device adopts a multi-plug-in design. With the continuous change of requirements, the functions of the plug-ins need to be continuously updated and upgraded to meet the requirements in applications. Since the plug-ins are set inside the product, when upgrading the plug-ins, it is necessary to remove the cover of the product, update the boot program in the plug-ins through an emulator, and then upgrade the application programs on the plug-ins. The upgrade steps are cumbersome and time-consuming.

[0069] This embodiment provides a method for upgrading a plug-in, where a boot program and an application program are loaded on the plug-in. The method for upgrading the plug-in includes the following steps.

[0070] Please refer to Figure 1 , Figure 1 which is a schematic flow chart of the method for upgrading a plug-in provided by an embodiment of the present application.

[0071] S1: Start the boot program, read the start flag from the plug-in and judge the start flag.

[0072] S2: In response to the start flag being a warm start, accumulate the number of warm starts.

[0073] S3: Based on the accumulated number of warm starts, determine that the boot program or the application program in the plug-in establishes a communication connection with the server to receive the target upgrade package sent by the server.

[0074] S4: The boot program in the plug-in upgrades the application program based on the target upgrade package.

[0075] In the technical solution of the embodiment of the present application, when the startup identifier in the plugin is a hot startup, the number of hot startups is counted and accumulated, and based on the accumulated number of hot startups, it is determined that the bootstrap program in the plugin mobilizes the application to establish a communication connection with the server, or the bootstrap program directly establishes a communication connection with the server without mobilizing the application, so that the plugin obtains the target upgrade package sent by the server, and the bootstrap program upgrades the application based on the target upgrade package, thereby realizing the upgrade of the application without opening the cover of the product and without updating the bootstrap program, and simplifying the upgrade process.

[0076] In some embodiments, the step of reading the startup identifier from the plugin and judging the startup identifier in S1 specifically includes the following implementation manners.

[0077] By starting the bootstrap program in the plugin, each time the bootstrap program in the plugin is started, there is a corresponding hot startup variable in the plugin. Among them, the hot startup variable is the startup identifier stored in the plugin. Starting the plugin in the shutdown state is called a cold startup; starting the plugin when it is powered on is called a hot startup.

[0078] When the hot startup variable corresponding to the current startup of the bootstrap program in the plugin is the set value, it is determined that the startup identifier corresponding to the current startup is a hot startup; when the hot startup variable corresponding to the current startup of the bootstrap program in the plugin is inconsistent with the set value, it is determined that the startup identifier corresponding to the current startup is a cold startup.

[0079] When the startup identifier of the current startup of the bootstrap program is a hot startup, add 1 to the count of hot startups to accumulate the number of hot startups.

[0080] In one embodiment, the plugin upgrade method further includes: in response to the startup identifier being a cold startup, the bootstrap program mobilizes the application, and the application establishes a communication connection with the server.

[0081] Specifically, when the startup identifier of the current startup of the bootstrap program is a cold startup, the hot startup variable corresponding to the current startup is reset so that the hot startup variable corresponding to the current startup is the set value.

[0082] When a failure occurs in the application in the plugin itself or a communication failure occurs between the plugin and other ports, the application cannot be upgraded. In this embodiment, by accumulating the above-mentioned accumulated hot startup times, the application can be directly updated online after a preset number of times.

[0083] In some embodiments, the step of determining to receive the target upgrade package sent by the server in S3 specifically includes the following implementation manners.

[0084] In a specific embodiment, in response to the cumulative number of warm boots reaching a preset number, the bootloader does not need to start the application. The current application has a fault and the target upgrade package cannot be obtained through the application. The bootloader establishes a communication connection with the server so that the bootloader in the plugin can receive the target upgrade package sent by the server.

[0085] In the technical solution of the embodiment of the present application, when the cumulative number of warm boots reaches the preset number, it indicates that the application has a fault. The bootloader does not need to start the application. The bootloader can directly establish a communication connection with the server and receive the target upgrade package sent by the server, improving the situation where the application in the plugin has a fault and the application cannot be upgraded.

[0086] In a specific embodiment, the specific steps of obtaining the target upgrade package through the application are as follows.

[0087] Please refer to Figure 2 , Figure 2 For Figure 1 a schematic flowchart of a specific embodiment of step S3 in a plugin upgrade method provided.

[0088] S31: In response to the cumulative number of warm boots not reaching the preset number, the bootloader starts the application, and the application establishes a communication connection with the server.

[0089] S32: The application queries the current running information of the application.

[0090] Specifically, after the application establishes a communication connection with the server, the applications of each plugin respectively actively send the feature information of the plugin to the server; the feature information includes the location information and type of the plugin, and the type of the plugin can include an interface board, an open circuit board, etc. The server saves the feature information of each plugin respectively. Among them, the location information of the plugin is the slot set for the plugin.

[0091] The server receives the feature information sent by each plugin, and the server sends a query instruction to each plugin. Among them, the query instruction is to query the current version number of the application in the plugin.

[0092] The applications of each plugin respectively receive the query instruction sent by the server, and query the current version number of the corresponding application based on the query instruction; the application of the plugin sends the current version number of the application to the server, and the server receives the current version numbers sent by each plugin and saves them so that the server can associate the feature information of the plugin with the current version number of the application.

[0093] In the technical solution of the embodiment of the present application, the application programs of each plugin send the characteristic information of the plugin to the server, so that the server can implement obtaining the current version numbers of the application programs in multiple plugins, which is convenient for subsequent upgrading of multiple plugins; at the same time, the number of plugins can also be adjusted.

[0094] When the client needs to query the characteristic information of each plugin and / or the current version number of the application program corresponding to the plugin, it can send a query request to the server. After receiving the query request, the server displays the characteristic information of each plugin and the current version number of the application program corresponding to the plugin to the user.

[0095] The user selects the upgrade package corresponding to the plugin according to the displayed characteristic information of the plugin and the current version number of the application program. The upgrade package is sent to the server through the client so that the server can save the upgrade package. The upgrade package includes the file to be upgraded and the verification code. After receiving the upgrade package, the server verifies the file to be upgraded in the upgrade package based on the verification code.

[0096] When the verification code is consistent with the preset verification code, the file to be upgraded is correct, and the file to be upgraded is saved to the area to be upgraded of the server. When the verification code is consistent with the preset verification code, the file to be upgraded is incorrect. The verification result obtained by the server is sent to the client. Among them, the preset verification code is pre-stored in the server. By setting the preset verification code, the security of data transmission can be improved and the problem of misoperation can be improved.

[0097] When the client detects that the current version number corresponding to the plugin is inconsistent with the version number corresponding to the file to be upgraded, the client sends an upgrade instruction to the server. After receiving the upgrade instruction sent by the client, the server generates an upgrade package based on the file to be upgraded and the check code and sends it to the corresponding plugin. The client in this embodiment can be a display panel with a communication function. The user side can remotely update or send the file to be upgraded to the server. The server can send the upgrade package to the application program in the plugin according to the preset time. So as to facilitate the maintenance personnel to control the upgrade time of the plugin.

[0098] S33: Determine the target upgrade package of the application program based on the current running information of the application program.

[0099] Specifically, the application program within the plugin receives the upgrade package sent by the server. The upgrade package includes the file to be upgraded and the verification code; the upgrade package is the installation package obtained by the server according to the current version number of the application program after receiving the upgrade instruction sent by the client; in response to the verification code being consistent with the preset information, the file to be upgraded is used as the target upgrade package of the application program, and the verification result is sent to the server for storage. In response to the verification code being inconsistent with the preset information, the file to be upgraded is incorrect, and the verification result is sent to the server, and the server sends the verification result to the client. Among them, the preset information is pre-stored in each plugin. By setting the preset information, the security of data transmission can be improved and the problem of misoperation can be alleviated.

[0100] In the technical solution of the embodiment of the present application, when the startup flag is a cold startup, the bootstrap program directly invokes the application program to establish a communication connection with the server; when the cumulative number of hot startups does not reach the preset number, the bootstrap program invokes the application program, and the application program establishes a communication connection with the server, enabling the application program to query the current running information, and then obtaining the target upgrade package of the application program based on the current running information, which facilitates the bootstrap program to upgrade the application program of the plugin based on the target upgrade package, reduces the complexity of the upgrade, and improves the success rate of the upgrade.

[0101] In some embodiments, the steps of upgrading the application program in S4 specifically include the following implementation manners.

[0102] Specifically, the bootstrap program upgrades the application program by overwriting the application program with the file to be upgraded.

[0103] In the technical solution of the embodiment of the present application, the plugin verifies the verification code in the upgrade package sent by the server to detect whether the file to be upgraded is correct, which improves the success rate of the application program upgrade.

[0104] In some embodiments, after the step of the bootstrap program in the plugin upgrading the application program based on the target upgrade package, it further includes: the plugin queries the upgrade version number of the upgraded application program; in response to the upgrade version number of the application program not being queried, it indicates that the application program has fallen into an infinite loop; the plugin is reset to the startup bootstrap program.

[0105] In the technical solution of the embodiment of the present application, by querying the upgrade version number of the application program, when the upgrade version number of the application program is not queried, it indicates that the upgrade of the application program has failed, and the current application program has fallen into an infinite loop, and the plugin is reset to the startup bootstrap program, so as to facilitate the plugin to start the bootstrap program again to upgrade the application program.

[0106] In some embodiments, after the step of upgrading the application program by the bootstrap program in the plugin based on the target upgrade package, the following steps are further included: in response to querying the upgrade version number of the application program, comparing the upgrade version number with the current version number; in response to the upgrade version number corresponding to the application program being consistent with the current version number, it indicates that the entry for the application program to jump to the bootstrap program is damaged; resetting the plugin to start the bootstrap program. Wherein, the current version number is the version number of the application program before the upgrade.

[0107] In the technical solution of the embodiment of the present application, by querying the upgrade version number of the application program in the plugin and comparing the queried upgrade version number of the application program with the current version number before the upgrade, when the upgrade version number is consistent with the current version number, it indicates that the upgrade of the application program fails, the entry for the application program to jump to the bootstrap program is damaged, and the plugin is reset to start the bootstrap program, so as to facilitate the plugin to start the bootstrap program again to upgrade the application program.

[0108] Through the above real-time method, when a failure occurs in the application program in the plugin, it can be reset by an external watchdog so that the plugin starts the bootstrap program again to upgrade the application program.

[0109] Based on the above Figure 1 and Figure 2 corresponding to the plugin upgrade method described in the embodiment, the following is an embodiment of the device of the present disclosure, which can be used to execute the method embodiment of the present disclosure.

[0110] Please refer to the attached Figure 3 , Figure 3 which is a schematic framework diagram of an embodiment of the plugin upgrade device provided by the present invention.

[0111] This embodiment provides a plugin upgrade device 60, on which a bootstrap program and an application program are loaded; the plugin upgrade device 60 includes a start module 61, a counting module 62, an analysis module 63, and an upgrade module 64.

[0112] The start module 61 is used to start the bootstrap program, read the start flag from the plugin and judge the start flag.

[0113] The counting module 62 is used to accumulate the number of warm starts in response to the start flag being a warm start.

[0114] The analysis module 63 is used to determine that the bootstrap program or the application program in the plugin establishes a communication connection with the server based on the accumulated number of warm starts, so as to receive the target upgrade package sent by the server.

[0115] The upgrade module 64 is used to upgrade the application program by the bootstrap program in the plugin based on the target upgrade package.

[0116] In the technical solution of the embodiment of the present application, when the start flag in the plug-in is a warm start, the number of warm starts is counted and accumulated, and based on the accumulated number of warm starts, it is determined that the bootstrap program in the plug-in either invokes the application program to establish a communication connection with the server, or the bootstrap program directly establishes a communication connection with the server without invoking the application program, so that the plug-in obtains the target upgrade package sent by the server, and the bootstrap program upgrades the application program based on the target upgrade package, thereby realizing the online upgrade of the application program without opening the cover of the product and simplifying the upgrade process.

[0117] This embodiment provides a terminal device, in which a plug-in with an upgrade component is installed, and the upgrade component executes the plug-in upgrade method in the first aspect when upgrading the plug-in.

[0118] Please refer to the attached Figure 4 , Figure 4 which is a schematic framework diagram of an embodiment of the plug-in upgrade system provided by the present invention.

[0119] The plug-in upgrade system 70 in the embodiment of the present disclosure may include a server 71 and a terminal device 72. Among them, a plug-in 721 is installed in the terminal device, and an upgrade component 7211 is included in the plug-in 721. The server 71 is used to send a connection request to the terminal device when detecting an upgrade package, and the upgrade component executes the plug-in upgrade method in the first aspect when upgrading the plug-in. The upgrade component 7211 in this embodiment is the application program in the above embodiment.

[0120] After considering the specification and practicing the disclosure herein, those skilled in the art will readily think of other embodiments of the present disclosure. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.

[0121] In some embodiments, the functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the method embodiments above. The specific implementation can refer to the description of the method embodiments above. For the sake of brevity, it will not be repeated here.

[0122] The descriptions of the above embodiments tend to emphasize the differences between the embodiments. The same or similar parts can be referred to each other. For the sake of brevity, they will not be repeated in this article.

[0123] Please refer to Figure 5 , Figure 5 which is a schematic framework diagram of an embodiment of the computer-readable storage medium provided by the present invention.

[0124] The computer-readable storage medium 90 stores program instructions 901 that can be run by a processor. The program instructions 901 are used to implement the steps of any of the above-described method embodiments for plugin upgrade.

[0125] The above solution provides a method for plugin upgrade. A bootstrap program and an application program are loaded on the plugin. The method for plugin upgrade includes: starting the bootstrap program, reading a startup identifier from the plugin and judging the startup identifier; in response to the startup identifier being a warm start, accumulating the number of warm starts; based on the accumulated number of warm starts, determining that the bootstrap program or the application program in the plugin establishes a communication connection with the server to receive a target upgrade package sent by the server; and the bootstrap program in the plugin upgrades the application program based on the target upgrade package.

[0126] In some embodiments, the functions or modules included in the device provided by the present disclosure can be used to execute the methods described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be elaborated here.

[0127] The descriptions of the above embodiments tend to emphasize the differences between the embodiments. The same or similar parts can be referred to each other. For the sake of brevity, they will not be elaborated in this article.

[0128] In several embodiments provided by the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.

[0129] In addition, each functional unit in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0130] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0131] Finally, it should be noted that: The above embodiments are only used to illustrate the technical solutions of this application, not to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: They can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the various embodiments of this application, and they should all be covered by the scope of the claims and the description of this application. In particular, as long as there is no structural conflict, the technical features mentioned in each embodiment can be combined in any way. This application is not limited to the specific embodiments disclosed in the text, but includes all technical solutions that fall within the scope of the claims.

Claims

1. A method for plug-in upgrade, characterized in that, A bootstrap program and an application program are loaded on the plug-in; the plug-in upgrade method includes: Start the bootstrap program, read the startup identifier from the plug-in and judge the startup identifier; In response to the startup identifier being a warm start, accumulate the number of warm starts; Based on the accumulated number of warm starts, determine that the bootstrap program or the application program in the plug-in establishes a communication connection with the server to receive the target upgrade package sent by the server; The bootstrap program in the plug-in upgrades the application program based on the target upgrade package.

2. The plug-in upgrade method according to claim 1, wherein The determining that the bootstrap program or the application program in the plug-in establishes a communication connection with the server to receive the target upgrade package sent by the server based on the accumulated number of warm starts includes: In response to the accumulated number of warm starts reaching a preset number, the bootstrap program does not need to invoke the application program, and the bootstrap program establishes a communication connection with the server; The bootstrap program in the plug-in receives the target upgrade package sent by the server.

3. The plug-in upgrade method according to claim 1, wherein The plug-in upgrade method further includes: In response to the startup identifier being a cold start, the bootstrap program invokes the application program, and the application program establishes a communication connection with the server; The determining that the bootstrap program or the application program in the plug-in establishes a communication connection with the server to receive the target upgrade package sent by the server based on the accumulated number of warm starts includes: In response to the accumulated number of warm starts not reaching the preset number, the bootstrap program invokes the application program, and the application program establishes a communication connection with the server; Query the current running information of the application program; Based on the current running information of the application program, determine the target upgrade package of the application program.

4. The plug-in upgrade method according to claim 3, wherein The current running information includes the current version number; The querying the current running information of the application program includes: The application programs of the respective plug-ins respectively send the characteristic information of the plug-ins to the server; the characteristic information includes the location information of the plug-ins; The application programs of the respective plug-ins respectively receive the query instructions sent by the server, and query the current version number of the corresponding application program based on the query instructions; The application program of the plug-in sends the current version number of the application program to the server for the server to save.

5. The plug-in upgrade method according to claim 3, wherein The determining the target upgrade package of the application program based on the current running information of the application program includes: Receive the upgrade package sent by the server; the upgrade package includes the file to be upgraded and the verification code; the upgrade package is the installation package obtained by the server according to the current version number of the application program after receiving the upgrade instruction sent by the client; In response to the verification code being consistent with the preset information, use the file to be upgraded as the target upgrade package of the application program; The upgrading of the application program by the bootstrap program in the plug-in based on the target upgrade package includes: The bootstrap program overwrites the application program based on the file to be upgraded to upgrade the application program.

6. The plug-in upgrade method according to any one of claims 1 to 5, characterized in that After the step of the bootstrap program in the plug-in upgrading the application program based on the target upgrade package, the method further includes: The plug-in queries the upgrade version number of the upgraded application program; In response to the failure to query the upgrade version number of the application program, it indicates that the application program has fallen into an infinite loop; Reset the plug-in to start the bootstrap program.

7. The plug-in upgrade method according to claim 6, characterized in that After the step of the bootstrap program in the plug-in upgrading the application program based on the target upgrade package, the method further includes: In response to querying the upgrade version number of the application program, compare the upgrade version number with the current version number; In response to the upgrade version number corresponding to the application program being the same as the current version number, it indicates that the jump to the entry of the bootstrap program of the application program is damaged; Reset the plug-in to start the bootstrap program.

8. A plug-in upgrade device, characterized in that, A bootstrap program and an application program are loaded on the plug-in; The plug-in upgrade device includes: A start module, configured to start the bootstrap program, read a start identifier from the plug-in and judge the start identifier; A counting module, configured to accumulate the number of warm boots in response to the start identifier being a warm boot; An analysis module, configured to determine, based on the accumulated number of warm boots, that the bootstrap program or the application program in the plug-in establishes a communication connection with the server to receive a target upgrade package sent by the server; An upgrade module, configured to upgrade the application program by the bootstrap program in the plug-in based on the target upgrade package.

9. A terminal device, characterized in that, A plug-in with an upgrade component is installed in the terminal device, and the upgrade component executes the steps in the plug-in upgrade method according to any one of claims 1 to 7 when upgrading the plug-in.

10. A plug-in upgrade system, characterized in that, It includes a server and the terminal device according to claim 9; the server is communicatively connected to the terminal device, and the server is configured to send a target upgrade package to the terminal device.