Multi-province customization method and system applied to terminal device and automatic deployment method thereof
By dynamically parsing provincial customization parameters on terminal devices, the problems of resource waste and high maintenance costs in provincial customization of terminal devices are solved, and efficient and low-cost multi-province customization support is achieved.
Patent Information
- Application Number
- CN202511359707.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-09-23
AI Technical Summary
Existing technologies suffer from several drawbacks when dealing with the regionally differentiated customization of terminal devices, including wasted storage resources, long compilation times, high maintenance costs, strong network dependence, and high management complexity. In particular, multi-channel packaging and cloud configuration distribution technologies struggle to efficiently support the customization needs of multiple provinces.
By classifying provincial-level customized parameters, generating data modeling rule templates, parsing them into abstract syntax trees and externalizing them into configuration files, and using the parsing engine module to dynamically parse the configuration at runtime, dynamic decoupling customization is achieved, reducing resource consumption and optimizing maintenance costs.
It achieves efficient support for multi-province fixed-time on terminal devices, reduces resource waste to O(1), reduces maintenance costs, improves configuration efficiency, and avoids the management burden of strong coupling and multi-branch development.
Smart Images

Figure CN120848946B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electric data processing, and particularly relates to a multi-provincial customization method and system applied to a terminal device and an automatic deployment method thereof. BACKGROUND
[0002] With the popularization of intelligent terminal devices (such as set-top boxes and smart televisions) in the whole country, the demand for provincial differentiated customization has become an industry necessity. Different provinces require different UI interfaces, function logics or service entrances of the same Android application due to differences in policies and regulations, operator specifications, group specifications and user preferences.
[0003] To meet the differentiated needs of different provinces for application interfaces and business logics, traditional solutions mainly rely on two industry general technologies. One is multi-channel packaging (Multi-channel Packaging) technology, which generates independent APKs for each province through the productFlavors mechanism of the Android Gradle plug-in, and hard codes the customization parameters in the resource files. The more different customizations there are, the more resource directories are generated and the more APKs are distributed, which leads to a straight-line increase in storage resources and compiled resources. The other is cloud-based configuration technology, which pulls the province configuration from the server after the application is started and relies on real-time interaction with the network.
[0004] However, in the multi-channel packaging technology, each new provincial customization requires complete execution of the compilation → signature → distribution process to produce an independent APK. When N provinces are supported, the storage overhead increases by O(N), and N APKs with the same code occupy a large amount of server storage. The provincial customization parameters and resource identifiers are embedded in the application code, resulting in a high coupling between configuration and code. This strong dependency leads to a chain of problems: the number of application packages increases dramatically, each province needs to be independently compiled, signed and generate a dedicated APK, resulting in linear waste of storage resources and compilation time, which seriously slows down the delivery efficiency; the maintenance cost is high; if single-engine single-branch development is used, the mixed provincial customization code will greatly increase the risk of code reading and modification, and easily cause "logic inflation and domino effect", modifying the logic of a province may cause cross-province compatibility faults; if multi-branch parallel development is used, with the increase of provinces, branch management will be chaotic and migration will be difficult. Each province has an independent branch, facing "branch hell" (Branch Hell) - frequent merge conflicts, difficulty in tracing historical versions, and exponential increase in management costs. Both modes lead to iteration delay, and the management complexity continues to deteriorate as the demand grows.
[0005] The cloud configuration delivery technology is that the terminal device sends a configuration request to the server, the server returns differential configuration parameters, and the terminal dynamically adjusts the function interface according to the parameters. The scheme has high requirements for network and server bandwidth, and high server requirements result in high cost. This method strongly depends on the network, and the terminal device such as a set-top box is often in a weak network environment, and configuration pulling failure will lead to functional abnormalities; start delay, the user needs to wait for configuration download when opening the application for the first time, which destroys the user experience. SUMMARY
[0006] Therefore, in one aspect, some embodiments disclose a multi-provincial customization method applied to a terminal device, comprising the steps of:
[0007] S1, analyzing the provincial customization requirements, classifying the provincial customization parameters, defining the field specifications of the classified parameters, and generating a data modeling rule template;
[0008] S2, reading the data modeling rule template, performing syntax analysis, generating an abstract syntax tree, abstracting each component of the data modeling rule template into a node tree, atomizing the node tree, and outputting the obtained rule set as a deconstruction rule set;
[0009] S3, parsing the received deconstruction rule set, and filling data according to the classification for different atomization conversion sequences when the application program is initialized and runs;
[0010] S4, externally placing the generated configuration file in the terminal device system partition.
[0011] Further, some embodiments disclose a multi-provincial customization method applied to a terminal device, wherein in step S1, the parameter classification includes UI parameters, function parameters, and service parameters; and in step S2, the node tree includes UI nodes, logic nodes, and service nodes.
[0012] Some embodiments disclose a multi-provincial customization method applied to a terminal device, wherein in step S3, after receiving the atomization conversion sequence, each processing interface is loaded, the configuration file of different partition paths is adapted, the serialized data is analyzed and interpreted, the classification of the sequence data is judged by itself, and the data is filled into different rule interpreters according to different classifications.
[0013] Some embodiments disclose a multi-provincial customization method applied to a terminal device, wherein the rule interpreter includes a UI renderer and a logic executor.
[0014] Some embodiments disclose a multi-provincial customization method applied to a terminal device, wherein in step S3, if an exception occurs in the middle, the step is automatically rolled back, the exception information is stored in the corresponding memory, the position of the rollback is recorded, and default data is filled according to needs.
[0015] In another aspect, some embodiments disclose a multi-provincial customization system applied to a terminal device for implementing a multi-provincial customization method applied to the terminal device, the system comprising:
[0016] a specification predefinition module configured to analyze the provincial customization requirements, classify the provincial customization parameters, define the field specifications of the classified parameters, and generate a data modeling rule template;
[0017] a rule deconstruction module configured to read the data modeling rule template, perform syntax analysis, generate an abstract syntax tree, abstract each component of the data modeling rule template into a node tree, atomize the node tree, and output the obtained rule set as a deconstructed rule set;
[0018] a parsing engine module configured to parse the received deconstructed rule set, and fill data according to the classification for different atomized conversion sequences when the application is initialized and runs;
[0019] a configuration module configured to externally place the generated configuration file in a system partition of the terminal device.
[0020] In yet another aspect, some embodiments disclose an automatic deployment method of the multi-provincial customization system applied to the terminal device, comprising:
[0021] triggering a build task of the configuration engine;
[0022] automatically scanning metadata and performing metadata analysis;
[0023] making a configuration change decision to determine a configuration file;
[0024] registering the configuration file to a system node.
[0025] Further, some embodiments disclose the multi-provincial customization method applied to the terminal device, further comprising: compiling a terminal system image and publishing it.
[0026] Some embodiments disclose the multi-provincial customization method applied to the terminal device, wherein the configuration change decision and the determination of the configuration file comprise:
[0027] if the configuration is updated, compiling the new configuration and writing it to the corresponding server node;
[0028] if the configuration is not updated, tracing the previous version, and then registering the previous version to the corresponding server node.
[0029] Some embodiments disclose the multi-provincial customization method applied to the terminal device, wherein the compiling of the terminal system image comprises: dynamically injecting according to the selected corresponding provincial node customization, and the compilation chain will put all the required build dependencies into a container for compilation, and the registered nodes are injected one by one into the system image partition.
[0030] The application embodiment discloses a multi-provincial customization method applied to a terminal device, which externally configures a provincial area in a system partition of the terminal device, and when the terminal device runs, a configuration file is parsed by a parsing engine module, and an automatic deployment link is constructed to automatically deploy the configuration file to the terminal device, so that resource waste is greatly reduced, configuration efficiency is improved, and maintenance cost is reduced. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 The application embodiment discloses a multi-provincial customization method applied to a terminal device, which externally configures a provincial area in a system partition of the terminal device, and when the terminal device runs, a configuration file is parsed by a parsing engine module, and an automatic deployment link is constructed to automatically deploy the configuration file to the terminal device, so that resource waste is greatly reduced, configuration efficiency is improved, and maintenance cost is reduced.
[0032] Figure 2 The application embodiment discloses a multi-provincial customization method applied to a terminal device, which externally configures a provincial area in a system partition of the terminal device, and when the terminal device runs, a configuration file is parsed by a parsing engine module, and an automatic deployment link is constructed to automatically deploy the configuration file to the terminal device, so that resource waste is greatly reduced, configuration efficiency is improved, and maintenance cost is reduced. DETAILED DESCRIPTION
[0033] Herein the term "embodiment" is used merely to describe any embodiment of the present application, and does not necessarily imply that the embodiment is superior to or preferable over other embodiments. In the performance index test of the present application embodiment, unless otherwise specified, the conventional test method in the art is adopted. It should be understood that the terms described in the present application embodiment are merely for the description of the specific embodiments, and are not intended to limit the disclosure of the present application embodiment.
[0034] Unless otherwise specified, the technical and scientific terms used herein have the same meanings as generally understood by those skilled in the art to which the present application embodiment belongs; and the test methods and technical means not specifically indicated in the present application embodiment refer to the test methods and technical means generally adopted by those skilled in the art.
[0035] The terms "substantial" and "about" are used herein to describe small fluctuations. For example, they can mean less than or equal to ±5%, such as less than or equal to ±2%, such as less than or equal to ±1%, such as less than or equal to ±0.5%, such as less than or equal to ±0.2%, such as less than or equal to ±0.1%, such as less than or equal to ±0.05%. Numerical data expressed or presented in the range format herein is used merely for the convenience and brevity and should be construed as flexible enough to include separate values or sub-ranges encompassed within the range. For example, a numerical range of "1 to 5%" should be interpreted to include not only the explicitly recited values of 1% to 5%, but also include individual values and sub-ranges within the indicated range. Thus, included in this numerical range are individual values such as 2%, 3.5%, and 4%, and sub-ranges such as 1 to 3%, 2 to 4%, and 3 to 5%, etc. This same principle applies to ranges reciting only one numerical value. Furthermore, such an interpretation should apply regardless of the breadth of the range or the characteristics being described.
[0036] In this document, including the claims, the conjunctions such as "comprise", "include", "have", "contain", "involve", "accommodate" and the like are understood to be open, i.e. refer to "including but not limited to". Only the conjunctions "consist of" and "consist only of" are closed conjunctions.
[0037] For better illustrating the content of the present application, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present application can be implemented without some specific details. In the embodiments, some methods, means, instruments, devices and the like which are well known to those skilled in the art are not described in detail, so as to highlight the main idea of the present application.
[0038] The technical features disclosed in the embodiments of the present application can be combined arbitrarily without conflict, and the technical solutions obtained belong to the content disclosed by the embodiments of the present application.
[0039] In some embodiments, the multi-provincial customization method applied to the terminal device comprises the steps of:
[0040] S1, analyzing the provincial customization demand, classifying the provincial customization parameters, defining the field specification of the classified parameters, and generating a data modeling rule template; usually, the parameters can be classified into UI parameters, function parameters and business parameters;
[0041] Usually, the provincial customization demand or specification and the like is decomposed to form a plurality of parameters, and then the parameters are classified, for example, according to the UI effect, function logic and business, the parameters are divided into three categories of UI parameters, function parameters and business parameters, and then each type of parameter is uniformly defined, so as to realize data modeling and combination according to the needs, and obtain a data modeling rule template;
[0042] S2, read the data modeling rule template, perform syntax analysis, generate an abstract syntax tree, abstract each component of the data modeling rule template into a node tree, atomize the node tree, and output the obtained rule set as a deconstructed rule set; generally, the generated node tree includes UI nodes, logic nodes, and business nodes; generally, the data modeling rule template contains multiple components, which are abstracted into a node tree through a parsing syntax defined by a specification, each node in the node tree is atomized and serialized, the rule node is converted into a program executable instruction, and finally a deconstructed rule set is obtained by deconstruction, which can be further input into the parsing module for parsing and packaging to be recognized; generally, a component refers to a reusable small functional module object that encapsulates data and methods; generally, a structured rule set is a low-level, imperative, atomized, and serializable instruction set output by processing a high-level, declarative data modeling rule template in the parsing module, and the final data format can be a mapping list or a sequential list in the program; the list is also a collection of serialized instructions, because the instructions in the instruction set are also the result of rule constraints, so it can also be called a rule set.
[0043] S3, parse the received deconstructed rule set, and the application fills the data according to the classification when initializing the running of different atomized conversion sequences; generally, the received structured rule set is also a configuration file, and the rule set at this time still supports manual customization and modification; generally, after receiving the atomized conversion sequence, load each processing interface, adapt the configuration file of different partition paths, analyze and interpret the serialized data, and judge the classification of the sequence data by itself, and transmit it to different rule interpreters for data filling according to different classifications;
[0044] Generally, according to the classification of the sequence data, such as UI parameters or functional parameter categories, the program will judge by itself and transmit the sequence data to the UI renderer and logic executor for the final data filling;
[0045] Generally, the classification of data can be predefined in the component, and multiple classifications correspond to multiple interpreters; an application can have only one classification or multiple classifications according to the required functions, and can correspond to one or more interpreters;
[0046] Generally, data filling is the process of associating (binding) abstract and parameterized atomic instructions in the "deconstructed rule set" with specific UI components, business objects or functions in the current running environment, and assigning (injecting) the parameter values carried by the target object to the target object;
[0047] For example:
[0048] Input an abstract simple atomic instruction such as {"op": "setText", "target": "btn_submit", "value": "submit"};
[0049] Output a specific, effective interface change or logic execution result, for example, the button text with ID btn_submit is successfully set to "submit";
[0050] The specific execution process of data filling is completed by the parsing engine at application initialization, which is an automated workflow. First, it checks whether the operation type "op" field in the instruction is in the predefined rule template list (supporting mapping search and sequential search), and if it exists, it judges its classification, and according to the classification, it routes (distributes) the instruction to the corresponding rule interpreter for processing. The interpreter parses the target (target identifier) field in the instruction, finds and obtains the actual reference "btn_submit" of the target object in the current runtime context; finally, the "value" value is injected into the object.
[0051] Generally, if an exception occurs in the middle, it will automatically roll back the step, store the exception information to the corresponding memory, record the rollback position, and fill in the default data as needed. Generally, rolling back the step does not mean rolling back the entire sequence, but rolling back the ongoing sequence. If the sequence has a sub-branch sequence, the sub-branch sequence is also rolled back.
[0052] Generally, the entire sequence refers to the collection of all instruction operations that need to be parsed in the file, and the ongoing sequence refers to the instruction being parsed. A single instruction can contain descendant instructions; therefore, the relationship between the entire sequence and the ongoing sequence is the relationship between the sequence and the sub-branch sequence.
[0053] Generally, the configuration file after serialization is an instruction set, which is a collection of multiple instructions. A instruction or B instruction in the instruction set can have descendant instructions, which are the sub-branch sequences of A instruction or B instruction, and the parent branch of A instruction and B instruction is the root instruction in the instruction set.
[0054] S4, externally store the generated configuration file in the terminal device system partition.
[0055] Some embodiments disclose a multi-provincial customization system for terminal devices, which is used to execute a multi-provincial customization method for terminal devices. The customization system includes:
[0056] A specification predefinition module is configured to analyze provincial customization requirements, classify provincial customization parameters, define field specifications of classified parameters, and generate data modeling rule templates;
[0057] A rule deconstruction module configured to read a data modeling rule template, perform syntax analysis, generate an abstract syntax tree, abstract each component of the data modeling rule template into a node tree, atomize the node tree, and output the obtained rule set as a deconstructed rule set;
[0058] A parsing engine module configured to parse the received deconstructed rule set and perform data filling on different atomized conversion sequences according to classification;
[0059] A configuration module configured to externally place the generated configuration file in a terminal device system partition.
[0060] Some embodiments disclose an automatic deployment method of a multi-provincial customization system applied to a terminal device, comprising:
[0061] Triggering a build task of the configuration engine;
[0062] Automatically scanning metadata and performing metadata analysis;
[0063] Making a configuration change decision to determine a configuration file; generally, the configuration change decision includes: if the configuration is updated, compiling the new configuration and writing the obtained configuration file to the corresponding server node; if the configuration is not updated, tracing the configuration file of the last version and then registering the configuration file of the last version to the corresponding server node; registering the configuration file to a system node; generally, the multi-provincial customization system is integrated in the terminal device, when the server allocates resources to the customization system, triggering the build task of the configuration engine, and performing a series of resource interactions with the server, and scanning metadata through the resources possessed and configured by the server; generally, metadata analysis includes comparing the last file hash fingerprint and the version number, if it is new data, signing and encrypting, writing the new configuration file to the corresponding server node; if the data is not updated, tracing the last version, and then registering the configuration file of the last version to the corresponding server node;
[0064] Compiling a terminal system image and publishing; generally, according to the dynamic injection of the selected corresponding provincial node customization, the compilation chain will put all the required build dependencies into the container for compilation, and the registered nodes will be injected into the system image partition one by one, and after the compilation is completed, the image package will be automatically published to the official warehouse, thus completing the automatic deployment.
[0065] Generally, the build dependency has a dual meaning, which is specified as follows:
[0066] First, system-level build dependencies
[0067] Toolchain: refers to the set of essential tools necessary for compiling the Android system image, such as specific versions of JDK (Java Development Kit), NDK (Native Development Kit), GCC (GNU Compiler Collection), Python interpreter, and build tools such as Make (GNU Make) and Ninja;
[0068] Environment and configuration: includes the source code of a specific version of AOSP (Android Open Source Project), hardware abstraction layer (HAL) code provided by device manufacturers, kernel header files, and a series of environment variables and compilation configuration files; these are the cornerstone of building the entire system environment;
[0069] Second, application-level dependent libraries
[0070] Third-party libraries: refers to external code libraries that need to be referenced when compiling built-in applications or system services. These dependencies are usually managed by package management tools such as Gradle and Maven, and are declared in Gradle files (such as the dependencies block in build.gradle);
[0071] Specific forms include: aar / jar packages in remote repositories (such as Google's AndroidX libraries, network libraries, and APIs in the Android system SDK (such as android.jar));
[0072] In summary, the core action of the compilation process (i.e., 'building') is to include all the above build dependencies (from toolchain to code library) into a controllable containerized environment (such as a Docker container) to ensure the consistency, reproducibility, and isolation of the compilation environment; then, the compilation system (such as the Build system) recursively retrieves, compiles, and links all the necessary code according to the dependency files (such as Android.bp, Android.mk, build.gradle) of each module based on the dependency relationship, and finally generates a complete system image embedded with provincial customization configurations.
[0073] The present invention discloses a multi-province customization method, a customization system, and an automated deployment method for the customization system applied to terminal devices. These methods achieve dynamic decoupling of customization. An embedded configuration parsing module reads the pre-set configuration files of the system partitions at runtime, parses them in real time, and loads the rules into memory (RAM). A two-stage mechanism of "static configuration during development + dynamic parsing at runtime" completely decouples the strong binding between code and customization logic. Resource consumption is fundamentally optimized; regardless of the number of customized provinces, only a single code compilation is required. The configurations for each province are injected into the system partitions through an automated pipeline, reducing resource overhead from O(N) to O(1), breaking through the linear bottleneck of traditional solutions. Maintenance and management efficiency are significantly improved; customization requirements are only implemented through configuration files, allowing the application layer to focus on general business logic and parsing algorithms. A single codebase supports multi-province customization, simultaneously avoiding the maintenance risks of strongly coupled code and the management burden of multi-branch development, significantly reducing long-term iteration costs.
[0074] The technical details are further illustrated below with reference to the embodiments.
[0075] Example 1
[0076] Example 1 discloses a multi-provincial customization method for terminal devices, such as... Figure 1 As shown, it includes:
[0077] S1. Analyze the customized requirements of each province, classify the customized parameters of each province, define the field specifications of the classified parameters, and generate data modeling rule templates;
[0078] S2. Read the data modeling rule template, perform syntax parsing, generate an abstract syntax tree, abstract each component of the data modeling rule template into a node tree, perform atomic transformation on the node tree, and output the resulting rule set as a deconstructed rule set.
[0079] S3. Parse the received deconstruction rule set. During initialization, the application fills in the data for different atomization transformation sequences according to the classification.
[0080] S4. Place the generated configuration file on the system partition of the terminal device.
[0081] Example 2
[0082] Example 2 discloses an automated deployment method for a multi-provincial customized system applied to terminal devices, such as... Figure 2 As shown, it includes:
[0083] Some embodiments disclose an automated deployment method for a multi-provincial customized system applied to terminal devices, including:
[0084] Trigger the build task of the configuration engine;
[0085] Automated scanning of metadata and metadata analysis;
[0086] Configuration change decision, determine configuration file;
[0087] Compiling terminal system image and publishing.
[0088] The multi-provincial customization method applied to the terminal device disclosed by the embodiment of the application externally configures the provincial configuration in the system partition of the terminal device, parses the configuration file through the parsing engine module when the terminal device runs, and constructs an automatic deployment link to automatically deploy the configuration file to the terminal device, which greatly reduces resource waste, improves configuration efficiency, and reduces maintenance cost.
[0089] The technical details disclosed in the technical scheme and the embodiment of the application are only exemplary to illustrate the inventive concept of the application, and do not constitute a limitation on the technical scheme of the embodiment of the application. Any conventional change, replacement or combination of the technical details disclosed in the embodiment of the application has the same inventive concept as the application, and is within the protection scope of the claims of the application.
Claims
1. A method for multi-province customization applied to terminal equipment, characterized in that, The method comprises the steps of: S1, analyzing the provincial customization demand, classifying the provincial customization parameters, defining the field specification of the classified parameters, and generating a data modeling rule template; wherein the parameter classification includes UI parameters, function parameters, and business parameters; S2, reading the data modeling rule template, performing syntax analysis, generating an abstract syntax tree, and abstracting each component of the data modeling rule template into a node tree; atomizing the node tree, and outputting the obtained rule set as a deconstructed rule set; wherein the node tree includes UI nodes, logic nodes, and business nodes; S3, parsing the received deconstructed rule set, and filling data according to the classification for different atomized conversion sequences when the application is initialized and runs; specifically including: after receiving the atomized conversion sequence, loading each processing interface, adapting the configuration file of different partition paths, analyzing and interpreting the serialized data, judging the classification of the sequence data by itself, and filling data in different rule interpreters according to different classifications; the rule interpreter includes a UI renderer and a logic executor; S4, externally placing the generated configuration file in the terminal device system partition.
2. The multi-province customization method applied to terminal equipment according to claim 1, characterized in that, In step S3, if an exception occurs in the middle, the step is automatically rolled back, the exception information is stored in the corresponding memory, the position of the rollback is recorded, and default data is filled according to needs.
3. A multi-provincial customization system applied to a terminal device, used for executing the method in claim 1, characterized in that, It comprises: a specification predefinition module; a configuration module configured to analyze the provincial customization demand, classify the provincial customization parameters, define the field specification of the classified parameters, and generate a data modeling rule template; a rule deconstruction module; a rule deconstruction module configured to read the data modeling rule template, perform syntax analysis, generate an abstract syntax tree, abstract each component of the data modeling rule template into a node tree, atomize the node tree, and output the obtained rule set as a deconstructed rule set; an analysis engine module configured to parse the received deconstructed rule set, fill data according to the classification for different atomized conversion sequences, and generate a configuration file; a configuration module; a configuration module configured to externally place the generated configuration file in the terminal device system partition.
4. The method for automated deployment of a multi-province customization system applied to terminal equipment according to claim 3, characterized in that, It comprises: triggering the build task of the configuration engine; automatically scanning metadata and performing metadata analysis; configuring a change decision to determine a configuration file; registering the configuration file to the system node of the terminal device.
5. The method of claim 4, wherein, It further comprises: compiling the terminal system image and publishing it.
6. The method of claim 4, wherein, The configuration change decision to determine the configuration file comprises: if the configuration is updated, compiling the new configuration and writing it to the corresponding server node; if the configuration is not updated, tracing back to the last version, and then registering the last version to the corresponding server node.
7. The method of claim 5, wherein, Compiling the terminal system image comprises: dynamically injecting according to the selected corresponding provincial node customization, and the compilation chain will put all the required build dependencies into the container for compilation, and the registered nodes are injected one by one into the system image partition.
Citation Information
Patent Citations
A configuration file generation method and device for an application program
CN109032620A
Link calling method based on atomization service
CN111580896A