Application framework configuration method and device, computer equipment, readable storage medium and program product
By progressively querying configuration files and rollback files within the application framework, the problem of insufficient configuration accuracy in existing technologies is solved, achieving higher configuration applicability and accuracy.
Patent Information
- Application Number
- CN202510852500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-28
AI Technical Summary
The existing application framework cannot meet the functional requirements of diverse scenarios during the configuration process, resulting in low configuration accuracy.
By obtaining the configuration attribute data corresponding to the application framework, the system first queries the configuration file. If no data is found, it queries the fallback file. If no data is found, the system uses the default data for configuration until matching configuration data is found.
It improves the accuracy of application framework configuration, making the configuration data match the current application scenario as closely as possible, thus enhancing the applicability and accuracy of the configuration.
Smart Images

Figure CN120848939A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for configuring an application framework. Background Technology
[0002] With the development of computer technology, the demand for application development and design is increasing, leading to the emergence of application framework technologies. Application frameworks can automatically configure attributes using default data. However, as the application is used in more and more scenarios, the default attribute data cannot meet the functional requirements of all scenarios. If attribute configuration is still based on the default data, the configured application framework may fail to meet the functional requirements of the current scenario, resulting in low accuracy in application framework configuration. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for configuring an application framework that can improve the accuracy of application framework configuration, in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a method for configuring an application framework, including:
[0005] Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework;
[0006] Based on the attribute data to be configured, a configuration data query is performed from the configuration file corresponding to the application framework to obtain the first query result;
[0007] If the first query result indicates that configuration data has been found, then the attribute data to be configured is configured according to the first query result;
[0008] If the first query result indicates that no configuration data was found, then the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the attribute data to be configured to obtain the second query result;
[0009] Based on the second query result, configure the attribute data to be configured.
[0010] In one embodiment, configuring the attribute data to be configured based on the second query result includes:
[0011] If the second query result indicates that the query failed, then the attribute data to be configured is configured according to the default configuration data corresponding to the attribute data to be configured.
[0012] If the second query result indicates that the query was successful, then the attribute data to be configured is configured according to the rollback configuration query data corresponding to the second query result.
[0013] In one embodiment, configuring the attribute data to be configured based on the rollback configuration query data corresponding to the second query result includes:
[0014] Based on the rollback configuration query data corresponding to the second query result, query the configuration file corresponding to the application framework to obtain the third query result;
[0015] If the third query result indicates that the query was successful, then the attribute data to be configured is configured according to the third query result;
[0016] If the third query result indicates that the query failed, then the attribute data to be configured is configured according to the default configuration data corresponding to the attribute data to be configured.
[0017] In one embodiment, before obtaining the first query result by querying configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, the method further includes:
[0018] Obtain the attribute data and configuration item data corresponding to each attribute data in each preset application scenario of the application framework; and obtain the rollback configuration query data and configuration item data corresponding to each rollback configuration query data in each preset application scenario of the application framework.
[0019] Based on the attribute data, the rollback configuration query data, and their corresponding configuration item data, a configuration file corresponding to the application framework is generated.
[0020] In one embodiment, obtaining the rollback file corresponding to the application framework includes:
[0021] Obtain the attribute data of the application framework in each preset application scenario and the rollback configuration query data corresponding to each attribute data;
[0022] Based on the attribute data and their corresponding rollback configuration query data, construct the rollback file corresponding to the application framework.
[0023] In one embodiment, the configuration file includes an attribute field configuration file and a configuration class constructor parameter configuration file; the step of querying configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured includes:
[0024] If the data type of the attribute data to be configured is an attribute field type, then the configuration data is queried from the attribute field configuration file corresponding to the application framework based on the attribute data to be configured.
[0025] If the data type of the attribute data to be configured is a configuration class constructor parameter type, then the configuration data is queried from the configuration class constructor parameter configuration file corresponding to the application framework based on the attribute data to be configured.
[0026] Secondly, this application also provides a configuration apparatus for an application framework, comprising:
[0027] The acquisition module is used to acquire the attribute data to be configured corresponding to the application framework, wherein the attribute data to be configured corresponds to the current application scenario of the application framework;
[0028] The query module is used to query configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, and obtain a first query result; if the first query result indicates that no configuration data is found, then the rollback file corresponding to the application framework is obtained, and data is queried from the rollback file based on the attribute data to be configured, and a second query result is obtained.
[0029] The configuration module is used to configure the attribute data to be configured according to the first query result if the first query result indicates that configuration data has been found; and to configure the attribute data to be configured according to the second query result.
[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0031] Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework;
[0032] Based on the attribute data to be configured, a configuration data query is performed from the configuration file corresponding to the application framework to obtain the first query result;
[0033] If the first query result indicates that configuration data has been found, then the attribute data to be configured is configured according to the first query result;
[0034] If the first query result indicates that no configuration data was found, then the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the attribute data to be configured to obtain the second query result;
[0035] Based on the second query result, configure the attribute data to be configured.
[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0037] Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework;
[0038] Based on the attribute data to be configured, a configuration data query is performed from the configuration file corresponding to the application framework to obtain the first query result;
[0039] If the first query result indicates that configuration data has been found, then the attribute data to be configured is configured according to the first query result;
[0040] If the first query result indicates that no configuration data was found, then the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the attribute data to be configured to obtain the second query result;
[0041] Based on the second query result, configure the attribute data to be configured.
[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0043] Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework;
[0044] Based on the attribute data to be configured, a configuration data query is performed from the configuration file corresponding to the application framework to obtain the first query result;
[0045] If the first query result indicates that configuration data has been found, then the attribute data to be configured is configured according to the first query result;
[0046] If the first query result indicates that no configuration data was found, then the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the attribute data to be configured to obtain the second query result;
[0047] Based on the second query result, configure the attribute data to be configured.
[0048] The configuration method, apparatus, computer device, computer-readable storage medium, and computer program product of the aforementioned application framework involve: acquiring configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework; querying configuration data from the configuration file corresponding to the application framework based on the configuration attribute data to obtain a first query result; if the first query result indicates that configuration data has been found, configuring the configuration attribute data based on the first query result; if the first query result indicates that no configuration data has been found, acquiring a fallback file corresponding to the application framework, and querying data from the fallback file based on the configuration attribute data to obtain a second query result; and configuring the configuration attribute data based on the second query result.
[0049] Thus, since the attribute data to be configured corresponds to the current application scenario, querying the configuration file based on the attribute data to be configured allows for the querying of pre-configured data under the current application scenario. If the first query result indicates failure, that is, the configuration file does not configure the attribute data to be configured corresponding to the current application scenario, a fallback file query is performed based on the attribute data to be configured. This allows for a fallback query that matches the current application scenario and provides a more general configuration. The generation of configuration data for the application framework is achieved through a progressive query process, ensuring that the queried configuration data matches the current application scenario as closely as possible, thereby improving the configuration accuracy of the application framework. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is an application environment diagram of the configuration method of the application framework in one embodiment;
[0052] Figure 2 This is a flowchart illustrating the configuration method of an application framework in one embodiment;
[0053] Figure 3 This is a flowchart illustrating the steps of configuring the attribute data to be configured based on the second query result in one embodiment.
[0054] Figure 4 This is a structural block diagram of the configuration device for the application framework in one embodiment;
[0055] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0056] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0057] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0058] The application framework configuration method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains the configuration attribute data corresponding to the application framework, where the configuration attribute data corresponds to the current application scenario of the application framework; based on the configuration attribute data, it queries the configuration data from the configuration file corresponding to the application framework to obtain a first query result; if the first query result indicates that configuration data has been found, the configuration attribute data is configured according to the first query result; if the first query result indicates that no configuration data has been found, it obtains the fallback file corresponding to the application framework and queries the data from the fallback file according to the configuration attribute data to obtain a second query result; based on the second query result, the configuration attribute data is configured. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0059] In an exemplary embodiment, Figure 2 As shown, a configuration method for an application framework is provided, which can be applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 202 to 208. Wherein:
[0060] Step 202: Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework.
[0061] In step 202, the application framework can be Spring Boot (a new framework provided by the Pivotal team, designed to simplify the initial setup and development process of new Spring applications), or other application frameworks; there are no restrictions here. The attribute data to be configured represents the type of attribute waiting to be configured. The current application scenario represents at least one of the application development requirements and application design requirements.
[0062] As one embodiment, obtaining the configuration attribute data corresponding to the application framework includes: obtaining the configuration attribute data corresponding to the application framework set by the user as needed.
[0063] As another embodiment, obtaining the configuration attribute data corresponding to the application framework includes: if it is detected that the application corresponding to the application framework is in the application development stage, then obtaining the application development information of the application corresponding to the application framework to obtain the configuration attribute data corresponding to the application framework.
[0064] As another embodiment, obtaining the configuration attribute data corresponding to the application framework includes: if it is detected that the application corresponding to the application framework is in the application design stage, then obtaining the application design information of the application corresponding to the application framework to obtain the configuration attribute data corresponding to the application framework.
[0065] Step 204: Based on the attribute data to be configured, query the configuration data from the configuration file corresponding to the application framework to obtain the first query result.
[0066] In step 204, the configuration files include attribute field configuration files and configuration class constructor parameter configuration files. Configuration class constructor parameters refer to the constructor method parameters of the configuration class. The first query result includes at least one of first query status data and first configuration item data. The first query status data represents the query status, and the first configuration item data represents the configuration item data corresponding to the attribute data to be configured.
[0067] For example, step 204 includes: determining the configuration file that corresponds to both the attribute data to be configured and the application framework based on the data type of the attribute data to be configured; querying the configuration file corresponding to the application framework based on the attribute data to be configured to obtain a first query result.
[0068] Furthermore, based on the data type of the attribute data to be configured, the configuration file corresponding to both the attribute data to be configured and the application framework is determined, including: if the data type of the attribute data to be configured is an attribute field type, then the attribute field configuration file corresponding to the application framework is determined as the configuration file corresponding to both the attribute data to be configured and the application framework; if the data type of the attribute data to be configured is a configuration class constructor parameter type, then the configuration class constructor parameter configuration file corresponding to the application framework is determined as the configuration file corresponding to both the attribute data to be configured and the application framework.
[0069] As one embodiment, based on the attribute data to be configured, the configuration file corresponding to the application framework is queried to obtain a first query result, including: if the configuration file corresponding to the application framework contains first attribute data that matches the attribute data to be configured, then first query status data indicating a successful query is generated; and the configuration item data corresponding to the first attribute data in the configuration file corresponding to the application framework is determined as first configuration item data, and the first query status data and the first configuration item data are merged to obtain the first query result; if the configuration file corresponding to the application framework does not contain first attribute data that matches the attribute data to be configured, then first query status data indicating a failed query is generated, and the first query status data is determined as the first query result.
[0070] In another embodiment, based on the attribute data to be configured, the configuration file corresponding to the application framework is queried to obtain a first query result, including: if there is first attribute data in the configuration file corresponding to the application framework that matches the attribute data to be configured, then the configuration item data corresponding to the first attribute data in the configuration file corresponding to the application framework is determined as the first configuration item data, and the first configuration item data is determined as the first query result; if there is no first attribute data in the configuration file corresponding to the application framework that matches the attribute data to be configured, then first query status data representing query failure is generated, and the first query status data is determined as the first query result.
[0071] As an embodiment, the above method further includes: obtaining the first data similarity between each attribute data in the configuration file corresponding to the application framework and the attribute data to be configured; if the first data similarity of at least one attribute data in the configuration file corresponding to the application framework is greater than a first preset similarity threshold, then the attribute data is determined as the first attribute data; if the first data similarity of at least one attribute data in the configuration file corresponding to the application framework is greater than the first preset similarity threshold, then it is determined that there is no first attribute data in the configuration file corresponding to the application framework that matches the attribute data to be configured.
[0072] The first preset similarity threshold can be set by the user as needed or it can be an empirical value; there are no restrictions here.
[0073] Optionally, before querying the configuration file corresponding to the application framework based on the attribute data to be configured and obtaining the first query result, the above method further includes: obtaining the attribute data and the configuration item data corresponding to each attribute data in each preset application scenario of the application framework, and obtaining the fallback configuration query data and the configuration item data corresponding to each fallback configuration query data in each preset application scenario of the application framework; generating the configuration file corresponding to the application framework based on the attribute data, the fallback configuration query data and their corresponding configuration item data.
[0074] Each preset application scenario is a set of multiple application scenarios that the application framework can support. These preset application scenarios can be unrelated to each other, or they can be related and contain each other. For example, scenario A and scenario B belong to the same type of scenario, but scenario B is more detailed than scenario A.
[0075] Furthermore, based on the attribute data and the rollback configuration query data and their corresponding configuration item data, a configuration file corresponding to the application framework is generated, including: constructing a first correspondence based on the attribute data and their corresponding configuration item data; constructing a second correspondence based on the rollback configuration query data and their corresponding configuration item data; and merging the first and second correspondences to obtain the configuration file corresponding to the application framework.
[0076] As one embodiment, the first and second correspondences are merged to obtain the configuration file corresponding to the application framework, including: filtering the attribute data data of the attribute data data of the first correspondences as attribute field types, and filtering the attribute data data of the second correspondences as configuration class constructor parameter types; filtering the attribute data data of the second correspondences as attribute field types, and filtering the attribute data data of the second correspondences as configuration class constructor parameter types; merging the first and third sub-correspondences to obtain the attribute field configuration file corresponding to the application framework; and merging the second and fourth sub-correspondences to obtain the configuration class constructor parameter configuration file corresponding to the application framework.
[0077] In this way, configuration files for different data types can be generated, improving the generalizability of configuration files.
[0078] Step 206: If the first query result indicates that configuration data has been found, then the configuration attribute data to be configured is configured according to the first query result.
[0079] For example, configuring the attribute data to be configured based on the first query result includes binding the first configuration item data in the first query result with the attribute data to be configured.
[0080] As one embodiment, binding the first configuration item data in the first query result with the attribute data to be configured includes: if the data type of the attribute data to be configured is an attribute field type, then binding the first configuration item data in the first query result with the attribute data to be configured is configured through a first constructor; if the data type of the attribute data to be configured is a configuration class construction parameter type, then binding the first configuration item data in the first query result with the attribute data to be configured is configured through a second constructor.
[0081] The first constructor can be a Java Bean iBnder, and the second constructor can be a Value ObjectBinder.
[0082] In this way, the application framework can be configured according to the corresponding matching tools, which improves the accuracy of the application framework configuration.
[0083] Step 208: If the first query result indicates that no configuration data was found, then obtain the fallback file corresponding to the application framework, and perform data query from the fallback file according to the attribute data to be configured to obtain the second query result.
[0084] The second query result in step 208 includes at least one of the second query status data and the second configuration item data. The second query status data is used to represent the query status, and the second configuration item data is used to represent the rollback configuration query data corresponding to the attribute data to be configured.
[0085] Optionally, as one embodiment, obtaining the fallback file corresponding to the application framework includes: querying the fallback file corresponding to the pre-configured application framework.
[0086] Optionally, as another embodiment, obtaining the fallback file corresponding to the application framework includes: obtaining the attribute data of the application framework under each preset application scenario and the fallback configuration query data corresponding to each attribute data; and constructing the fallback file corresponding to the application framework based on each attribute data and its corresponding fallback configuration query data.
[0087] Furthermore, obtaining the attribute data and fallback configuration query data corresponding to each attribute data in each preset application scenario of the application framework includes: obtaining the association information between each preset application scenario, wherein the association information is used to characterize the pairwise association relationship between each preset application scenario; if the association information characterizes that the first application scenario and the second application scenario belong to the same type, and the scenario granularity of the first application scenario is larger than that of the second application scenario, then the attribute data of the first application scenario is determined as the fallback configuration query data corresponding to the attribute data of the second application scenario.
[0088] In this way, attribute data belonging to the same type but with a larger granularity than the scenario is identified as the fallback configuration query data corresponding to the attribute data of the application scenario with a smaller granularity. This allows configuration item data to be queried through attribute data of the same type but with a larger granularity when configuration item data cannot be found in the application scenario with a smaller granularity. This makes the entire query process proceed from the smallest to the largest scenario granularity, improving the configuration accuracy of the application framework.
[0089] As one embodiment, based on the attribute data to be configured, a data query is performed from the fallback file to obtain a second query result, including: if there is second attribute data in the fallback file corresponding to the application framework that matches the attribute data to be configured, then the configuration item data corresponding to the second attribute data in the fallback file corresponding to the application framework is determined as the second configuration item data, and the second configuration item data is determined as the second query result; if there is no second attribute data in the fallback file corresponding to the application framework that matches the attribute data to be configured, then second query status data representing query failure is generated, and the second query status data is determined as the second query result.
[0090] As another embodiment, based on the attribute data to be configured, a data query is performed from the fallback file to obtain a second query result, including: if there is second attribute data in the fallback file corresponding to the application framework that matches the attribute data to be configured, then second query status data indicating a successful query is generated; and the configuration item data corresponding to the second attribute data in the fallback file corresponding to the application framework is determined as the second configuration item data, and the second query status data and the second configuration item data are merged to obtain the second query result; if there is no second attribute data in the fallback file corresponding to the application framework that matches the attribute data to be configured, then second query status data indicating a failed query is generated, and the second query status data is determined as the second query result.
[0091] Step 210: Configure the attribute data to be configured based on the second query result.
[0092] Optionally, the specific implementation steps for configuring the attribute data to be configured based on the second query result can refer to the specific implementation content of configuring the attribute data to be configured based on the first query result in step 206 above, which will not be repeated here.
[0093] In the configuration method of the above application framework, since the attribute data to be configured corresponds to the current application scenario, when querying the configuration file based on the attribute data to be configured, the pre-configured data query under the current application scenario can be realized. When the first query result indicates failure, that is, the configuration file does not configure the attribute data to be configured corresponding to the current application scenario, the rollback file query is performed based on the attribute data to be configured. This enables the rollback query to match the current application scenario and achieve a more general configuration. The generation of configuration data of the application framework is carried out in a progressive query form, so that the queried configuration data matches the current application scenario as closely as possible, thereby improving the configuration accuracy of the application framework.
[0094] In an exemplary embodiment, Figure 3 As shown, step 210 includes steps 302 to 304. Wherein:
[0095] Step 302: If the second query result indicates that the query failed, then configure the attribute data to be configured according to the default configuration data corresponding to the attribute data to be configured.
[0096] Optionally, the specific implementation steps for configuring the attribute data to be configured based on the default configuration data corresponding to the attribute data to be configured can refer to the specific implementation content of configuring the attribute data to be configured based on the first query result in step 206 above, which will not be repeated here.
[0097] Step 304: If the second query result indicates that the query was successful, then configure the attribute data to be configured according to the rollback configuration query data corresponding to the second query result.
[0098] As one embodiment, configuring the attribute data to be configured based on the fallback configuration query data corresponding to the second query result includes: querying the configuration file corresponding to the application framework based on the fallback configuration query data corresponding to the second query result to obtain a third query result; if the third query result indicates that the query was successful, then configuring the attribute data to be configured based on the third query result; if the third query result indicates that the query failed, then configuring the attribute data to be configured based on the default configuration data corresponding to the attribute data to be configured.
[0099] The third query result includes at least one of the third query status data and the third configuration item data. The third query status data is used to represent the query status, and the third configuration item data is used to represent the configuration item data corresponding to the attribute data to be configured.
[0100] As one embodiment, based on the rollback configuration query data corresponding to the second query result, the configuration file corresponding to the application framework is queried to obtain the third query result, including: if there is third attribute data in the configuration file corresponding to the application framework that matches the rollback configuration query data, then the configuration item data corresponding to the third attribute data in the configuration file corresponding to the application framework is determined as the third configuration item data, and the third configuration item data is determined as the third query result; if there is no third attribute data in the configuration file corresponding to the application framework that matches the rollback configuration query data, then third query status data representing query failure is generated, and the third query status data is determined as the third query result.
[0101] In another embodiment, based on the rollback configuration query data corresponding to the third query result, the configuration file corresponding to the application framework is queried to obtain the third query result, including: if the configuration file corresponding to the application framework contains third attribute data that matches the rollback configuration query data, then third query status data representing a successful query is generated; and the configuration item data corresponding to the third attribute data in the configuration file corresponding to the application framework is determined as third configuration item data, and the third query status data and the third configuration item data are merged to obtain the third query result; if the configuration file corresponding to the application framework does not contain third attribute data that matches the rollback configuration query data, then third query status data representing a failed query is generated, and the third query status data is determined as the third query result.
[0102] In this embodiment, if the first query result indicates that no configuration data was found, meaning that the application function corresponding to the current application scenario has not been pre-configured, a second query result is obtained by querying the rollback file. If the second query result fails, meaning that the application function corresponding to the scenario of the same type as the current application scenario and with a relatively large granularity has not been pre-configured, the default data is directly determined as the configuration data. The default data is the configuration content under the application function corresponding to the largest scenario. If the second query result fails, meaning that the application function corresponding to the scenario of the same type as the current application scenario and with a relatively large granularity has not been pre-configured, the configuration data is determined based on the rollback configuration query data. This realizes that the determination of configuration data is based on scenario configuration queries from large to small granularity, improving the accuracy of configuration data determination.
[0103] As a detailed embodiment, the configuration attribute data corresponding to the application framework is obtained, wherein the configuration attribute data corresponds to the current application scenario of the application framework; based on the configuration attribute data, configuration data is queried from the configuration file corresponding to the application framework to obtain a first query result; if the first query result indicates that configuration data is found, the configuration attribute data is configured according to the first query result; if the first query result indicates that no configuration data is found, the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the configuration attribute data to obtain a second query result; if the second query result indicates that the query failed, the configuration attribute data is configured according to the default configuration data corresponding to the configuration attribute data; if the second query result indicates that the query succeeded, the configuration file corresponding to the application framework is queried according to the fallback configuration query data corresponding to the second query result to obtain a third query result; if the third query result indicates that the query succeeded, the configuration attribute data is configured according to the third query result; if the third query result indicates that the query failed, the configuration attribute data is configured according to the default configuration data corresponding to the configuration attribute data.
[0104] Thus, since the attribute data to be configured corresponds to the current application scenario, querying the configuration file based on the attribute data to be configured allows for the querying of pre-configured data under the current application scenario. If the first query result indicates failure, that is, the configuration file does not configure the attribute data to be configured corresponding to the current application scenario, a fallback file query is performed based on the attribute data to be configured. This allows for a fallback query that matches the current application scenario and provides a more general configuration. The generation of configuration data for the application framework is achieved through a progressive query process, ensuring that the queried configuration data matches the current application scenario as closely as possible, thereby improving the configuration accuracy of the application framework.
[0105] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0106] Based on the same inventive concept, this application also provides an application framework configuration apparatus for implementing the application framework configuration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more application framework configuration apparatus embodiments provided below can be found in the limitations of the application framework configuration method described above, and will not be repeated here.
[0107] In an exemplary embodiment, Figure 4 As shown, a configuration device 400 for an application framework is provided, including: an acquisition module 402, a query module 404, and a configuration module 406, wherein:
[0108] The acquisition module 402 is used to acquire the attribute data to be configured corresponding to the application framework, wherein the attribute data to be configured corresponds to the current application scenario of the application framework.
[0109] The query module 404 is used to query configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, and obtain a first query result; if the first query result indicates that no configuration data is found, the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file based on the attribute data to be configured, to obtain a second query result.
[0110] The configuration module 406 is used to configure the attribute data to be configured according to the first query result if the first query result indicates that configuration data has been found; and to configure the attribute data to be configured according to the second query result.
[0111] In one embodiment, the configuration module 406 is further configured to configure the attribute data to be configured according to the default configuration data corresponding to the attribute data to be configured if the second query result indicates that the query failed; and to configure the attribute data to be configured according to the rollback configuration query data corresponding to the second query result if the second query result indicates that the query was successful.
[0112] In one embodiment, the configuration module 406 is further configured to query the configuration file corresponding to the application framework based on the rollback configuration query data corresponding to the second query result, and obtain a third query result; if the third query result indicates that the query was successful, the configuration attribute data to be configured is configured based on the third query result; if the third query result indicates that the query failed, the configuration attribute data to be configured is configured based on the default configuration data corresponding to the configuration attribute data.
[0113] In one embodiment, before obtaining the first query result by querying configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, the above-mentioned device further includes a generation module, which is used to obtain the attribute data and the configuration item data corresponding to each attribute data in each preset application scenario of the application framework, and to obtain the fallback configuration query data and the configuration item data corresponding to each fallback configuration query data in each preset application scenario of the application framework; and to generate the configuration file corresponding to the application framework based on the attribute data, the fallback configuration query data and their corresponding configuration item data.
[0114] In one embodiment, the query module 404 is further configured to obtain the attribute data of the application framework in each preset application scenario and the rollback configuration query data corresponding to each attribute data; and construct the rollback file corresponding to the application framework based on each attribute data and its corresponding rollback configuration query data.
[0115] In one embodiment, the configuration file includes an attribute field configuration file and a configuration class constructor parameter configuration file; the query module 404 is further configured to, if the data type of the attribute data to be configured is an attribute field type, query the configuration data from the attribute field configuration file corresponding to the application framework based on the attribute data to be configured; if the data type of the attribute data to be configured is a configuration class constructor parameter type, query the configuration data from the configuration class constructor parameter configuration file corresponding to the application framework based on the attribute data to be configured.
[0116] Each module in the configuration device of the aforementioned application framework can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0117] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores configuration files, rollback files, etc. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a configuration method for an application framework.
[0118] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0119] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0120] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0121] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0123] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0124] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0125] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A configuration method for an application framework, characterized in that, The method comprises: Obtain the configuration attribute data corresponding to the application framework, wherein the configuration attribute data corresponds to the current application scenario of the application framework; Based on the attribute data to be configured, a configuration data query is performed from the configuration file corresponding to the application framework to obtain the first query result; If the first query result indicates that configuration data has been found, then the attribute data to be configured is configured according to the first query result; If the first query result indicates that no configuration data was found, then the fallback file corresponding to the application framework is obtained, and data is queried from the fallback file according to the attribute data to be configured to obtain the second query result; Based on the second query result, configure the attribute data to be configured.
2. The method according to claim 1, characterized in that, The step of configuring the attribute data to be configured based on the second query result includes: If the second query result indicates that the query failed, then the attribute data to be configured is configured according to the default configuration data corresponding to the attribute data to be configured. If the second query result indicates that the query was successful, then the attribute data to be configured is configured according to the rollback configuration query data corresponding to the second query result.
3. The method according to claim 2, characterized in that, The step of configuring the attribute data to be configured based on the rollback configuration query data corresponding to the second query result includes: Based on the rollback configuration query data corresponding to the second query result, query the configuration file corresponding to the application framework to obtain the third query result; If the third query result indicates that the query was successful, then the attribute data to be configured is configured according to the third query result; If the third query result indicates that the query failed, then the attribute data to be configured is configured according to the default configuration data corresponding to the attribute data to be configured.
4. The method according to claim 1, characterized in that, Before obtaining the first query result by querying configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, the method further includes: Obtain the attribute data and configuration item data corresponding to each attribute data in each preset application scenario of the application framework; and obtain the rollback configuration query data and configuration item data corresponding to each rollback configuration query data in each preset application scenario of the application framework. Based on the attribute data, the rollback configuration query data, and their corresponding configuration item data, a configuration file corresponding to the application framework is generated.
5. The method according to claim 1, characterized in that, The step of obtaining the rollback file corresponding to the application framework includes: Obtain the attribute data of the application framework in each preset application scenario and the rollback configuration query data corresponding to each attribute data; Based on the attribute data and their corresponding rollback configuration query data, construct the rollback file corresponding to the application framework.
6. The method according to any one of claims 1 to 5, characterized in that, The configuration file includes an attribute field configuration file and a configuration class constructor parameter configuration file; the step of querying configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured includes: If the data type of the attribute data to be configured is an attribute field type, then the configuration data is queried from the attribute field configuration file corresponding to the application framework based on the attribute data to be configured. If the data type of the attribute data to be configured is a configuration class constructor parameter type, then the configuration data is queried from the configuration class constructor parameter configuration file corresponding to the application framework based on the attribute data to be configured.
7. A configuration device for an application framework, characterized in that, The device comprises: The acquisition module is used to acquire the attribute data to be configured corresponding to the application framework, wherein the attribute data to be configured corresponds to the current application scenario of the application framework; The query module is used to query configuration data from the configuration file corresponding to the application framework based on the attribute data to be configured, and obtain a first query result; if the first query result indicates that no configuration data is found, then the rollback file corresponding to the application framework is obtained, and data is queried from the rollback file based on the attribute data to be configured, and a second query result is obtained. The configuration module is used to configure the attribute data to be configured according to the first query result if the first query result indicates that configuration data has been found; and to configure the attribute data to be configured according to the second query result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.