Page dynamic variable configuration loading processing method and system and medium

Centralizing dynamic variable loading on the server and parsing them into static text addresses the performance and complexity issues in existing website management systems, enhancing loading speed and maintenance efficiency.

CN119691300APending Publication Date: 2025-03-25SHANGHAI SHUHE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411715549.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Current methods for loading dynamic variables on websites, particularly in content management systems, result in increased page load time, complexity, and maintenance challenges due to the lack of unified server-side management, leading to performance issues and complexity in managing and updating variable logic.

Method used

A method and system that centralize the loading of dynamic variables on the server, using a structured approach to map and parse these variables, replacing them with static text before transmission to the client, thereby reducing client-side complexity and improving performance.

Benefits of technology

This approach enhances page loading performance, simplifies maintenance, and reduces the complexity of dynamic variable management by shifting the dynamic variable processing to the server, allowing for parallel processing and shared data source handling, thus improving responsiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691300A_ABST
    Figure CN119691300A_ABST
Patent Text Reader

Abstract

The invention provides a page dynamic variable configuration loading processing method and system and a medium, and the method comprises the steps: carrying out the configuration of loading logic mapping of a dynamic variable through a server, so as to obtain a variable structure corresponding to the dynamic variable; calling the variable structure through a CMS system, configuring the dynamic variable into a display text according to the variable structure, and configuring the display text in a page component corresponding to the dynamic variable; loading the page component through the CMS system, and inputting the display text into the server for analysis to obtain a variable value of the dynamic variable in the page component; replacing a dynamic variable in the display text with the variable value, converting the display text into a target text, loading the target text in the page component by the CMS system, and transmitting the target text to the client for loading and displaying; according to the method, the page performance and the loading speed can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of website page management, and relates to a page variable loading processing method, and in particular to a configuration loading processing method, system and medium for page dynamic variables. Background Art

[0002] Content Management System (CMS) is a set of tools for managing website content. It allows operators to set page layouts, and then the server application processes these settings and sends customized content to the client. This process involves static configuration and dynamic data to adapt to the needs of different users.

[0003] Specifically, for finance-related websites, operators define page elements in the CMS, such as the location of user credit limits. The server application receives these static configurations and dynamically generates page data based on each user's specific information, such as credit limits. This personalized data is then sent to the user's device, and the client renders personalized page content accordingly.

[0004] At present, the common solutions to solve this kind of dynamic content loading are as follows: The first is that the server only returns the static configuration, which includes the type, location, and style of the dynamic content, and the client requests data from the corresponding backend service system according to the configuration. For example, for the loading of the credit limit, the server returns the credit limit account and type configuration to be displayed, and the client then loads the user's credit limit from the credit limit system according to the configuration. The second is that the server loads the dynamic variables and returns them to the client together with the static configuration.

[0005] However, the above method increases the time consumption of page display and is not conducive to the iterative update of variable loading logic, because the dynamic variables of the page are maintained on the client side and there is no unified and easy-to-maintain server-side variable processing technology. In addition, the variable loading logic is managed in a distributed manner, which may lead to ambiguity, increases the complexity of client page loading, and reduces performance, which is not friendly to non-technical personnel. Summary of the invention

[0006] The purpose of the present application is to provide a configuration loading processing method, system and medium for page dynamic variables, so as to solve the problem of poor performance caused by complex page variable loading in the prior art.

[0007] In a first aspect, the present application provides a configuration loading processing method for page dynamic variables, the method comprising:

[0008] The loading logic mapping of the dynamic variable is configured by the server to obtain a variable structure corresponding to the dynamic variable;

[0009] Calling the variable structure through the CMS system, configuring the dynamic variable as a display text according to the variable structure, and configuring the display text in the page component corresponding to the dynamic variable;

[0010] The page component is loaded through the CMS system, and the display text is input into the server for parsing to obtain the variable value of the dynamic variable in the page component;

[0011] The variable value replaces the dynamic variable in the display text and is converted into a target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

[0012] In this application, by unifying the dynamic variable loading process into the server for unified management, the existence of dynamic variables on the client is weakened, allowing the client to focus on displaying the static style of the page and processing the interactive logic, which is beneficial to improving page loading performance, reducing the complexity of client page loading, improving the maintainability of page dynamic variables, and reducing the complexity of dynamic variable loading.

[0013] In an implementation of the first aspect, the variable structure includes an operation structure and an execution structure, the operation structure includes an applicable component, a variable Chinese name and a variable key, the execution structure includes a data source, a default value, a data source identifier and a calculation logic, the applicable component is used to indicate the component and component element to which the dynamic variable is applicable, the variable Chinese name is a Chinese description of the dynamic variable, the variable key is a unique identifier of the dynamic variable, the data source is used to indicate the data source of the dynamic variable, the default value is the default value of the dynamic variable when an exception occurs during the loading and replacement process of the dynamic variable, the data source identifier is used to screen the data source corresponding to the dynamic variable, and the calculation logic is the calculation logic for calculating the variable value of the dynamic variable.

[0014] In an implementation of the first aspect, calling the variable structure through a CMS system and configuring the dynamic variable as a display text according to the variable structure includes:

[0015] The page configuration personnel calls the variable structure on the server through the CMS system;

[0016] The variable key is used as a placeholder, and the placeholder and the Chinese name of the variable are combined with the rich text to form the display text;

[0017] The configuring the display text in the page component corresponding to the dynamic variable includes:

[0018] The components and component elements to which the dynamic variable is applicable are determined according to the applicable components, and the display text is configured in the corresponding page components.

[0019] In an implementation of the first aspect, loading the page component through the CMS system and inputting the display text into the server for parsing to obtain the variable value of the dynamic variable in the page component includes:

[0020] Loading the page component through the CMS system to obtain the display text;

[0021] After determining that the display text is not empty, extracting the dynamic variable in the display text through regular matching;

[0022] After determining that the dynamic variable has not been calculated, obtaining a variable key corresponding to the dynamic variable in the display text according to the loading logic mapping, and matching variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable;

[0023] The variable value of the dynamic variable in the page component is calculated according to the variable configuration information.

[0024] In an implementation of the first aspect, matching the variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable includes:

[0025] In the cache data of the kv structure, the variable configuration memory address corresponding to the variable key is matched by a hash algorithm;

[0026] Acquire the variable configuration information corresponding to the dynamic variable according to the variable configuration memory address;

[0027] The cache data is used to store the memory address of the dynamic variable and the variable configuration information, and the variable configuration information includes the variable structure, data source interface address and service name corresponding to the dynamic variable.

[0028] In an implementation of the first aspect, calculating the variable value of the dynamic variable in the page component according to the variable configuration information includes:

[0029] Obtaining the construction logic code service corresponding to the data source in the service container according to the service name;

[0030] Acquire the data source interface address according to the variable configuration information, send an http request according to the data source interface address and connect to the downstream business service to acquire the corresponding data source, and determine whether the data source has been loaded;

[0031] After determining that the data source has not been loaded, the data source is loaded and cached by the construction logic code service, and the variable value corresponding to the dynamic variable is calculated according to the variable structure;

[0032] After determining that the data source has been loaded, the variable value corresponding to the dynamic variable is directly calculated according to the variable structure.

[0033] In an implementation of the first aspect, when there are multiple dynamic variables in the display text, the variable value calculated by the current dynamic variable replaces the current dynamic variable in the display text, and then the next dynamic variable is calculated until the dynamic variables in the display text are replaced one by one by the corresponding variable values, and the calculation process of multiple dynamic variables is implemented in parallel through a thread pool.

[0034] In an implementation of the first aspect, when the calculation processes of the multiple dynamic variables are processed in parallel, the following verification is performed before requesting the data source interface:

[0035] When there is an identical data source request task running, wait for the corresponding data source request task to finish running, and replace the variable value of the dynamic variable with a default value after a timeout;

[0036] When the data source response result of the requested data is stored in the shared cache data area, no request is issued, and the data source response result in the shared cache data area is directly used;

[0037] When there is neither the same data source request task running nor the completed data source response result stored in the shared cache data area, a data source interface request is directly issued, and the current data source task in progress is recorded in the shared cache data area. After the request is completed, the current data source response result is placed in the shared cache data area.

[0038] In a second aspect, the present application also provides a configuration loading processing system for page dynamic variables, including:

[0039] A mapping configuration module, used to configure the loading logic mapping of the dynamic variable through the server to obtain a variable structure corresponding to the dynamic variable;

[0040] A text configuration module, used to call the variable structure through the CMS system, configure the dynamic variable as a display text according to the variable structure, and configure the display text in the page component corresponding to the dynamic variable;

[0041] A variable calculation module, used for loading the page component through the CMS system, inputting the display text into the server for parsing, so as to obtain the variable value of the dynamic variable in the page component;

[0042] The loading and display module is used to replace the dynamic variables in the display text with the variable values ​​and then convert them into target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

[0043] In a third aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed, the configuration loading processing method of the dynamic variables of the page is implemented.

[0044] As described above, the configuration loading processing method, system and medium of the page dynamic variables described in the present application have the following beneficial effects:

[0045] By unifying the dynamic variable loading process into the server for unified management, the existence of dynamic variables on the client side is weakened, allowing the client to focus on displaying the static style of the page and processing the interactive logic, which is beneficial to improving the page loading performance and speed, reducing the complexity of client page loading, improving the maintainability of page dynamic variables, reducing the complexity of dynamic variable loading, and realizing parallel processing of multiple dynamic variables through multi-threading technology. Through user-level local variables, multiple variable processing threads can share their own data sources to avoid multiple requests for the interface corresponding to the data source, reduce network IO, and improve response speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 Shown is a flowchart of the configuration loading processing method of the page dynamic variables described in an embodiment of the present application.

[0047] Figure 2 Shown is a schematic diagram of the variable structure in the configuration loading processing method of the page dynamic variables described in an embodiment of the present application.

[0048] Figure 3 Shown is a schematic diagram of the processing process of dynamic variables in the configuration loading processing method of page dynamic variables described in an embodiment of the present application.

[0049] Figure 4 The structure diagram of the configuration loading processing system of the page dynamic variables described in the embodiment of the present application is shown as follows DETAILED DESCRIPTION

[0050] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0051] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.

[0052] See also Figures 1 to 3 The following embodiment of the present application provides a configuration loading processing method for dynamic variables of a page, and the method comprises the following steps:

[0053] S100: configuring a loading logic mapping of a dynamic variable through a server to obtain a variable structure corresponding to the dynamic variable.

[0054] In this embodiment, for the dynamic variables of the page where the user is located, the backend personnel configure the loading mapping logic of the dynamic variables through the server, so as to standardize the application of the dynamic variables and reduce application errors.

[0055] Specifically, refer to Figure 2 The variable structure includes an operation structure and an execution structure. The operation structure includes an applicable component, a variable Chinese name and a variable key. The execution structure includes a data source, a default value, a data source identifier and a calculation logic. The applicable component is used to indicate the component and component element to which the dynamic variable is applicable. The variable Chinese name is a Chinese description of the dynamic variable. The variable key is a unique identifier of the dynamic variable. The data source is used to indicate the data source of the dynamic variable. The default value is the default value of the dynamic variable when an exception occurs during the loading and replacement process of the dynamic variable. The data source identifier is used to screen the data source corresponding to the dynamic variable. The calculation logic is the calculation logic for calculating the variable value of the dynamic variable.

[0056] After the dynamic variable configuration of the page is completed and the corresponding loading mapping logic configuration is completed to obtain the variable structure, the applicable components, variable Chinese names and variable keys in the operation structure are exposed to the configuration personnel of the CMS system, so that the configuration personnel of the CMS system can see the variable key, variable Chinese name and applicable components corresponding to the dynamic variables, which is convenient for the standard configuration personnel to configure the dynamic variables in the appropriate page components.

[0057] S200: calling the variable structure through the CMS system, configuring the dynamic variable as a display text according to the variable structure, and configuring the display text in the page component corresponding to the dynamic variable.

[0058] In some embodiments, calling the variable structure through the CMS system and configuring the dynamic variable as a display text according to the variable structure includes:

[0059] The page configuration personnel calls the variable structure on the server through the CMS system;

[0060] The variable key is used as a placeholder, and the placeholder and the variable Chinese name are combined with the rich text to form the display text;

[0061] The configuring the display text in the page component corresponding to the dynamic variable includes:

[0062] The components and component elements to which the dynamic variable is applicable are determined according to the applicable components, and the display text is configured in the corresponding page components.

[0063] In this embodiment, after the backend personnel configure the corresponding variable structure for the dynamic variable through the server, the page configuration personnel of the CMS system calls the variable structure corresponding to the dynamic variable, uses the variable key of the dynamic variable as a placeholder, and combines the placeholder, the Chinese name of the variable and the rich text to obtain the display text corresponding to the dynamic variable, thereby simplifying the variable configuration of the CMS system.

[0064] To do this, open the configuration page, select the CMS component that needs to be configured, click Insert Variable in the text input box of the field configuration that supports variables, select the variable, and the front-end server will enter the selected variable into the text input box in a certain format. Then save the configuration.

[0065] For example, the placeholders (i.e., variable keys) of each dynamic variable are multiple and diverse. For example, a nickname can be represented by the placeholder {NICK_NAME}, and a full name can be represented by the placeholder {USER_NAME}. The English names of the placeholders can be used to distinguish them. If multiple identical placeholders are configured in a text, they do not need to be distinguished. For example, if your name is {USER_NAME}, {USER_NAME}, then in actual processing, these two placeholders will be replaced with the same value, because for the same user, the placeholder value obtained must be the same and will not change due to different configuration locations.

[0066] It should be noted that there are not many restrictions on rich text content, and it is mainly through the free configuration of its content by the operators of the CMS system. However, in order to reduce conflicts with placeholders, it is usually verified that the placeholders in the rich text must be supported, that is, the back-end system has relevant logical configurations, and an unsupported placeholder cannot be manually entered; it is also avoided that the other content formats of the rich text are the same as the placeholder format. For example, if the format of the placeholder is: ${XXXX}, then non-variables are not allowed to appear and are configured in this format.

[0067] S300, loading the page component through the CMS system, inputting the display text into the server for parsing to obtain the variable value of the dynamic variable in the page component.

[0068] In some embodiments, reference Figure 3 , the page component is loaded through the CMS system, and the display text is input to the server for parsing to obtain the variable value of the dynamic variable in the page component, including:

[0069] Loading the page component through the CMS system to obtain the display text;

[0070] After determining that the display text is not empty, extracting the dynamic variable in the display text through regular matching;

[0071] After determining that the dynamic variable has not been calculated, obtaining a variable key corresponding to the dynamic variable in the display text according to the loading logic mapping, and matching variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable;

[0072] The variable value of the dynamic variable in the page component is calculated according to the variable configuration information.

[0073] In this embodiment, when the CMS system loads the page component, the corresponding display text in the page component is obtained, and firstly, it is determined whether the display text is empty. After determining that the display text is not empty, the dynamic variables in the display text are extracted by regular matching. Specifically, a regular expression matching the dynamic variable format is set through a regular matching algorithm, for example: \$\{(.*?)}, which means matching the string prefixed with "${" and suffixed with "}", and then the display text and the expression are used as input items, and the variable list in the original text can be obtained by running the regular matching algorithm, thereby extracting the dynamic variables in the display text.

[0074] After extracting the dynamic variables in the displayed text, determine whether the variable value of the current dynamic variable has been calculated. If the variable value of the current dynamic variable has been calculated, since the variable value will be put into the cache after calculation, the calculated variable value will be directly loaded. Since the variable value will be put into the cache after calculation, if the variable value corresponding to the variable is found in the cache, it means that this variable has been calculated in this user's request and can be used directly without repeated calculation. This cache is generated once for each page request and destroyed when the response is completed, that is, the cache between different users and different requests is not shared to prevent mutual interference.

[0075] In contrast, when the variable value of a dynamic variable has not been calculated, the variable key corresponding to the dynamic variable in the display text is obtained according to the loading logic mapping, and the variable configuration information corresponding to the dynamic variable is matched according to the variable key corresponding to the dynamic variable.

[0076] In some further embodiments, matching the variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable includes:

[0077] In the cache data of the kv structure, the variable configuration memory address corresponding to the variable key is matched by a hash algorithm;

[0078] Acquire the variable configuration information corresponding to the dynamic variable according to the variable configuration memory address;

[0079] The cache data is used to store the memory address of the dynamic variable and the variable configuration information, and the variable configuration information includes the variable structure, data source interface address and service name corresponding to the dynamic variable.

[0080] Specifically, after extracting the dynamic variables in the display text, the variable key corresponding to the dynamic variable, that is, the corresponding placeholder, is obtained according to the loading mapping logic configured above. Since the memory address of the variable configuration corresponding to the dynamic variable is stored in the cache data of a kv structure, after obtaining the variable key of the dynamic variable, the variable configuration memory address corresponding to the variable key is matched through the hash algorithm, and then the variable configuration information corresponding to the dynamic variable is obtained according to the variable configuration memory address, so as to facilitate the subsequent calculation of the subsequent variable value according to the variable configuration information.

[0081] In some other embodiments, calculating the variable value of the dynamic variable in the page component according to the variable configuration information includes:

[0082] Obtaining the construction logic code service corresponding to the data source in the service container according to the service name;

[0083] Acquire the data source interface address according to the variable configuration information, send an http request according to the data source interface address and connect to the downstream business service to acquire the corresponding data source, and determine whether the data source has been loaded;

[0084] After determining that the data source has not been loaded, the data source is loaded and cached by the construction logic code service, and the variable value corresponding to the dynamic variable is calculated according to the variable structure;

[0085] After determining that the data source has been loaded, the variable value corresponding to the dynamic variable is directly calculated according to the variable structure.

[0086] Specifically, since the variable configuration information includes the variable structure, data source interface address and service name corresponding to the dynamic variable, after obtaining the variable configuration information corresponding to the dynamic variable, the corresponding construction class is obtained in the service container according to the service name. Since different services correspond to different code logics and request logics, after determining the service name corresponding to the dynamic variable, the construction logic code service required for the dynamic variable is taken out from the service container through the service name. Then, the data source interface address is obtained according to the variable configuration information, and after an http request is issued according to the data source interface address, the downstream business service is connected to obtain the corresponding data source. After obtaining the data source corresponding to the dynamic variable, it is further determined whether the data source has been loaded. When the data source has been loaded, the loaded data source can be directly used to return without repeatedly issuing requests, which can greatly improve the page request speed. If the data source has not been loaded, the data source is loaded and cached through the construction logic code service, and the variable value corresponding to the dynamic variable is calculated according to the variable structure.

[0087] Among them, after loading the data source, the data source is cached to ensure that the same data source is requested once. Other dynamic variables that require the same data source can share the response result of this request through caching without having to request again, which greatly reduces the number of requests for data sources and improves page response speed.

[0088] The process of calculating the variable value corresponding to the dynamic variable according to the variable structure includes:

[0089] The calculation logic corresponding to the dynamic variable is determined according to the variable key. The calculation logic includes screening, conversion, calculation and formatting. According to the different dynamic variables, the corresponding processing method is selected to obtain the variable value corresponding to the dynamic variable.

[0090] Specifically, since the data source is the response obtained by requesting the business interface, its format is relatively complex and includes multiple data. For example, when requesting the user's credit limit data, multiple credit limit data may be returned. At this time, it is necessary to filter out the required credit limit data based on the variable configuration information.

[0091] The corresponding calculation process mainly includes the following:

[0092] Conversion usually refers to the conversion of data types. For example, the amount data is usually a number, but the variable value is a string, so data type conversion is required.

[0093] Calculation usually refers to logic that includes mathematical calculations. For example, if the user's loan amount and interest rate are obtained through the data source, the calculation logic of the variable structure includes an expression that calculates the interest through the loan amount and interest rate. The interest needs to be calculated through this expression as the variable value.

[0094] Formatting: Since the values ​​obtained through the above conversions and calculations are usually not displayed to the user, the calculated results need to be formatted. For example, if the user's credit limit is 100,000 points, it needs to be formatted as 1,000 yuan. For another example, the expiration date of the user's credit limit is usually a digital timestamp in the data source, which needs to be converted to a date and time format, such as year-month-day hour-minute-second date and time format.

[0095] It should be noted that in this application, the parsing of dynamic variables and conversion of variable texts are implemented by a unified base class, while variable data source loading and variable value calculation that require personalized logic will be implemented by writing different subclasses according to the type of variable. In this way, it is only necessary to implement its calculation logic and data source loading logic according to different types of variables, use the base class to implement unified logic, and the subclass to implement personalized customization logic, which improves the reusability of the code, reduces complexity, and enhances its functionality.

[0096] S400, replacing the dynamic variable in the display text with the variable value and converting it into a target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

[0097] After the variable value corresponding to the dynamic variable is calculated in the above method, the target variable in the display text is replaced by the variable value to obtain the final target text. For example, if the variable key is ${LIMIT} and the initial display text is "Your limit is ${LIMIT}", the final target text obtained after calculation is "Your limit is 1,000 yuan". The CMS system then loads the target text on the corresponding page component and transmits it to the user's client for loading and display. Since the calculation and processing of dynamic variables are performed on the server throughout the process, the client only needs to obtain the final display target text, which simplifies the client's page loading logic and improves the page loading speed.

[0098] In some other embodiments, when there are multiple dynamic variables in the display text, the variable value calculated by the current dynamic variable replaces the current dynamic variable in the display text, and then the next dynamic variable is calculated until the dynamic variables in the display text are replaced one by one by the corresponding variable values, and the calculation process of multiple dynamic variables is implemented in parallel through a thread pool.

[0099] For example, when there are multiple dynamic variables that need to be processed in the displayed text, after processing a variable in the text, the dynamic variable will be replaced with the variable value. For example, ${LIMIT} is replaced with 1,000. Then the first variable before the replacement will not meet the variable format after the replacement and cannot be regarded as a variable. Then the second dynamic variable before the replacement will be the first dynamic variable in the text after the first dynamic variable is replaced. This process continues until all variables in the text are replaced, so that multiple variables in the text can be replaced one by one.

[0100] Furthermore, multiple dynamic variables of the same user are processed in parallel, which is specifically achieved through thread pool technology, that is, the processing task is added as a thread to a thread pool of a limited size. The thread pool will take out several threads to run in parallel according to a certain configuration (usually related to the performance of the server CPU), thereby ensuring that multiple dynamic variables can be processed in parallel, effectively improving the loading speed of variables. Using multi-threaded parallel processing variable logic, using user-level variable pools to achieve thread communication, sharing data from each data source, greatly improving variable processing speed and reducing IO times.

[0101] In some embodiments, when the calculation processes of multiple dynamic variables are processed in parallel, the following check is performed before requesting the data source interface:

[0102] When there is an identical data source request task running, wait for the corresponding data source request task to finish running, and replace the variable value of the dynamic variable with a default value after a timeout;

[0103] When the data source response result of the requested data is stored in the shared cache data area, no request is issued, and the data source response result in the shared cache data area is directly used;

[0104] When there is neither the same data source request task running nor the completed data source response result stored in the shared cache data area, a data source interface request is directly issued, and the current data source task in progress is recorded in the shared cache data area. After the request is completed, the current data source response result is placed in the shared cache data area.

[0105] Specifically, since the server puts a shared cache data area shareCache of kv structure in the cache, this shared cache data will be generated once for the user when the user loads the page and destroyed after use.

[0106] Before requesting, do the following checks:

[0107] (1) Whether there are tasks with the same data source request running.

[0108] (2) Whether there is a data source response result that has been requested and is stored in the kv data structure.

[0109] If the verification results in (1) and (2) are both negative, a request is issued and the data source task is recorded in the shared cache data area shareCache as being in progress. After the request is completed, the data source response result is also placed in the shared cache data area shareCache.

[0110] If the verification result of (1) is yes, wait for the corresponding data source task to complete, and call the corresponding result after the completion of the task.

[0111] It should be noted that there is a corresponding timeout period for waiting for the corresponding data source task to complete. If it is still not completed after the timeout, it is considered that the data source has failed to load. This is to prevent the processing time from being too long, causing the user to wait for a long time. The variable value of the data source that failed to load will be replaced with the default value in the configuration, for example, the amount is replaced with:--.

[0112] If the verification result of (2) is yes, no request is issued and the shared data source is directly used to respond, thus avoiding issuing repeated requests and improving the page loading response speed.

[0113] Among them, when the data in the shared cache data area shareCache is modified, the shared cache data area shareCache will be exclusively occupied. Other threads cannot view or modify shareCache and need to wait for the data to be modified. This can effectively prevent data confusion caused by multiple threads concurrently modifying the memory.

[0114] The protection scope of the configuration and loading processing method of page dynamic variables described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.

[0115] The configuration loading processing method, system and medium of the page dynamic variables described in the present application, by unifying the dynamic variable loading process into the server for unified management, weakens the existence of dynamic variables on the client side, and allows the client to focus on displaying the static style of the page and processing the interactive logic, which is beneficial to improving the page loading performance and loading speed, reducing the complexity of client page loading, improving the maintainability of page dynamic variables, reducing the complexity of dynamic variable loading, and realizing parallel processing of multiple dynamic variables through multi-threading technology, and through user-level local variables, multiple variable processing threads can share their respective data sources to avoid multiple requests for the interface corresponding to the data source, reduce network IO, and improve response speed.

[0116] This application also provides a configuration loading processing system for page dynamic variables, refer to Figure 4 ,include:

[0117] A mapping configuration module 401 is used to configure the loading logic mapping of the dynamic variable through the server to obtain a variable structure corresponding to the dynamic variable;

[0118] A text configuration module 402 is used to call the variable structure through the CMS system, configure the dynamic variable as a display text according to the variable structure, and configure the display text in the page component corresponding to the dynamic variable;

[0119] The variable calculation module 403 is used to load the page component through the CMS system, input the display text to the server for parsing, and obtain the variable value of the dynamic variable in the page component;

[0120] The loading and displaying module 404 is used to replace the dynamic variables in the display text with the variable values ​​and convert them into target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

[0121] Since the various modules in the above-mentioned system for processing the configuration and loading of dynamic variables on a page correspond one to one with the steps of the above-mentioned method for processing the configuration and loading of dynamic variables on a page, they will not be described in detail here.

[0122] It should be noted that the configuration loading and processing system of the page dynamic variables can implement the configuration loading and processing method of the page dynamic variables described in this application, but the implementation device of the configuration loading and processing method of the page dynamic variables described in this application includes but is not limited to the structure of the configuration loading and processing system of the page dynamic variables listed in this embodiment. All structural deformations and replacements of the prior art made according to the principles of this application are included in the protection scope of this application.

[0123] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed, the configuration loading processing method of the dynamic variables of the page is implemented.

[0124] A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above-mentioned embodiment can be completed by instructing a processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above-mentioned storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (DVD)), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.

[0125] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.

[0126] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.

[0127] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0128] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0129] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A configuration loading processing method for page dynamic variables, characterized in that: The method comprises: The loading logic mapping of the dynamic variable is configured by the server to obtain a variable structure corresponding to the dynamic variable; Calling the variable structure through the CMS system, configuring the dynamic variable as a display text according to the variable structure, and configuring the display text in the page component corresponding to the dynamic variable; The page component is loaded through the CMS system, and the display text is input into the server for parsing to obtain the variable value of the dynamic variable in the page component; The variable value replaces the dynamic variable in the display text and is converted into a target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

2. The configuration loading processing method of page dynamic variables according to claim 1 is characterized in that: The variable structure includes an operation structure and an execution structure. The operation structure includes applicable components, a variable Chinese name and a variable key. The execution structure includes a data source, a default value, a data source identifier and a calculation logic. The applicable component is used to indicate the component and component element applicable to the dynamic variable. The variable Chinese name is a Chinese description of the dynamic variable. The variable key is a unique identifier of the dynamic variable. The data source is used to indicate the data source of the dynamic variable. The default value is the default value of the dynamic variable when an exception occurs during the loading and replacement process of the dynamic variable. The data source identifier is used to screen the data source corresponding to the dynamic variable. The calculation logic is the calculation logic for calculating the variable value of the dynamic variable.

3. The configuration loading processing method of page dynamic variables according to claim 2 is characterized in that: The step of calling the variable structure through the CMS system and configuring the dynamic variable as a display text according to the variable structure includes: The page configuration personnel calls the variable structure on the server through the CMS system; The variable key is used as a placeholder, and the placeholder and the variable Chinese name are combined with the rich text to form the display text; The configuring the display text in the page component corresponding to the dynamic variable includes: The components and component elements to which the dynamic variable is applicable are determined according to the applicable components, and the display text is configured in the corresponding page components.

4. The configuration loading processing method of page dynamic variables according to claim 2 is characterized in that: The step of loading the page component through the CMS system and inputting the display text into the server for parsing to obtain the variable value of the dynamic variable in the page component includes: Loading the page component through the CMS system to obtain the display text; After determining that the display text is not empty, extracting the dynamic variable in the display text through regular matching; After determining that the dynamic variable has not been calculated, obtaining a variable key corresponding to the dynamic variable in the display text according to the loading logic mapping, and matching variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable; The variable value of the dynamic variable in the page component is calculated according to the variable configuration information.

5. The configuration loading processing method of page dynamic variables according to claim 4 is characterized in that: The matching the variable configuration information corresponding to the dynamic variable according to the variable key corresponding to the dynamic variable includes: In the cache data of the kv structure, the variable configuration memory address corresponding to the variable key is matched by a hash algorithm; Acquire the variable configuration information corresponding to the dynamic variable according to the variable configuration memory address; The cache data is used to store the memory address of the dynamic variable and the variable configuration information, and the variable configuration information includes the variable structure, data source interface address and service name corresponding to the dynamic variable.

6. The configuration loading processing method of page dynamic variables according to claim 5 is characterized in that: The calculating the variable value of the dynamic variable in the page component according to the variable configuration information includes: Obtaining the construction logic code service corresponding to the data source in the service container according to the service name; Acquire the data source interface address according to the variable configuration information, send an http request according to the data source interface address, and then connect to the downstream business service to obtain the corresponding data source, and determine whether the data source has been loaded; After determining that the data source has not been loaded, the data source is loaded and cached by the construction logic code service, and the variable value corresponding to the dynamic variable is calculated according to the variable structure; After determining that the data source has been loaded, the variable value corresponding to the dynamic variable is directly calculated according to the variable structure.

7. The method for loading and configuring dynamic variables of a page according to any one of claims 4 to 6, characterized in that: When there are multiple dynamic variables in the display text, the variable value calculated by the current dynamic variable replaces the current dynamic variable in the display text, and then the next dynamic variable is calculated until the dynamic variables in the display text are replaced one by one by the corresponding variable values, and the calculation process of multiple dynamic variables is realized in parallel through a thread pool.

8. The configuration loading processing method of page dynamic variables according to claim 7 is characterized in that: When the calculation processes of multiple dynamic variables are processed in parallel, the following verification is performed before requesting the data source interface: When there is an identical data source request task running, wait for the corresponding data source request task to finish running, and replace the variable value of the dynamic variable with a default value after a timeout; When the data source response result of the requested data is stored in the shared cache data area, no request is issued, and the data source response result in the shared cache data area is directly used; When there is neither the same data source request task running nor the completed data source response result stored in the shared cache data area, a data source interface request is directly issued, and the current data source task in progress is recorded in the shared cache data area. After the request is completed, the current data source response result is placed in the shared cache data area.

9. A configuration loading and processing system for page dynamic variables, characterized in that: include: A mapping configuration module, used to configure the loading logic mapping of the dynamic variable through the server to obtain a variable structure corresponding to the dynamic variable; A text configuration module, used to call the variable structure through the CMS system, configure the dynamic variable as a display text according to the variable structure, and configure the display text in the page component corresponding to the dynamic variable; A variable calculation module, used for loading the page component through the CMS system, inputting the display text into the server for parsing, so as to obtain the variable value of the dynamic variable in the page component; The loading and display module is used to replace the dynamic variables in the display text with the variable values ​​and then convert them into target text. The CMS system transmits the target text to the client for loading and display after the page component is loaded.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the configuration loading processing method of the page dynamic variables described in any one of claims 1 to 8 is implemented.