CN107291481B - Component updating method, device and system - Google Patents

Component updating method, device and system Download PDF

Info

Publication number
CN107291481B
CN107291481B CN201610190155.5A CN201610190155A CN107291481B CN 107291481 B CN107291481 B CN 107291481B CN 201610190155 A CN201610190155 A CN 201610190155A CN 107291481 B CN107291481 B CN 107291481B
Authority
CN
China
Prior art keywords
component
updated
updating
update
server
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.)
Active
Application number
CN201610190155.5A
Other languages
Chinese (zh)
Other versions
CN107291481A (en
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.)
Shenzhen Yayue Technology Co ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610190155.5A priority Critical patent/CN107291481B/en
Publication of CN107291481A publication Critical patent/CN107291481A/en
Application granted granted Critical
Publication of CN107291481B publication Critical patent/CN107291481B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a component updating method, a device and a system, wherein the method comprises the steps of obtaining a preset updating thread corresponding to a local component to be updated; determining version information of the component to be updated based on the preset updating thread; sending an updating request to a server, wherein the updating request carries the version information; and when the server determines that the component to be updated needs to be updated according to the update request, downloading the update file from the server, and updating the component to be updated according to the update file. In the embodiment of the invention, the corresponding updating thread is started inside the component to be updated, and version information comparison, updating file downloading and the like are carried out on the basis of the updating process and the server, so that the updating of the component can be automatically loaded and completed, and compared with a mode of updating the component by means of an external updating process, the timeliness of updating the component is improved, and meanwhile, the bandwidth consumption is reduced.

Description

Component updating method, device and system
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a component updating method, device and system.
Background
COM component (COM component) is a new software development technology developed by microsoft corporation for software production in computer industry to better conform to human behavior; with the rapid development of internet technology, under the COM framework, people can develop various COM components (hereinafter referred to as components) with specific functions, and then combine them as required to form a complex application system.
To facilitate upgrading and customization of the system, components in the system may be replaced with new components, a process commonly referred to as "component update"; in the current component updating process, firstly, a process loaded with a component to be updated needs to be closed, then, an upgrading process is started, the latest version of the component is downloaded from a server through the upgrading process, finally, the latest version is used for replacing a local old version, and then, the closed process is started, so that the component updating is completed.
During the research and practice process of the prior art, the inventor of the present invention found that, because the update of the component needs to be completed by means of the upgrade process in the prior art, the problem of untimely update of the component and large bandwidth consumption is caused.
Disclosure of Invention
The invention aims to provide a component updating method, a device and a system, aiming at improving the timeliness of component updating and reducing bandwidth consumption.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
a component upgrade method, comprising:
acquiring a corresponding preset updating thread started inside a local component to be updated;
determining version information of the component to be updated based on the preset updating thread, wherein the determining comprises the following steps: acquiring a corresponding preset time interval according to the preset updating thread, and determining the version information of the component to be updated according to the preset time interval, wherein the preset updating thread is provided with a timer, and when the timer is triggered at preset time intervals, the local version information of the component to be updated is determined;
sending an updating request to a server, wherein the updating request carries the version information;
when the server determines that the component to be updated needs to be updated according to the updating request, downloading an updating file from the server;
naming the updated file as first identification information, and naming the component to be updated as second identification information;
updating the component to be updated according to the update file, including:
copying the updated file to the directory where the component to be updated is located to generate a new version component;
after the process of the new version component is restarted, loading the new version component;
when the new version component is determined to be loaded completely, determining the new version component as an updated component to be updated;
after the new version component is generated, the method further comprises the following steps:
and naming the new version component according to the first identification information and the second identification information.
In order to solve the above technical problems, embodiments of the present invention further provide the following technical solutions:
a component upgrade apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring a corresponding preset updating thread started inside a local component to be updated;
the determining unit is used for determining the version information of the component to be updated based on the preset updating thread;
a sending unit, configured to send an update request to a server, where the update request carries the version information;
the downloading unit is used for downloading the update file from the server when the server determines that the component to be updated needs to be updated according to the update request;
the updating unit is used for updating the component to be updated according to the updating file;
the determination unit includes:
the obtaining subunit is used for obtaining a corresponding preset time interval according to the preset updating thread;
the determining subunit is configured to determine version information of the component to be updated according to the preset time interval;
the update unit includes:
the generating subunit is used for copying the updated file to the directory where the component to be updated is located, and generating a new version component;
the loading subunit is used for loading the new version component after the process of the new version component is restarted;
the update determining subunit is used for determining the new version component as an updated component to be updated after the new version component is determined to be loaded;
the device further comprises:
and the naming unit is used for naming the updated file as first identification information, naming the component to be updated as second identification information, and naming the new version component according to the first identification information and the second identification information after the new version component is generated by the generation subunit.
In order to solve the above technical problems, embodiments of the present invention further provide the following technical solutions:
the component updating system comprises a server and the component updating device;
the server is used for receiving an update request sent by the component updating device, wherein the update request carries version information of a component to be updated, and sending notification information to the component updating device when the component to be updated is determined to need updating according to the version information, so that the component updating device updates the component to be updated.
In order to solve the above technical problems, embodiments of the present invention further provide the following technical solutions:
an electronic device comprising a processor and a memory, the memory being configured to store program code, the processor being configured to execute the program code when the electronic device is running, to perform the above component updating method.
In order to solve the above technical problems, embodiments of the present invention further provide the following technical solutions:
a computer-readable storage medium storing a computer program for causing a computer to execute the above-described component updating method.
Compared with the prior art, the method and the device for updating the version information of the component to be updated have the advantages that firstly, the preset updating thread corresponding to the local component to be updated is obtained, and then the version information of the component to be updated is determined based on the preset updating thread; and then, sending an updating request carrying the version information to the server, downloading an updating file when the server determines that the component to be updated needs to be updated according to the updating request, and updating the component to be updated according to the updating file. In the embodiment of the invention, the corresponding updating thread is started inside the component to be updated, and version information comparison, updating file downloading and the like are carried out on the basis of the updating process and the server, so that the updating of the component can be automatically loaded and completed, and compared with a mode of updating the component by means of an external updating process, the timeliness of updating the component is improved, and meanwhile, the bandwidth consumption is reduced.
Drawings
The technical solution and other advantages of the present invention will become apparent from the following detailed description of specific embodiments of the present invention, which is to be read in connection with the accompanying drawings.
FIG. 1a is a schematic diagram of a scenario of a component update system according to an embodiment of the present invention;
FIG. 1b is a flowchart illustrating a component update method according to a first embodiment of the present invention;
FIG. 2 is a flowchart illustrating a component update method according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a component updating apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a component update system according to a fifth embodiment of the present invention.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present invention are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present invention are described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the invention have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, but on the contrary, it is to be understood that various steps and operations described hereinafter may be implemented in hardware.
The term "module" as used herein may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein are preferably implemented in software, but may also be implemented in hardware, and are within the scope of the present invention.
The embodiment of the invention provides a component updating method, a device and a system.
Referring to fig. 1a, which is a schematic view of a scenario of a component update system according to an embodiment of the present invention, the component update system may include a component update apparatus and a server, where the component update apparatus may be specifically integrated on a terminal (e.g., a mobile phone or a tablet computer), and is mainly configured to: acquiring a preset updating thread corresponding to a local component to be updated, then determining version information of the component to be updated based on the preset updating thread, namely starting a corresponding updating thread in the component to be updated, and updating the component based on the updating thread; then, sending an updating request to a server, wherein the updating request carries the version information of the component to be updated; and when the server determines that the component to be updated needs to be updated according to the update request, downloading the update file from the server, updating the component to be updated according to the update file, and the like.
In addition, the server in the component updating system is mainly used for: receiving an update request sent by the component updating device, wherein the update request carries local version information of a component to be updated; and when the server determines that the component to be updated needs to be updated according to the version information, sending notification information to the component updating device, so that the component updating device updates the component to be updated in time according to the notification information.
The details will be described below separately.
First embodiment
In the present embodiment, the component updating apparatus will be described in terms of a component updating apparatus, which may be integrated on a terminal, such as a mobile phone, a tablet computer, or a terminal with a memory unit and a microprocessor installed therein to have a computing capability.
A component upgrade method, comprising: acquiring a preset updating thread corresponding to a local component to be updated; determining version information of the component to be updated based on the preset updating thread; sending an updating request to a server, wherein the updating request carries the version information; and when the server determines that the component to be updated needs to be updated according to the update request, downloading the update file from the server, and updating the component to be updated according to the update file.
Referring to fig. 1b, fig. 1b is a schematic flow chart illustrating an element updating method according to a first embodiment of the present invention. The method comprises the following steps:
in step S101, a preset update thread corresponding to a local component to be updated is obtained.
In step S102, based on the preset update thread, version information of the component to be updated is determined.
The steps S101 and S102 may specifically be:
for example, an update thread is preset in each component, and when it is determined that a component needs to be updated, the component starts its corresponding update thread, and updates the component based on the update thread.
It is understood that in the present embodiment, a thread is also referred to as a lightweight process (light process), which refers to a scheduling unit of a running program in the computer field. Threads are entities in a process, a process may have multiple threads, and a thread must have a parent process. The thread does not have system resources and only has a plurality of data structures necessary for operation; it shares all the resources owned by the process with the other threads of the parent process. Threads can be created and retired to enable concurrent execution of programs. Generally, a thread has three basic states of ready, blocked, and running.
Further, based on the preset update thread, determining version information of the component to be updated may include:
step 1, acquiring a corresponding preset time interval according to the preset updating thread.
And 2, determining the version information of the component to be updated according to the preset time interval.
For example, the preset update thread sets a timer, triggers every preset time interval (e.g., 20 minutes or 30 minutes, etc.), and determines the version information of the component to be updated locally when the timer triggers.
In step S103, an update request is sent to the server, where the update request carries the version information.
In step S104, when the server determines that the component to be updated needs to be updated according to the update request, the update file is downloaded from the server, and the component to be updated is updated according to the update file.
The steps S103 and S104 may specifically be:
it can be understood that after determining the version information of the component to be updated in the local area, an update request carrying the version information is sent to the server, so that whether the component to be updated needs to be updated can be determined according to the version information.
For example, after receiving the update request, the server first obtains the latest version information of the component to be updated, compares the latest version information with the local version information of the component to be updated, and if the latest version information is not consistent with the local version information of the component to be updated, it may be determined that the component to be updated needs to be updated.
Further, when the server determines that the component to be updated needs to be updated, notification information is sent, where the notification information indicates that the component to be updated needs to be updated, and further, downloading the update file from the server may specifically include:
step a, receiving notification information which is sent by a server and indicates that updating is needed;
and b, downloading the update file from the server according to the notification information.
For example, according to the indication of the notification information, searching a corresponding update file from the server; the update file may be an update file corresponding to the whole component with the latest version information, or may be an update file corresponding to a part of the component that needs to be updated, and is not limited specifically here.
In this embodiment, there may be many ways to update the component to be updated according to the update file, for example, the ways may include:
step A, copying the updated file to a directory where the component to be updated is located, and generating a new version component;
step B, loading the new version component after the process of the new version component is restarted;
and step C, after the new version component is determined to be loaded completely, determining the new version component as the updated component to be updated.
That is, after the update file is copied to the directory where the component to be updated is located, and the new version component is generated, the process where the new version component is located (e.g., the terminal application where the new version component is located) needs to be restarted, and the new version component is loaded.
Further, in a preferable mode, before the updated file is copied to the directory where the component to be updated is located (in step a), the file and the component may be named, for example:
the updated file is named as first identification information, and the component to be updated is named as second identification information.
Based on this, after the new version component is generated (in step a), the method may further include: and naming the new version component according to the first identification information and the second identification information.
Specifically, for example, the updated file may be named as "a.new", and the component to be updated may be named as "a.old", so that the new version component may be named as "a.a", so as to quickly find the corresponding file/component according to the naming information, and facilitate the updating of the component.
As can be seen from the above, in the component updating method provided in the embodiment of the present invention, first, a preset updating thread corresponding to a local component to be updated is obtained, and then based on the preset updating thread, version information of the component to be updated is determined; and then, sending an updating request carrying the version information to the server, downloading an updating file when the server determines that the component to be updated needs to be updated according to the updating request, and updating the component to be updated according to the updating file. In the embodiment of the invention, the corresponding updating thread is started inside the component to be updated, and version information comparison, updating file downloading and the like are carried out on the basis of the updating process and the server, so that the updating of the component can be automatically loaded and completed, and compared with a mode of updating the component by means of an external updating process, the timeliness of updating the component is improved, and meanwhile, the bandwidth consumption is reduced.
Second embodiment
The method according to the first embodiment will be described in further detail below by way of example.
Firstly, a component updating device is arranged, the device for updating the component can be integrated on a terminal, secondly, a server is arranged, the server is used for determining whether the component on the terminal needs to be updated or not, and notification information is generated when the component needs to be updated so as to remind the component updating device of updating the component in time. As will be described in detail below.
Referring to fig. 2, fig. 2 is a flowchart illustrating an assembly updating method according to a second embodiment of the present invention.
The method comprises the following steps:
in step S201, the terminal control component starts a corresponding update thread.
In step S202, the terminal acquires version a of the component at the update interval indicated by the update thread.
The steps S201 and S202 may specifically be:
for example, each component is internally provided with its own update thread, wherein the update thread is provided with a timer and is triggered at a set update interval, such as once every 20 minutes or 30 minutes, and the like; when the timer triggers, i.e. the update interval arrives, the terminal acquires the local version of the component.
Further, for example, the terminal obtains a version of a dll (dynamic link library) of the local component, and for convenience of description, the version of the dll of the local component is referred to as version a for short.
In Windows, many applications are not a complete executable file, and are divided into relatively independent dynamic link libraries, i.e., dll files, which are placed in a system. When a program is executed, the corresponding dll file is called.
In step S203, the terminal sends an update request to the server, where the update request carries version a.
In step S204, the server receives the update request, and obtains version B of the corresponding component.
In step S205, the server determines that the component needs to be updated according to version a and version B.
The steps S203 to S205 may specifically be:
for example, after receiving the update request carrying version a, the server first obtains the corresponding component, and then detects the latest dll version of the component, i.e., the version with the latest update time.
Assuming that version a is "xxdll 6.2" and version B is "xxdll 6.5", it can be considered that version B is the latest updated version of version a, and the server determines that the corresponding component needs to be updated.
In step S206, the server transmits notification information to the terminal.
In step S207, the terminal receives the notification information and downloads the update file from the server, so as to obtain the updated component.
In step S208, the terminal automatically loads the updated component after the process of the component is restarted.
The steps S206 to S208 may specifically be:
for example, when the server determines that the component needs to be updated, the server sends notification information to the terminal to indicate whether the terminal updates the component; when the terminal receives the notification information, that is, receives the server response, if it is known that the component needs to be updated based on the notification information, the update file may be downloaded from the server using a hypertext Transfer Protocol (HTTP).
Further preferably, the downloaded update file is the latest version dll file, and may be named as ". dll.new", and meanwhile, the local dll file is named as ". dll.old"; subsequently, ".dll.new" is copied to the directory where the dll component is located and renamed to ". dll".
It should be noted that, in the embodiment of the present invention, the updated component can take effect only after being restarted, for example, after the terminal restarts the process where the dll component is located, the updated dll file is automatically loaded.
The method comprises the following steps of: XX browser servlet and component B: dll update of the XBschellicon is taken as an example, the update of the two components needs to be bound with a browser installation package by virtue of the update of the browser; after the self-updating method provided by the invention is used, the component A and the component B can be flexibly configured and upgraded and decoupled with the browser installation package, and the component can realize self-updating under the condition of not needing the browser to be re-published, timely cope with various changes and save bandwidth.
As can be seen from the above, in the component updating method provided in the embodiment of the present invention, first, a preset updating thread corresponding to a local component to be updated is obtained, and then based on the preset updating thread, version information of the component to be updated is determined; and then, sending an updating request carrying the version information to the server, downloading an updating file when the server determines that the component to be updated needs to be updated according to the updating request, and updating the component to be updated according to the updating file. In other words, in the embodiment of the present invention, the corresponding update thread is started inside the component to be updated, and version information comparison, update file downloading, and the like are performed based on the update process and the server, so that the update of the component can be automatically loaded, that is, the process for loading the component can complete the update by itself without using other processes, and the process before update does not need to be closed, so that the timeliness of the update of the component is greatly improved, and meanwhile, the bandwidth consumption is reduced.
Third embodiment
In order to better implement the component updating method provided by the embodiment of the present invention, an embodiment of the present invention further provides a device based on the component updating method. Wherein the meanings of the nouns are the same as those in the above method for updating the components, and the details of the implementation can be referred to the description in the method embodiment.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a component updating apparatus according to an embodiment of the present invention, where the component updating apparatus may include an obtaining unit 301, a determining unit 302, a sending unit 303, a downloading unit 304, and an updating unit 305;
the acquiring unit 301 is configured to acquire a preset update thread corresponding to a local component to be updated; a determining unit 302, configured to determine version information of the component to be updated based on the preset update thread.
For example, an update thread is preset in each component, and when it is determined that a component needs to be updated, the component starts its corresponding update thread, and updates the component based on the update thread.
It is understood that in the present embodiment, a thread is also referred to as a lightweight process, and in the field of computers, it refers to a scheduling unit of a running program. Threads are entities in a process, a process may have multiple threads, and a thread must have a parent process. The thread does not have system resources and only has a plurality of data structures necessary for operation; it shares all the resources owned by the process with the other threads of the parent process. Threads can be created and retired to enable concurrent execution of programs. Generally, a thread has three basic states of ready, blocked, and running.
Further, the determining unit 302 may include:
the obtaining subunit is used for obtaining a corresponding preset time interval according to the preset updating thread;
and the determining subunit is used for determining the version information of the component to be updated according to the preset time interval.
For example, the preset update thread sets a timer, triggers every preset time interval (e.g., 20 minutes or 30 minutes, etc.), and determines the version information of the component to be updated locally when the timer triggers.
Then, the sending unit 303 is configured to send an update request to the server, where the update request carries the version information; a downloading unit 304, configured to download an update file from the server when the server determines that the component to be updated needs to be updated according to the update request; an updating unit 305, configured to update the component to be updated according to the update file.
It can be understood that after determining the version information of the component to be updated in the local area, an update request carrying the version information is sent to the server, so that whether the component to be updated needs to be updated can be determined according to the version information.
For example, after receiving the update request, the server first obtains the latest version information of the component to be updated, compares the latest version information with the local version information of the component to be updated, and if the latest version information is not consistent with the local version information of the component to be updated, it may be determined that the component to be updated needs to be updated.
Further, when the server determines that the component to be updated needs to be updated, send notification information indicating that the component to be updated needs to be updated, and the downloading unit 304 may include:
a receiving subunit, configured to receive notification information indicating that updating is required, where the notification information is sent by the server;
and the downloading subunit is used for downloading the update file from the server according to the notification information.
For example, according to the indication of the notification information, searching a corresponding update file from the server; the update file may be an update file corresponding to the whole component with the latest version information, or may be an update file corresponding to a part of the component that needs to be updated, and is not limited specifically here.
In this embodiment, there may be many ways to update the component to be updated according to the update file, for example, the updating unit 305 may include:
the generating subunit is used for copying the updated file to the directory where the component to be updated is located, and generating a new version component;
the loading subunit is used for loading the new version component after the process of the new version component is restarted;
and the update determining subunit is used for determining that the new version component is the updated component to be updated after the new version component is determined to be loaded completely.
That is, after the update file is copied to the directory where the component to be updated is located, and the new version component is generated, the process where the new version component is located (e.g., the terminal application where the new version component is located) needs to be restarted, and the new version component is loaded.
Further, in a preferable mode, before copying the update file to the directory where the component to be updated is located, each file and each component may be named, and based on this, the apparatus may further include:
the naming unit is used for naming the updated file as first identification information and naming the component to be updated as second identification information; after the generation subunit generates the new version component, naming the new version component according to the first identification information and the second identification information.
Specifically, for example, the updated file may be named as "a.new", and the component to be updated may be named as "a.old", so that the new version component may be named as "a.a", so as to quickly find the corresponding file/component according to the naming information, and facilitate the updating of the component.
In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.
The component updating device can be integrated on a terminal, and the terminal can be a mobile phone, a tablet personal computer and other terminals which have a storage unit and are provided with a microprocessor and have the computing capability.
As can be seen from the above, in the component updating apparatus provided in the embodiment of the present invention, first, a preset updating thread corresponding to a local component to be updated is obtained, and then based on the preset updating thread, version information of the component to be updated is determined; and then, sending an updating request carrying the version information to the server, downloading an updating file when the server determines that the component to be updated needs to be updated according to the updating request, and updating the component to be updated according to the updating file. In the embodiment of the invention, the corresponding updating thread is started inside the component to be updated, and version information comparison, updating file downloading and the like are carried out on the basis of the updating process and the server, so that the updating of the component can be automatically loaded and completed, and compared with a mode of updating the component by means of an external updating process, the timeliness of updating the component is improved, and meanwhile, the bandwidth consumption is reduced.
Fourth embodiment
Referring to fig. 4, fig. 4 is an electronic device according to an embodiment of the present invention, which can be used to implement the component updating method provided in the foregoing embodiment. The method comprises the following specific steps:
the electronic device 400 includes a processor (CPU)401, a system memory 404 including a Random Access Memory (RAM)402 and a Read Only Memory (ROM)403, and a system bus 405 that connects the system memory 404 and the processor 401. The electronic device 400 also includes a basic input/output system (I/O system) 406, which facilitates the transfer of information between devices within the computer, and a mass storage device 407 for storing an operating system 413, application programs 414, and other program modules 415.
The electronic device 400 includes a processor (CPU)401, a system memory 404 including a Random Access Memory (RAM)402 and a Read Only Memory (ROM)403, and a system bus 405 that couples the system memory 404 and the processor 401. The electronic device 400 also includes a basic input/output system (I/O system) 406, which facilitates the transfer of information between devices within the computer, and a mass storage device 407 for storing an operating system 413, application programs 414, and other program modules 415.
The basic input/output system 406 includes a display 408 for displaying information and an input device 409 such as a mouse, keyboard, etc. for user input of information. Wherein the display 408 and input device 409 are coupled to the processor 401 through an input output controller 410 that is coupled to the system bus 405. The basic input/output system 406 may also include an input/output controller 410 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input/output controller 410 may also provide output to a display screen, a printer, or other type of output device.
The mass storage device 407 is connected to the processor 401 through a mass storage controller (not shown) connected to the system bus 405. The mass storage device 407 and its associated computer-readable media provide non-volatile storage for the client device 400. That is, the mass storage device 407 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 404 and mass storage device 407 described above may be collectively referred to as memory.
The electronic device 400 may also operate as a remote computer connected to a network via a network, such as the internet, in accordance with various embodiments of the present invention. That is, the electronic device 400 may be connected to the network 412 through the network interface unit 411 connected to the system bus 405, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 411.
The memory also includes one or more modules stored in the memory and configured to be executed by the one or more processors 401, the one or more modules having the functions of:
acquiring a preset updating thread corresponding to a local component to be updated; determining version information of the component to be updated based on the preset updating thread; sending an updating request to a server, wherein the updating request carries the version information; and when the server determines that the component to be updated needs to be updated according to the update request, downloading an update file from the server, and updating the component to be updated according to the update file.
Optionally, the one or more modules further have the following functions:
acquiring a corresponding preset time interval according to the preset updating thread; and determining the version information of the component to be updated according to the preset time interval.
Optionally, the one or more modules further have the following functions:
receiving notification information which is sent by the server and indicates that updating is needed; and downloading the update file from the server according to the notification information.
Optionally, the one or more modules further have the following functions:
copying the updated file to the directory where the component to be updated is located to generate a new version component; after the process of the new version component is restarted, loading the new version component; and when the new version component is determined to be loaded completely, determining the new version component as the updated component to be updated.
Optionally, the one or more modules further have the following functions:
naming the update file as first identification information; naming the component to be updated as second identification information; after the new version component is generated, the method further comprises the following steps: and naming the new version component according to the first identification information and the second identification information.
As can be seen from the above, in the electronic device provided in the embodiment of the present invention, first, a preset update thread corresponding to a local component to be updated is obtained, and then based on the preset update thread, version information of the component to be updated is determined; and then, sending an updating request carrying the version information to the server, downloading an updating file when the server determines that the component to be updated needs to be updated according to the updating request, and updating the component to be updated according to the updating file. In the embodiment of the invention, the corresponding updating thread is started inside the component to be updated, and version information comparison, updating file downloading and the like are carried out on the basis of the updating process and the server, so that the updating of the component can be automatically loaded and completed, and compared with a mode of updating the component by means of an external updating process, the timeliness of updating the component is improved, and meanwhile, the bandwidth consumption is reduced.
Fifth embodiment
The embodiment of the invention also provides a system based on the component updating method. Wherein the meanings of the nouns are the same as those in the above method for updating the components, and the details of the implementation can be referred to the description in the method embodiment.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an element updating system 500 according to an embodiment of the present invention, where the element updating system 500 may include a server 501 and an element updating apparatus 502 according to a third embodiment;
the component updating device 502 is mainly used for acquiring a preset updating thread corresponding to a local component to be updated; determining version information of the component to be updated based on the preset updating thread; sending an updating request to a server, wherein the updating request carries the version information; and when the server determines that the component to be updated needs to be updated according to the update request, downloading the update file from the server, and updating the component to be updated according to the update file.
The server 501 is configured to receive an update request sent by the component update apparatus, where the update request carries version information of a component to be updated, and send notification information to the component update apparatus when it is determined that the component to be updated needs to be updated according to the version information, so that the component update apparatus updates the component to be updated.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the component updating method, and are not described herein again.
The component updating apparatus provided in the embodiment of the present invention is, for example, a computer, a tablet computer, a mobile phone with a touch function, and the like, and the component updating apparatus and the component updating method in the above embodiments belong to the same concept, and any method provided in the component updating method embodiment may be run on the component updating apparatus, and a specific implementation process thereof is described in the component updating method embodiment in detail, and is not described herein again.
It should be noted that, for the component updating method of the present invention, it can be understood by a person skilled in the art that all or part of the process of implementing the component updating method according to the embodiment of the present invention can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory of the terminal, and executed by at least one processor in the terminal, and during the execution process, the process of implementing the embodiment of the component updating method can be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
In the component updating apparatus according to the embodiment of the present invention, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description of a new method, apparatus and system for updating components provided by the embodiments of the present invention has been presented, and the principles and embodiments of the present invention are explained herein using specific examples, and the above description of the embodiments is only used to help understand the method and its core ideas of the present invention; meanwhile, for those skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (7)

1. A component upgrade method, comprising:
acquiring a corresponding preset updating thread started inside a local component to be updated;
determining version information of the component to be updated based on the preset updating thread, wherein the determining comprises the following steps: acquiring a corresponding preset time interval according to the preset updating thread, and determining the version information of the component to be updated according to the preset time interval, wherein the preset updating thread is provided with a timer, and when the timer is triggered at preset time intervals, the local version information of the component to be updated is determined;
sending an updating request to a server, wherein the updating request carries the version information;
when the server determines that the component to be updated needs to be updated according to the updating request, downloading an updating file from the server;
naming the updated file as first identification information, and naming the component to be updated as second identification information;
updating the component to be updated according to the update file, including:
copying the updated file to the directory where the component to be updated is located to generate a new version component;
after the process of the new version component is restarted, loading the new version component;
when the new version component is determined to be loaded completely, determining the new version component as an updated component to be updated;
after the new version component is generated, the method further comprises the following steps:
and naming the new version component according to the first identification information and the second identification information.
2. The component updating method according to claim 1, wherein the downloading of the update file from the server comprises:
receiving notification information which is sent by the server and indicates that updating is needed;
and downloading the update file from the server according to the notification information.
3. A component upgrade apparatus, comprising:
the device comprises an acquisition unit, a processing unit and a control unit, wherein the acquisition unit is used for acquiring a corresponding preset updating thread started inside a local component to be updated;
the determining unit is used for determining the version information of the component to be updated based on the preset updating thread;
a sending unit, configured to send an update request to a server, where the update request carries the version information;
the downloading unit is used for downloading the update file from the server when the server determines that the component to be updated needs to be updated according to the update request;
the updating unit is used for updating the component to be updated according to the updating file;
the determination unit includes:
the obtaining subunit is used for obtaining a corresponding preset time interval according to the preset updating thread;
the determining subunit is configured to determine version information of the component to be updated according to the preset time interval;
the update unit includes:
the generating subunit is used for copying the updated file to the directory where the component to be updated is located, and generating a new version component;
the loading subunit is used for loading the new version component after the process of the new version component is restarted;
the update determining subunit is used for determining the new version component as an updated component to be updated after the new version component is determined to be loaded;
the device further comprises:
and the naming unit is used for naming the updated file as first identification information, naming the component to be updated as second identification information, and naming the new version component according to the first identification information and the second identification information after the new version component is generated by the generation subunit.
4. The component updating apparatus according to claim 3, wherein the downloading unit includes:
a receiving subunit, configured to receive notification information indicating that updating is required, where the notification information is sent by the server;
and the downloading subunit is used for downloading the update file from the server according to the notification information.
5. A component update system comprising a server and the component update apparatus according to any one of claims 3 to 4;
the server is used for receiving an update request sent by the component updating device, wherein the update request carries version information of a component to be updated, and sending notification information to the component updating device when the component to be updated is determined to need updating according to the version information, so that the component updating device updates the component to be updated.
6. An electronic device, characterized in that the electronic device comprises a processor and a memory, the memory is used for storing program codes, and the electronic device is operated, the processor is used for executing the program codes to execute the component updating method of any one of claims 1 to 2.
7. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for causing a computer to execute the component update method of any one of claims 1 to 2.
CN201610190155.5A 2016-03-30 2016-03-30 Component updating method, device and system Active CN107291481B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610190155.5A CN107291481B (en) 2016-03-30 2016-03-30 Component updating method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610190155.5A CN107291481B (en) 2016-03-30 2016-03-30 Component updating method, device and system

Publications (2)

Publication Number Publication Date
CN107291481A CN107291481A (en) 2017-10-24
CN107291481B true CN107291481B (en) 2020-07-03

Family

ID=60086605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610190155.5A Active CN107291481B (en) 2016-03-30 2016-03-30 Component updating method, device and system

Country Status (1)

Country Link
CN (1) CN107291481B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766131B (en) * 2017-11-06 2022-04-01 上海宝信软件股份有限公司 System and method for realizing intelligent automatic software upgrading based on multithreading technology
CN110069266B (en) * 2018-01-24 2022-02-01 腾讯科技(深圳)有限公司 Application upgrading method and device, computer equipment and storage medium
CN110865827B (en) * 2018-08-27 2023-04-25 阿里巴巴集团控股有限公司 Data updating method, device and system
CN110874260B (en) * 2018-09-04 2023-03-10 北京奇虎科技有限公司 File processing method and device based on multi-user machine
CN109766127B (en) * 2019-01-16 2022-06-28 上海掌门科技有限公司 Method for updating application version information
CN110764805B (en) * 2019-10-28 2024-01-23 腾讯科技(深圳)有限公司 Client non-inductive upgrading method, device, terminal and storage medium
CN111831312B (en) * 2020-07-07 2024-03-22 广州市挖米科技有限责任公司 Medical system updating method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN104038819A (en) * 2014-05-30 2014-09-10 四川长虹电器股份有限公司 Software upgrading system and method of digital set-top box

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103716719A (en) * 2013-12-02 2014-04-09 乐视网信息技术(北京)股份有限公司 Multimedia file downloading method and user terminal
CN104038819A (en) * 2014-05-30 2014-09-10 四川长虹电器股份有限公司 Software upgrading system and method of digital set-top box

Also Published As

Publication number Publication date
CN107291481A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN107291481B (en) Component updating method, device and system
US8812451B2 (en) Programming model for synchronizing browser caches across devices and web services
US20140380295A1 (en) Method and system for updating application, and computer storage medium thereof
US10684838B2 (en) Dynamic application deployment
EP2955627B1 (en) Managing versions of components of a software suite
CN103353845A (en) Method and device for uploading and pushing script
CN110851204B (en) Application starting method and device and application packaging method and device
CN109117153B (en) Application processing method, device, terminal and storage medium
CN112486552A (en) Server hot update method, device, equipment and storage medium
US9965295B2 (en) Creating a custom series of commands
CN112199567A (en) Distributed data acquisition method, system, server and storage medium
CN114968406B (en) Plug-in management method and device, electronic equipment and storage medium
CN111240766A (en) Application starting method and device, electronic equipment and computer readable storage medium
CN109885332A (en) Image quality chip software upgrade method, device, display equipment and storage medium
CN110990038B (en) Method, apparatus, electronic device and medium for applying local update
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN111752577B (en) Upgrading method and equipment for system version
CN115145605A (en) Vehicle-mounted application software upgrading method and system, electronic equipment and storage medium
US10013259B2 (en) User initiated data rollback using operating system partitions
US20150212866A1 (en) Management system for service of multiple operating environments, and methods thereof
US20140137092A1 (en) Information processing apparatus, information processing system, non-transitory computer-readable storage medium having stored therein information processing program, and information processing method
CN111625326B (en) Task pipeline execution method and device and electronic equipment
CN112379943A (en) Plug-in application method and device of Electron application program and storage medium
CN109840156B (en) Data caching method and equipment, storage medium and terminal thereof
CN111858234A (en) Task execution method, device, equipment and medium

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221115

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518,101

Patentee after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.