A webpage processing method and device, electronic equipment and medium

By generating source code detection files to identify the highest scripting language version supported by webpage display components, and directly selecting the target scripting language version for loading, the compatibility issues of webpage display components are resolved, and the compatibility and smoothness of webpage loading are improved.

CN122286017APending Publication Date: 2026-06-26ZHEJIANG UNIVIEW TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2024-12-24
Publication Date
2026-06-26

Smart Images

  • Figure CN122286017A_ABST
    Figure CN122286017A_ABST
Patent Text Reader

Abstract

This application discloses a webpage processing method, apparatus, electronic device, and medium. The method includes: determining source code detection files generated based on the functional characteristics of each basic scripting language version; loading and running the source code detection files by a webpage display component, executing the functional characteristics of the basic scripting language version by running the source code detection files; determining the highest scripting language version supported by the webpage display component based on the execution result of the source code detection files, and selecting a webpage functional module of the target scripting language version for loading based on the highest scripting language version. This solution solves the current problem of not being able to accurately determine the highest scripting language version supported by a webpage display component, and improves the accuracy of highest scripting language version detection by running the source code detection files of the basic scripting language versions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of web page loading technology, and in particular to a web page processing method, apparatus, electronic device and medium. Background Technology

[0002] In mobile application development, hybrid development is a common approach that combines native development with web technologies such as HTML5, CSS, and JavaScript to quickly build feature-rich applications across multiple platforms. However, hybrid development faces some compatibility challenges. Different operating systems and different versions of WebView may have varying levels of support for the HTML5 standard, potentially leading to incompatibility between the WebView component and the loaded web page functional modules.

[0003] In the current solution, the webpage display component iterates through and loads webpage functional modules in different scripting languages, attempting to find a compatible version. However, multiple loading and display attempts cause the webpage interface to refresh repeatedly, resulting in screen flickering. Alternatively, other API tools can be used to determine the browser version of the webpage display component and load the corresponding version of the webpage functional modules. However, these tools have limited capabilities and may fail to accurately determine the browser version in some cases, leading to the loading of incorrect webpage functional module versions and webpage display failure. Summary of the Invention

[0004] This application provides a web page processing method, apparatus, electronic device, and medium to accurately determine the highest scripting language version supported by a web page display component, and adaptively load compatible target scripting language version web page function modules directly into the web page display component, thereby improving the efficiency and smoothness of web page display.

[0005] According to one aspect of this application, a webpage processing method is provided, the method comprising:

[0006] For each version of the basic scripting language, determine the source code detection files generated based on the functional characteristics of each version of the basic scripting language;

[0007] The webpage display component loads and runs the source code detection file, and executes the various functional features of the underlying scripting language version by running the source code detection file;

[0008] Based on the running results of the source code detection file by the webpage display component, the highest scripting language version supported by the webpage display component is determined, so that when loading a webpage function module in the webpage display component, the target scripting language version of the webpage function module is selected and loaded according to the highest scripting language version.

[0009] According to one aspect of this application, a web page processing apparatus is provided, the apparatus comprising:

[0010] The source code detection file generation module is used to determine the source code detection file generated based on the functional characteristics of each basic scripting language version.

[0011] The running module can be used to enable the web page display component to load and run the source code detection file, and execute the various functional features in the basic scripting language version by running the source code detection file;

[0012] The highest scripting language version determination module is used to determine the highest scripting language version supported by the webpage display component based on the running results of the source code detection file by the webpage display component, so that when a webpage function module to be loaded is selected in the webpage display component, the webpage function module with the target scripting language version is loaded according to the highest scripting language version.

[0013] According to another aspect of this application, an electronic device is provided, the electronic device comprising:

[0014] At least one processor; and

[0015] A memory that is communicatively connected to at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the web page processing method of any embodiment of this application.

[0017] According to another aspect of this application, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the web page processing method of any embodiment of this application.

[0018] The technical solution of this application embodiment determines, for each basic scripting language version, a source code detection file generated according to the functional characteristics of each basic scripting language version; the web page display component loads and runs the source code detection file, and executes the functional characteristics of the basic scripting language version by running the source code detection file; based on the running result of the source code detection file by the web page display component, the highest scripting language version supported by the web page display component is determined, so that when loading a web page functional module in the web page display component, the web page functional module of the target scripting language version is selected and loaded according to the highest scripting language version. The above solution generates source code detection files based on the functional characteristics of each basic scripting language version. It then detects the highest scripting language version based on the webpage display component's execution of these files. This accurately and conveniently determines the highest scripting language version supported by the webpage display component, solving the current problem of inaccurate detection of supported scripting language versions. Furthermore, it adaptively selects the target scripting language version based on the highest supported version, directly loading webpage functional modules of the target scripting language version into the webpage display component. This eliminates the need to iterate and verify compatibility during the loading process, resolving screen flickering issues caused by multiple loading and refreshing of webpage functional modules, and improving webpage loading compatibility and smoothness.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 A flowchart illustrating a webpage processing method provided in this application embodiment;

[0022] Figure 2 A flowchart illustrating a webpage processing method provided in another embodiment of this application;

[0023] Figure 3 A schematic diagram of a version management module provided in another embodiment of this application;

[0024] Figure 4 A flowchart illustrating a webpage processing method provided in yet another embodiment of this application;

[0025] Figure 5 A module structure diagram for one specific implementation of this application;

[0026] Figure 6 This is a schematic diagram of the structure of a web page processing device provided in an embodiment of this application;

[0027] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0029] It should be noted that the terms "first," "second," "third," "fourth," "actual," "preset," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Figure 1 This is a flowchart illustrating a webpage processing method provided in an embodiment of this application. This embodiment is applicable to situations where a webpage is loaded and displayed using a webpage display component. The method can be executed by a webpage processing device, which can be implemented in hardware and / or software. This webpage processing device can be configured in an electronic device, such as a mobile terminal or a desktop computer, that supports webpage display. Figure 1 As shown, the method includes:

[0031] S110. For each basic scripting language version, determine the source code detection file generated based on the functional characteristics of each basic scripting language version.

[0032] The "basic scripting language version" refers to all currently existing scripting language versions, and the "features" of each basic scripting language version represent the functionalities that the scripting language version can implement. The "source code detection file" is the executable code file that implements each feature.

[0033] For example, in order to test each basic scripting language version to determine whether the web page display component supports the version, a source code test file can be generated in advance according to the functional characteristics of each basic scripting language version. When the source code test file corresponding to a basic scripting language version is executed, all functional characteristics in that basic scripting language version can be implemented, covering all functional characteristics to achieve comprehensive testing of the basic scripting language version.

[0034] In this embodiment of the application, the process of generating source code detection files based on the functional characteristics of each basic scripting language version includes:

[0035] Based on the features of the current base scripting language version, generate code modules that can execute each feature, and package the code modules to obtain the source code detection file corresponding to the current base scripting language version.

[0036] If there are changes and / or additions to the functional features, code modules capable of executing each functional feature will be generated based on the changed and / or added functional features, and the code modules will be packaged to obtain the source code detection file corresponding to another version of the basic scripting language.

[0037] For example, assuming the underlying scripting language version ES3 includes features new-feature-A, new-feature-B, and new-feature-C, then code module A (which implements new-feature-A), code module B (which implements new-feature-B), and code module C (which implements new-feature-C) are generated. Code modules A, B, and C are then packaged to obtain the source code analysis file corresponding to ES3. If there are changes and / or additions to the code modules, then code modules implementing the original features and the changed / added features are generated based on the changed and / or added features. All code modules are then packaged to obtain the source code analysis file corresponding to another underlying scripting language version. For example, if the underlying scripting language version ES5 has modified `new-feature-C` compared to ES3, then code module A, which implements `new-feature-A`, code module B, which implements `new-feature-B`, and code module C', which implements the modified `new-feature-C`, are generated. Code modules A, B, and C' are then packaged to obtain the corresponding ES5 source code analysis file. If the underlying scripting language version ES6 adds the features `new-feature-D`, `new-feature-E`, and `new-feature-F` compared to ES5, then in addition to generating code modules A, B, and C', code modules D, D', D'', and F'', also need to be generated. Code modules A, B, C', D, E, and F are then packaged to obtain the corresponding ES6 source code analysis file.

[0038] S120. The web page display component loads and runs the source code detection file, and executes the various functional features in the basic scripting language version by running the source code detection file.

[0039] Among them, the webpage display component is a component that can load webpage functional modules to display the webpage, such as the WebView component. Different operating systems and different versions of the webpage display component may support different scripting language versions. The webpage display component can load and run the source code detection files corresponding to each basic scripting language version. During the process of running the source code detection files for each basic scripting language version, the code modules corresponding to each functional feature in the source code detection files are executed one by one. This allows the webpage display component to check whether it supports running the functional features of that basic scripting language version by executing the source code detection files.

[0040] In this embodiment of the application, the webpage display component loads and runs the source code detection file, including:

[0041] The webpage display component loads and runs the source code detection file corresponding to the lowest version of the basic scripting language.

[0042] If the web page display component successfully runs the source code detection file corresponding to the lowest version of the basic scripting language, then the web page display component will continue to load and run the source code detection files corresponding to other versions of the basic scripting language.

[0043] Otherwise, if the browser is found to be faulty, exit the program.

[0044] In this embodiment, before loading and running the source code detection files for each basic scripting language version into the webpage display component, the webpage display component can first load and run the source code detection file corresponding to the lowest version of the basic scripting language. If the webpage display component successfully runs the source code detection file for the lowest version of the basic scripting language, it is determined that the browser can run normally, and then the loading and running of the source code detection files corresponding to other versions of the basic scripting language can continue. If the webpage display component fails to execute the source code detection file corresponding to the lowest version of the basic scripting language, it indicates a browser error, and the loading and running of the source code detection files corresponding to other versions of the basic scripting language will inevitably fail as well. Therefore, there is no need to continue loading and running the source code detection files corresponding to other versions of the basic scripting language, reducing unnecessary waste of computing resources.

[0045] S130. Based on the running results of the source code detection file by the web page display component, determine the highest scripting language version supported by the web page display component, so that when loading a web page function module in the web page display component, the target scripting language version of the web page function module is selected and loaded according to the highest scripting language version.

[0046] For example, based on the execution status of each source code detection file by the webpage display component, the supported versions of various basic scripting languages ​​are determined. If the webpage display component can successfully execute the source code detection file corresponding to a basic scripting language version, it is determined that the webpage display component supports that basic scripting language version; if it fails to execute, it is determined that the webpage display component does not support that basic scripting language version. In determining whether the webpage display component has successfully executed a source code detection file, if the webpage display component successfully executes all code modules in the source code detection file, it is determined that the webpage display component has successfully executed the source code detection file and supports the corresponding basic scripting language version. If any code module fails to execute, it is determined that the webpage display component has successfully executed the source code detection file, but the webpage display component does not support the corresponding basic scripting language version.

[0047] In this embodiment of the application, the web page component can be located in a browser on a PC or a browser on a mobile device. On a PC, because there is no independent memory, the highest scripting language version needs to be re-determined every time the browser is opened. On a mobile device, the highest scripting language version can be cached in memory after it is determined, and the highest scripting language version can be used directly the next time the browser is opened, unless the browser notifies an update to re-determine the highest scripting language version.

[0048] The technical solution of this application embodiment determines, for each basic scripting language version, a source code detection file generated according to the functional characteristics of each basic scripting language version; the web page display component loads and runs the source code detection file, and executes the functional characteristics of the basic scripting language version by running the source code detection file; based on the running result of the source code detection file by the web page display component, the highest scripting language version supported by the web page display component is determined, so that when loading a web page functional module in the web page display component, the web page functional module of the target scripting language version is selected and loaded according to the highest scripting language version. The above solution generates source code detection files based on the functional characteristics of each basic scripting language version. It then detects the highest scripting language version based on the webpage display component's execution of these files. This accurately and conveniently determines the highest scripting language version supported by the webpage display component, solving the current problem of inaccurate detection of supported scripting language versions. Furthermore, it adaptively selects the target scripting language version based on the highest supported version, directly loading webpage functional modules of the target scripting language version into the webpage display component. This eliminates the need to iterate and verify compatibility with the webpage display component during the loading process, resolving the screen flickering issue caused by multiple loading and refreshing of webpage functional modules, and improving the compatibility and smoothness of webpage loading.

[0049] Figure 2 This is a flowchart illustrating a webpage processing method according to another embodiment of this application. This embodiment is an optimization based on the above embodiment; solutions not described in detail in this embodiment are found in the above embodiment. Figure 2 As shown, the method in this embodiment of the application specifically includes the following steps:

[0050] S210. For each basic scripting language version, determine the source code detection file generated based on the functional characteristics of each basic scripting language version.

[0051] S220. Sort the versions of each basic scripting language contained in the version management information according to their version level.

[0052] For example, version management information can be managed through a version management module, summarizing all currently developed basic scripting language versions. For example, such as... Figure 3 As shown, the version management module can manage versions of various basic scripting languages, such as ECMAScript ES3, ES5, ES6, ..., ESN versions. In ES3, new_Feature3-A, new_Feature3-B, and new_Feature3-C represent new feature modules in that version, which are feature modules gradually updated during version optimization. The same logic applies to new feature modules in other basic scripting language versions.

[0053] For example, the versions of each basic scripting language can be sorted by version from highest to lowest, such as ES3, ES5, ES6, ..., ESN. Sort the versions of each basic scripting language by version, which clearly and intuitively determines the priority of each version, making it easier to select the version to run for testing first and improving testing efficiency.

[0054] S230. For each sorted basic scripting language version, divide the version range according to the binary search method, load the source code detection files corresponding to the lowest and highest versions in the version range into the web page display component for execution, and take the version range where the lowest version runs successfully and the highest version fails as the target range.

[0055] The binary search method involves dividing all sorted basic scripting language versions into two version ranges for testing. The version ranges that meet the conditions are then divided into two version ranges for testing, and so on, until the final condition is met. In this embodiment, the final condition is to determine the highest scripting language version supported by the webpage display component.

[0056] Specifically, for the sorted basic scripting language versions, all basic scripting language versions are divided into two version ranges using a binary search approach. The source code detection files corresponding to the lowest and highest versions within each range are then loaded into the webpage display component for execution. The source code detection files for the highest and lowest versions are pre-written execution code files based on the characteristics of the scripting language versions. Source code detection files for all basic scripting language versions can be pre-written and stored, and then called when execution detection is required. Alternatively, source code detection files can be written specifically for the versions that require the webpage display component to run during the execution detection process.

[0057] For example, regarding version ranges, if the lowest version of the source code detection file in a version range runs successfully in the web page display component, while the highest version of the source code detection file fails to run in the web page display component, it means that the highest scripting language version supported by the web page display component is within that version range. In this case, the version range is taken as the target range, and version division and detection are continued according to the binary search method.

[0058] In this embodiment of the application, for each sorted basic scripting language version, version intervals are divided using a binary search method. The lowest and highest versions within each interval are loaded into the webpage display component for execution. The version interval where the lowest version runs successfully and the highest version fails is taken as the target interval, including:

[0059] Load the source code detection file of the highest version of the basic scripting language into the webpage display component and run it;

[0060] If the operation is successful, the highest version of the base scripting language will be used as the highest scripting language version.

[0061] Otherwise, the source code detection file of the basic scripting language version corresponding to the median of the sorted basic scripting language versions will be loaded into the web page display component for execution;

[0062] If the source code detection file of the underlying scripting language version corresponding to the median runs successfully, then the version range from the underlying scripting language version corresponding to the median to the highest version of the underlying scripting language version is taken as the target range.

[0063] Otherwise, the target range is the range between the lowest version of the underlying scripting language and the version range corresponding to the median version of the underlying scripting language.

[0064] In this embodiment, to improve testing efficiency and quickly and efficiently determine the highest scripting language version supported by the webpage display component, instead of using a binary search method to divide the versions and then running the source code detection files corresponding to the highest and lowest versions across all version ranges, the source code detection file of the highest-version basic scripting language version is first loaded into the webpage display component for execution. If the execution is successful, the highest-version basic scripting language version is taken as the highest scripting language version. If the execution fails, the source code detection file of the basic scripting language version corresponding to the median is loaded into the webpage display component for execution; that is, the source code detection file of the basic scripting language version in the middle position of the sorted basic scripting language versions is loaded into the webpage display component for execution. If the execution is successful, it indicates that the highest scripting language version supported by the webpage display component is located in the version range from the basic scripting language version corresponding to the median to the highest-version basic scripting language version, and this version range is taken as the target range. If the execution fails, it indicates that the highest scripting language version supported by the webpage display component is located in the version range from the lowest-version basic scripting language version to the basic scripting language version corresponding to the median, and this version range is taken as the target range. Further, the target interval is divided and loaded using a bisection method. That is, the target interval is divided into two version intervals based on the basic scripting language version corresponding to the median. The source code detection file of the basic scripting language version corresponding to the median is loaded into the web page display component for execution. If the execution is successful, the basic scripting language version corresponding to the median and the endpoint version of the target interval that failed to run are taken as the target interval. If the execution fails, the basic scripting language version corresponding to the median and the endpoint version of the target interval that succeeded to run are taken as the target interval.

[0065] The median is determined by ranking the base scripting language versions in the middle position after sorting by version size. For example, if there are seven base scripting language versions, the fourth one will be chosen as the median.

[0066] The beneficial effect of the above scheme is that it can start from the highest version of the basic scripting language and gradually narrow down the scope of runtime detection. Runtime detection is not performed on version ranges where the highest scripting language version is impossible, thereby reducing the amount of computation, avoiding unnecessary processing resource consumption, improving the efficiency of highest scripting language version detection, and quickly determining the highest scripting language version supported by the web page display component.

[0067] S240. For the target interval, continue to divide the interval and load it using the binary search method until the target interval contains two versions, and the lowest version in the target interval runs successfully while the highest version fails to run. The lowest version in the target interval is taken as the highest scripting language version. When loading a web page function module in the web page display component, the target scripting language version of the web page function module is selected and loaded according to the highest scripting language version.

[0068] Specifically, for the target range, the range is further divided and loaded using a binary search approach. This means dividing the target range into two version ranges, and loading the source code detection files corresponding to the lowest and highest versions of each range into the webpage display component for execution. The range where the lowest version runs successfully and the highest version fails is designated as the target range. This binary search and loading process is repeated until the target range contains only two versions, where the lowest version's source code detection file runs successfully in the webpage display component, and the highest version's source code detection file fails. The lowest version within this target range is then designated as the highest scripting language version.

[0069] In this embodiment of the application, the process of determining whether the basic scripting language version runs successfully or fails in the webpage display component includes:

[0070] If all feature modules in the basic scripting language version run successfully, then the basic scripting language version is determined to run successfully in the webpage display component.

[0071] If at least one feature module in the basic scripting language version fails to run, then the basic scripting language version is determined to have failed to run in the webpage display component.

[0072] For example, a base scripting language version may contain more than one feature module, each containing different functionalities. These feature modules may be existing or newly added. When the source code detection files of the base scripting language version are loaded into the webpage display component, the source code detection files of all feature modules of that base scripting language version need to be run. If all run successfully, the base scripting language version is confirmed to be running successfully in the webpage display component, and the webpage display component supports that base scripting language version. If the source code detection files of at least one feature module fail to run, the base scripting language version is confirmed to be failing to run in the webpage display component, and the webpage display component does not support that base scripting language version.

[0073] For example, as shown in Table 1, if all feature modules in ES3 run successfully, it indicates that the web page display component supports ES3. If all feature modules in ES5 run successfully, it indicates that the web page display component supports ES5. If `newFeature6_E` in ES6 fails to run, it indicates that ES6 fails to run in the web page display component, and the web page display component does not support ES6. According to Table 1, it can be determined that the highest scripting language version supported by the web page display component is ES5.

[0074] Table 1

[0075]

[0076] This application provides a webpage processing method. For each basic scripting language version included in version management information, the versions are sorted according to their version number. For each sorted version, a version range is divided using a binary search approach. The source code detection files corresponding to the lowest and highest versions within each range are loaded into the webpage display component for execution. The version range where the lowest version runs successfully and the highest version fails is designated as the target range. For the target range, the binary search approach is continued to divide and load versions until the target range contains two versions, and the lowest version runs successfully while the highest version fails. The lowest version within the target range is then designated as the highest scripting language version. This method can accurately and efficiently determine the highest scripting language version supported by the webpage display component, thereby pre-defining the compatibility of the webpage display component. For the webpage functional modules to be loaded, the candidate scripting language versions used in the webpage functional modules are determined; the target scripting language version is selected from the candidate scripting language versions that are no higher than the highest scripting language version; wherein, the highest scripting language version is the highest version supported by the webpage display component; the highest scripting language version is obtained by the webpage display component running source code detection files for different basic scripting language versions; the webpage functional modules using the target scripting language version are loaded into the webpage display component so that the webpage can be displayed through the webpage display component. By selectively loading a newer and compatible version of the webpage display component, the screen flickering problem caused by sequentially refreshing to test compatibility is avoided, and the webpage is loaded and displayed successfully on the first try, improving the compatibility and smoothness of the webpage display.

[0077] Figure 4 This is a flowchart illustrating a webpage processing method according to another embodiment of this application. This embodiment is an optimization based on the above embodiments; solutions not described in detail in this embodiment are found in the above embodiments. Figure 4 As shown, the method in this embodiment of the application specifically includes the following steps:

[0078] S310. For each basic scripting language version, determine the source code detection file generated based on the functional characteristics of each basic scripting language version.

[0079] S320. The webpage display component loads and runs the source code detection file, and executes the various functional features in the basic scripting language version by running the source code detection file.

[0080] S330. Based on the running results of the webpage display component on the source code detection file, determine the highest scripting language version supported by the webpage display component.

[0081] S340. For the web page function module to be loaded, determine the candidate script language version used in the web page function module.

[0082] The webpage function modules to be loaded are pre-written function modules corresponding to the webpages to be displayed, such as a hot news recommendation module in the webpage to be displayed. These webpage function modules can be, for example, function modules of webpages written in HTML5. This embodiment uses one webpage function as an example for illustration; the loading and display of other webpage functions are similar. For a single webpage function, in order to load and display it in webpage display components with different compatibility, it may be written using more than one scripting language version, resulting in multiple scripting language versions of the webpage function module.

[0083] In this embodiment of the application, for a webpage functional module to be loaded, determining the candidate scripting language version used in the webpage functional module includes:

[0084] Iterate through the scripts in the functional modules of the webpage to be loaded;

[0085] During the traversal, the candidate scripting language version used to write the script is determined based on the script's attribute information.

[0086] For example, for a webpage functional module to be loaded, each script within that module can be iterated through. During this iteration, the script's attribute information is checked, and the candidate scripting language version used to write the script is obtained from the attribute information. The webpage functional module corresponding to that script is the one written using that candidate scripting language version. This distinguishes the webpage functional modules, allowing for targeted loading of subsequent webpage display components, rather than loading them all sequentially. There may be one or more candidate scripting language versions. For example, candidate scripting language versions could be ECMAScript ES3, ES5, ES6, etc.

[0087] S350. Select the target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version.

[0088] For example, the highest scripting language version supported by a webpage display component can be determined in advance. Specifically, for a webpage display component running on the current operating system, the highest supported scripting language version can be pre-determined. Specifically, the source code detection files corresponding to each basic scripting language version can be loaded into the webpage display component for runtime testing to determine if the webpage display component can run successfully, thus determining whether the webpage display component supports that version. Based on the runtime testing results of the source code detection files for each basic scripting language version, the highest supported scripting language version of the webpage display component can be determined. This solution does not require other tool interfaces and can directly construct source code detection files based on the syntax characteristics of the basic scripting language versions, improving the accuracy and convenience of highest scripting language version detection.

[0089] Specifically, a candidate scripting language version, no higher than the highest version, can be selected from the candidate scripting language versions corresponding to the webpage functional modules. This ensures that the webpage display component can support the loading and running of the webpage functional modules using the selected scripting language version. The target scripting language version is then selected from the candidate scripting language versions, ensuring that the webpage display component can support the loading and running of the webpage functional modules of that version. Furthermore, this process clearly selects one version of the webpage functional module for single loading and running, avoiding screen flickering caused by the webpage display component repeatedly loading and running multiple versions of the webpage functional modules.

[0090] In this embodiment of the application, selecting a target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version includes:

[0091] The highest version among the candidate scripting language versions that is no higher than the highest scripting language version is taken as the target scripting language version.

[0092] For example, in order to enable the web page display component to load web page function modules in a supported scripting language version and to load the latest version with more functions, the highest version can be selected from the candidate scripting language versions that are no higher than the highest scripting language version as the target scripting language version. This satisfies the compatibility of the web page display component and allows for the selection of the highest version to provide richer functions.

[0093] In this embodiment of the application, selecting a target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version includes:

[0094] For web page functional modules generated from at least two candidate scripting language versions, determine the same candidate scripting language version used in each web page functional module that is no higher than the highest scripting language version.

[0095] The highest version among the same candidate scripting language versions is taken as the target scripting language version.

[0096] For example, if there are at least two candidate scripting language versions for a webpage functional module that needs to be loaded, the same candidate scripting language version is determined from among the candidate scripting language versions corresponding to each webpage functional module that are no higher than the highest scripting language version. For instance, if the selected scripting language versions for webpage functional module 1 that are no higher than the highest scripting language version are ES3, ES5, and ES6, and the candidate scripting language versions for webpage functional module 2 that are no higher than the highest scripting language version are ES3 and ES5, then the same candidate scripting language version includes ES3 and ES5. The highest version among the same candidate scripting language versions can be used as the target scripting language version, thereby enabling webpage display components to load the same version of the webpage functional module, improving the stability of webpage loading and display, and loading the highest version of the webpage functional module while maintaining compatibility, thus providing richer functionality.

[0097] S360. Load the web page function module using the target scripting language version into the web page display component, so as to display the web page through the web page display component.

[0098] For example, a webpage function module written in the target scripting language version is loaded into the webpage display component. This allows the webpage display component to directly load the highest compatible version of the target scripting language, enabling normal webpage display with only one loading. Unlike existing technologies that directly iterate through and load webpage function modules using various candidate scripting language versions to find a compatible one, this solution intercepts the loading of webpage function modules before loading. Based on the highest scripting language version supported by the webpage display component, the target scripting language version is selected, and the webpage function module using the target scripting language version is loaded into the webpage display component. This eliminates the need to iterate through and detect the scripting language versions supported by the webpage display component, solving the screen flickering problem. Normal webpage display with only one loading improves the compatibility and smoothness of webpage display.

[0099] The technical solution of this application embodiment, for a webpage functional module to be loaded, determines the candidate scripting language version used in the webpage functional module; selects a target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version; wherein, the highest scripting language version is the highest version supported by the webpage display component; the highest scripting language version is obtained by the webpage display component running and detecting source code files of different basic scripting language versions; loads the webpage functional module using the target scripting language version into the webpage display component, so as to display the webpage through the webpage display component. The above solution can accurately determine the highest version supported by the webpage display component in advance by running the source code detection files of each basic scripting language version, adaptively select the target scripting language version based on the highest version supported by the webpage display component, and directly load the webpage functional module of the target scripting language version into the webpage display component. There is no need to traverse and verify whether the webpage display component is compatible during the loading process of the webpage functional module, solving the screen flickering problem caused by multiple loading and refreshing of webpage functional modules, and improving the compatibility and smoothness of webpage loading.

[0100] This application provides a specific implementation method for webpage processing, such as... Figure 5 As shown, the details are as follows:

[0101] The version management module manages ECMAScript version information, summarizing all basic scripting language versions. The version diagnostic module performs runtime checks on the basic scripting language versions according to the runtime detection scheme described in the above embodiment, determining the highest scripting language version (ESmax) supported by the webpage display component. The version diagnostic module transmits ESmax to the version monitoring and interception module. The version monitoring and interception module monitors the scripts of the webpage functional modules (i.e., H5 page functional modules) and iterates through each script in the H5 page functional modules for version detection. It selects the highest version (not higher than ESmax) as the target scripting language version, loads the webpage functional module with the target scripting language version into the webpage display component, and intercepts other versions of webpage functional modules, preventing them from being loaded into the webpage display component. This ensures that the webpage display component loads the latest compatible version, providing richer functionality. Furthermore, it achieves the best display effect for the webpage with a single load, solving the screen flickering problem caused by frequent loading of the same webpage and improving the compatibility and smoothness of the webpage display.

[0102] Figure 6 This is a schematic diagram of a webpage processing apparatus provided in an embodiment of this application. This apparatus can execute the webpage processing method provided in any embodiment of this application, and has corresponding functional modules and beneficial effects for executing the method. For example... Figure 6As shown, the device is configured on a mobile terminal, which has a device management application installed. The device includes:

[0103] The source code detection file generation module 410 is used to determine the source code detection file generated according to the functional characteristics of each basic scripting language version for each basic scripting language version.

[0104] The running module 420 can be used to enable the web page display component to load and run the source code detection file, and execute various functional features in the basic scripting language version by running the source code detection file;

[0105] The highest scripting language version determination module 430 is used to determine the highest scripting language version supported by the webpage display component based on the running results of the source code detection file by the webpage display component, so that when a webpage function module to be loaded is selected in the webpage display component, the webpage function module with the target scripting language version is loaded according to the highest scripting language version.

[0106] In this embodiment, the process by which the source code detection file generation module 410 generates source code detection files based on the functional characteristics of each basic scripting language version includes:

[0107] Based on the features of the current base scripting language version, generate code modules that can execute each feature, and package the code modules to obtain the source code detection file corresponding to the current base scripting language version.

[0108] If there are changes and / or additions to the functional features, code modules capable of executing each functional feature will be generated based on the changed and / or added functional features, and the code modules will be packaged to obtain the source code detection file corresponding to another version of the basic scripting language.

[0109] In this embodiment of the application, the running module 420 instructs the webpage display component to load and run the source code detection file, including:

[0110] The webpage display component loads and runs the source code detection file corresponding to the lowest version of the basic scripting language.

[0111] If the web page display component successfully runs the source code detection file corresponding to the lowest version of the basic scripting language, then the web page display component will continue to load and run the source code detection files corresponding to other versions of the basic scripting language.

[0112] Otherwise, if the browser is found to be faulty, exit the program.

[0113] In this embodiment of the application, the running module 420 instructs the webpage display component to load and run the source code detection file, including:

[0114] For each basic scripting language version included in the version management information, sort them according to version number from highest to lowest;

[0115] For each sorted basic scripting language version, the version range is divided according to the binary search method. The source code detection files corresponding to the lowest and highest versions in the version range are loaded into the web page display component for execution. The version range in which the lowest version runs successfully and the highest version fails to run is taken as the target range.

[0116] For the target interval, continue to divide the interval and load the data using the bisection method;

[0117] Accordingly, based on the execution results of the source code detection file by the webpage display component, the highest scripting language version supported by the webpage display component is determined, including:

[0118] If the target range contains two versions, and the lowest version in the target range runs successfully while the highest version fails, then the lowest version in the target range shall be taken as the highest scripting language version.

[0119] In this embodiment, the running module 420 divides the sorted basic scripting language versions into version ranges using a binary search method, loads the lowest and highest versions within each range into the webpage display component for execution, and designates the version range where the lowest version runs successfully and the highest version fails as the target range, including:

[0120] Load the source code detection file of the highest version of the basic scripting language into the webpage display component and run it;

[0121] If the operation is successful, the highest version of the base scripting language will be used as the highest scripting language version.

[0122] Otherwise, the source code detection file of the basic scripting language version corresponding to the median of the sorted basic scripting language versions will be loaded into the web page display component for execution;

[0123] If the source code detection file of the underlying scripting language version corresponding to the median runs successfully, then the version range from the underlying scripting language version corresponding to the median to the highest version of the underlying scripting language version is taken as the target range.

[0124] Otherwise, the target range is the range between the lowest version of the underlying scripting language and the version range corresponding to the median version of the underlying scripting language.

[0125] In this embodiment of the application, the process by which the running module 420 determines whether the basic scripting language version runs successfully or fails in the webpage display component includes:

[0126] If all feature modules in the basic scripting language version run successfully, then the basic scripting language version is determined to run successfully in the webpage display component.

[0127] If at least one feature module in the basic scripting language version fails to run, then the basic scripting language version is determined to have failed to run in the webpage display component.

[0128] In this embodiment of the application, the device further includes:

[0129] The candidate script language version determination module is used to determine the candidate script language version used in the web page functional module to be loaded.

[0130] The target scripting language version determination module is used to select a target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version.

[0131] A loading module is used to load web page function modules using the target scripting language version into the web page display component, so as to display the web page through the web page display component.

[0132] The web page processing apparatus provided in this application embodiment can execute a web page processing method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.

[0133] Figure 7 A schematic diagram of an electronic device 10, which can be used to implement embodiments of this application, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0134] like Figure 7As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0135] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of monitors, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless web transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0136] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as web page processing methods.

[0137] In some embodiments, the web page processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the web page processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the web page processing method by any other suitable means (e.g., by means of firmware).

[0138] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable web page processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0140] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0141] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0142] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0143] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0144] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired information of the technical solution of this application can be achieved, and this is not limited herein.

[0145] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A webpage processing method, characterized in that, The method includes: For each version of the basic scripting language, determine the source code detection files generated based on the functional characteristics of each version of the basic scripting language; The webpage display component loads and runs the source code detection file, and executes the various functional features of the underlying scripting language version by running the source code detection file; Based on the running results of the source code detection file by the webpage display component, the highest scripting language version supported by the webpage display component is determined, so that when loading a webpage function module in the webpage display component, the target scripting language version of the webpage function module is selected and loaded according to the highest scripting language version.

2. The method according to claim 1, characterized in that, The process of generating source code detection files based on the features of each basic scripting language version includes: Based on the features of the current base scripting language version, generate code modules that can execute each feature, and package the code modules to obtain the source code detection file corresponding to the current base scripting language version. If there are changes and / or additions to the functional features, code modules capable of executing each functional feature will be generated based on the changed and / or added functional features, and the code modules will be packaged to obtain the source code detection file corresponding to another version of the basic scripting language.

3. The method according to claim 1, characterized in that, The webpage display component loads and runs the source code analysis file, including: The webpage display component loads and runs the source code detection file corresponding to the lowest version of the basic scripting language. If the web page display component successfully runs the source code detection file corresponding to the lowest version of the basic scripting language, then the web page display component will continue to load and run the source code detection files corresponding to other versions of the basic scripting language. Otherwise, if the browser is found to be faulty, exit the program.

4. The method according to claim 1, characterized in that, The webpage display component loads and runs the source code analysis file, including: For each basic scripting language version included in the version management information, sort them according to version number from highest to lowest; For each sorted basic scripting language version, the version range is divided according to the binary search method. The source code detection files corresponding to the lowest and highest versions in the version range are loaded into the web page display component for execution. The version range in which the lowest version runs successfully and the highest version fails to run is taken as the target range. For the target interval, continue to divide the interval and load the data using the bisection method; Accordingly, based on the execution results of the source code detection file by the webpage display component, the highest scripting language version supported by the webpage display component is determined, including: If the target range contains two versions, and the lowest version in the target range runs successfully while the highest version fails, then the lowest version in the target range shall be taken as the highest scripting language version.

5. The method according to claim 4, characterized in that, For each sorted basic scripting language version, a version range is divided using a binary search method. The lowest and highest versions within each range are loaded into the webpage display component for execution. The version range where the lowest version runs successfully and the highest version fails is designated as the target range, including: Load the source code detection file of the highest version of the basic scripting language into the webpage display component and run it; If the operation is successful, the highest version of the base scripting language will be used as the highest scripting language version. Otherwise, the source code detection file of the basic scripting language version corresponding to the median of the sorted basic scripting language versions will be loaded into the web page display component for execution; If the source code detection file of the underlying scripting language version corresponding to the median runs successfully, then the version range from the underlying scripting language version corresponding to the median to the highest version of the underlying scripting language version is taken as the target range. Otherwise, the target range is the range between the lowest version of the underlying scripting language and the version range corresponding to the median version of the underlying scripting language.

6. The method according to claim 4, characterized in that, The process of determining whether the underlying scripting language version runs successfully or fails in the webpage display component includes: If all feature modules in the basic scripting language version run successfully, then the basic scripting language version is determined to run successfully in the webpage display component. If at least one feature module in the basic scripting language version fails to run, then the basic scripting language version is determined to have failed to run in the webpage display component.

7. The method according to claim 1, characterized in that, The method further includes: For each webpage function module to be loaded, determine the candidate scripting language version used in that webpage function module; Select the target scripting language version from the candidate scripting language versions that are no higher than the highest scripting language version; Load the web page function module using the target scripting language version into the web page display component so that the web page can be displayed through the web page display component.

8. A webpage processing device, characterized in that, The device includes: The source code detection file generation module is used to determine the source code detection file generated based on the functional characteristics of each basic scripting language version. The running module can be used to enable the web page display component to load and run the source code detection file, and execute the various functional features in the basic scripting language version by running the source code detection file; The highest scripting language version determination module is used to determine the highest scripting language version supported by the webpage display component based on the running results of the source code detection file by the webpage display component, so that when a webpage function module to be loaded is selected in the webpage display component, the webpage function module with the target scripting language version is loaded according to the highest scripting language version.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the web page processing method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the web page processing method according to any one of claims 1-7.