Page rendering file path updating method and device, and storage medium

By obtaining the original path and version identifier of the target file, using a preset database to find the target directory file, determining the relative path and updating the path, the problem of low business development efficiency in existing technologies is solved, and efficient customized business development and page rendering are achieved.

CN117742703BActive Publication Date: 2026-11-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211114571.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2026-11-24
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

In existing technologies, data-driven solutions and hard-coded judgment solutions lead to low business development efficiency, difficulty in supporting deep customization, and poor maintainability.

Method used

By obtaining the original path and version identifier of the target file, the target directory file is found using a preset database. The relative path is determined based on the path set of the target and the initial directory file, and the original path is updated to obtain the target file. A preset file system is then constructed to carry the target version identifier.

Benefits of technology

It improves the efficiency of customized business development and maintenance for target applications, enhances page rendering efficiency, supports deep customization, and reduces the risk of conflicts between versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117742703B_ABST
    Figure CN117742703B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, and storage medium for updating the path of a page rendering file, which can be applied to various scenarios such as cloud technology, artificial intelligence, intelligent transportation, and the Internet of Vehicles. The method includes: obtaining the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file; based on the target version identifier, searching for a directory file matching the target version identifier in a preset database to obtain a target directory file; obtaining a first path set corresponding to the target directory file and a second path set corresponding to the initial directory file; determining the relative path corresponding to the target file based on the first path set and the second path set; updating the original path based on the matching result of the relative path and a preset file system to obtain an updated path; and determining the target file based on the updated path. This application improves the development and maintenance efficiency of customized business of the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and storage medium for updating the path of a page rendering file. Background Technology

[0002] In related technologies, multiple versions corresponding to the same business logic are built based on either a data-driven approach or a hard-coded judgment approach. The data-driven approach stores different versions' styles and business logic in the backend database, using the backend to distinguish requests from different versions and return different style data to display different frontend versions. The hard-coded judgment approach adds different code branches to relevant code modules, using global variables to distinguish different versions and display related effects. The data-driven approach requires sufficient code robustness, leading to lower development efficiency; if a certain version requires high customization later, the data describing the customization becomes more complex than the program itself, so this approach does not support deep customization. In the hard-coded judgment approach, each functional module needs to consider the original code logic, resulting in low development efficiency and a tendency for modifications to cause conflicts with the original version. Therefore, this approach has low development efficiency and low maintainability. Summary of the Invention

[0003] This application provides a method, apparatus, and storage medium for updating the path of page rendering files, in order to at least solve the technical problem of low business development efficiency in the prior art.

[0004] On the one hand, this application provides a method for updating the path of a page rendering file, the method comprising:

[0005] Obtain the original path of the target file and the target version identifier of the target application corresponding to the target file;

[0006] Based on the target version identifier, a directory file matching the target version identifier is searched in a preset database to obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application;

[0007] Obtain the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file;

[0008] Based on the first path set and the second path set, determine the relative path corresponding to the target file;

[0009] Based on the matching result between the relative path and the preset file system, the original path is updated to obtain the updated path; the preset file system is a file system built based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file;

[0010] Based on the update path, the target file is determined; the target file is used to render the page in the target application.

[0011] On the other hand, a path update device for page rendering files is provided, the device comprising:

[0012] The target version identifier acquisition module is used to acquire the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file.

[0013] The target directory file determination module is used to search for a directory file matching the target version identifier in a preset database based on the target version identifier, thereby obtaining a target directory file. The target directory file is used to store the target business features corresponding to the target application. The target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application. The preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications. The preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application.

[0014] The path set acquisition module is used to acquire the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file.

[0015] The relative path determination module is used to determine the relative path corresponding to the target file based on the first path set and the second path set;

[0016] The path update module is used to update the original path based on the matching result between the relative path and the preset file system to obtain the updated path; the preset file system is a file system built based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file;

[0017] The target file determination module is used to determine the target file based on the update path; the target file is used to render the page in the target application.

[0018] In some embodiments, the relative path determination module includes:

[0019] The path conversion submodule is used to convert the original path corresponding to the target file into an absolute path;

[0020] The candidate path set determination submodule is used to determine the first path set and the second path set as candidate path sets;

[0021] The relative path determination submodule is used to convert the absolute path into a relative path if the absolute path is a path in the candidate path set, so as to obtain the relative path corresponding to the target file.

[0022] In some embodiments, the path update module includes:

[0023] The matching result determination submodule is used to determine the matching result between the relative path and the preset file system;

[0024] The path set determination submodule is used to determine the path set to which the absolute path belongs;

[0025] The path update submodule is used to update the original path based on the matching result and the path set to which the absolute path belongs, to obtain the updated path.

[0026] In some embodiments, the path update submodule includes:

[0027] The first update unit is configured to modify the root path in the original path to the root path of the initial directory file if the relative path fails to match the preset file system and the absolute path is a path in the first path set, thereby obtaining the first update path.

[0028] In some embodiments, the path update submodule includes:

[0029] The second update unit is used to modify the root path in the original path to the root path of the target directory file if the relative path matches the preset file system and the absolute path is the path in the second path set, so as to obtain the second update path.

[0030] In some embodiments, the matching result determination submodule includes:

[0031] A preset temporary variable construction unit is used to construct a preset temporary variable corresponding to the preset file system, which serves as the current temporary variable;

[0032] An array conversion unit is used to convert the relative path into multiple arrays, each array corresponding to a directory level;

[0033] A traversal unit is used to traverse the multiple arrays and determine the matching result of each array with the current temporary variable;

[0034] The judgment unit is used to determine whether the directory corresponding to any array is a directory at a preset level and to determine the data information matched by the current temporary variable if any array successfully matches the current temporary variable.

[0035] The first matching unit is used to determine that the relative path fails to match the preset file system if the directory corresponding to any array is a directory at the preset level and the data information matched by the current temporary variable is a directory.

[0036] In some embodiments, the apparatus further includes:

[0037] The step jump module is used to, if the directory corresponding to any array is not a preset level directory, and the data information matched by the current temporary variable is a directory, re-use the matched directory as the current temporary variable, and jump to the step of traversing the multiple arrays and determining the matching result between each array and the current temporary variable.

[0038] In some embodiments, the path update module includes:

[0039] The root path determination submodule is used to determine the root path and the relative path corresponding to the target file;

[0040] The first matching result determination submodule is used to determine the first matching result between the root path and the initial directory file;

[0041] The second matching result determination submodule is used to determine the second matching result between the relative path and the preset file system;

[0042] The update path determination submodule is used to update the original path based on the first matching result and the second matching result to obtain the updated path.

[0043] In some embodiments, the update path determination submodule includes:

[0044] The first unit is used to modify the root path in the original path to the root path of the target directory file if the first matching result is a successful match and the second matching result is a successful match, thereby obtaining the updated path.

[0045] In some embodiments, the update path determination unit includes:

[0046] The second unit is used to modify the root path in the original path to the root path of the initial directory file if both the first matching result and the second matching result are failures, thereby obtaining an updated path.

[0047] In some embodiments, the apparatus further includes: a preset database construction module, the preset database construction module comprising:

[0048] A preset customized business parameter acquisition submodule is used to acquire preset customized business parameters corresponding to at least two preset applications; the at least two preset applications include the target application.

[0049] The preset directory file construction submodule is used to construct the preset directory files corresponding to the at least two preset applications based on the initial target file and the preset customized business parameters corresponding to each of the at least two preset applications.

[0050] The preset version identifier determination submodule is used to determine the preset version identifier corresponding to each of the at least two preset applications;

[0051] The preset database construction submodule is used to construct the preset database based on the preset version identifiers and preset directory files corresponding to the at least two preset applications.

[0052] In some embodiments, the preset directory file construction submodule includes:

[0053] An initial business feature acquisition unit is used to acquire the initial business features corresponding to each preset customized business parameter from the initial target file;

[0054] The parameter adjustment unit is used to adjust the initial business features corresponding to each preset customized business parameter based on each preset customized business parameter, so as to obtain the preset business features corresponding to each preset application.

[0055] The file construction unit is used to construct a preset directory file corresponding to each preset application based on the preset business characteristics corresponding to each preset application.

[0056] On the other hand, a path update device for page rendering files is provided. The device includes a processor and a memory, wherein the memory stores at least one instruction or at least one program segment, which is loaded and executed by the processor to implement the path update method for page rendering files as described above.

[0057] On the other hand, a computer storage medium is provided that stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the page rendering file path update method as described above.

[0058] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method for updating the path of a page rendering file as described above.

[0059] The method, apparatus, and storage medium for updating the path of page rendering files provided in this application have the following technical effects:

[0060] This application obtains the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file; based on the target version identifier, it searches for a directory file matching the target version identifier in a preset database to obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application; it obtains the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file; based on the first path set and the second path set, it determines the relative path corresponding to the target file; based on the matching result of the relative path and the preset file system, it updates the original path to obtain the updated path; the preset file system is a file system constructed based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file; based on the updated path, it determines the target file; the above target file is used to render the page in the target application. This application stores the target business features corresponding to the customized business parameters of the target application separately and constructs a corresponding target directory file, thereby facilitating the separate maintenance of the target directory file and improving the development and maintenance efficiency of the customized business of the target application. This application determines the relative path corresponding to the target file based on the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file. Based on the first path set and the second path set, the application updates the original path based on the matching result of the relative path and the preset file system to obtain the updated path. Thus, the target file can be quickly obtained based on the updated path, improving the rendering efficiency of the page in the target application. Attached Figure Description

[0061] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.

[0062] Figure 1 This is a schematic diagram of a path update system for page rendering files provided in an embodiment of this application;

[0063] Figure 2 This is a flowchart illustrating a method for updating the path of a page rendering file provided in an embodiment of this application;

[0064] Figure 3 This is a flowchart illustrating a method for constructing a preset database according to an embodiment of this application;

[0065] Figure 4 This is a flowchart illustrating a method for constructing preset directory files corresponding to each of the at least two preset applications, as provided in an embodiment of this application.

[0066] Figure 5 This is a schematic diagram of the structure of a path update system for page rendering files provided in an embodiment of this application;

[0067] Figure 6 This is a schematic diagram of a code building system for a target application provided in an embodiment of this application;

[0068] Figure 7 This is a schematic diagram of a version catalog provided in an embodiment of this application;

[0069] Figure 8 This is a flowchart illustrating a method for determining the relative path of the target file based on the first path set and the second path set provided in this application embodiment.

[0070] Figure 9 This is a flowchart illustrating a method for obtaining an update path based on the matching result between the relative path and a preset file system, as provided in an embodiment of this application.

[0071] Figure 10 This is a flowchart illustrating a method for determining the relative path of the target file based on the first path set and the second path set provided in this application embodiment.

[0072] Figure 11 This is a schematic diagram of the structure of a file path update system provided in an embodiment of this application;

[0073] Figure 12This is a schematic diagram of the structure of a path updating device for page rendering files provided in an embodiment of this application;

[0074] Figure 13 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0076] First, some of the nouns or terms that appear in the description of the embodiments of this application are explained as follows:

[0077] Webpack: A code compilation tool with an entry point, an exit point, loaders, and plugins. Webpack is a static module bundler for modern JavaScript applications. Starting with a given main file (e.g., index.js), webpack finds all the project's dependent files, processes them using loaders, and finally bundles them into one (or more) browser-readable JavaScript files.

[0078] Loader: A source code converter used to transform the source code of a module. Loaders can preprocess files when a module is loaded. Therefore, loaders are similar to "tasks" in other build tools, providing a powerful way to handle the front-end build process.

[0079] It should be noted that the terms "first," "second," etc., 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 server 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 devices.

[0080] Please see Figure 1 , Figure 1This is a schematic diagram of a path update system for page rendering files provided in an embodiment of this application, such as... Figure 1 As shown, the path update system for the page rendering file can include at least server 01 and client 02.

[0081] Specifically, in this embodiment, server 01 may include a standalone server, a distributed server, or a server cluster composed of multiple servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 01 may include a network communication unit, a processor, and a memory, etc. Specifically, server 01 can be used to construct a target directory file, update file paths based on the target directory file, and obtain target files according to the updated paths.

[0082] Specifically, in this embodiment, the client 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, smart speakers, in-vehicle terminals, and smart TVs. It may also include software running on the physical device, such as web pages provided to accounts by service providers, or applications provided to accounts by such service providers. Specifically, the client 02 can be used to render pages in the target application based on the target file.

[0083] The following describes a method for updating the path of a page rendering file according to this application. Figure 2 This is a flowchart illustrating a method for updating the path of a page rendering file according to an embodiment of this application. This specification provides the operational steps of the method described in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or server product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the following... Figure 2 As shown, the above method may include:

[0084] S201: Obtain the original path of the target file and the target version identifier of the target application corresponding to the above target file.

[0085] In this embodiment of the application, obtaining the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file may include:

[0086] The terminal responds to the operation command triggered by the interactive control and sends a target page display request to the server; the interactive control mentioned above is a control in a preset page of the target application; the target page display request carries the target version identifier of the target application corresponding to the target file, and the target file is the file corresponding to the target page;

[0087] In this embodiment, the account corresponding to the terminal can trigger an interactive control to send a request to the server to display the target page; the target version identifier can be the version identifier corresponding to the target application; for example, for application A, account X requires that the contact's name and company name be displayed in the address book of application A; account Y requires that only the contact's nickname be displayed in the address book of application A; then, based on these two requirements, different versions of the application need to be built, so that application A1 and application A2 can be obtained; at this time, A1 and A2 can be used as the version identifier of the application.

[0088] The server parses the above target page display request and obtains the target version identifier of the target application corresponding to the above target file;

[0089] Based on the above target page display request, the server obtains the original path corresponding to the above target file.

[0090] In this embodiment of the application, the server can obtain the original path of the target file and the target version identifier of the target application corresponding to the target file based on the terminal's request.

[0091] S203: Based on the aforementioned target version identifier, search the preset database for a directory file that matches the aforementioned target version identifier to obtain a target directory file; the aforementioned target directory file is used to store the target business features corresponding to the aforementioned target application; the aforementioned target business features are generated based on the initial business features in the aforementioned initial target file and the customized business parameters of the aforementioned target application. The aforementioned preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the aforementioned initial target file and the aforementioned preset customized business parameters corresponding to each preset application;

[0092] In this embodiment, the target business feature can be a feature of information displayed on any display page of the target application, and the customized business parameter of the target application can be a parameter corresponding to the information displayed on any display page of the target application. The display method of the information displayed on the page can be determined by the customized business parameter. The initial target file is the initially constructed file, and the initial business feature is the business feature preset in the initial target file. For example, for application A, the default display method of displaying contacts in the address book is to display the contact's name. Account X requires to display the contact's name and company name in the address book of application A. Account Y requires to display only the contact's nickname in the address book of application A. Then, the customized business parameter of the target application is the contact display parameter. Among them, displaying the contact's name is the initial business feature. For account X, the target business feature is to display the contact's name and company name. For account Y, the target business feature is to display the contact's nickname.

[0093] In this embodiment, the preset database stores the correspondence between preset version identifiers and preset directory files corresponding to multiple preset applications; the preset version identifiers and preset directory files can have a one-to-one correspondence; the preset directory files can be used to store files corresponding to customized business features. For example, for application A, during the application process, for the needs of accounts X and Y, only the contact display module in the address book can be updated, and a separate directory can be built to store the contact display modules corresponding to the two versions, thus obtaining the preset directory file.

[0094] In this embodiment, for each preset application's customized business parameters, a corresponding preset directory file can be built for separate storage, thereby facilitating the separate development and maintenance of customized businesses for different versions of applications and improving the efficiency of business development and maintenance in the application.

[0095] In the embodiments of this application, such as Figure 3 As shown, the method for constructing the aforementioned preset database includes:

[0096] S301: Obtain the preset customized business parameters corresponding to at least two preset applications; the above-mentioned at least two preset applications include the above-mentioned target application;

[0097] In this application embodiment, for an application, corresponding preset customized business parameters can be determined according to the needs of different accounts, and multiple preset applications of different versions can be built; the preset customized business parameters can be parameters corresponding to preset business modules in the application; the above-mentioned at least two preset applications can include the above-mentioned target application.

[0098] S303: Based on the above initial target file and the preset customized business parameters corresponding to each of the above at least two preset applications, construct the preset directory file corresponding to each of the above at least two preset applications;

[0099] In this embodiment, the initial target file is the original file of the application; a preset directory file corresponding to any preset application can be constructed based on the initial target file and the preset customized business parameters corresponding to any preset application, thereby realizing the storage of customized business parameters based on the preset target file.

[0100] In the embodiments of this application, such as Figure 4 As shown, based on the initial target file and the preset customized business parameters corresponding to the at least two preset applications, the preset directory files corresponding to the at least two preset applications are constructed, including:

[0101] S3031: Obtain the initial business features corresponding to each preset customized business parameter from the above initial target file;

[0102] In this embodiment of the application, the initial target file stores various types of initial business features, from which the initial business features corresponding to each preset customized business parameter can be obtained; the initial business features corresponding to each preset customized business parameter can be the same or different; if the initial business features corresponding to each preset customized business parameter are the same, then the initial business feature corresponding to any preset customized business parameter can be obtained and further improved.

[0103] S3033: Based on each preset customized business parameter, adjust the initial business features corresponding to each preset customized business parameter to obtain the preset business features corresponding to each preset application;

[0104] In this embodiment, the initial business features corresponding to each preset customized business parameter can be adjusted according to each preset customized business parameter to obtain the preset business features corresponding to each preset application; each initial business feature corresponds to an initial business parameter, and for any initial business feature, the preset customized business parameter can be used to replace the initial business parameter in the initial business feature; each preset application can have one or more preset customized services, and its corresponding preset business features can also be one or more; the preset business features and preset customized business parameters can have a one-to-one correspondence or a one-to-many relationship; that is, one preset business feature can correspond to one or more preset customized business parameters.

[0105] S3035: Based on the preset business characteristics corresponding to each preset application, construct a preset directory file corresponding to each preset application.

[0106] In this embodiment, the preset business features corresponding to each preset application can be stored in a preset directory file corresponding to each preset application. Each preset application can correspond to one or more preset business features.

[0107] In this embodiment of the application, the initial business features corresponding to each preset customized business parameter can be adjusted based on each preset customized business parameter, thereby enabling the rapid construction of a preset directory file corresponding to each preset application.

[0108] S305: Determine the preset version identifier corresponding to each of the above at least two preset applications;

[0109] In this embodiment, a preset version identifier can be constructed for each preset application. The preset version identifier is used to distinguish preset directory files of different versions of preset applications. The preset version identifier may include, but is not limited to, character identifiers and image identifiers.

[0110] S307: Construct the aforementioned preset database based on the preset version identifiers and preset directory files corresponding to the above at least two preset applications.

[0111] In this embodiment, the aforementioned preset database can be constructed based on the preset version identifiers corresponding to the at least two preset applications and the preset directory files corresponding to the at least two preset applications; the preset version identifiers and preset directory files can have a one-to-one correspondence; the preset database can store preset target files corresponding to different preset applications.

[0112] In this embodiment, the webpack development environment can be used to distinguish different customized versions for different clients through a directory system. The overall packaging and compilation process of the front-end code can be completed through a self-developed plugin to customize the loading of different version paths, thereby achieving the effect of building different versions of the front-end based on different paths.

[0113] In this embodiment, a preset database can be constructed based on the preset version identifier and preset directory file corresponding to each preset application, thereby facilitating quick subsequent querying of target directory files.

[0114] In a specific embodiment, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of a path update system for page rendering files, including a preset database, a configuration module, and a deployment package generation module;

[0115] The system includes a pre-defined database storing directory files for each application version, including a base version directory, version A directory, version B directory, and version C directory. The base version directory stores all module information for the application, including header styles, alert statistics modules, login modules, etc. The other version directories store their respective customized business features. The server can work with terminals to perform localized packaging based on the configuration module, resulting in configuration files for multiple versions. Alternatively, it can perform SaaS packaging, generating configuration files for multiple versions. SaaS (Software as a Service) provides software services over the network. Finally, the deployment package generation module generates deployment packages for each version. For example, a deployment package for version A can be generated, including configuration file A, middleware business logic modules, and version A language. Each version has a separate directory, which only needs to contain the version-specific business code. This approach ensures that version development is independent of each other, allowing development of only the specific business logic, resulting in high development efficiency and ease of maintenance.

[0116] In this embodiment of the application, the method for generating the target directory file includes:

[0117] Obtain the customized business parameters of the target application mentioned above;

[0118] In this embodiment, an account can submit customized business parameters on the terminal and send them to the server. The customized business parameters of the target application can be parameters corresponding to the information displayed on any display page of the target application. The display method of the information displayed on the page can be determined by the customized business parameters. The initial target file is the initially constructed file, and the initial business features are the business features preset in the initial target file. For example, for application A, the default display method of displaying contacts in the address book is to display the contact's name. Account X requires that the contact's name and company name be displayed in the address book of application A. Account Y requires that only the contact's nickname be displayed in the address book of application A. Then, the customized business parameters of the target application are the contact display parameters.

[0119] Based on the above customized business parameters, the initial business features corresponding to the above customized business parameters are obtained from the above initial target file;

[0120] In this embodiment of the application, the initial service features correspond to the initial service parameters.

[0121] Based on the above customized business parameters, the above initial business characteristics are adjusted to obtain the target business characteristics;

[0122] In this embodiment of the application, customized business parameters can be used to replace the initial business parameters, thereby determining the target business characteristics.

[0123] Based on the aforementioned target business characteristics, the aforementioned target directory file is constructed.

[0124] In this embodiment of the application, target business features can be stored in the target directory file, and there can be one or more target business features.

[0125] In a specific embodiment, such as Figure 6 As shown, Figure 6 This diagram illustrates a code building system for a target application, including a compilation module and a file generation module. The compilation module stores the base path and the corresponding pre-defined application's original files. When new versions A and B are needed, the file generation module generates corresponding version files based on the customized business parameters for each version. For example, for version A, if the customized business is page header file A and menu plugin A, a version A directory can be created to store these two files. For version B, if the customized business is page header file B, a version B directory can be created to store page header file B. Then, based on the base directory and the version A directory, file A corresponding to version A is built, and based on the base directory and the version B directory, file B corresponding to version B is built. The code in directory A represents the customized business of version A. If directory A is set as the preferred path, the final generated compiled code will prioritize importing files from path A, and then reference files not in path A from the base path, thus creating a development and packaging environment for the front-end code based on version A. Therefore, for front-end project code building, the file priority path referencing scheme only requires creating a customized directory at the same level as the original basic code path.

[0126] In a specific instance, such as Figure 7 As shown, Figure 7 This is a schematic diagram of a version directory, where directory 03 is the basic version directory and directory 04 is the customized version directory. For example, directory 04 can be a directory in version A or version B.

[0127] S205: Obtain the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file.

[0128] In this embodiment of the application, the initial directory file can be the file corresponding to the initial version of the application initially built by the server, which can store all modules of the application.

[0129] S207: Based on the first path set and the second path set mentioned above, determine the relative path corresponding to the target file mentioned above.

[0130] In this embodiment of the application, the original path can be updated according to the paths corresponding to the target directory file and the initial directory file to obtain the updated path of the target file, so as to quickly and accurately find the target file.

[0131] Specifically, in this embodiment, the path sets corresponding to the target directory file and the initial directory file can be obtained respectively. The priority of the first path set can be set higher than that of the second path set. After determining the target version identifier, the file can be imported from the first path set first. If the file is not found, it can be imported from the second path set. The first path set corresponding to the target directory file may include the target version identifier, and the second path set corresponding to the initial directory file may include the initial version identifier.

[0132] S209: Based on the first path set and the second path set mentioned above, determine the relative path corresponding to the target file mentioned above;

[0133] In the embodiments of this application, such as Figure 8 As shown, based on the first path set and the second path set mentioned above, the relative path corresponding to the target file is determined, including:

[0134] S2091: Convert the original path of the target file to an absolute path;

[0135] In this embodiment of the application, the original path is a relative path, which can be converted into an absolute path.

[0136] In this application embodiment, the basic rule of the path is:

[0137] " / " represents the root directory, ". / " represents returning to the parent directory, ". / . / " represents returning to the parent directory two levels higher, " / ." represents the subdirectory, and ". / . / " represents the subdirectory two levels lower.

[0138] Absolute path: An absolute path refers to the actual path where a file exists on the hard drive. For example, if the file "1.txt" is stored in the directory "C:\Users\15063\Desktop" on the hard drive, then the absolute path of the document "1.txt" is "C:\Users\15063\Desktop\1.txt".

[0139] Relative path: relative to the location of its target file. For example, if the directory where the file "1.htm" is located is "C:\Users\15063\Desktop\lqf", and the directory where the file "1.txt" is located is "C:\Users\15063\Desktop", then "1.txt" is in the parent directory of the directory where "1.htm" is located.

[0140] The differences between the two are: ① An absolute path is the actual path where a file exists on the hard drive. ② A relative path refers to the location associated with its target file. ③ An absolute path means that the folder can be found at this path, regardless of whether it is accessed from outside or inside the file. A relative path, on the other hand, is associated with the file itself; files and paths in other locations can only be accessed internally.

[0141] S2093: The first path set and the second path set mentioned above are determined as candidate path sets;

[0142] In some embodiments, the above method further includes:

[0143] Determine whether the above absolute path is a path in the candidate path set.

[0144] In this embodiment of the application, the first path set and the second path set can be used as candidate path sets.

[0145] S2095: If the above absolute path is a path in the candidate path set, convert the above absolute path into a relative path; the above candidate path set includes the above first path set and the above second path set.

[0146] Specifically, in this embodiment of the application, the absolute path can also be a path other than the first path set and the second path set; if the absolute path is a path in the candidate path set, the absolute path can be converted into a relative path. The relative path can be constructed based on the version identifier, thereby facilitating the quick search of files in the directory file corresponding to the version identifier.

[0147] S2011: Based on the matching result between the above relative path and the preset file system, the above original path is updated to obtain the updated path; the above preset file system is a file system built based on the above target directory file, and the file path in the above preset file system carries the target version identifier of the above target directory file.

[0148] Specifically, in this embodiment, the preset file system can be a file system built based on the target directory file, and the file path in the preset file system can carry the target version identifier of the target directory file; after determining the relative path, it can be matched with the preset file system, and the path can be updated according to the matching result, thereby improving the accuracy of path update.

[0149] In some embodiments, such as Figure 9 As shown, based on the matching results between the relative path and the preset file system, the original path is updated to obtain the updated path, including:

[0150] S20111: Determine the matching result between the above relative path and the preset file system;

[0151] In some embodiments, determining the matching result between the relative path and the preset file system includes:

[0152] Construct a preset temporary variable corresponding to the above preset file system, and use it as the current temporary variable;

[0153] In this embodiment of the application, a preset temporary variable can be constructed for the preset file system first, and then the subsequent matching can be performed.

[0154] Convert the above relative paths into multiple arrays, with each array corresponding to a directory level;

[0155] In this embodiment of the application, the determined relative path can be converted into multiple arrays, with each array corresponding to a directory level; for example, the root directory can be used as the first-level directory (the highest-level directory), and then other levels of directories can be constructed in sequence.

[0156] Iterate through the arrays above and determine the matching result of each array with the current temporary variable.

[0157] In this embodiment of the application, each array can be matched with the current temporary variable to obtain its corresponding matching result.

[0158] If any array matches the current temporary variable, determine whether the directory corresponding to any array is a directory at a preset level and determine the data information that matches the current temporary variable.

[0159] In this embodiment of the application, the preset level directory can be the last level directory, that is, the lowest level directory, and the data information is the information corresponding to the array.

[0160] If the directory corresponding to any of the above arrays is a directory at the preset level, and the data information matched by the current temporary variable is a directory, it is determined that the relative path fails to match the preset file system.

[0161] In this embodiment of the application, if the directory corresponding to any of the above arrays is a directory at the preset level, that is, when the target path matches the last level directory, if the data information matched by the above current temporary variable is a directory, then it is determined that the above relative path fails to match the preset file system.

[0162] In some embodiments, the above method further includes:

[0163] If any array fails to match the current temporary variable, it is determined that the relative path fails to match the preset file system.

[0164] In this embodiment of the application, if any array fails to match the current temporary variable, it is determined that the relative path fails to match the preset file system, and the traversal will not continue.

[0165] In this embodiment of the application, the absolute path can be determined as a path in the first path set based on the matching result between the relative path and the preset file system.

[0166] S20113: Determine the path set to which the above absolute path belongs;

[0167] In the embodiments of this application, it can be determined whether the above absolute path is a path in the first path set or a path in the second path set.

[0168] S20115: Based on the above matching results and the path set to which the above absolute path belongs, the above original path is updated to obtain the updated path.

[0169] In some embodiments, the above-mentioned updating of the original path based on the matching result and the path set to which the absolute path belongs, to obtain an updated path, includes:

[0170] If the relative path fails to match the preset file system, and the absolute path is a path in the first path set, the root path in the original path is modified to the root path of the initial directory file to obtain the first updated path.

[0171] In this embodiment of the application, the first update path may carry the version identifier of the initial directory file.

[0172] In some embodiments, the above-mentioned updating of the original path based on the matching result and the path set to which the absolute path belongs, to obtain an updated path, includes:

[0173] If the relative path matches the preset file system, and the absolute path is a path in the second path set, the root path in the original path is modified to the root path of the target directory file to obtain the second update path. The second update path may carry the version identifier of the target directory file.

[0174] In some embodiments, the above method further includes:

[0175] If the directory corresponding to any of the above arrays is not a directory at the preset level, and the data information matched by the above current temporary variable is a directory, the matched directory is used again as the above current temporary variable, and the process jumps to the above steps of traversing the above arrays and determining the matching result of each array with the above current temporary variable.

[0176] In this embodiment of the application, if the directory corresponding to any of the above arrays is not a directory at a preset level, and the data information matched by the above current temporary variable is a directory, the matched directory is used again as the above current temporary variable, and the process jumps to the above step of traversing the above multiple arrays and determining the matching result of each array with the above current temporary variable, and continues to traverse the next data for matching.

[0177] In some embodiments, the above method further includes:

[0178] If the directory corresponding to any of the above arrays is a directory at the preset level, and the data information matched by the current temporary variable is a file, then the relative path is determined to be a successful match with the preset file system.

[0179] In this embodiment of the application, during the traversal process, if the directory corresponding to any array is a directory at the preset level, and the data information matched by the current temporary variable is a file, it is determined that the relative path matches the preset file system successfully.

[0180] In some embodiments, the above-mentioned updating of the original path based on the matching result between the relative path and the preset file system to obtain the updated path includes:

[0181] Determine the root path and relative path corresponding to the above target files;

[0182] Determine the first matching result between the above root path and the above initial directory file;

[0183] In this embodiment of the application, the first matching result includes a first successful result and a first failed result.

[0184] Determine the second matching result between the above relative path and the above preset file system;

[0185] In this embodiment of the application, the second matching result includes a second successful result and a second failed result.

[0186] Based on the first matching result and the second matching result, the original path is updated to obtain the updated path.

[0187] In this embodiment of the application, the original path can be updated by combining the first matching result of the root path with the initial directory file and the second matching result of the relative path with the preset file system.

[0188] In a specific embodiment, as shown in Table 1 below, Table 1 is a schematic diagram of a path update method;

[0189] Table 1:

[0190]

[0191] The file reference request = absolute path root directory + relative path can specifically be:

[0192] ' / A / container / header / user.js' = ' / A' + '. / container / header / user.js';

[0193] In some embodiments, for Example 2 in Table 1, the following applies: Based on the first matching result and the second matching result, the original path is updated to obtain the updated path, including:

[0194] If both the first and second matching results are successful, the root path in the original path is modified to the root path of the target directory file to obtain the updated path.

[0195] In some embodiments, for Example 3 in Table 1, the following applies: Based on the first matching result and the second matching result, the original path is updated to obtain the updated path, including:

[0196] If the first matching result and the second matching result are both unsuccessful, the root path in the original path is modified to the root path of the initial directory file to obtain the updated path.

[0197] In some embodiments, for example 1 in Table 1, the above method further includes:

[0198] If the first matching result is a successful match and the second matching result is a failed match, it is determined that the relative path matches the preset file system successfully.

[0199] In some embodiments, for example 4 in Table 1, the above method further includes:

[0200] If the first matching result is a failed match and the second matching result is a successful match, then the relative path is determined to be a successful match with the preset file system.

[0201] In this embodiment, if the relative path matches the preset file system, the target file can be obtained by parsing the original path; if the relative path fails to match the preset file system, the target file can be obtained by parsing the updated path.

[0202] S2013: Based on the above update path, determine the above target file; the above target file is used to render the page in the above target application.

[0203] In this embodiment of the application, the above method may further include:

[0204] The aforementioned target file is sent to the terminal so that the terminal renders the page in the target application based on the aforementioned target file.

[0205] In this embodiment, pages in the target application can be rendered in the terminal based on the target file; for different versions of the application, the display pages corresponding to the same module are different.

[0206] In a specific embodiment, such as Figure 10 As shown, Figure 10 A flowchart illustrating an alternative method for updating the path of page rendering files, applied in webpack, including:

[0207] S1001: Import target file retrieval request, which carries the original path;

[0208] Specifically, in the embodiments of this specification, the target file acquisition request may also carry the target version identifier of the target application corresponding to the target file; the target version identifier can be used to search for a directory file matching the target version identifier in a preset database to obtain the target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application.

[0209] S1003: Parse the target file retrieval request to obtain the original path and the request path;

[0210] Specifically, in the embodiments of this specification, the target file acquisition request can be parsed to obtain the source code, and the original path and request path can be determined through the source code; specifically, the source code converter corresponding to the above source code can be determined; the source code is converted into multiple code blocks based on the source code converter; the multiple code blocks are merged to obtain a merged code block; a code package is generated based on the merged code block; and the code is parsed repeatedly through the recursive parsing module.

[0211] S1005: Call the path resolution function to perform path resolution;

[0212] Specifically, in the embodiments of this specification, the path resolution function can be the `resolve` function; a file system can be built through the path resolution function; the file system can include file identifiers (logo.js), header files (header.js), and account identifiers (user.js). During the resolve phase, webpack resolves the referenced code paths to the actual file paths. Although the official configuration of webpack's resolve function does not include the ability to modify paths, this can be achieved by registering a plugin in the function description (describe-resolve) event.

[0213] S10071: Convert the original path into the first absolute path;

[0214] Specifically, in the embodiments described in this specification, the original path is in relative path format;

[0215] In some embodiments, the original path is shown below:

[0216] Path 1: modulDirectory: '. / src / modules / newDir1',

[0217] Path 2: modulRawDirectory: '. / src / modules / dashboard',

[0218] Path 1 is the version path, and Path 2 is the base path; both are relative paths.

[0219] S10073: Convert the request path to a second absolute path;

[0220] Specifically, in the embodiments of this specification, the request path is used to determine the path of the path processing module; the target path processing module can be determined based on the second absolute path; and subsequent steps are processed based on the target path processing module.

[0221] S1009: Determine whether the first absolute path matches the first directory file of the base path or the second directory file of the priority path;

[0222] Specifically, in the embodiments of this specification, the target path processing module can determine whether the first absolute path matches the first directory file of the base path or the second directory file of the priority path; it can determine the function description (describe-resolve) event; and based on the function description event, it can determine whether the first absolute path is referenced from the priority path, thereby determining whether the first absolute path matches the first directory file of the base path or the second directory file of the priority path.

[0223] S100101: If the first absolute path does not match the first directory file of the base path or the second directory file of the priority path, then proceed to the next path resolution stage;

[0224] Specifically, in the embodiments of this specification, some files are stored in other modules of the modules corresponding to the base path and the priority path; if the first absolute path does not match the first directory file of the base path or the second directory file of the priority path, it means that the target file is not in the first directory file or the second directory file. At this time, the next path resolution stage can be entered, and path resolution can be performed based on other directory files other than the first directory file and the second directory file.

[0225] S10011: If the first absolute path matches the first directory file of the base path or the second directory file of the priority path, determine whether the first absolute path matches the base path.

[0226] Specifically, in the embodiments of this specification, if the first absolute path matches the first directory file of the base path or the second directory file of the preferred path, it means that the target file is stored in the first directory file of the base path or the second directory file of the preferred path. At this time, the first absolute path can be matched with the two target files in turn to determine the path that matches the first absolute path.

[0227] S10013: If the first absolute path matches the base path, convert the first absolute path into a relative path;

[0228] In the embodiments of this specification, if the first absolute path matches the base path, the first absolute path can be converted into a relative path based on the base path; specifically, the first absolute path can be converted into a relative path based on the root directory of the base path.

[0229] S10015: Determine whether the relative path is in the preset file system;

[0230] Specifically, the default file system is a file system built based on the target directory file. The file paths in the default file system carry the target version identifier of the target directory file. The method for updating the original path of the target file can be determined through the default file system.

[0231] S10017: If the relative path is in the preset file system, modify the original path to the referenced priority path directory; and jump to step S1005;

[0232] Specifically, in the embodiments of this specification, if the relative path is in the preset file system, it can be explained that the original path can reference the root directory of the preferred path, and the original path can be modified to reference the preferred path directory, thereby facilitating the quick acquisition of the target file.

[0233] S10019: If the relative path is not in the preset file system, proceed to the next path resolution stage;

[0234] In the embodiments of this specification, if the relative path is not in the preset file system, it means that the original path cannot reference the preferred path directory. In this case, the path can be resolved through other directory files to enter the next path resolution stage.

[0235] S10021: If the first absolute path does not match the base path, that is, if the first absolute path matches the priority path, convert the first absolute path into a relative path.

[0236] Specifically, in the embodiments of this specification, if the first absolute path does not match the base path, it means that the first absolute path matches the preferred path. In this case, the first absolute path can be converted into a relative path according to the directory file of the preferred path.

[0237] S10023: Determine whether the relative path is in the preset file system;

[0238] Specifically, in the embodiments of this specification, if the relative path is in the preset file system, then jump to step S10019;

[0239] S10025: If the relative path is not in the preset file system, modify the original path to reference the base path directory; and jump to step S1005.

[0240] Specifically, in the embodiments of this specification, if the relative path is not in the preset file system, the original path is modified to reference the base path directory; specifically, the original path can be modified according to the root directory of the base path.

[0241] In some embodiments, the above file path update method corresponds to a plugin. The plugin receives the request for the referenced file and then determines whether the referenced file is loaded from the preferred path. If so, the referenced path is modified, and the resolve phase is re-executed; otherwise, the path resolution proceeds normally. In this way, the ability to modify the referenced path can be added to the webpack workflow.

[0242] The embodiments of this application improve code development efficiency, enabling the addition and deployment of a new project version in 5 minutes; reduce the maintenance difficulty of different versions of the application, and reduce the development time of requirements between different versions by 2-3 hours compared to before; and for multi-version front-end display solutions, it can be used in scenarios such as webpack projects, code debugging, and test cases.

[0243] In a specific instance, such as Figure 11 As shown, Figure 11This is a schematic diagram of a file path update system, including a base path module and a priority path module. The base path module stores file identifier 1, header file 1, and account identifier 1; the priority path module stores file identifier 2, header file 2, and account identifier 2. The files in both the base path module and the priority path module are relative path references. For example, header file 1 in the base path can be modified to reference the priority path, and file identifier 2 and account identifier 2 in the priority path can be modified to reference the base path, thereby realizing the path update.

[0244] In some embodiments, for root path matching, both the optimized path and the base path can be converted into strings, and the root directory reference of the file can be determined by string comparison. In this way, the original judgment of the file stream path is transformed into the execution of statements under the same execution stack, which improves execution efficiency.

[0245] As can be seen from the technical solutions provided by the embodiments of this application above, the embodiments of this application obtain the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file; based on the target version identifier, search for a directory file that matches the target version identifier in a preset database to obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application; obtain the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file; determine the relative path corresponding to the target file based on the first path set and the second path set; update the original path based on the matching result of the relative path and the preset file system to obtain the updated path; the preset file system is a file system constructed based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file; determine the target file based on the updated path; the above target file is used to render the page in the target application. This application stores the target business features corresponding to the customized business parameters of the target application separately and constructs a corresponding target directory file, thereby facilitating the separate maintenance of the target directory file and improving the development and maintenance efficiency of the customized business of the target application. This application determines the relative path corresponding to the target file based on the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file. Based on the first path set and the second path set, the application updates the original path based on the matching result of the relative path and the preset file system to obtain the updated path. Thus, the target file can be quickly obtained based on the updated path, improving the rendering efficiency of the page in the target application.

[0246] This application also provides a path updating device for page rendering files, such as... Figure 12 As shown, the above-mentioned device includes:

[0247] The target version identifier acquisition module 1210 is used to acquire the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file.

[0248] The target directory file determination module 1220 is used to search for a directory file that matches the target version identifier in a preset database based on the target version identifier, and obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application;

[0249] The path set acquisition module 1230 is used to acquire the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file.

[0250] The relative path determination module 1240 is used to determine the relative path corresponding to the target file based on the first path set and the second path set.

[0251] The path update module 1250 is used to update the original path based on the matching result between the relative path and the preset file system to obtain the updated path; the preset file system is a file system built based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file.

[0252] The target file determination module 1260 is used to determine the target file based on the update path mentioned above; the target file is used to render the page in the target application mentioned above.

[0253] In some embodiments, the relative path determination module includes:

[0254] The path conversion submodule is used to convert the original path of the target file into an absolute path.

[0255] The candidate path set determination submodule is used to determine the first path set and the second path set as candidate path sets.

[0256] The relative path determination submodule is used to convert the absolute path into a relative path if the absolute path is a path in the candidate path set, so as to obtain the relative path corresponding to the target file.

[0257] In some embodiments, the path update module includes:

[0258] The matching result determination submodule is used to determine the matching result between the above relative path and the preset file system;

[0259] The path set determination submodule is used to determine the path set to which the above absolute path belongs;

[0260] The path update submodule is used to update the original path based on the matching results and the path set to which the absolute path belongs, to obtain the updated path.

[0261] In some embodiments, the path update submodule described above includes:

[0262] The first update unit is used to modify the root path in the original path to the root path of the initial directory file if the relative path fails to match the preset file system and the absolute path is a path in the first path set, thereby obtaining the first update path.

[0263] In some embodiments, the path update submodule described above includes:

[0264] The second update unit is used to modify the root path in the original path to the root path of the target directory file if the relative path matches the preset file system and the absolute path is the path in the second path set, so as to obtain the second update path.

[0265] In some embodiments, the matching result determination submodule includes:

[0266] The preset temporary variable construction unit is used to construct the preset temporary variable corresponding to the above preset file system, which serves as the current temporary variable;

[0267] The array conversion unit is used to convert the above relative path into multiple arrays, each array corresponding to a directory level;

[0268] The traversal unit is used to traverse the above arrays and determine the matching result of each array with the current temporary variable.

[0269] The judgment unit is used to determine whether the directory corresponding to any array is a directory at a preset level and to determine the data information matched by the current temporary variable if any array successfully matches the above-mentioned current temporary variable.

[0270] The first matching unit is used to determine that the relative path fails to match the preset file system if the directory corresponding to any of the above arrays is a directory at the preset level and the data information matched by the current temporary variable is a directory.

[0271] In some embodiments, the above-described apparatus further includes:

[0272] The step jump module is used to, if the directory corresponding to any of the above arrays is not a directory at a preset level, and the data information matched by the above current temporary variable is a directory, re-use the matched directory as the above current temporary variable, and jump to the above step of traversing the above multiple arrays and determining the matching result of each array with the above current temporary variable.

[0273] In some embodiments, the path update module includes:

[0274] The root path determination submodule is used to determine the root path and relative path corresponding to the above target files.

[0275] The first matching result determination submodule is used to determine the first matching result between the above root path and the above initial directory file;

[0276] The second matching result determination submodule is used to determine the second matching result between the above relative path and the above preset file system;

[0277] The update path determination submodule is used to update the original path based on the first matching result and the second matching result to obtain the updated path.

[0278] In some embodiments, the update path determination submodule includes:

[0279] The first unit is used to modify the root path in the original path to the root path of the target directory file if the first matching result and the second matching result are both successful, thus obtaining the updated path.

[0280] In some embodiments, the update path determination unit includes:

[0281] The second unit is used to modify the root path in the original path to the root path of the initial directory file if the first matching result and the second matching result are both unsuccessful, so as to obtain the updated path.

[0282] In some embodiments, the above apparatus may further include: a preset database construction module, wherein the preset database construction module includes:

[0283] The preset custom business parameter acquisition submodule is used to acquire the preset custom business parameters corresponding to at least two preset applications; the above-mentioned at least two preset applications include the above-mentioned target application.

[0284] The preset directory file construction submodule is used to construct the preset directory files corresponding to the above-mentioned at least two preset applications based on the above-mentioned initial target file and the preset customized business parameters corresponding to the above-mentioned at least two preset applications.

[0285] The preset version identifier determination submodule is used to determine the preset version identifier corresponding to each of the above at least two preset applications;

[0286] The preset database construction submodule is used to construct the preset database based on the preset version identifiers and preset directory files corresponding to the above at least two preset applications.

[0287] In some embodiments, the aforementioned preset directory file construction submodule may include:

[0288] The initial business feature acquisition unit is used to acquire the initial business features corresponding to each preset customized business parameter from the above-mentioned initial target file;

[0289] The parameter adjustment unit is used to adjust the initial business features corresponding to each preset customized business parameter based on each preset customized business parameter, so as to obtain the preset business features corresponding to each preset application.

[0290] The file construction unit is used to construct a preset directory file corresponding to each preset application based on the preset business characteristics corresponding to each preset application.

[0291] The apparatus and method embodiments described above are based on the same inventive concept.

[0292] This application provides a path update device for page rendering files. The device includes a processor and a memory. The memory stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by the processor to implement the path update method for page rendering files as provided in the above method embodiments.

[0293] The embodiments of this application also provide a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to implementing a path update method for a page rendering file in the method embodiments. The at least one instruction or at least one program is loaded and executed by the processor to implement the path update method for a page rendering file provided in the above method embodiments.

[0294] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the page rendering file path update method provided in the above-described method embodiments.

[0295] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0296] The memory described in this embodiment can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created based on the use of the aforementioned device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0297] The page rendering file path update method embodiment provided in this application can be executed on a mobile terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 13 This is a hardware structure block diagram of a server for a page rendering file path update method provided in an embodiment of this application. For example... Figure 13As shown, the server 1300 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1310 (CPUs 1310 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 1330 for storing data, and one or more storage media 1320 (e.g., one or more mass storage devices) for storing application programs 1323 or data 1322. The memory 1330 and storage media 1320 may be temporary or persistent storage. The program stored in the storage media 1320 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 1310 may be configured to communicate with the storage media 1320 and execute the series of instruction operations stored in the storage media 1320 on the server 1300. Server 1300 may also include one or more power supplies 1360, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1340, and / or one or more operating systems 1321, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0298] The input / output interface 1340 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 1300. In one example, the input / output interface 1340 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 1340 may be a radio frequency (RF) module for wireless communication with the Internet.

[0299] Those skilled in the art will understand that Figure 13 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 1300 may also include... Figure 13 The more or fewer components shown, or having the same Figure 13 The different configurations shown.

[0300] As can be seen from the embodiments of the page rendering file path update method, apparatus, device, or storage medium provided in this application, this application obtains the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file; based on the target version identifier, it searches for a directory file that matches the target version identifier in a preset database to obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial target file and the preset customized business parameters corresponding to each preset application; a first path set corresponding to the target directory file and a second path set corresponding to the initial directory file are obtained; based on the first path set and the second path set, the relative path corresponding to the target file is determined; based on the matching result of the relative path and the preset file system, the original path is updated to obtain an updated path; the preset file system is a file system constructed based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file; based on the updated path, the target file is determined; the target file is used to render the page in the target application. This application stores the target business features corresponding to the customized business parameters of the target application separately and constructs a corresponding target directory file, thereby facilitating the separate maintenance of the target directory file and improving the development and maintenance efficiency of the customized business of the target application. This application determines the relative path corresponding to the target file based on the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file. Based on the first path set and the second path set, the application updates the original path based on the matching result of the relative path and the preset file system to obtain the updated path. Thus, the target file can be quickly obtained based on the updated path, improving the rendering efficiency of the page in the target application.

[0301] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0302] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0303] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer storage medium, such as a read-only memory, a disk, or an optical disk.

[0304] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for updating the path of a page rendering file, characterized in that, The method includes: Obtain the original path of the target file and the target version identifier of the target application corresponding to the target file; Based on the target version identifier, a directory file matching the target version identifier is searched in a preset database to obtain a target directory file; the target directory file is used to store the target business features corresponding to the target application; the target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application; the preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications; the preset directory file corresponding to each preset application is constructed based on the initial directory file and the preset customized business parameters corresponding to each preset application; Obtain the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file; Based on the first path set and the second path set, determine the relative path corresponding to the target file; Based on the matching result between the relative path and the preset file system, the original path is updated to obtain the updated path; the preset file system is a file system built based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file; Based on the update path, the target file is determined; the target file is used to render the page in the target application.

2. The method according to claim 1, characterized in that, Determining the relative path corresponding to the target file based on the first path set and the second path set includes: Convert the original path corresponding to the target file into an absolute path; The first path set and the second path set are determined as candidate path sets; If the absolute path is a path in the candidate path set, the absolute path is converted into a relative path to obtain the relative path corresponding to the target file.

3. The method according to claim 2, characterized in that, The step of updating the original path based on the matching result between the relative path and the preset file system to obtain the updated path includes: Determine the matching result between the relative path and the preset file system; Determine the path set to which the absolute path belongs; Based on the matching result and the path set to which the absolute path belongs, the original path is updated to obtain the updated path.

4. The method according to claim 3, characterized in that, The step of updating the original path based on the matching result and the path set to which the absolute path belongs, to obtain the updated path, includes: If the relative path fails to match the preset file system, and the absolute path is a path in the first path set, the root path in the original path is modified to the root path of the initial directory file to obtain the first updated path.

5. The method according to claim 3, characterized in that, The step of updating the original path based on the matching result and the path set to which the absolute path belongs, to obtain the updated path, includes: If the relative path matches the preset file system successfully, and the absolute path is the path in the second path set, the root path in the original path is modified to the root path of the target directory file to obtain the second update path.

6. The method according to claim 3, characterized in that, Determining the matching result between the relative path and the preset file system includes: Construct a preset temporary variable corresponding to the preset file system, and use it as the current temporary variable; The relative path is converted into multiple arrays, with each array corresponding to a directory level; Iterate through the arrays and determine the matching result between each array and the current temporary variable; If any array matches the current temporary variable, determine whether the directory corresponding to any array is a directory at a preset level and determine the data information that the current temporary variable matches. If the directory corresponding to any of the arrays is a directory at the preset level, and the data information matched by the current temporary variable is a directory, it is determined that the relative path fails to match the preset file system.

7. The method according to claim 6, characterized in that, The method further includes: If the directory corresponding to any of the arrays is not a directory at a preset level, and the data information matched by the current temporary variable is a directory, the matched directory is used again as the current temporary variable, and the process jumps to the step of traversing the multiple arrays and determining the matching result between each array and the current temporary variable.

8. The method according to claim 1, characterized in that, The step of updating the original path based on the matching result between the relative path and the preset file system to obtain the updated path includes: Determine the root path and relative path corresponding to the target file; Determine the first matching result between the root path and the initial directory file; Determine the second matching result between the relative path and the preset file system; Based on the first matching result and the second matching result, the original path is updated to obtain the updated path.

9. The method according to claim 8, characterized in that, The step of updating the original path based on the first matching result and the second matching result to obtain the updated path includes: If both the first and second matching results are successful, the root path in the original path is modified to the root path of the target directory file to obtain the updated path.

10. The method according to claim 8, characterized in that, The step of updating the original path based on the first matching result and the second matching result to obtain the updated path includes: If both the first and second matching results are unsuccessful, the root path in the original path is modified to the root path of the initial directory file to obtain the updated path.

11. The method according to claim 1, characterized in that, The method for constructing the preset database includes: Obtain the preset customized business parameters corresponding to each of the at least two preset applications; the at least two preset applications include the target application; Based on the initial directory file and the preset customized business parameters corresponding to each of the at least two preset applications, construct the preset directory file corresponding to each of the at least two preset applications; Determine the preset version identifier corresponding to each of the at least two preset applications; The preset database is constructed based on the preset version identifiers and preset directory files corresponding to the at least two preset applications.

12. The method according to claim 11, characterized in that, The step of constructing the preset directory file corresponding to each of the at least two preset applications based on the initial directory file and the preset customized business parameters corresponding to each of the at least two preset applications includes: Obtain the initial business features corresponding to each preset customized business parameter from the initial directory file; Based on each preset customized business parameter, the initial business features corresponding to each preset customized business parameter are adjusted to obtain the preset business features corresponding to each preset application. Based on the preset business characteristics corresponding to each preset application, a preset directory file corresponding to each preset application is constructed.

13. A path update device for page rendering files, characterized in that, The device includes: The target version identifier acquisition module is used to acquire the original path corresponding to the target file and the target version identifier of the target application corresponding to the target file. The target directory file determination module is used to search for a directory file matching the target version identifier in a preset database based on the target version identifier, thereby obtaining a target directory file. The target directory file is used to store the target business features corresponding to the target application. The target business features are generated based on the initial business features in the initial directory file and the customized business parameters of the target application. The preset database is constructed based on the preset version identifiers and preset directory files corresponding to at least two preset applications. The preset directory file corresponding to each preset application is constructed based on the initial directory file and the preset customized business parameters corresponding to each preset application. The path set acquisition module is used to acquire the first path set corresponding to the target directory file and the second path set corresponding to the initial directory file. The relative path determination module is used to determine the relative path corresponding to the target file based on the first path set and the second path set; The path update module is used to update the original path based on the matching result between the relative path and the preset file system to obtain the updated path; the preset file system is a file system built based on the target directory file, and the file path in the preset file system carries the target version identifier of the target directory file; The target file determination module is used to determine the target file based on the update path; the target file is used to render the page in the target application.

14. The apparatus according to claim 13, characterized in that, The relative path determination module includes: The path conversion submodule is used to convert the original path corresponding to the target file into an absolute path; The candidate path set determination submodule is used to determine the first path set and the second path set as candidate path sets; The relative path determination submodule is used to convert the absolute path into a relative path if the absolute path is a path in the candidate path set, so as to obtain the relative path corresponding to the target file.

15. The apparatus according to claim 14, characterized in that, The path update module includes: The matching result determination submodule is used to determine the matching result between the relative path and the preset file system; The path set determination submodule is used to determine the path set to which the absolute path belongs; The path update submodule is used to update the original path based on the matching result and the path set to which the absolute path belongs, to obtain the updated path.

16. The apparatus according to claim 15, characterized in that, The path update submodule includes: The first update unit is configured to modify the root path in the original path to the root path of the initial directory file if the relative path fails to match the preset file system and the absolute path is a path in the first path set, thereby obtaining the first update path.

17. The apparatus according to claim 15, characterized in that, The path update submodule includes: The second update unit is used to modify the root path in the original path to the root path of the target directory file if the relative path matches the preset file system and the absolute path is the path in the second path set, so as to obtain the second update path.

18. The apparatus according to claim 15, characterized in that, The matching result determination submodule includes: A preset temporary variable construction unit is used to construct a preset temporary variable corresponding to the preset file system, which serves as the current temporary variable; An array conversion unit is used to convert the relative path into multiple arrays, each array corresponding to a directory level; A traversal unit is used to traverse the multiple arrays and determine the matching result of each array with the current temporary variable; The judgment unit is used to determine whether the directory corresponding to any array is a directory at a preset level and to determine the data information matched by the current temporary variable if any array successfully matches the current temporary variable. The first matching unit is used to determine that the relative path fails to match the preset file system if the directory corresponding to any array is a directory at the preset level and the data information matched by the current temporary variable is a directory.

19. The apparatus according to claim 18, characterized in that, The device further includes: The step jump module is used to, if the directory corresponding to any array is not a preset level directory, and the data information matched by the current temporary variable is a directory, re-use the matched directory as the current temporary variable, and jump to the step of traversing the multiple arrays and determining the matching result between each array and the current temporary variable.

20. The apparatus according to claim 13, characterized in that, The path update module includes: The root path determination submodule is used to determine the root path and the relative path corresponding to the target file; The first matching result determination submodule is used to determine the first matching result between the root path and the initial directory file; The second matching result determination submodule is used to determine the second matching result between the relative path and the preset file system; The update path determination submodule is used to update the original path based on the first matching result and the second matching result to obtain the updated path.

21. The apparatus according to claim 20, characterized in that, The update path determination submodule includes: The first unit is used to modify the root path in the original path to the root path of the target directory file if the first matching result is a successful match and the second matching result is a successful match, thereby obtaining the updated path.

22. The apparatus according to claim 20, characterized in that, The update path determination unit includes: The second unit is used to modify the root path in the original path to the root path of the initial directory file if both the first matching result and the second matching result are failures, thereby obtaining an updated path.

23. The apparatus according to claim 13, characterized in that, The device further includes: a preset database construction module, the preset database construction module comprising: A preset customized business parameter acquisition submodule is used to acquire preset customized business parameters corresponding to at least two preset applications; the at least two preset applications include the target application. The preset directory file construction submodule is used to construct the preset directory file corresponding to each of the at least two preset applications based on the initial directory file and the preset customized business parameters corresponding to each of the at least two preset applications. The preset version identifier determination submodule is used to determine the preset version identifier corresponding to each of the at least two preset applications; The preset database construction submodule is used to construct the preset database based on the preset version identifiers and preset directory files corresponding to the at least two preset applications.

24. The apparatus according to claim 23, characterized in that, The preset directory file construction submodule includes: An initial business feature acquisition unit is used to acquire the initial business feature corresponding to each preset customized business parameter from the initial directory file; The parameter adjustment unit is used to adjust the initial business features corresponding to each preset customized business parameter based on each preset customized business parameter, so as to obtain the preset business features corresponding to each preset application. The file construction unit is used to construct a preset directory file corresponding to each preset application based on the preset business characteristics corresponding to each preset application.

25. A path update device for page rendering files, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the path update method for page rendering files as described in any one of claims 1-12.

26. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a method for updating the path of a page rendering file as described in any one of claims 1-12.

27. A computer storage medium, characterized in that, The computer storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the path update method for page rendering files as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Application program updating method and device in multi-tenant scene and electronic equipment

    CN112486547A

  • Detection method, code package processing method, operation control method and computing device

    CN113608742A