Application program update detection method and device, storage medium and electronic device

CN120762731APending Publication Date: 2025-10-10QINGDAO HAIER TECH +2
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510971343.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

In the existing technology, application version update detection is difficult to adapt to different operating environments, resulting in excessive resource occupation or untimely updates, affecting user experience.

Method used

By determining the update query strategy based on the current network status, obtaining the query version data, and performing version comparison processing, the update detection results are judged, including using local cache space to obtain data when the network is abnormal, adjusting the query frequency when the network is normal, and performing lightweight or complete comparison to determine the version update level and strategy.

Benefits of technology

实现了高精度、低消耗的应用程序更新检测,适配不同运行环境,优化用户体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120762731A_ABST
    Figure CN120762731A_ABST
Patent Text Reader

Abstract

The invention discloses an application program update detection method and device, a storage medium and an electronic device, and relates to the technical field of computers.The application program update detection method comprises the steps that an update query strategy is determined according to the current network state, and query version data is obtained according to the update query strategy; performing version comparison processing on the local version data and the query version data to obtain a version comparison result; and executing update judgment processing according to the version comparison result and the query version data to obtain an update detection result. According to the technical scheme provided by the embodiment of the invention, high-precision and low-consumption update detection of the application program can be flexibly adapted to different operation environments, and the user experience of the update function of the application program is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to an application update detection method, device, storage medium, and electronic device. Background Art

[0002] In the field of application development, low user access to version updates has always been a core pain point for developers. Due to the caching mechanisms in user terminals and the lack of user habit of manually checking for updates, users often fail to notice application version updates in a timely manner. This lag in application versions and the reliance on manual user interaction for updates severely impacts the user experience.

[0003] Existing technologies perform update detection by polling the server. However, excessive detection frequency can lead to excessive usage of operating memory and communication channels, impacting the execution of more critical tasks on the terminal and server. On the other hand, too low a detection frequency makes it difficult to detect version information in a timely manner. This is particularly true for web applications, which rely on external containers such as browsers to load and run on user terminals. Limited by the container's caching strategy, the configuration method is relatively rigid, making existing update detection strategies difficult to adapt to different operating environments. In summary, the solutions provided by existing technologies struggle to achieve ideal update detection results and user experience. Summary of the Invention

[0004] The embodiments of the present application provide an application update detection method, device, storage medium and electronic device, the purpose of which is to achieve high-precision, low-consumption, and flexible adaptation to different operating environments for application update detection, and optimize the user experience of the application update function.

[0005] According to one aspect of an embodiment of the present application, a method for detecting an application update is provided, comprising:

[0006] Determine an update query strategy based on the current network status, and obtain query version data using the update query strategy;

[0007] Performing version comparison processing on the local version data and the query version data to obtain a version comparison result;

[0008] An update determination process is performed based on the version comparison result and the query version data to obtain an update detection result.

[0009] In an optional implementation, determining an update query strategy according to the current network state and obtaining query version data using the update query strategy includes:

[0010] In the case where the current network status is a network anomaly, detecting the current operating environment based on the update query strategy;

[0011] In a case where it is determined that the current running environment is a hybrid cache environment, the query version data is acquired in a local cache space.

[0012] In an optional embodiment, the updating query strategy is determined according to the current network state, and the query version data is acquired in the updating query strategy, including:

[0013] In a case where the current network state is a normal network state, a version query frequency matched with the current network state is determined based on the updating query strategy;

[0014] A version query request is sent to a target server at the version query frequency to acquire the query version data returned by the target server.

[0015] In an optional embodiment, the version comparison processing is performed on the local version data and the query version data to obtain a version comparison result, including:

[0016] In a case where the current network state is a strong network state, complete comparison processing is performed on the local version data and the query version data to obtain the version comparison result;

[0017] In a case where the current network state is a weak network state, lightweight comparison processing is performed on the local version data and the query version data to obtain the version comparison result.

[0018] In an optional embodiment, the query version data includes a query version identifier, a query submission identifier and a query content identifier.

[0019] The version comparison processing is performed on the local version data and the query version data to obtain a version comparison result, including:

[0020] In a case where it is determined through the version comparison processing that the query version identifier, the query submission identifier and the query content identifier are all unmatched with the local version data, it is determined that the version comparison result is version inconsistency.

[0021] In an optional embodiment, the updating judgment processing is performed according to the version comparison result and the query version data to obtain an updating detection result, including:

[0022] Based on the updating judgment processing, in a case where it is determined that the version comparison result is version inconsistency, a version update magnitude matched with the query version data is determined;

[0023] A version update strategy matched with the version update magnitude is determined as the updating detection result.

[0024] In an optional implementation, determining the version update level matched by the query version data includes:

[0025] In the case where the query version data and the major version identifier of the local version data are inconsistent, determining that the version update level is a mandatory update level;

[0026] In the case where the minor version identifiers of the query version data and the local version data are inconsistent, determining that the version update level is an incremental update level;

[0027] In a case where the revision identifiers of the query version data and the local version data are inconsistent, the version update level is determined to be a silent update level.

[0028] According to another aspect of an embodiment of the present application, there is provided an application update detection device, comprising:

[0029] A version query module, configured to determine an update query strategy based on the current network status and obtain query version data using the update query strategy;

[0030] A version comparison module is used to perform version comparison processing on the local version data and the query version data to obtain a version comparison result;

[0031] The update judgment module is used to perform update judgment processing according to the version comparison result and the query version data to obtain an update detection result.

[0032] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is run, the application update detection method provided by any embodiment of the present invention is executed.

[0033] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the application update detection method provided by any embodiment of the present invention through the computer program.

[0034] An embodiment of the present application provides an application update detection method, device, storage medium and electronic device, which determines an update query strategy by judging the current network status, obtains query version data according to the update query strategy, and performs version comparison processing on the local version data and the obtained query version data, and performs update judgment processing based on the obtained version comparison result and the query version data to obtain an update detection result, thereby solving the problem that the existing version query mechanism cannot adapt to different operating environments and causes excessive resource occupation or untimely updates, and realizes high-precision, low-consumption, and flexible adaptation to different operating environments update detection of applications, thereby optimizing the user experience of the application update function. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0037] Figure 1 Schematic diagram of a hardware environment for an interactive method of a smart device according to an embodiment of the present application;

[0038] Figure 2 This is a flow chart of an application update detection method provided by an embodiment of the present invention;

[0039] Figure 3 This is a flowchart of a method for detecting a Web application update in a WebView environment provided by an embodiment of the present invention;

[0040] Figure 4 This is a flow chart of a Web application update detection method provided by an embodiment of the present invention;

[0041] Figure 5 It is a structural diagram of an application update detection device provided by an embodiment of the present invention;

[0042] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0044] It should be noted that the terms "first", "second", etc. 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 sequential order. 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 a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0045] According to one aspect of the embodiment of the present application, an application update detection method is provided. The application update detection method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart residential (Intelligence House) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above application update detection method can be applied to Figure 1 In the hardware environment shown in FIG. 1 , which is composed of a terminal device 102 and a server 104. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0046] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth. The terminal device 102 may be, but is not limited to, a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing machine, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, smart curtains, smart audio and video, a smart socket, a smart speaker, a smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purifier, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0047] In this embodiment, a method for detecting application updates is provided, which is applied to a terminal device, and optionally to a Web application client running in the terminal device. Figure 2 A flowchart of an application update detection method provided by an embodiment of the present invention includes the following steps:

[0048] Step 210: Determine an update query strategy based on the current network status, and obtain query version data using the update query strategy.

[0049] The current network status may refer to the quality of the network currently being used by the terminal device. The update query policy may be preset to match different network quality states and may be used to control the terminal device to perform specific operations to obtain query version data. The query version data may describe the version and / or content of the application most recently provided by the application developer.

[0050] The terminal device can communicate with the server via the currently used network to obtain the query version data deployed by the developer on the server. To adapt to operating environments with different network quality states, an update query strategy can be preset for the current network state that may occur. The terminal device determines the matching update query strategy based on the current network state and can perform corresponding operations based on the update query strategy to obtain the query version data. Different current network states can adopt different update query strategies, so that the operations performed by the terminal device to obtain the query version data can be dynamically adjusted according to the current network state, making it more adaptable to the current network state.

[0051] In an optional embodiment, determining an update query strategy based on the current network status and obtaining query version data using the update query strategy may include: when the current network status is a network abnormality, detecting the current operating environment based on the update query strategy; and obtaining query version data in the local cache space when it is determined that the current operating environment is a hybrid cache environment.

[0052] A network anomaly may be a state where the network quality is insufficient to support communication between the terminal device and the server and the transmission of query version data. A current operating environment may be the software and / or hardware configuration of the terminal device used to run the application. A hybrid cache environment may be a terminal device configuration that includes local storage of query version data. Local cache space may be the storage space on the terminal device used to locally store query version data.

[0053] If the current network status is abnormal, the terminal device may have difficulty communicating with the server and obtaining query version data over the current network. Retrieving query version data from the server at this time may risk data transmission failure or excessive communication resource usage, impacting other business processes. Therefore, a matching update query strategy can be pre-defined for the abnormal network status. Based on this update query strategy, the current operating environment provided by the terminal device can be checked. The current operating environment can describe the configuration of the application running on the terminal device, including the cache configuration provided by the terminal device. If the current operating environment is a hybrid cache environment, it indicates that the terminal device has a configuration for local caching of query version data. It should be noted that other configurations of the hybrid cache environment are not limited here. Typically, query version data provided by the developer is stored only on the server. However, in a hybrid cache environment, query version data can be retrieved from the server and stored locally if the network quality is sufficient. It can be stored simultaneously on the server and in the local cache space, ensuring that the local cache space also stores the latest query version data. Therefore, if the current operating environment is determined to be a hybrid cache environment and the network is abnormal, query version data can be retrieved from the local cache space.

[0054] The above implementation provides a pre-configured hybrid cache environment. By locally storing the query version data on the server side, it is possible to obtain the latest query version data from the local cache space in the event of network anomalies, thereby realizing application update detection and further improving the reliability and environmental adaptability of application update detection.

[0055] In an optional embodiment, the application may be a web application, and the hybrid cache environment may be a mobile WebView environment pre-configured with a hybrid cache strategy combining Service Worker and local storage. Figure 3 A flowchart of a Web application update detection method in a WebView environment provided by an embodiment of the present invention. Figure 3 As shown, when the application client Client running in the terminal device initiates a request for the latest version of the application version.json, the latest query version data last_valid_version is checked through the Service Worker. When the network is normal, the Service Worker can query the local cache space LocalStorage and the server Server at the same time, obtain the latest query version data returned by the server Server and feed it back to the client Client, and at the same time update the query version data last_valid_version stored in the local cache space LocalStorage to the latest version returned by the server Server. In the case of network abnormalities, the Service Worker only obtains the latest query version data from the local cache space LocalStorage, thereby obtaining the latest query version data stored in the local cache space LocalStorage and feeding it back to the client Client. The above embodiment provides a highly reliable application update detection method for the technical problem of unstable network quality performance in the mobile WebView environment of Web applications.

[0056] In an optional embodiment, determining an update query strategy based on the current network status and obtaining query version data using the update query strategy may include: when the current network status is normal, determining a version query frequency that matches the current network status based on the update query strategy; sending a version query request to the target server at the version query frequency to obtain the query version data returned by the target server.

[0057] The term "normal network" may refer to a state where the network quality supports communication between the terminal device and the server and transmission of query version data. The term "version query frequency" may refer to the frequency of sending requests to the server to obtain query version data. The target server may refer to the server that provides the query version data. The term "version query request" may refer to a request to obtain query version data.

[0058] The current network status can have different network quality conditions when the network is normal. Different version query frequencies can be pre-set for different current network quality conditions, so that version query requests are sent to the target server at time intervals corresponding to the version query frequency. Generally, the better the current network quality, the higher the version query frequency can be set, and the shorter the time interval between each version query request is, so that application updates can be detected in a timely manner; the worse the current network quality, the lower the version query frequency can be set, and the longer the time interval between each version query request is, so as to avoid excessive request sending, which would occupy network communication resources and affect other business processing.

[0059] In an optional embodiment, the normal network status of the current network state can be divided into 5G / Wi-Fi, 4G, 3G and 2G according to the network type. Correspondingly, by setting the version query frequency matching the above four current network states, a version query request can be sent to the target server every 30 seconds under the 5G / Wi-Fi network to achieve real-time response to application updates under high-speed networks; a version query request can be sent to the target server every 5 minutes under the 4G network to balance real-time performance and energy consumption; a version query request can be sent to the target server every 9 minutes under the 3G network to appropriately reduce the detection density; a version query request can be sent to the target server every 15 minutes under the 2G network to minimize traffic consumption.

[0060] In an optional implementation, the query version data may include: a query version identifier, a query submission identifier, and a query content identifier.

[0061] The query version identifier may be data describing the version number of the application most recently provided by the application developer. The query submission identifier may be data describing the submission information of the application most recently provided by the application developer. The query content identifier may be data describing the content of the application most recently provided by the application developer.

[0062] After completing the development of each version of an application, the developer can submit the application's content and version number to the server. During the build phase, the server can generate a query version identifier in the query version data based on the submitted version number, and a query content identifier based on the application's content. Simultaneously, based on the information submitted by the developer regarding the application's content and version number, which may include the developer's identity or submission timestamp, the server generates a query submission identifier, thereby obtaining the query version data for the latest version of the application.

[0063] It should be noted that, when the server's construction environment is different, the query version identifier generated for the same version of the application may be different. In addition, if the developer repeatedly submits the same version of the application, the query submission identifier generated for each submission will also be different. Therefore, due to the different construction environments and / or repeated submissions by the developer, a "pseudo-update" situation may occur where the query version data corresponding to the same application content and version is different. The above-mentioned implementation method adds a query content identifier generated according to the application content to the query version data. Based on the query content identifier, it can be determined whether the content of the application has changed, thereby identifying the above-mentioned "pseudo-update" situation and improving the accuracy and reliability of update detection.

[0064] In an optional embodiment, the query version identifier can be the version number of the application. Specifically, the query version identifier can be composed of a major version number, a minor version number, and a revision version number, and can be distinguished by specific symbols. For example, the query version identifier can be "1.3.7", where the major version number is 1, the minor version number is 3, and the revision number is 7.

[0065] In an optional embodiment, the query commit identifier can be a Git Commit Hash, which can be a 40-digit hexadecimal string used to uniquely identify a commit in a Git repository, and can be calculated using the SHA-1 algorithm (Secure Hash Algorithm-1) based on the commit information, author, timestamp and other information.

[0066] In an optional embodiment, the query content identifier can be a Content Hash, which can be a unique hash value calculated based on the file content, such as code, pictures, text, etc. When the file content changes, the Content Hash value will also change accordingly.

[0067] Step 220: Perform version comparison processing on the local version data and the query version data to obtain a version comparison result.

[0068] The local version data may be data describing the version and / or content of an application currently running on the terminal device. The version comparison process may be an operation to determine whether the local version data is consistent with the query version data. The version comparison result may be data describing whether the local version data is consistent with the query version data.

[0069] After obtaining the query version data, whether the local version data is consistent with the query version data can be determined through version comparison processing, and a version comparison result can be obtained, so that the version comparison result can be used as a basis for application updates.

[0070] In an optional embodiment, performing version comparison processing on the local version data and the query version data to obtain a version comparison result may include: when the current network status is a strong network status, performing a complete comparison processing on the local version data and the query version data to obtain a version comparison result; when the current network status is a weak network status, performing a lightweight comparison processing on the local version data and the query version data to obtain a version comparison result.

[0071] A strong network state may be a state in which the network quality is good and stable and can support high-quality communication. A weak network state may be a state in which the network quality cannot ensure high-quality communication. A full comparison process may be an operation that compares the complete contents of the local version data and the query version data to determine whether they are completely consistent. A lightweight comparison process may be an operation that compares specific portions of the local version data and the query version data to determine whether the specific portions are consistent.

[0072] Depending on the network quality of the network used for communication between the terminal device and the server, the current network state can be divided into a strong network state and a weak network state. Optionally, the strong network state and the weak network state can be divided according to the judgment criteria of the weak network test in the prior art. For example, a weak network state can be determined when the packet loss rate is higher than a preset threshold and the delay is longer than a preset threshold, and vice versa. Therefore, in a strong network state, the communication quality between the terminal device and the server is relatively high, and the local version data and the query version data can be fully compared. The version comparison result can be obtained based on the consistency of all their contents, so that the consistency of each part of the content is mutually verified, ensuring the reliability of the version comparison result; in a weak network state, the communication quality between the terminal device and the server is relatively low. Only a lightweight comparison can be performed on the local version data and the query version data. The version comparison result can be obtained based on the consistency of only a specific part. The specific part can be content that is sufficient to reflect the consistency of the local version data and the query version data, so as to save network communication resources and improve the efficiency of obtaining the version comparison result.

[0073] In an optional implementation, the complete comparison process may be an operation of comparing the version identifier, submission identifier, and content identifier in the local version data and the query version data respectively to determine whether they are consistent.

[0074] The version identifier in the local version data and the query version data can be data respectively describing the version number of the application program running in the terminal device and the application program provided by the developer in the server last time, and consistency can indicate that the version number is not updated, and inconsistency can indicate that the version number is updated. The commit identifier in the local version data and the query version data can be data respectively describing the commit information of the application program running in the terminal device and the application program provided by the developer in the server last time, and consistency can indicate that the developer does not have a new commit operation, and inconsistency can indicate that the developer performs a new application program commit operation. The content identifier in the local version data and the query version data can be data respectively describing the content of the application program running in the terminal device and the application program provided by the developer in the server last time, and consistency can indicate that the content of the application program is not updated, and inconsistency can indicate that the content of the application program is updated. Therefore, through complete comparison processing, the version comparison result can be obtained according to the consistency of the version identifier, the commit identifier and the content identifier.

[0075] In an optional embodiment, the lightweight comparison processing can be an operation of comparing the version identifier in the local version data and the query version data to determine whether they are consistent.

[0076] Among them, since the information contained in the commit identifier and the content identifier is more complex, the operation of comparing them can occupy more network communication resources, or can have the risk of not being able to correctly complete the comparison due to poor communication quality in a weak network state. Therefore, only the version identifier can be compared.

[0077] In an optional embodiment, the version comparison processing of the local version data and the query version data to obtain the version comparison result can include: in the case that it is determined through the version comparison processing that the query version identifier, the query commit identifier and the query content identifier are all unmatched with the local version data, determining that the version comparison result is version inconsistency.

[0078] Among them, corresponding to the query version data, the local version data can also include data describing the version number, commit information and content of the application program running in the terminal device. The query version identifier, the query commit identifier and the query content identifier are all unmatched with the local version data, which can indicate that the version number, commit information and content of the application program submitted by the developer last time are all different from the application program currently running in the terminal device, and therefore it can be determined that the version comparison result is version inconsistency.

[0079] The above implementation can avoid misjudging the same version of an application as inconsistent due to changes in the query version identifier and / or the query submission identifier when the build environment changes and / or the developer repeatedly submits the same version of the application, thereby improving the reliability and accuracy of update detection.

[0080] Step 230: Perform update judgment processing based on the version comparison result and the query version data to obtain an update detection result.

[0081] The update determination process may be to determine whether the application currently running in the terminal device needs to be updated and determine the corresponding operations to be performed. The update detection result may be data describing the update-related operations to be performed on the application currently running in the terminal device.

[0082] Based on the version comparison results, it can be determined whether the version and / or content of the application currently running in the terminal device is consistent with the version and / or content most recently provided by the developer. Through the update judgment processing, it is determined whether the application currently running in the terminal device needs to be updated, and the operations that need to be performed to complete the corresponding update, and the above judgment results of the update judgment processing are determined as the update detection results.

[0083] In an optional embodiment, update judgment processing is performed based on the version comparison result and the query version data to obtain an update detection result, which may include: based on the update judgment processing, when it is determined that the version comparison result is inconsistent, determining the version update level that matches the query version data; and determining the version update policy that matches the version update level as the update detection result.

[0084] The version update level may describe the degree of difference between the application described in the query version data and the currently running application. The version update policy may be a specific update-related operation that needs to be performed on the application and may be pre-set for each version update level.

[0085] If the version comparison result is inconsistent, it can indicate that the latest application submitted by the developer on the server is not the same version as the application currently running on the terminal device. In this case, it can be determined that the application currently running on the terminal device needs to be updated, and the operations required for the update can be further determined. Specifically, by determining the version update level that matches the query version data, a pre-set version update policy that matches the version update level can be obtained, thereby obtaining an update detection result, so that the application running on the terminal device can be updated according to the update detection result.

[0086] In an optional embodiment, the version update level may include: forced update level, incremental update level and silent update level; determining the version update level based on the local version data and the query version data may include: when it is determined that the major version identifiers of the local version data and the query version data are inconsistent, determining the version update level to be a forced update level; when it is determined that the minor version identifiers of the local version data and the query version data are inconsistent, determining the version update level to be an incremental update level; when it is determined that the revision version identifiers of the local version data and the query version data are inconsistent, determining the version update level to be a silent update level.

[0087] The major version identifier, minor version identifier, and revision version identifier can be the three parts that make up the version identifier, describing the major version number, minor version number, and revision number of the application version number, respectively. The forced update level can describe situations where an application has undergone underlying changes that are incompatible with the previous version and requires a forced update. The incremental update level can describe situations where an application has been updated with new features but remains compatible with the previous version and requires an incremental update. The silent update level can describe situations where an application has been updated only to fix vulnerabilities or optimize performance and can be updated silently.

[0088] By comparing the version identifiers of the local version data and the query version data, the consistency of the major version identifier, minor version identifier and revision version identifier can be obtained respectively, so as to determine the extent to which the latest application provided by the developer has been updated relative to the application currently running in the terminal device, and determine the corresponding version update magnitude.

[0089] In an optional embodiment, determining the version update level based on the local version data and the query version data may include: sequentially comparing the major version identifier, minor version identifier, and revision version identifier of the local version data and the query version data, stopping the comparison once an inconsistency occurs, and determining the version update level corresponding to the inconsistent identifier.

[0090] Exemplarily, the version identifier in the local version data may be the version number "1.3.7", where the major version identifier is 1, the minor version identifier is 3, and the revision version identifier is 7. The version identifier in the query version data may be "1.4.7", where the major version identifier is 1, the minor version identifier is 4, and the revision version identifier is 7. When determining the level of the version update, the major version identifiers are compared first. When the major version identifiers are both 1, the minor version identifiers are compared. There is an inconsistency between the minor version identifiers of the local version data and the query version data, which are 3 and 4 respectively. Therefore, it can be determined that there is an update to the application. The new version provided by the developer has new features but remains compatible with the old version. The level of the version update is determined to be an incremental update level.

[0091] In an optional embodiment, the version update policy may include: a forced update policy, an incremental update policy and a silent update policy; determining the version update policy that matches the version update level as the update detection result may include: determining the forced update policy that matches the forced update level as the update detection result, or determining the incremental update policy that matches the incremental update level as the update detection result, or determining the silent update policy that matches the silent update level as the update detection result.

[0092] The forced update strategy may include obtaining the application corresponding to the query report data from the server, performing a forced update based on the obtained application, and displaying an update prompt. The incremental update strategy may include obtaining the application corresponding to the query report data from the server, performing an incremental update based on the obtained application in the form of a hot update patch, and providing a non-blocking prompt. The silent update strategy may include obtaining the application corresponding to the query report data from the server, and performing a silent preload based on the obtained application.

[0093] For example, Figure 4 Flowchart of a Web application update detection method provided by an embodiment of the present invention. Figure 4 As shown, during the server build phase, the Git commit hash and content hash are obtained to generate a version fingerprint. This fingerprint is then written to a version file and deployed on the server to obtain the query version data. This data can also be written to the front-end runtime file and used as local version data when the application runs on the terminal device. In the runtime environment, the update detection process begins by initializing the detector and loading configuration parameters. In the event of network anomalies, if a mobile WebView environment is detected, a hybrid caching strategy can be enabled, and a Service Worker can be called to take over the update query process from the server. In non-WebView environments, an intelligent polling strategy is activated to determine the update detection frequency. When the detection time is reached based on the update detection frequency, a query request for the new version is sent to the server. Depending on the detected network conditions, a full version comparison or a lightweight check is performed. If the queried version is inconsistent with the currently running version, the update strategy is triggered to determine the update type and select the appropriate update strategy based on the update magnitude.

[0094] According to another aspect of the embodiments of the present invention, Figure 5 A schematic diagram of a structure of an application update detection device provided by an embodiment of the present invention is shown as follows: Figure 5 As shown, the device includes a version query module 510, a version comparison module 520 and an update judgment module 530, wherein:

[0095] A version query module 510 is configured to determine an update query strategy based on the current network status and obtain query version data using the update query strategy;

[0096] A version comparison module 520 is configured to perform version comparison processing on the local version data and the query version data to obtain a version comparison result;

[0097] The update judgment module 530 is used to perform update judgment processing according to the version comparison result and the query version data to obtain an update detection result.

[0098] In an optional embodiment, the version query module 510 may include: an environment detection unit, which is used to detect the current operating environment based on the update query strategy when the current network status is a network abnormality; and a cache acquisition unit, which is used to obtain query version data in the local cache space when it is determined that the current operating environment is a hybrid cache environment.

[0099] In an optional embodiment, the version query module 510 may include: a frequency determination unit, used to determine the version query frequency that matches the current network status based on the update query strategy when the current network status is normal; a request sending unit, used to send a version query request to the target server at the version query frequency to obtain the query version data returned by the target server.

[0100] In an optional embodiment, the version comparison module 520 may include: a complete comparison unit, which is used to perform a complete comparison process on the local version data and the query version data when the current network status is a strong network status, and obtain a version comparison result; a lightweight comparison unit, which is used to perform a lightweight comparison process on the local version data and the query version data when the current network status is a weak network status, and obtain a version comparison result.

[0101] In an optional embodiment, the query version data includes: a query version identifier, a query submission identifier and a query content identifier; the version comparison module 520 may include: a comparison result unit, which is used to determine that the version comparison result is inconsistent when it is determined through version comparison processing that the query version identifier, the query submission identifier and the query content identifier cannot match the local version data.

[0102] In an optional embodiment, the update judgment module 530 may include: a level determination unit, which is used to determine the version update level that matches the query version data based on the update judgment processing when the version comparison result is determined to be inconsistent; and a policy determination unit, which is used to determine the version update policy that matches the version update level as the update detection result.

[0103] In an optional embodiment, the level determination unit can be specifically used to: determine the version update level as a forced update level when the major version identifier of the queried version data is inconsistent with the local version data; determine the version update level as an incremental update level when the minor version identifier of the queried version data is inconsistent with the local version data; and determine the version update level as a silent update level when the revision version identifier of the queried version data is inconsistent with the local version data.

[0104] According to another aspect of the embodiments of the present invention, Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 6 As shown, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of processors 610 in the electronic device can be one or more. Figure 6 In the figure, a processor 610 is used as an example; the processor 610, the memory 620, the input device 630 and the output device 640 in the electronic device can be connected via a bus or other means. Figure 6 The bus connection is taken as an example.

[0105] The memory 620, as a computer-readable storage medium, can be used to store software programs, computer executable programs, and modules, such as the program instructions / modules corresponding to the application update detection method in the embodiments of the present invention (for example, the version query module 510, the version comparison module 520, and the update determination module 530 in the application update detection device). The processor 610 executes the software programs, instructions, and modules stored in the memory 620 to execute various functional applications and data processing of the electronic device, thereby implementing the above-mentioned application update detection method.

[0106] The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 620 may further include a memory remotely located relative to the processor 610, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0107] The input device 630 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. It can also be a camera for capturing images and a sound pickup device for capturing audio data. The output device 640 may include a display device such as a display screen and an audio device such as a speaker. It should be noted that the specific composition of the input device 630 and the output device 640 can be set according to actual circumstances. The processor 610 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 620.

[0108] According to another aspect of an embodiment of the present invention, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is run, the following application update detection method is executed:

[0109] Determine an update query strategy based on the current network status, and obtain query version data using the update query strategy;

[0110] Performing version comparison processing on the local version data and the query version data to obtain a version comparison result;

[0111] An update determination process is performed based on the version comparison result and the query version data to obtain an update detection result.

[0112] Of course, the computer executable instructions of the storage medium provided by the embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the application update detection method provided by any embodiment of the present invention.

[0113] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0114] It is worth noting that in the embodiment of the above-mentioned application update detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0115] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for detecting application updates, characterized in that: include: Determine an update query strategy based on the current network status, and obtain query version data using the update query strategy; Performing version comparison processing on the local version data and the query version data to obtain a version comparison result; An update determination process is performed based on the version comparison result and the query version data to obtain an update detection result.

2. The method according to claim 1, characterized in that The step of determining an update query strategy according to the current network state and obtaining query version data using the update query strategy includes: In the case where the current network status is a network anomaly, detecting the current operating environment based on the update query strategy; When it is determined that the current operating environment is a hybrid cache environment, the query version data is obtained in a local cache space.

3. The method according to claim 1, characterized in that The step of determining an update query strategy according to the current network state and obtaining query version data using the update query strategy includes: When the current network status is normal, determining a version query frequency that matches the current network status based on the update query strategy; A version query request is sent to the target server at the version query frequency to obtain the query version data returned by the target server.

4. The method according to claim 1, wherein The performing version comparison processing on the local version data and the query version data to obtain a version comparison result includes: When the current network state is a strong network state, performing a complete comparison process on the local version data and the query version data to obtain the version comparison result; When the current network state is a weak network state, a lightweight comparison process is performed on the local version data and the query version data to obtain the version comparison result.

5. The method according to claim 1, wherein The query version data includes: a query version identifier, a query submission identifier, and a query content identifier; The performing version comparison processing on the local version data and the query version data to obtain a version comparison result includes: When it is determined through the version comparison process that the query version identifier, the query submission identifier, and the query content identifier all fail to match the local version data, the version comparison result is determined to be version inconsistency.

6. The method according to claim 1, characterized in that The performing update judgment processing according to the version comparison result and the query version data to obtain an update detection result includes: Based on the update judgment process, if it is determined that the version comparison result is inconsistent, determining the version update level matched by the query version data; The version update strategy that matches the version update magnitude is determined as the update detection result.

7. The method according to claim 6, characterized in that Determining the version update level matched by the query version data includes: In the case where the query version data and the major version identifier of the local version data are inconsistent, determining that the version update level is a mandatory update level; In the case where the minor version identifiers of the query version data and the local version data are inconsistent, determining that the version update level is an incremental update level; In a case where the revision identifiers of the query version data and the local version data are inconsistent, the version update level is determined to be a silent update level.

8. An application update detection device, characterized in that: include: A version query module, configured to determine an update query strategy based on the current network status and obtain query version data using the update query strategy; A version comparison module is used to perform version comparison processing on the local version data and the query version data to obtain a version comparison result; The update judgment module is used to perform update judgment processing according to the version comparison result and the query version data to obtain an update detection result.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the application update detection method according to any one of claims 1 to 7 when running.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the application update detection method according to any one of claims 1 to 7 through the computer program.

Citation Information

Cited By

  • Web application intelligent update detection and notification method based on multi-dimensional version signature

    CN121349497A

  • A web application intelligent update detection and notification method based on multi-dimensional version signature

    CN121349497B