Hot update method and related device

By deleting old child processes and creating new child processes during hot updates, the memory leak problem is solved, system performance is improved, and the application is run stably.

CN119065697APending Publication Date: 2024-12-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310652321.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing hot update technology may not be completely cleared when clearing old version files, resulting in memory leaks, which in turn affects the speed of the application and system stability.

Method used

By obtaining the latest and current version information of the target application, identify the corresponding child processes, and delete the old child processes when the version is inconsistent, and create new child processes to avoid memory leaks and improve system performance.

Benefits of technology

It effectively avoids memory leak problems, improves system performance and application running speed, and prevents serious consequences such as system crashes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065697A_ABST
    Figure CN119065697A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a hot update method and a related device. The method comprises the following steps: acquiring latest version information and current version information of a target application program, and a corresponding relationship between the application program and a sub-process; based on the corresponding relation, a first sub-process corresponding to the target application program is determined, and the first sub-process is a sub-process created based on the current version information. If the current version information is inconsistent with the latest version information, deleting the first sub-process, creating a second sub-process based on the latest version information, and updating the sub-process corresponding to the target application program into the second sub-process in the corresponding relationship, the request from the target application program is distributed to the second sub-process based on the updated corresponding relation, and therefore hot updating of the target application program is achieved. The processes are mutually independent, so that after the old first sub-process is deleted, all allocated memories in the first sub-process can be deleted, memory leakage is avoided, and the system performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a hot update method and related devices. Background Art

[0002] Hot Update refers to the process of repairing or adding new features by updating certain parts of the program without stopping the application or service. Hot Update can update the application code, configuration files, resource files and other files in real time without restarting the application.

[0003] In the related art, in order to improve the loading speed, the files related to the application are read from the hard disk into the cache in advance, and after the request is obtained, the corresponding files are loaded from the cache based on the request. When it is necessary to perform a hot update on the application, the i-th version of the file in the cache needs to be cleared first, and then the i+1-th version of the file is read from the hard disk into the cache, so as to load the i+1-th version of the file from the cache.

[0004] However, in the process of clearing the i-th version of the file, it may not be completely cleared, resulting in a memory leak. As the application continues to run, there will be a certain amount of memory leakage after each request, causing a waste of system memory, slowing down the application running speed or even system crashes and other serious consequences. Summary of the invention

[0005] In order to solve the above technical problems, the present application provides a hot update method and related devices for avoiding memory leakage problems and improving system performance.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] On the one hand, an embodiment of the present application provides a hot update method, the method comprising:

[0008] Acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications;

[0009] Determine, according to the corresponding relationship, a first sub-process corresponding to the target application, where the first sub-process is created based on the current version information;

[0010] During the running of the target application, if the current version information is inconsistent with the latest version information, deleting the first sub-process and creating a second sub-process based on the latest version information;

[0011] In the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process.

[0012] On the other hand, an embodiment of the present application provides a hot update device, the device comprising: an acquisition unit, a determination unit, a deletion and creation unit, and an update unit;

[0013] The acquisition unit is used to acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications;

[0014] The determining unit is configured to determine, according to the corresponding relationship, a first sub-process corresponding to the target application, wherein the first sub-process is a sub-process created based on the current version information;

[0015] The deletion and creation unit is used to delete the first sub-process and create a second sub-process based on the latest version information if the current version information and the latest version information are inconsistent during the operation of the target application;

[0016] The updating unit is used to update the sub-process corresponding to the target application to the second sub-process in the corresponding relationship.

[0017] Optionally, the device further comprises a distribution unit, configured to:

[0018] If a plurality of the first requests are distributed to the third sub-process for processing, after the second sub-process is created, the first requests that have not been processed by the third sub-process are distributed to the second sub-process for processing.

[0019] Optionally, the determining unit is further configured to:

[0020] If, after the second sub-process is created, a second request from the target application is obtained, determining a second sub-process corresponding to the target application according to the corresponding relationship;

[0021] The device also includes a distribution unit, configured to:

[0022] Distribute the second request to the second sub-process for processing.

[0023] Optionally, the device further comprises a distribution unit, configured to:

[0024] If it is determined that the second sub-process fails to process the second request, the second request is distributed to a third sub-process for processing, where the third sub-process is a sub-process created based on the current version information.

[0025] Optionally, the deletion creation unit is further used to:

[0026] After obtaining the third request from the target application, if the subprocess corresponding to the target application is not determined based on the corresponding relationship, creating the first subprocess based on the latest version information, and distributing the third request to the first subprocess for processing;

[0027] The device also includes an updating unit, configured to:

[0028] In the corresponding relationship, a corresponding relationship between the target application and the first sub-process is established.

[0029] Optionally, the deletion creation unit is specifically used to:

[0030] After obtaining a plurality of the third requests from the target application, obtaining the number of cores of the central processing unit of the computer device;

[0031] Creating a plurality of the first sub-processes based on the latest version information and the number of cores, wherein the number of the first sub-processes is the same as the number of cores;

[0032] The device also includes a distribution unit, configured to:

[0033] Evenly distribute the plurality of the third requests to the plurality of the first sub-processes for processing.

[0034] Optionally, if the number of the first subprocesses is n, where n is an integer greater than 1, the deletion creation unit is specifically configured to:

[0035] Delete n-1 of the first sub-processes;

[0036] The device also includes a distribution unit, configured to:

[0037] If a first request from the target application is obtained before the second sub-process is created, the first request is distributed to the first sub-process that has not been deleted for processing.

[0038] Optionally, the acquisition unit is further used to:

[0039] Obtaining a first request from the target application;

[0040] Based on the first request, the latest version information of the target application is obtained.

[0041] Optionally, the acquisition unit is specifically used to:

[0042] The latest version information of the target application is obtained at preset time intervals.

[0043] On the other hand, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory:

[0044] The memory is used to store a computer program and transmit the computer program to the processor;

[0045] The processor is configured to execute the method described in the above aspects according to the instructions in the computer program.

[0046] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the above aspects.

[0047] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above aspects.

[0048] It can be seen from the above technical solution that the latest version information of the target application and the current version information of the target application, as well as the corresponding relationship between the application and the sub-process are obtained. In the corresponding relationship, different applications correspond to different sub-processes, so that different applications have different business logics through different sub-processes, and the requests from each application are distributed to different sub-processes for processing based on the corresponding relationship. Based on the corresponding relationship, the first sub-process corresponding to the target application is determined, and the first sub-process is a sub-process created based on the current version information. During the operation of the target application, a hot update is performed, that is, if the current version information is inconsistent with the latest version information, it means that the target application should be updated, then the request from the target application is no longer distributed to the first sub-process, but the first sub-process is deleted, and a second sub-process is created based on the latest version information, and in the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process, so that the request from the target application is distributed to the second sub-process based on the updated corresponding relationship. Therefore, during the operation of the target application, if it is found that the target application is updated, a new second sub-process can be created based on the latest version information, thereby realizing hot update. Furthermore, since the processes are independent of each other, after deleting the old first child process, all allocated memory in the first child process will be deleted, and all reference relationships within the first child process will be deleted, thereby avoiding memory leaks and improving system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A schematic diagram of a module reference provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of a module loading mechanism provided in an embodiment of the present application;

[0052] Figure 3 A method provided in the embodiment of the present application Figure 2 Schematic diagram of the corresponding reference relationship;

[0053] Figure 4 A schematic diagram of an application scenario of the hot update method provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of a hot update method according to an embodiment of the present invention;

[0055] Figure 6 A schematic diagram of creating a subprocess provided in an embodiment of the present application;

[0056] Figure 7 A schematic diagram of sending a request to a first sub-process provided in an embodiment of the present application;

[0057] Figure 8 A schematic diagram of sending a request to a first sub-process provided in an embodiment of the present application;

[0058] Fig. 9 A schematic diagram of deleting an old process and creating a new process provided by an embodiment of the present application;

[0059] Fig.10 A schematic diagram of a parallel processing request provided in an embodiment of the present application;

[0060] Fig.11 A schematic diagram of an application scenario of a hot update method provided in an embodiment of the present application;

[0061] Fig.12 A schematic diagram of the structure of a thermal update device provided in an embodiment of the present application;

[0062] Fig.13 A schematic diagram of the structure of a server provided in an embodiment of the present application;

[0063] Fig.14 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0065] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0066] With the increasing demand for computer applications, the design and development of applications have become increasingly complex. The number of variables that developers deal with during program implementation has also increased significantly. The problem of how to effectively allocate and release memory and prevent memory leaks has become increasingly prominent. Memory leak defects are hidden and cumulative, and are more difficult to detect than other memory access errors. Because memory leaks are caused by the failure to release memory that is no longer in use, they are omission defects rather than fault defects. If the location of the memory leak is critical, then over time, the increase in useless memory will cause the server to respond more slowly. In severe cases, the memory will reach a certain limit, causing the application to crash.

[0067] The following uses Node.js, an open source JavaScript (a programming language) runtime environment, as an example. Node.js provides many built-in modules that allow developers to easily build scalable applications. The following uses module a and module b as examples.

[0068] See also Figure 1 , which is a schematic diagram of a module reference provided by an embodiment of the present application. Figure 1 The left subgraph in the figure shows that in module a, a variable a is exported. Figure 1 The right sub-diagram in the figure shows that the exported variable a is referenced in module b. At this time, a reference cache relationship will be established in the cache. The variable in module a is referenced in module b, so module a can be called parent module A, and module b can be called child module B.

[0069] In Node.js, when a module is loaded for the first time, it will be cached. If the module is referenced again in the subsequent code, Node.js will read the module directly from the cache instead of reloading it, thereby improving the loading speed. Figure 2 , which is a schematic diagram of a module loading mechanism provided by an embodiment of the present application. During the loading process, it is determined whether submodule B exists in the cache. If not, submodule B is compiled and parsed, submodule B is added to the cache require.cache, and submodule B is referenced to the children array of parent module A. If it exists, submodule B is referenced to the children array of parent module A.

[0070] In Node.js, module.cache is used to cache loaded modules. When Node.js first loads a module, it caches the module's code in the module.cache object so that it can quickly access and reuse these modules in subsequent requests. require.cache contains cache information for all modules that are currently loaded. Whenever a module is loaded, Node.js uses the module's full path as the key and the module's exports and other related information as the value, which are stored in the require.cache object.

[0071] See also Figure 3 , which is a diagram of an embodiment of the present application Figure 2 Schematic diagram of the corresponding reference relationship. Parent module A, module.cache and require.cache will cache information related to submodule B. When hot updating submodule B, it is necessary to clear all cached information related to the old version of submodule B so that the next time submodule B is referenced, the new version of submodule B will be reloaded to achieve hot update. Only when the information related to submodule B is completely cleared will memory leaks not occur. However, as the reference relationship becomes more complex, it becomes difficult to clear all reference relationships, thereby increasing the probability of memory leaks.

[0072] Based on this, an embodiment of the present application provides a hot update method and related devices. Since it is found that the reference relationship between modules is complex, hot update is no longer performed based on the module level, but hot update is performed based on the process level, thereby avoiding memory leakage problems caused by complex references between modules and improving system performance.

[0073] The hot update method provided in this application can be applied to computer devices with hot update capabilities, such as terminal devices and servers. Among them, the terminal device can specifically be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an Internet of Things device and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The smart car device can be a car navigation terminal and a car computer, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc., but it is not limited to this; the server can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.

[0074] The computer equipment can also have cloud technology capabilities. Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data calculation, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application. It can form a resource pool and be used on demand, which is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0075] To facilitate understanding of the hot update method provided in the embodiment of the present application, the following uses a server as an example in which the execution subject of the hot update method is an example, and exemplarily introduces the application scenario of the hot update method based on cloud gaming.

[0076] Among them, cloud gaming, also known as gaming on demand, is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thin clients with relatively limited graphics processing and data computing capabilities to run high-quality games. In a cloud gaming scenario, the game is not played on the player's game terminal, but on a cloud server, which renders the game scene into a video and audio stream and transmits it to the player's game terminal over the network. The player's game terminal does not need to have powerful graphics computing and data processing capabilities, but only needs to have basic streaming media playback capabilities and the ability to obtain player input commands and send them to the cloud server.

[0077] See also Figure 4 , which is a schematic diagram of an application scenario of the hot update method provided in the embodiment of the present application. Figure 4 As shown, the application scenario includes a terminal device 410 and a server 420, and the terminal device 410 and the server 420 can communicate through a network. Figure 4 Only one terminal device and one server are shown in the figure, but in different embodiments, there are other terminal devices that can also access the server.

[0078] The following is an example of a cloud gaming application scenario. The terminal device 410 installs and runs a cloud gaming application, and the user can play the cloud game through the terminal device 410, and send various requests through the terminal device 410, such as controlling the first virtual object to jump, run, sprint, etc. The server 120 is installed with a service corresponding to the application, so as to respond to various requests sent by the terminal device 410. The following is an example of installing and running the target application on the terminal device 410.

[0079] The server 420 may pre-store a correspondence between applications and sub-processes, in which different applications correspond to different sub-processes, so that different applications have different business logics, and requests from various applications are distributed to different sub-processes for processing based on the correspondence. For example, in the correspondence, the target application corresponds to the first sub-process, so the request sent by the terminal device 410 during the running of the target application will be distributed to the first sub-process by the server 420 for processing.

[0080] During the operation of the target application, the server 420 obtains the latest version information of the target application and the current version information of the target application. If the current version information is inconsistent with the latest version information, it means that the target application should be updated, or in other words, the first sub-process is an old process created based on the current version information, and a new process, i.e., the second sub-process, should be created based on the latest version information. At the same time, the request from the target application is no longer distributed to the first sub-process, but the first sub-process is deleted, and in the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process, so that the request from the target application is distributed to the second sub-process based on the updated corresponding relationship.

[0081] Therefore, during the operation of the target application, if the target application is updated, a new second sub-process can be created based on the latest version information, thus realizing hot update. Moreover, since the processes are independent of each other, after deleting the old first sub-process, all the allocated memory in the first sub-process will be deleted, and all the reference relationships in the first sub-process will be deleted, thus avoiding memory leaks and improving system performance.

[0082] The hot update method provided in the embodiment of the present application can be executed by the server. However, in other embodiments of the present application, the terminal device can also have similar functions as the server, thereby executing the hot update method provided in the embodiment of the present application, or the terminal device and the server jointly execute the hot update method provided in the embodiment of the present application, which is not limited in the present embodiment.

[0083] The hot update method provided by the present application is described in detail below through a method embodiment.

[0084] See also Figure 5 , which is a schematic diagram of the process flow of the hot update method provided in the embodiment of the present application. For the convenience of description, the following embodiment is introduced by taking the execution subject of the hot update method as a terminal device as an example.

[0085] like Figure 5 As shown, the hot update method includes the following steps:

[0086] S501: Acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process.

[0087] Various applications are running in the terminal device, which will interact with other computer devices, such as sending relevant requests to a server, etc. An application among the multiple applications, namely the target application, is taken as an example for description.

[0088] During the operation of the target application, the target application may be updated. The hot update technology can be used to update the target application. The hot update technology allows the application to be updated without stopping. The main purpose of hot update is to solve the current problems of the application and improve the performance and functions of the application. It can help developers quickly fix problems in the application, improve the performance and functions of the application, shorten the release cycle, and improve user satisfaction.

[0089] Based on this, in order to determine whether the target application has been updated, the latest version information and current version information of the target application can be obtained. Among them, the current version information of the target application is used to identify the version of the target application currently running, and can be obtained from the local location of the terminal device. The latest version information of the target application is used to identify the latest version of the target application currently running, and can be obtained from the application store, the official website of the target application, etc.

[0090] The embodiment of the present application does not specifically limit the time for obtaining the version information. The following three methods are used as examples for explanation.

[0091] Method 1: You can obtain the current version information of the target application in advance, and obtain the latest version information of the target application after the target application is started. Alternatively, after the target application is started, you can obtain both the current version information and the latest version information of the target application.

[0092] Method 2: Since the version update time of the target application is uncertain, in order to quickly and timely implement hot updates, the latest version information of the target application can be obtained after each request from the target application is received, thereby ensuring that the version update can be quickly implemented during the operation of the target application. Compared with constantly obtaining the latest version information of the target application, it can save traffic and reduce the performance consumption of the terminal device.

[0093] Specifically, a first request from the target application is obtained, and the latest version information of the target application is obtained based on the first request. The current version information of the target application can be obtained together with the latest version information, or can be obtained in advance before the latest version information, which is not specifically limited in this application.

[0094] Method 3: If you obtain the latest version of the target application every time after obtaining the request and then process the request, it may result in a long response time for the request. Therefore, you can obtain the latest version of the target application at a preset time, so that after each request, you do not need to wait for the latest version to be obtained before executing the request. This ensures that the target application can be updated in a timely manner, shortens the response time of the request, and improves the user experience.

[0095] Method 4: After the target application is updated in the application store or on the official website, it can be actively pushed to each computer device that has the target application installed, so as to trigger the update of the target application installed in the first computing device.

[0096] Terminal devices generally include multiple applications. Since the business logic of each application is different, different processes are required to handle different business logics, so each application has its corresponding process. In order to facilitate the processing of requests sent by each application, a corresponding relationship between applications and processes can be established. In the corresponding relationship between applications and sub-processes, different applications correspond to different sub-processes, and sub-processes are used to process requests from corresponding applications.

[0097] It should be noted that, for the convenience of management, the terminal device can establish a main process, and the main process is responsible for receiving requests sent by various applications, so that the main process distributes the requests to corresponding sub-processes based on the corresponding relationship.

[0098] Among them, the main process is the first process created when a program is executed, and it is the parent process of all other processes. The main process is usually a control process, which is responsible for starting and managing other processes. The child process is a new process created by the main process. The child process can perform different tasks from the main process. The child process is usually created in the context of the main process, and they inherit the environment variables, file descriptors, and other resources of the main process. When creating a child process, the main process can specify the program to be executed by the child process, or copy the code of the main process to the child process for execution. The child process can share memory with the main process so that data can be exchanged between them.

[0099] It is understandable that in the specific implementation of this application, the request may involve data related to users, etc. When the above embodiments of this application are applied to specific products or technologies, the user's separate permission or consent is required, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

[0100] S502: Determine a first subprocess corresponding to the target application according to the corresponding relationship.

[0101] As can be seen from the foregoing, in the correspondence between applications and subprocesses, different applications correspond to different subprocesses, and subprocesses are used to process requests from corresponding applications. Therefore, based on the correspondence, the first subprocess corresponding to the target application can be determined, and the first subprocess is a subprocess created based on the current version information.

[0102] As a possible implementation, after obtaining the third request from the target application, if the subprocess corresponding to the target application is not determined in the corresponding relationship, or in other words, there is currently no subprocess for processing the request from the target application, then a first subprocess can be created based on the latest version information, and the third request can be distributed to the first subprocess for processing. At the same time, the corresponding relationship between the first subprocess and the target application is added to the corresponding relationship, that is, the corresponding relationship between the first subprocess and the target application is established, and an updated corresponding relationship is obtained.

[0103] It should be noted that the first request and the third request are different requests. The third request is a request sent by the target application before the first sub-process is established, and the first request is a request sent by the target application after the first sub-process is established.

[0104] Therefore, after each request is obtained, a subprocess for processing the request can be created in time, and the correspondence between each application and the subprocess can be added in time in the correspondence, so that based on the correspondence, the requests from each application can be distributed to the corresponding subprocess for processing.

[0105] S503: During the running of the target application, if the current version information is inconsistent with the latest version information, the first sub-process is deleted, and a second sub-process is created based on the latest version information.

[0106] During the running of the target application, if the current version information is consistent with the latest version information, it means that the currently running target application is the latest version; if the current version information is inconsistent with the latest version information, it means that the target application has a new version and needs to be updated. The first sub-process is a sub-process created based on the current version information, that is, the old version information, and cannot be used any more. Therefore, the first sub-process is deleted, and the second sub-process is created based on the latest version information to achieve hot update of the target application.

[0107] Let's continue to take Node.js as an example. In Node.js, a module is a collection of related functions, variables, and objects that can be referenced and used by other modules. Each module has its own scope and namespace to avoid naming conflicts and data pollution. Modules can be loaded and used through the require() function, or they can expose interfaces to the outside through the exports object. A process is a concept in the operating system, which is an instance of a running program. In Node.js, each Node.js application is a process. Processes are independent of each other, and they have their own memory space, resources, and operating environment. Processes can exchange data and control information through inter-process communication mechanisms so that they can work together to complete tasks.

[0108] Therefore, although it is difficult to implement hot update by clearing the cache in the same process instance in the related art, memory leaks may occur. Based on this, the embodiment of the present application manages module instances by the process dimension, and the processes are independent of each other. When the first sub-process is deleted, all the allocated memory in the first sub-process will be deleted, thereby avoiding memory leaks and improving system performance.

[0109] S504: In the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process.

[0110] Before the target application is updated, in the correspondence, the subprocess corresponding to the target application is the first subprocess, which has been deleted. Therefore, after determining that the target application needs to be updated, the correspondence is updated, that is, the subprocess corresponding to the target application is updated to the second subprocess.

[0111] As a possible implementation, after the second sub-process is created, if a second request from the target application is obtained, the second sub-process corresponding to the target application is determined according to the updated correspondence, and the second request is assigned to the second sub-process for processing. The second request is different from the first request and the third request. The second request is a request sent by the target application after the second sub-process is created, the first request is a request sent by the target application after the first sub-process is established and before the second sub-process is created, and the third request is a request sent by the target application before the first sub-process is established.

[0112] It can be seen from the above technical solution that during the operation of the target application, the latest version information of the target application and the current version information of the target application, as well as the corresponding relationship between the application and the sub-process are obtained. In the corresponding relationship, different applications correspond to different sub-processes, so that different applications have different business logics through different sub-processes, and the requests from each application are distributed to different sub-processes for processing based on the corresponding relationship. Based on the corresponding relationship, the first sub-process corresponding to the target application is determined, and the first sub-process is a sub-process created based on the current version information. If the current version information is inconsistent with the latest version information, it means that the target application should be updated, then the request from the target application is no longer distributed to the first sub-process, but the first sub-process is deleted, and the second sub-process is created based on the latest version information. In the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process, so that the request from the target application is distributed to the second sub-process based on the updated corresponding relationship. Therefore, during the operation of the target application, if it is found that the target application is updated, a new second sub-process can be created based on the latest version information, and hot update is realized. Furthermore, since the processes are independent of each other, after deleting the old first child process, all allocated memory in the first child process will be deleted, and all reference relationships within the first child process will be deleted, thereby avoiding memory leaks and improving system performance.

[0113] As a possible implementation method, if a first request from a target application is obtained before the second child process is created, two methods are described below to process the first request.

[0114] Method 1: Since the first sub-process is created based on the current version information, the first sub-process is responsible for the requests sent by the old version of the target application, so the first request is no longer distributed to the first sub-process, but waits for the creation of the second sub-process. If the second sub-process is created, the first request is distributed to the second sub-process for processing. Therefore, before the second sub-process is created, if the first request from the target application is received, it is possible to wait for the creation of the second sub-process. After the second sub-process is created, the first request is distributed to the second sub-process for processing, so as to avoid request loss and ensure the stability of the system.

[0115] Method 2: If the request is distributed in the method of the above method 1, it may take a long time to wait. Based on this, the third sub-process based on the current version information is determined. The third sub-process and the first sub-process are both sub-processes created based on the current version information. The third sub-process is used as a backup sub-process for the first sub-process. When a problem occurs in the first sub-process, the third sub-process as a backup sub-process is used to process it. Therefore, before the second sub-process is created, the first request can be distributed to the three sub-processes for processing, thereby avoiding request loss and ensuring the stability of the system without delaying the processing of the first request, shortening the waiting time and improving the user experience.

[0116] The embodiment of the present application does not specifically limit the creation time of the third sub-process. For example, the third sub-process can be created when needed to avoid wasting memory. For another example, the third sub-process can be created at the same time as the first sub-process is created, thereby eliminating the need to wait and shortening the response time of the request.

[0117] In addition, the embodiment of the present application does not specifically limit the number of backup sub-processes serving as the first sub-process, or in other words, the embodiment of the present application does not specifically limit the number of third sub-processes, and multiple third sub-processes may be established to speed up the processing of the first request.

[0118] It should be noted that, in order to avoid confusion, in the correspondence, only the correspondence between the main sub-process and the application is recorded. If the first sub-process as the main one and the third sub-process as the backup are established together based on the current version information, the relationship between the first sub-process and the third sub-process can be established so that the third sub-process as the backup sub-process can be determined based on the first sub-process identifier. Alternatively, the third sub-process as the backup can be identified based on the current version information, and so on. This application does not make specific restrictions on this.

[0119] Furthermore, if multiple first requests from the target application are received before the second sub-process is created, and the multiple first requests are distributed to the third sub-process for processing, it may happen that the third sub-process has not yet processed the multiple first requests, and the second sub-process has been established. At this time, the first request among the multiple first requests that the third sub-process has not started to process can be distributed to the second sub-process for processing, so that the second sub-process created based on the latest version information can process as many requests from the target application as possible, thereby avoiding request loss and improving user experience.

[0120] It should be noted that when a request is processed by a child process, the request will continue to be processed by the child process until the request is processed. It will not happen that the first request is processed halfway and the remaining half is processed by other child processes, thus ensuring that data is not lost and requests can be processed correctly.

[0121] As a possible implementation manner, a part of the first request may be allocated to the third sub-process for processing, and a part thereof may be allocated to the second sub-process for processing, so as to speed up the processing of the first request.

[0122] As a possible implementation method, since the second sub-process created based on the latest version information may have problems after going online, in order to ensure the stable operation of the system, a version rollback mechanism can be provided. Specifically, if it is determined that the second sub-process fails to process the second request, it means that the second sub-process created based on the latest version information has some problems in actual use, so the second request can be distributed to the third sub-process for processing again. Since the third sub-process is an old sub-process created based on the current version information, its corresponding first sub-process has been running stably for a period of time, and the possibility of failure of the third sub-process to process the second request is small, thereby ensuring the stable operation of the system.

[0123] Furthermore, the second request that fails to be processed by the second subprocess may be recorded and reported, so that the latest version of the target application may be updated later to ensure stable operation of the target application and improve user experience.

[0124] As a possible implementation method, after the second sub-process fails to process the second request, in the process of processing the second request again based on the third sub-process, the second sub-process that failed to process the second request can be deleted, that is, the currently existing second sub-process is deleted, and then the second sub-process is created again based on the latest version information, so as to avoid the failure of the second request processing due to installation problems rather than the failure of the second request processing due to problems with the latest version information.

[0125] As a possible implementation method, after trying several times, the currently existing second sub-process can be deleted, and the second sub-process can be created again based on the latest version information. After trying several times, if the second sub-process still fails to process the second request, it is determined that there is a problem with the latest version information. The second request that failed to be processed by the second sub-process can be recorded and reported, so that the latest version of the target application can be updated later to ensure the stable operation of the target application and improve the user experience.

[0126] As a possible implementation, in the early stage of the creation of the second sub-process, the second sub-process may be unstable, but the second request will not necessarily fail to be processed. In this way, when it is determined that the second sub-process is unstable, the third sub-process can be used for processing, so that there is no need to wait for the second request to fail to be processed before executing the version rollback, that is, the second request is processed again based on the third sub-process, which reduces the processing time. When the second sub-process is stable, the second sub-process is used for processing, and after the second sub-process is stable, all the received second requests are distributed to the second sub-process for processing. In this way, it is possible to ensure that the request can be processed stably as much as possible, while processing it based on the second sub-process created based on the latest version information.

[0127] As a possible implementation method, if after obtaining the third request from the target application, the sub-process corresponding to the target application is not determined based on the corresponding relationship, it means that the sub-process for processing the request from the target application has not been determined yet. At this time, a first sub-process can be created based on the latest version information so that the first sub-process can process the third request, and the correspondence between the target application and the first sub-process is added to the correspondence, so that after subsequently receiving the first request, the first request can be distributed to the first sub-process based on the corresponding relationship.

[0128] Further, if multiple requests are obtained from the target application, the third request is used as an example for explanation below: The number of cores of a central processing unit (CPU) of the current computing device is obtained, and at least one first subprocess is created based on the number of cores, so that the number of first subprocesses is the same as the number of cores.

[0129] Among them, in the computer architecture, the CPU is the core hardware unit that controls and allocates all the hardware resources of the computer (such as memory, input and output units) and performs general operations. The CPU is the computing and control core of the computer. The operations of all software layers in the computer system will eventually be mapped to the operations of the CPU through the instruction set. For the CPU, the indicators that affect its performance mainly include the main frequency, the number of bits of the CPU, the cache instruction set of the CPU, the number of CPU cores and the number of instructions per cycle (IPC). Therefore, based on the performance of the CPU, as many sub-processes as possible can be established so that the third request can be processed in parallel through multiple sub-processes.

[0130] For example, multiple first sub-processes are created based on the latest version information and the number of CPU cores, so that the number of first sub-processes is consistent with the number of CPU cores, and each first sub-process is created based on the latest version information, thereby, multiple third requests can be evenly distributed to multiple first sub-processes for processing.

[0131] It can be seen from the above scheme that by creating multiple first sub-processes based on the performance of the CPU, multiple third requests are evenly distributed to multiple first sub-processes for processing, so that multiple first sub-processes can process multiple third requests in parallel. Therefore, within the allowable range of the performance of the computer device, multiple sub-processes can be created to process requests in parallel, shortening the response time of each request and improving the user experience.

[0132] Furthermore, if the number of the multiple first sub-processes is n, and n is an integer greater than 1, then one achievable way to delete the first sub-process is to delete n-1 first sub-processes from the n first sub-processes, and only retain one first sub-process, so that the first sub-process can be used as a backup sub-process like the aforementioned third sub-process, which can not only achieve that before the second sub-process is created, the first request from the target application is obtained, and the first request is distributed to the undeleted first sub-process for processing. It is also possible that after the second sub-process fails to process the second request, the undeleted first sub-process can process the failed second request, thereby eliminating the need to establish the third sub-process again, reducing memory usage, shortening the request response time, and improving the user experience.

[0133] In order to facilitate further understanding of the technical solution provided in the embodiment of the present application, the following takes the execution subject of the hot update method provided in the embodiment of the present application as an example of a server, and provides an overall exemplary introduction to the hot update method based on Node.js.

[0134] See also Figure 6 , which is a schematic diagram of creating a subprocess provided by an embodiment of the present application. Figure 6 In the example, two independent child processes are created in advance in the main process of the server, namely the first child process child1 and the third child process child2, and the third child process child2 is used as a backup child process of the first child process child1. The fork function is imported from the child_process module and assigned to the constant fork through the statement const{fork}=require('child_process').

[0135] Among them, the child_process module is a built-in module that allows Node.js to create and control child processes. The fork function is a method in the child_process module that allows a new process to be created in Node.js and the specified module file to be executed in the process. Using the fork function, a new process can be created to perform some long-running tasks without blocking the main thread.

[0136] child1 and child2 are child_process objects, which use the fork() method to create a new child process, which executes the module named child.js based on the file address ". / child.js". This means that the code in child.js will run in the child process instead of the main process.

[0137] In the case where the target application is not updated, that is, the current version information is consistent with the latest version information, the obtained request (i.e., the second request) is distributed to the first child process child1 for processing, and some logical processing is performed in the first child process child1 before returning to the main process, so that the main process returns the processing result to the client that sent the request. The first child process for processing the request is determined based on the corresponding relationship, and the first child process is created based on the current version information, and is a child process for processing the request from the target application.

[0138] See also Figure 7 , this figure is a schematic diagram of sending a request to the first child process provided by an embodiment of the present application. In Node.js, "let" is a keyword used to declare variables, and "aliveChild" is a variable name. And "child1" is another variable name, which is a variable that has been declared and assigned before. In "let aliveChild=child1", the value of "child1" is assigned to "aliveChild" so that "aliveChild" references the same object as "child1" (or value, if "child1" is a primitive data type). In other words, based on the corresponding relationship, it is determined that the child process corresponding to the target application is the first child process, so the value of the first child process "child1" is assigned to "aliveChild".

[0139] "createServer()" is a method used to create an HTTP server. This method accepts a callback function as a parameter, which will be called when each client request reaches the server. The "req" parameter in the callback function is an object containing request information, representing the request sent by the client, and the "res" parameter is an object used to send a response to the client, representing the response returned by the server. "req.cookies" is a property used to obtain cookie information in the request. The cookie information parsed from the request is assigned to the cookies variable through the statement "const cookies = req.cookies". This means that in this callback function, the cookies variable can be used to read and manipulate the cookie information in the request, such as getting the value of a cookie, setting a new cookie, etc. The statement "aliveChild.send({cookies})" is a method that sends a JavaScript object containing cookies attributes to the aliveChild process.

[0140] Based on each request obtained from the target application, the main process pulls configurations from the target application's official website, app store, or configuration platform through an interface, such as obtaining the latest version information of the target application. If the latest version information is inconsistent with the current version information of the running target application, it means that the version of the currently running target application is old and needs to be updated.

[0141] See also Figure 8 , which is a schematic diagram of determining the version of a target application provided by an embodiment of the present application. In Node.js, the "async" keyword is used to mark it as an asynchronous function, and the "await" keyword can be used to wait for other asynchronous operations to complete. In the request handler, any logic can be written to handle HTTP requests and responses. For example, the req.url property can be used to obtain the URL path of the request and return different responses based on different paths.

[0142] If the current version information is inconsistent, the first request is distributed to the third child process "child2" for processing, so that during the process of deleting the first child process "child1" and creating the second child process "child3", the request from the target application can still be processed. And, in the corresponding relationship, the child process corresponding to the target application is updated to the second child process.

[0143] See also Fig. 9 , which is a schematic diagram of deleting an old process and creating a new process provided by an embodiment of the present application. Fig. 9In the process, it is determined that the backup child process for the first child process is the third child process, so the value of the third child process "child2" is assigned to "aliveChild", and the request from the target application is processed based on the third child process "child2".

[0144] child1.kill() is used to stop the first child process child1. This method sends a SIGTERM signal to the first child process child1 to request it to terminate normally. If the child process terminates successfully, it will trigger an exit event.

[0145] The statement "let child3=fork('. / child.js')" is used to create a second child process "child3" based on the latest version information, so that requests from the target application can be processed through the second child process "child3", and the child process corresponding to the target application in the corresponding relationship is modified to the second child process, so the value of the second child process "child3" is assigned to "aliveChild".

[0146] As a possible implementation method, the embodiment of the present application can simultaneously create multiple sub-processes for the same version, and evenly distribute multiple requests from the target application to different sub-processes, thereby increasing the maximum number of requests processed simultaneously, shortening user waiting time, and improving user experience.

[0147] See also Fig.10 , which is a schematic diagram of a parallel processing request provided by an embodiment of the present application. Fig.10 In the process, the same number of subprocesses are created based on the number of cores of the CPU of the current computer device. When a request arrives, a subprocess is randomly selected to handle the request, so as to maximize the use of the multi-core processor capability of the CPU to increase the number of request processing.

[0148] Further, the following takes parallel processing of requests as an example for explanation. Fig.11 , which is a schematic diagram of an application scenario of a hot update method provided in an embodiment of the present application.

[0149] S1101: During the running of the target application, multiple requests from the target application are obtained.

[0150] S1102: Acquire the latest version information and current version information of the target application based on the request.

[0151] S1103: Determine whether the latest version information is consistent with the current version information. If so, execute S1104; if not, execute S1107.

[0152] S1104: Create multiple first sub-processes and third sub-processes, and add a corresponding relationship between the target application and the first sub-process in the corresponding relationship.

[0153] S1105: Evenly distribute the multiple requests to the multiple first sub-processes, and use the third sub-process as a standby sub-process.

[0154] S1106: After the processing of multiple requests is completed, the first sub-process is deleted.

[0155] S1107: Create a second sub-process based on the latest version information, and in the corresponding relationship, update the sub-process corresponding to the target application to the second sub-process.

[0156] S1108: Delete the first child process.

[0157] Therefore, the target application can be updated without restarting it, which improves the release speed of the target application. Moreover, during the hot update process, requests from the target application can still be processed, avoiding the loss of requests and improving the stability of the service.

[0158] With respect to the thermal update method described above, the present application also provides a corresponding thermal update device so that the thermal update method can be applied and implemented in practice.

[0159] See also Fig.12 , which is a schematic diagram of the structure of a thermal update device provided in an embodiment of the present application. Fig.12 As shown, the hot update device 1200 includes: an acquisition unit 1201, a determination unit 1202, a deletion and creation unit 1203 and an update unit 1204;

[0160] The acquisition unit 1201 is used to acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications;

[0161] The determining unit 1202 is configured to determine a first subprocess corresponding to the target application according to the corresponding relationship, wherein the first subprocess is a subprocess created based on the current version information;

[0162] The deletion creation unit 1203 is used to delete the first sub-process and create a second sub-process based on the latest version information if the current version information and the latest version information are inconsistent during the operation of the target application;

[0163] The updating unit 1204 is configured to update the sub-process corresponding to the target application to the second sub-process in the corresponding relationship.

[0164] It can be seen from the above technical solution that the latest version information of the target application and the current version information of the target application, as well as the corresponding relationship between the application and the sub-process are obtained. In the corresponding relationship, different applications correspond to different sub-processes, so that different applications have different business logics through different sub-processes, and the requests from each application are distributed to different sub-processes for processing based on the corresponding relationship. Based on the corresponding relationship, the first sub-process corresponding to the target application is determined, and the first sub-process is a sub-process created based on the current version information. During the operation of the target application, a hot update is performed, that is, if the current version information is inconsistent with the latest version information, it means that the target application should be updated, then the request from the target application is no longer distributed to the first sub-process, but the first sub-process is deleted, and a second sub-process is created based on the latest version information, and in the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process, so that the request from the target application is distributed to the second sub-process based on the updated corresponding relationship. Therefore, during the operation of the target application, if it is found that the target application is updated, a new second sub-process can be created based on the latest version information, thereby realizing hot update. Furthermore, since the processes are independent of each other, after deleting the old first child process, all allocated memory in the first child process will be deleted, and all reference relationships within the first child process will be deleted, thereby avoiding memory leaks and improving system performance.

[0165] As a possible implementation manner, the determining unit 1202 is further configured to:

[0166] If a first request from the target application is obtained before the second sub-process is created, a third sub-process is determined to be created based on the current version information;

[0167] The device also includes a distribution unit, configured to:

[0168] Distribute the first request to the third sub-process for processing.

[0169] As a possible implementation manner, the device further includes a distribution unit, configured to:

[0170] If a plurality of the first requests are distributed to the third sub-process for processing, after the second sub-process is created, the first requests that have not been processed by the third sub-process are distributed to the second sub-process for processing.

[0171] As a possible implementation manner, the determining unit 1202 is further configured to:

[0172] If, after the second sub-process is created, a second request from the target application is obtained, determining a second sub-process corresponding to the target application according to the corresponding relationship;

[0173] The device also includes a distribution unit, configured to:

[0174] Distribute the second request to the second sub-process for processing.

[0175] As a possible implementation manner, the device further includes a distribution unit, configured to:

[0176] If it is determined that the second sub-process fails to process the second request, the second request is distributed to a third sub-process for processing, where the third sub-process is a sub-process created based on the current version information.

[0177] As a possible implementation manner, the deletion creation unit 1203 is further used to:

[0178] After obtaining the third request from the target application, if the subprocess corresponding to the target application is not determined based on the corresponding relationship, creating the first subprocess based on the latest version information, and distributing the third request to the first subprocess for processing;

[0179] The device also includes an updating unit, configured to:

[0180] In the corresponding relationship, a corresponding relationship between the target application and the first sub-process is established.

[0181] As a possible implementation manner, the deletion creation unit 1203 is specifically used to:

[0182] After obtaining a plurality of the third requests from the target application, obtaining the number of cores of the central processing unit of the computer device;

[0183] Creating a plurality of the first sub-processes based on the latest version information and the number of cores, wherein the number of the first sub-processes is the same as the number of cores;

[0184] The device also includes a distribution unit, configured to:

[0185] Evenly distribute the plurality of the third requests to the plurality of the first sub-processes for processing.

[0186] As a possible implementation manner, if the number of the first sub-processes is n, and n is an integer greater than 1, the deletion creation unit 1203 is specifically configured to:

[0187] Delete n-1 of the first sub-processes;

[0188] The device also includes a distribution unit, configured to:

[0189] If a first request from the target application is obtained before the second sub-process is created, the first request is distributed to the first sub-process that has not been deleted for processing.

[0190] As a possible implementation manner, the obtaining unit 1201 is further configured to:

[0191] Obtaining a first request from the target application;

[0192] Based on the first request, the latest version information of the target application is obtained.

[0193] As a possible implementation manner, the obtaining unit 1201 is specifically configured to:

[0194] The latest version information of the target application is obtained at preset time intervals.

[0195] The present application also provides a computer device, which is the computer device described above. The computer device can be a server or a terminal device. The aforementioned hot update device can be built into the server or the terminal device. The computer device provided by the present application will be introduced from the perspective of hardware entity. Fig.13 The following is a schematic diagram of the server structure. Fig.14 Shown is a schematic diagram of the structure of the terminal equipment.

[0196] See also Fig.13, which is a schematic diagram of a server structure provided in an embodiment of the present application. The server 1400 may have relatively large differences due to different configurations or performances, and may include one or more processors 1422, such as central processing units (CPU), memory 1432, one or more application programs 1442 or storage media 1430 (such as one or more massive storage devices) for data 1444. Among them, the memory 1432 and the storage medium 1430 may be temporary storage or permanent storage. The program stored in the storage medium 1430 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage medium 1430 to execute a series of instruction operations in the storage medium 1430 on the server 1400.

[0197] The server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input and output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.

[0198] The steps performed by the server in the above embodiment can be based on the Fig.13 The server structure shown.

[0199] The CPU 1422 is used to perform the following steps:

[0200] Acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications;

[0201] Determine, according to the corresponding relationship, a first sub-process corresponding to the target application, where the first sub-process is created based on the current version information;

[0202] During the running of the target application, if the current version information is inconsistent with the latest version information, deleting the first sub-process and creating a second sub-process based on the latest version information;

[0203] In the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process.

[0204] Optionally, the CPU 1422 may also execute the method steps of any specific implementation of the hot update method in the embodiments of the present application.

[0205] See also Fig.14 , which is a structural diagram of a terminal device provided in an embodiment of the present application. Fig.14 The block diagram shows a partial structure of a smart phone related to a terminal device provided in an embodiment of the present application, and the smart phone includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a wireless fidelity (WiFi) module 1570, a processor 1580, and a power supply 1590. Those skilled in the art can understand that Fig.14 The structure of the smartphone shown in the figure does not constitute a limitation of the smartphone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0206] Combine the following Fig.14 A detailed introduction to the various components of a smartphone:

[0207] The RF circuit 1510 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 1580 for processing; in addition, the designed uplink data is sent to the base station.

[0208] The memory 1520 may be used to store software programs and modules. The processor 1580 implements various functional applications and data processing of the smartphone by running the software programs and modules stored in the memory 1520 .

[0209] The input unit 1530 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect user touch operations on or near it and drive the corresponding connection device according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0210] The display unit 1540 may be used to display information input by the user or information provided to the user and various menus of the smartphone. The display unit 1540 may include a display panel 1541, and the display panel 1541 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0211] The smartphone may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. As for other sensors that may be configured in the smartphone, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., they will not be described in detail here.

[0212] The audio circuit 1560, the speaker 1561, and the microphone 1562 can provide an audio interface between the user and the smartphone. The audio circuit 1560 can transmit the received audio data to the speaker 1561 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 1562 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1560 and converted into audio data, and then the audio data is output to the processor 1580 for processing, and then sent to another smartphone through the RF circuit 1510, or the audio data is output to the memory 1520 for further processing.

[0213] The processor 1580 is the control center of the smartphone, and uses various interfaces and lines to connect various parts of the entire smartphone, and executes various functions of the smartphone and processes data by running or executing software programs and / or modules stored in the memory 1520, and calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0214] The smart phone also includes a power supply 1590 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption management.

[0215] Although not shown, the smartphone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

[0216] In the embodiment of the present application, the memory 1520 included in the smart phone can store program codes and transmit the program codes to the processor.

[0217] The processor 1580 included in the smart phone can execute the hot update method provided in the above embodiment according to the instructions in the program code.

[0218] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute the hot update method provided in the above embodiment.

[0219] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the hot update method provided in various optional implementations of the above aspects.

[0220] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the above storage medium can be at least one of the following media: read-only memory (English: Read-Only Memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0221] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0222] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a technician familiar with the technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application. Based on the implementation methods provided in the above aspects, the present application can also be further combined to provide more implementation methods. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A hot update method, characterized in that: The method comprises: Acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications; Determining, according to the corresponding relationship, a first sub-process corresponding to the target application, wherein the first sub-process is a sub-process created based on the current version information; During the running of the target application, if the current version information is inconsistent with the latest version information, deleting the first sub-process and creating a second sub-process based on the latest version information; In the corresponding relationship, the sub-process corresponding to the target application is updated to the second sub-process.

2. The method according to claim 1, characterized in that Before the second sub-process is created, the method further includes: If a first request from the target application is obtained, determining a third subprocess created based on the current version information; Distribute the first request to the third sub-process for processing.

3. The method according to claim 2, characterized in that If a plurality of the first requests are distributed to the third sub-process for processing, the method further includes: After the second sub-process is created, the first request that has not yet been processed by the third sub-process is distributed to the second sub-process for processing.

4. The method according to claim 1, characterized in that: After the second sub-process is created, the method further includes: If a second request from the target application is obtained, determining a second subprocess corresponding to the target application according to the corresponding relationship; Distribute the second request to the second sub-process for processing.

5. The method according to claim 4, characterized in that The method further comprises: If it is determined that the second sub-process fails to process the second request, the second request is distributed to a third sub-process for processing, where the third sub-process is a sub-process created based on the current version information.

6. The method according to claim 1, characterized in that After obtaining the third request from the target application, the method further includes: If the sub-process corresponding to the target application is not determined based on the corresponding relationship, creating the first sub-process based on the latest version information, and distributing the third request to the first sub-process for processing; In the corresponding relationship, a corresponding relationship between the target application and the first sub-process is established.

7. The method according to claim 6, characterized in that After obtaining the plurality of third requests from the target application, creating the first sub-process based on the latest version information includes: Get the number of cores of the central processing unit of the computer device; Creating a plurality of the first sub-processes based on the latest version information and the number of cores, wherein the number of the first sub-processes is the same as the number of cores; The distributing the third request to the first sub-process for processing includes: Evenly distribute the plurality of the third requests to the plurality of the first sub-processes for processing.

8. The method according to claim 7, characterized in that If the number of the first sub-processes is n, and n is an integer greater than 1, then deleting the first sub-processes includes: Delete n-1 of the first sub-processes; If a first request from the target application is obtained before the second sub-process is created, the method further includes: The first request is distributed to the first child process that has not been deleted for processing.

9. The method according to claim 1, characterized in that: The method further comprises: Obtaining a first request from the target application; Obtain the latest version information of the target application, including: Based on the first request, the latest version information of the target application is obtained.

10. The method according to claim 1, characterized in that Obtain the latest version information of the target application, including: The latest version information of the target application is obtained at preset time intervals.

11. A thermal update device, characterized in that: The device comprises: an acquisition unit, a determination unit, a deletion and creation unit and an update unit; The acquisition unit is used to acquire the latest version information of the target application, the current version information of the target application, and the correspondence between the application and the sub-process, in which different sub-processes are used to process requests from different applications; The determining unit is configured to determine, according to the corresponding relationship, a first sub-process corresponding to the target application, wherein the first sub-process is a sub-process created based on the current version information; The deletion and creation unit is used to delete the first sub-process and create a second sub-process based on the latest version information if the current version information and the latest version information are inconsistent during the operation of the target application; The updating unit is used to update the sub-process corresponding to the target application to the second sub-process in the corresponding relationship.

12. The device according to claim 11, characterized in that The determining unit is further configured to: If a first request from the target application is obtained before the second sub-process is created, a third sub-process is determined to be created based on the current version information; The device also includes a distribution unit, configured to: Distribute the first request to the third sub-process for processing.

13. A computer device, characterized in that: The computer device comprises a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 10 according to the computer program.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 10.

15. A computer program product comprising a computer program, characterized in that When the method is executed on a computer device, the computer device is enabled to execute the method according to any one of claims 1 to 10.

Citation Information

Cited By

  • Intelligent application life cycle management method and system

    CN121918901A