WO2024041358A1 - Configuration file updating method and apparatus, electronic device and readable storage medium - Google Patents

Configuration file updating method and apparatus, electronic device and readable storage medium Download PDF

Info

Publication number
WO2024041358A1
WO2024041358A1 PCT/CN2023/111451 CN2023111451W WO2024041358A1 WO 2024041358 A1 WO2024041358 A1 WO 2024041358A1 CN 2023111451 W CN2023111451 W CN 2023111451W WO 2024041358 A1 WO2024041358 A1 WO 2024041358A1
Authority
WO
WIPO (PCT)
Prior art keywords
update
configuration file
configuration
parameter
annotation information
Prior art date
Application number
PCT/CN2023/111451
Other languages
French (fr)
Chinese (zh)
Inventor
常舒超
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2024041358A1 publication Critical patent/WO2024041358A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • This application belongs to the field of data processing technology, and specifically relates to a configuration file updating method, device, electronic equipment and readable storage medium.
  • the purpose of the embodiments of the present application is to provide a configuration file updating method, device, electronic device and readable storage medium, which can solve the problem of data loss or deletion in the configuration parameter updating method of related technologies.
  • embodiments of the present application provide a configuration file updating method, which includes: acquiring all configuration parameters in the first configuration file; updating each configuration parameter according to pre-generated annotation information, the annotation information being Instructing an update strategy for each configuration parameter; generating a second configuration file according to the result of the update process.
  • inventions of the present application provide a configuration file updating device.
  • the device includes: a configuration parameter acquisition unit for acquiring all configuration parameters in the first configuration file; an update unit, configured to update each configuration parameter according to pre-generated annotation information, the annotation information being used to indicate an update strategy for each configuration parameter; a second configuration file generating unit configured to generate a third configuration file according to the result of the update process. Two configuration files.
  • inventions of the present application provide an electronic device.
  • the electronic device includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor.
  • the program or instructions are When executed by the processor, the steps of the method described in the first aspect are implemented.
  • embodiments of the present application provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the steps of the method described in the first aspect are implemented. .
  • Figure 1 is a schematic flow chart of a configuration file updating method provided by an embodiment of the present application
  • Figure 2 is another schematic flowchart of a configuration file updating method provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of the parameter correlation range between the configuration file and update requirement information provided by the embodiment of the present application.
  • Figure 4 is a schematic flow chart of service configuration file parsing provided by an embodiment of the present application.
  • Figure 5 is an example diagram of the parsing process of service configuration file update according to the embodiment of the present application.
  • Figure 6 is an example flowchart of the preparation phase of service configuration file update according to the embodiment of the present application.
  • Figure 7 is an example flowchart of the comparison phase of service configuration file update according to the embodiment of the present application.
  • Figure 8 is an example flowchart of the result splicing phase of the service configuration file update according to the embodiment of the present application.
  • Figure 9 is a schematic structural diagram of a configuration file updating device provided by an embodiment of the present application.
  • Figure 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish Similar objects, rather than describing a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,”"second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • the embodiment of the present application provides a configuration file update scheme, which processes all configuration parameters in the configuration file that need to be updated, and uses this to Each configuration parameter is updated to obtain an updated configuration file. Since all configuration parameters in the configuration file are marked, the problem of data loss or deletion in related technologies can be overcome, thereby improving the accuracy of configuration parameter update. .
  • Figure 1 is a schematic flowchart of a configuration file update method provided by an embodiment of the present application.
  • the method 100 can be executed by a terminal device.
  • the method may be executed by software or hardware installed on the terminal device.
  • the method may include the following steps S110-S130.
  • the first configuration file here refers to the configuration file that needs to be updated.
  • S120 Update each configuration parameter according to the pre-generated annotation information.
  • the annotation information is used to indicate the update strategy of each configuration parameter.
  • the configuration file updating method provided by the embodiment of the present application separately updates all configuration parameters in the first configuration file according to the pre-generated annotation information, and generates a second configuration file based on the update processing results. All configuration parameters are annotated, so the problem of data loss or missingness in related technologies can be overcome, thereby improving the accuracy of configuration file updates.
  • annotation information may be generated based on update requirement information and all configuration parameters in the first configuration file, where the update requirement information is used to indicate configuration parameters in the second configuration file and their update requirements.
  • the above-mentioned first configuration file, annotation information, and update requirement information may be converted into a program-recognizable format to facilitate the update process.
  • the update strategy in step S120 may be discarding (ie, no need to appear in the second configuration file), using current values (ie, using parameter values in the first configuration file), using update value (that is, using the updated value), the union of the current value and the updated value with priority based on the current value, the union of the current value and the updated value with priority based on the updated value, etc.
  • the above-mentioned union of the current value and the updated value based on the current value as priority means: for a parameter (also called a parameter item), for example, the parameter type is a dictionary type (or called a dictionary value), then the current value can be is called the current list, and the updated value can be called the update list. If the values of the two lists are different, the final value is the union of the two lists. For the case where the keys are the same but the values are different, Get the value in the current list. Similarly, the union of the current value and the updated value based on the priority of the updated value means that the final value is the union of the two lists. For the case where the key (key) is the same but the value (value) is different, take Update the values in the list.
  • the update policy of the configuration parameter needs to be marked as discarded. During the update process, this configuration parameter will be deleted, that is, it will not be included in the updated second configuration file.
  • the annotation information may specifically include: parameter item type, update strategy, and subsidiary parameters of the parameter item, etc. .
  • the parameter item types here can include common types (i.e. in Table 1 Ordinary values), array types (i.e., list values in Table 1), and dictionary types (i.e., dictionary values in Table 1), etc.
  • Table 1 is an example of parameter item type annotation, as shown in Table 1:
  • Table 2 is an example of the update strategy (that is, the strategy name in Table 2) annotation for common values, as shown in Table 2:
  • Table 3 is an example of update strategy annotation for list values, as shown in Table 3:
  • Table 4 is an example of update strategy annotation for dictionary values, as shown in Table 4:
  • a parameter item if it is not expected to exist after an update and upgrade, it can be marked as deprecated, for example, marked as deprecated.
  • the parameter item type is a list value or dictionary value
  • the parameter There will be some small items in the item. If you do not want some small items to still exist after the update and upgrade, you can mark them in deprecatedItem (a code name). If you want some small items in the parameter items to exist no matter what after the update and upgrade, you can mark them in comfirmItem (a code name). If some small items in the parameters are mutually exclusive and you want to retain one of the values after update and upgrade, you can mark it in mutexItem (a code name).
  • Table 5 is an example of small item labeling, as shown in Table 5:
  • mark information can be called mark-file
  • the mark information can be in a common file format to facilitate program identification and parsing.
  • all parameters to be annotated need to be within the known range.
  • the annotation information may be in YAML (a markup language) format.
  • the configuration file types supported by annotation information include:
  • Such configuration files can usually be directly recognized by the program and converted into corresponding data structures.
  • the form "featureGates.Accelerators" can be used as the primary key, one by one. Label parameter items.
  • Figure 2 is another schematic flowchart of a configuration file update method provided by an embodiment of the present application. As shown in Figure 2, the method 200 may include the following steps.
  • Step S210 update requirement information (current-file) preparation: needs to be carried out before file update and upgrade.
  • the configuration file is upgraded from an old version to a new version.
  • the configuration file corresponding to the old version ie, the first configuration file origin-file
  • the configuration file in the new version needs to have a "reference object", that is, current-file.
  • the relevant ranges of parameter items of origin-file and current-file can be seen in Figure 3, including: obsolete parameters, overlapping parameters and new parameters.
  • the preparation of current-file includes the following principles:
  • Parameter items that may overlap with origin-file are generally set to the default value of the parameter item. For some special parameter items, they can be set to fixed values, such as critical paths. Parameter items of this type.
  • Parameter items unique to later versions are generally set to the default value of the parameter item.
  • This kind of parameter item is generally a newly added parameter in a later version of the configuration file, representing a new function or change.
  • current-file may be a common file format to facilitate parsing.
  • Step S220 mark-file preparation: Marking needs to be done before file update and upgrade. All possible parameter items should be marked.
  • the parameter item marks of each configuration file are saved in a mark file.
  • the annotation file can be in a common format (such as yaml, json, etc.), which can facilitate the next step of file parsing.
  • Step S230 file parsing: File parsing is a preparatory step before comparison in the following step S240. It is necessary to parse origin-file, current-file and mark-file into structures that can be recognized by the program.
  • configuration file types include: common format files and service configuration files. Among them, common development languages will support the parsing of universal format files, and there is no need to design parsing logic by yourself.
  • FIG. 4 is a schematic flow chart of service configuration file parsing provided by an embodiment of the present application. As shown in Figure 4, the process includes steps S410-S440:
  • Step S410 The parsing process starts and determines whether the next line can be read. If so, proceed to step S420; otherwise, it ends;
  • Step S420 whether it is a comment line, if so, return to step S410, otherwise proceed to step S430;
  • Step S430 remove the parameter classification title and separate parameter items according to commas
  • step S240 After analyzing origin-file, current-file and mark-file respectively, step S240 can be entered.
  • Step S240 configuration item comparison: obtain the parameter items and their annotation items in mark-file in turn, and compare each parameter item in origin-file and current-file according to the annotation type and update strategy of each parameter item.
  • the comparison process here is the update process.
  • Step S250 Generate a new configuration file (ie, the above-mentioned second configuration file): After the comparison of all annotated items is completed, the results are summarized and a new configuration file is generated. At this time, the configuration file update and upgrade is completed.
  • each parameter item in the configuration file is marked, and then the marked parameter items are traversed, the corresponding update and upgrade strategy is executed for each parameter item, and then a new parameter is generated based on the update and upgrade results.
  • configuration file indicates the update strategy of each parameter item in the upgrade process by annotating the configuration file parameter items.
  • Figures 5 to 8 are example flow charts of service configuration file updates provided by embodiments of the present application.
  • Figure 5 shows the parsing process of service configuration file updates
  • Figure 6 shows the preparation phase process of service configuration file updates
  • Figure 7 shows the comparison phase process of service configuration file update
  • Figure 8 shows the result splicing phase process of service configuration file update.
  • the input items are three files, origin-file, current-file and mark-file. These three files are parsed respectively, mark-file is parsed into an array structure mark Arr, and origin-file is parsed into Dictionary object originMap, parses current-file into currentMap.
  • the comparison stage of service configuration file update As shown in Figure 7, it is the comparison stage of service configuration file update.
  • the comparison operation is performed according to the annotation type and update strategy (useOrigin, useCurrent, merge, originBaseMerge, currentBaseMerge) of the parameter items.
  • the result splicing stage of the service configuration file update corresponds to the above-mentioned step S250.
  • the records in currentMap are cyclically read, and the result string is converted and written into destFile to form a new configuration file.
  • Table 6 is an example of configuration file parameter update, as shown in Table 6:
  • the configuration file parameter update method provided by the embodiment of the present application is based on pre-setting the type of each parameter item and the strategy that needs to be executed for the update.
  • the parameter item can be identified during the update process, and the update strategy can be executed on the parameter item, thereby realizing the parameter Expected updates of items, such as retaining the values of parameter items before the upgrade, merging parameter items, etc.
  • the embodiment of this application indicates the update strategy of each parameter item in the upgrade process by annotating the configuration file parameter items, which can realize customized upgrade of each parameter, and can also overcome the problem of data loss or missing in related technologies. problems and improve the efficiency and accuracy of upgrades.
  • embodiments of the present application also provide a configuration file updating device.
  • Figure 9 is a schematic structural diagram of a configuration file update device provided by an embodiment of the present application.
  • the configuration file update device 900 includes: a configuration parameter acquisition unit 910, an update unit 920 and a second configuration file generation unit 930 ,in:
  • the configuration parameter acquisition unit 910 is used to acquire all configuration parameters in the first configuration file
  • Update unit 920 configured to update each configuration parameter according to pre-generated annotation information, where the annotation information is used to indicate the update strategy of each configuration parameter;
  • the second configuration file generating unit 930 is configured to generate a second configuration file according to the result of the update process.
  • the update unit 920 updates all the configuration parameters in the first configuration file obtained by the configuration parameter acquisition unit 910 according to the pre-generated annotation information, and then the second configuration file generation unit 930 generates a second configuration file according to the update processing result, Since all configuration parameters in the configuration file are annotated, the problem of data loss or deletion in related technologies can be overcome, thereby improving the accuracy of configuration file updates.
  • the configuration file updating device further includes: an annotation information generating unit, the annotation information generating unit is configured to generate annotation information according to the update requirement information and all the above configuration parameters, the above update requirement information indicates the second configuration file Configuration parameters and their update requirements.
  • the configuration file updating device further includes: a format conversion unit configured to convert the first configuration file, annotation information, and update requirement information into a program-recognizable format.
  • the above update strategies include: discard, use the current value, use the updated value, the union of the current value and the updated value based on the current value as the priority, and the combination of the current value and the updated value based on the updated value as the priority. Union etc.
  • the update policy of the first configuration parameter is discarded, the annotation information of the first configuration parameter generated according to the above update requirement information is discarded. After the update is completed, the first configuration parameter is not included in the second configuration file.
  • the configuration file updating device in the embodiment of the present application may be a device or a part in the terminal. components, integrated circuits, or chips.
  • the device may be a mobile terminal or a non-mobile terminal, which is not specifically limited in the embodiments of this application.
  • the configuration file updating device 900 in the embodiment of the present application may be a device with an operating system.
  • the operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
  • the configuration file updating device provided by the embodiment of the present application can implement each process implemented by the terminal in the above method embodiment, and achieve the same technical effect. To avoid duplication, the details will not be described here.
  • this embodiment of the present application also provides an electronic device 1000, which includes a processor 1010 and a memory 1020.
  • the memory 1020 stores programs or instructions that can be run on the processor 1010.
  • the electronic device 1000 is a terminal
  • the program or instruction is executed by the processor 1010
  • each process of the above configuration file update method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
  • Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above configuration file update method embodiment is implemented, and can achieve The same technical effects will not be repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage media includes computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disks or optical disks, etc.
  • An embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the above embodiment of the configuration file update method. Each process can achieve the same technical effect. To avoid repetition, we will not go into details here.
  • embodiments of the present application also provide a computer program product, the computer program
  • the program product includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor.
  • the program or instruction is executed by the processor, each of the above configuration file updating method embodiments is implemented. The process can achieve the same technical effect. To avoid repetition, it will not be described again here.
  • the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation.
  • the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology.
  • the computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A configuration file updating method and apparatus, an electronic device, and a readable storage medium. The method comprises: acquiring all configuration parameters in a first configuration file (S110); updating each configuration parameter according to pre-generated annotation information (S120), the annotation information being used for indicating an update strategy of each configuration parameter; and generating a second configuration file according to an update processing result (S130).

Description

配置文件更新方法、装置、电子设备及可读存储介质Configuration file update method, device, electronic device and readable storage medium
交叉引用cross reference
本申请要求在2022年08月24日提交中国专利局、申请号为202211016851.6、名称为“配置文件更新方法、装置、电子设备及可读存储介质”的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application requests the priority of a Chinese patent application filed with the China Patent Office on August 24, 2022, with application number 202211016851.6 and titled "Configuration file update method, device, electronic device and readable storage medium". All the application's The contents are incorporated into this application by reference.
技术领域Technical field
本申请属于数据处理技术领域,具体涉及一种配置文件更新方法、装置、电子设备及可读存储介质。This application belongs to the field of data processing technology, and specifically relates to a configuration file updating method, device, electronic equipment and readable storage medium.
背景技术Background technique
目前,为了更好地适应技术发展,应用程序配置文件的升级或者版本之间参数更新都较为频繁。当前配置文件的参数(可以简称为配置参数)更新的主要方式为:仅对需要更新的参数进行升级,而不考虑其他不需要更新的参数,这会导致后续版本中缺失部分参数,不利于后续版本参数的维护。Currently, in order to better adapt to technological developments, application configuration files are upgraded more frequently or parameters are updated between versions. The main way to update the parameters of the current configuration file (which can be referred to as configuration parameters) is to only upgrade the parameters that need to be updated, without considering other parameters that do not need to be updated. This will cause some parameters to be missing in subsequent versions, which is not conducive to the follow-up. Maintenance of version parameters.
也就是说,相关的配置参数更新方式存在数据丢失或缺失的问题。In other words, there is a problem of data loss or deletion in the relevant configuration parameter update method.
发明内容Contents of the invention
本申请实施例的目的是提供一种配置文件更新方法、装置、电子设备及可读存储介质,能够解决相关技术的配置参数更新方式存在数据丢失或缺失的问题。The purpose of the embodiments of the present application is to provide a configuration file updating method, device, electronic device and readable storage medium, which can solve the problem of data loss or deletion in the configuration parameter updating method of related technologies.
第一方面,本申请实施例提供了一种配置文件更新方法,包括:获取第一配置文件中的全部配置参数;根据预先生成的标注信息对每个配置参数进行更新处理,所述标注信息用于指示每个配置参数的更新策略;根据所述更新处理的结果生成第二配置文件。In a first aspect, embodiments of the present application provide a configuration file updating method, which includes: acquiring all configuration parameters in the first configuration file; updating each configuration parameter according to pre-generated annotation information, the annotation information being Instructing an update strategy for each configuration parameter; generating a second configuration file according to the result of the update process.
第二方面,本申请实施例提供了一种配置文件更新装置,所述装置包括:配置参数获取单元,用于获取第一配置文件中的全部配置参数;更新单元, 用于根据预先生成的标注信息对每个配置参数进行更新处理,所述标注信息用于指示每个配置参数的更新策略;第二配置文件生成单元,用于根据所述更新处理的结果生成第二配置文件。In a second aspect, embodiments of the present application provide a configuration file updating device. The device includes: a configuration parameter acquisition unit for acquiring all configuration parameters in the first configuration file; an update unit, configured to update each configuration parameter according to pre-generated annotation information, the annotation information being used to indicate an update strategy for each configuration parameter; a second configuration file generating unit configured to generate a third configuration file according to the result of the update process. Two configuration files.
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device. The electronic device includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor. The program or instructions are When executed by the processor, the steps of the method described in the first aspect are implemented.
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the steps of the method described in the first aspect are implemented. .
附图说明Description of drawings
图1是本申请实施例提供的配置文件更新方法的一种流程示意图;Figure 1 is a schematic flow chart of a configuration file updating method provided by an embodiment of the present application;
图2是本申请实施例提供的配置文件更新方法的另一种流程示意图;Figure 2 is another schematic flowchart of a configuration file updating method provided by an embodiment of the present application;
图3是本申请实施例提供的配置文件和更新需求信息之间的参数相关范围示意图;Figure 3 is a schematic diagram of the parameter correlation range between the configuration file and update requirement information provided by the embodiment of the present application;
图4是本申请实施例提供的服务配置文件解析的一种流程示意图;Figure 4 is a schematic flow chart of service configuration file parsing provided by an embodiment of the present application;
图5是本申请实施例的服务配置文件更新的解析流程示例图;Figure 5 is an example diagram of the parsing process of service configuration file update according to the embodiment of the present application;
图6是本申请实施例的服务配置文件更新的准备阶段流程示例图;Figure 6 is an example flowchart of the preparation phase of service configuration file update according to the embodiment of the present application;
图7是本申请实施例的服务配置文件更新的比对阶段流程示例图;Figure 7 is an example flowchart of the comparison phase of service configuration file update according to the embodiment of the present application;
图8是本申请实施例的服务配置文件更新的结果拼接阶段流程示例图;Figure 8 is an example flowchart of the result splicing phase of the service configuration file update according to the embodiment of the present application;
图9是本申请实施例提供的配置文件更新装置的一种结构示意图;Figure 9 is a schematic structural diagram of a configuration file updating device provided by an embodiment of the present application;
图10是本申请实施例提供的电子设备的一种结构示意图。Figure 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别 类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。The terms "first", "second", etc. in the description and claims of this application are used to distinguish Similar objects, rather than describing a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first,""second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
鉴于相关技术的配置参数更新方式存在数据丢失或缺失的问题,本申请实施例提供了一种配置文件更新方案,该方案通过对需要更新的配置文件中的全部配置参数进行标注处理,并以此对各配置参数进行更新,得到更新后的配置文件,由于对配置文件中的全部配置参数进行了标注,因而可以克服相关技术中的数据丢失或缺失的问题,从而可以提高配置参数更新的准确性。In view of the problem of data loss or deletion in the configuration parameter update method of the related art, the embodiment of the present application provides a configuration file update scheme, which processes all configuration parameters in the configuration file that need to be updated, and uses this to Each configuration parameter is updated to obtain an updated configuration file. Since all configuration parameters in the configuration file are marked, the problem of data loss or deletion in related technologies can be overcome, thereby improving the accuracy of configuration parameter update. .
下面结合附图,通过具体的实施例及其应用场景对本申请实施例进行详细地说明。The embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
图1是本申请实施例提供的配置文件更新方法的一种流程示意图,该方法100可以由终端设备执行。换言之,所述方法可以由安装在终端设备的软件或硬件来执行。如图1所示,该方法可以包括以下步骤S110-S130。Figure 1 is a schematic flowchart of a configuration file update method provided by an embodiment of the present application. The method 100 can be executed by a terminal device. In other words, the method may be executed by software or hardware installed on the terminal device. As shown in Figure 1, the method may include the following steps S110-S130.
S110:获取第一配置文件中的全部配置参数。这里的第一配置文件即是指需要更新的配置文件。S110: Obtain all configuration parameters in the first configuration file. The first configuration file here refers to the configuration file that needs to be updated.
S120:根据预先生成的标注信息对每个配置参数进行更新处理,该标注信息用于指示每个配置参数的更新策略。S120: Update each configuration parameter according to the pre-generated annotation information. The annotation information is used to indicate the update strategy of each configuration parameter.
S130:根据上述更新处理的结果生成第二配置文件。S130: Generate a second configuration file according to the result of the above update process.
本申请实施例提供的配置文件更新方法,通过根据预先生成的标注信息对第一配置文件中的全部配置参数分别进行更新处理,并根据更新处理结果生成第二配置文件,由于对配置文件中的全部配置参数进行了标注,因而可以克服相关技术中的数据丢失或缺失的问题,从而可以提高配置文件更新的准确性。 The configuration file updating method provided by the embodiment of the present application separately updates all configuration parameters in the first configuration file according to the pre-generated annotation information, and generates a second configuration file based on the update processing results. All configuration parameters are annotated, so the problem of data loss or missingness in related technologies can be overcome, thereby improving the accuracy of configuration file updates.
在一种可能的实现方式中,可以根据更新需求信息和上述第一配置文件中的全部配置参数生成标注信息,上述更新需求信息用于指示第二配置文件中的配置参数及其更新需求。In a possible implementation, annotation information may be generated based on update requirement information and all configuration parameters in the first configuration file, where the update requirement information is used to indicate configuration parameters in the second configuration file and their update requirements.
在一种可能的实现方式中,在进行S120的更新处理之前,可以将上述第一配置文件、标注信息和更新需求信息转换为程序可识别的格式,以便于更新处理。In a possible implementation, before performing the update process in S120, the above-mentioned first configuration file, annotation information, and update requirement information may be converted into a program-recognizable format to facilitate the update process.
在一种可能的实现方式中,步骤S120中的更新策略可以是废弃(即,无需出现在第二配置文件中)、使用当前值(即,使用第一配置文件中的参数值)、使用更新值(即,使用更新后的值)、基于当前值为优先级的当前值和更新值的并集、基于更新值为优先级的当前值和更新值的并集等。In a possible implementation, the update strategy in step S120 may be discarding (ie, no need to appear in the second configuration file), using current values (ie, using parameter values in the first configuration file), using update value (that is, using the updated value), the union of the current value and the updated value with priority based on the current value, the union of the current value and the updated value with priority based on the updated value, etc.
上述基于当前值为优先级的当前值和更新值的并集是指:对于一个参数(也可以称为参数项),例如该参数类型为字典类型(或称为字典值),则当前值可以称为当前列表,更新值可以称为更新列表,如果这两个列表取值不同,最终取值为两个列表的并集,对于其中健(key)相同、但是值(value)不同的情况,取当前列表中的值。类似地,基于更新值为优先级的当前值和更新值的并集是指,最终取值为两个列表的并集,对于其中健(key)相同、但是值(value)不同的情况,取更新列表中的值。The above-mentioned union of the current value and the updated value based on the current value as priority means: for a parameter (also called a parameter item), for example, the parameter type is a dictionary type (or called a dictionary value), then the current value can be is called the current list, and the updated value can be called the update list. If the values of the two lists are different, the final value is the union of the two lists. For the case where the keys are the same but the values are different, Get the value in the current list. Similarly, the union of the current value and the updated value based on the priority of the updated value means that the final value is the union of the two lists. For the case where the key (key) is the same but the value (value) is different, take Update the values in the list.
在一个实施例中,当一个配置参数的更新需求信息为废弃时,在对该配置参数进行标注时,需要将该配置参数的更新策略标注为废弃。在更新过程中,该配置参数将会被删除,即,不会包含在上述更新后的第二配置文件中。In one embodiment, when the update requirement information of a configuration parameter is discarded, when marking the configuration parameter, the update policy of the configuration parameter needs to be marked as discarded. During the update process, this configuration parameter will be deleted, that is, it will not be included in the updated second configuration file.
在一种可能的实现方式中,在分别对配置文件中的每个参数(以下可以称为参数项)进行标注时,标注信息具体可以包括:参数项类型、更新策略以及参数项的附属参数等。这里的参数项类型可以包括普通类型(即表1中 的普通值)、数组类型(即表1中的列表值)以及字典类型(即表1中的字典值)等。In a possible implementation, when each parameter (hereinafter referred to as parameter item) in the configuration file is marked respectively, the annotation information may specifically include: parameter item type, update strategy, and subsidiary parameters of the parameter item, etc. . The parameter item types here can include common types (i.e. in Table 1 Ordinary values), array types (i.e., list values in Table 1), and dictionary types (i.e., dictionary values in Table 1), etc.
表1是参数项类型标注的示例,如表1所示:
Table 1 is an example of parameter item type annotation, as shown in Table 1:
表1Table 1
基于上述参数项类型,更新策略的标注示例如下表2-表4所示,在如下示例中,第一配置文件称为origin-file,更新需求信息称为current-file。Based on the above parameter types, examples of labeling of update strategies are shown in Table 2-Table 4 below. In the following examples, the first configuration file is called origin-file, and the update requirement information is called current-file.
表2是普通值的更新策略(即表2中的策略名称)标注的示例,如表2所示:

Table 2 is an example of the update strategy (that is, the strategy name in Table 2) annotation for common values, as shown in Table 2:

表2Table 2
表3是列表值的更新策略标注的示例,如表3所示:
Table 3 is an example of update strategy annotation for list values, as shown in Table 3:
表3table 3
表4是字典值的更新策略标注的示例,如表4所示:

Table 4 is an example of update strategy annotation for dictionary values, as shown in Table 4:

表4Table 4
在一种可能的实现方式中,如果一个参数项,不希望在更新升级之后它还存在,可以将其标注为废弃,例如标注为deprecated。In a possible implementation, if a parameter item is not expected to exist after an update and upgrade, it can be marked as deprecated, for example, marked as deprecated.
在一种可能的实现方式中,如果参数项类型是列表值或者字典值,参数 项中会有一些小项,如果不希望一些小项在更新升级之后还存在,可以将其在deprecatedItem(一种代码名)中标注。如果参数项中的一些小项,希望在更新升级之后无论如何都存在,可以将其在comfirmItem(一种代码名)中标注。如果参数中的一些小项存在互斥的情况,希望更新升级之后保留其中的一个值,则可以将其在mutexItem(一种代码名)中标注。In a possible implementation, if the parameter item type is a list value or dictionary value, the parameter There will be some small items in the item. If you do not want some small items to still exist after the update and upgrade, you can mark them in deprecatedItem (a code name). If you want some small items in the parameter items to exist no matter what after the update and upgrade, you can mark them in comfirmItem (a code name). If some small items in the parameters are mutually exclusive and you want to retain one of the values after update and upgrade, you can mark it in mutexItem (a code name).
表5是小项标注的示例,如表5所示:



Table 5 is an example of small item labeling, as shown in Table 5:



表5table 5
在一种可能的实现方式中,标注信息(可以称为mark-file)可以是通用的文件格式,方便程序识别并解析。对于参数标注,需要所有待标注的参数在已知范围内,通过更新升级的路径(低版本-》高版本),可以获取全部可能出现的参数项。In a possible implementation, the mark information (can be called mark-file) can be in a common file format to facilitate program identification and parsing. For parameter annotation, all parameters to be annotated need to be within the known range. By updating the upgrade path (lower version->higher version), all possible parameter items can be obtained.
在一个示例中,标注信息可以采用yaml(一种标记语言)格式。In one example, the annotation information may be in YAML (a markup language) format.
在一种可能的实现方式中,标注信息支持的配置文件类型包括:In a possible implementation, the configuration file types supported by annotation information include:
(1)服务配置文件(1)Service configuration file
在具体实施过程中,这类配置文件无法直接解析,但是遵循“xx=xx”的范式,对于这类配置文件的mark-file可以使用参数项的名称作为主键(key),逐一标注参数项。In the specific implementation process, this type of configuration file cannot be directly parsed, but following the "xx=xx" paradigm, the mark-file of this type of configuration file can use the name of the parameter item as the primary key (key), and mark the parameter items one by one.
(2)通用格式文件(2) Common format files
在具体实施过程中,这类配置文件通常可以被程序直接识别并转换成相应的数据结构,例如,对于yaml格式的配置文件的mark-file可以使用“featureGates.Accelerators”这种形式作为主键,逐一标注参数项。During the specific implementation process, such configuration files can usually be directly recognized by the program and converted into corresponding data structures. For example, for the mark-file of the yaml format configuration file, the form "featureGates.Accelerators" can be used as the primary key, one by one. Label parameter items.
图2是本申请实施例提供的配置文件更新方法的另一种流程示意图,如图2所示,该方法200可以包括以下步骤。 Figure 2 is another schematic flowchart of a configuration file update method provided by an embodiment of the present application. As shown in Figure 2, the method 200 may include the following steps.
步骤S210,更新需求信息(current-file)准备:需要在文件更新升级前进行,配置文件是从旧版本升级到新版本,旧版本对应的配置文件(即,第一配置文件origin-file)已经存在。新版本中的配置文件需要有一个“参照物”,即current-file。current-file中存在若干个参数项,取值是新版本中推荐的取值。origin-file和current-file的参数项相关范围可以参见图3所示,包括:废弃参数、重合参数和新参数。Step S210, update requirement information (current-file) preparation: needs to be carried out before file update and upgrade. The configuration file is upgraded from an old version to a new version. The configuration file corresponding to the old version (ie, the first configuration file origin-file) has been exist. The configuration file in the new version needs to have a "reference object", that is, current-file. There are several parameter items in current-file, and the values are recommended in the new version. The relevant ranges of parameter items of origin-file and current-file can be seen in Figure 3, including: obsolete parameters, overlapping parameters and new parameters.
在一种可能的实现方式中,current-file的准备包括如下原则:In a possible implementation, the preparation of current-file includes the following principles:
(1)废弃参数项无需写入current-file。(1) There is no need to write the discarded parameter items to current-file.
(2)与origin-file中可能重合的参数项(例如图3所示的重合参数),一般设置为该参数项的默认值,对于一些特殊的参数项,可以设置为固定值,例如关键路径这种类型的参数项。(2) Parameter items that may overlap with origin-file (such as the overlapping parameters shown in Figure 3) are generally set to the default value of the parameter item. For some special parameter items, they can be set to fixed values, such as critical paths. Parameter items of this type.
(3)较高版本中特有的参数项(例如图3所示的新参数),一般设置为该参数项的默认值。这种参数项一般是高版本配置文件中新增的参数,代表新的功能或者变更。(3) Parameter items unique to later versions (such as the new parameters shown in Figure 3) are generally set to the default value of the parameter item. This kind of parameter item is generally a newly added parameter in a later version of the configuration file, representing a new function or change.
在一个实施例中,current-file可以是通用的文件格式,方便解析。In one embodiment, current-file may be a common file format to facilitate parsing.
步骤S220,标注文件(mark-file)准备:标注需要在文件更新升级前进行,对可能出现的参数项进行全部标注,每个配置文件的参数项标注保存在一个标注文件中。标注文件可以是通用的格式(例如yaml、json等),可以方便下一步文件解析。Step S220, mark-file preparation: Marking needs to be done before file update and upgrade. All possible parameter items should be marked. The parameter item marks of each configuration file are saved in a mark file. The annotation file can be in a common format (such as yaml, json, etc.), which can facilitate the next step of file parsing.
步骤S230,文件解析:文件解析为下述步骤S240比对前的准备步骤,需要将origin-file、current-file和mark-file分别解析成程序可识别的结构。Step S230, file parsing: File parsing is a preparatory step before comparison in the following step S240. It is necessary to parse origin-file, current-file and mark-file into structures that can be recognized by the program.
在具体实施时,配置文件类型包括:通用格式文件和服务配置文件。其中,通用格式文件通常的开发语言会支持其解析,无需自行设计解析逻辑。 服务配置文件通常会有注释(例如,#开头的行为注释)、参数分类标题(标题可能对应多个配置项)以及配置项(通常是“xxx=xxx”的格式)。In specific implementation, configuration file types include: common format files and service configuration files. Among them, common development languages will support the parsing of universal format files, and there is no need to design parsing logic by yourself. Service configuration files usually have comments (for example, behavioral comments starting with #), parameter classification titles (the titles may correspond to multiple configuration items), and configuration items (usually in the format of "xxx=xxx").
图4是本申请实施例提供的服务配置文件解析的一种流程示意图,如图4所示,该流程包括步骤S410-S440:Figure 4 is a schematic flow chart of service configuration file parsing provided by an embodiment of the present application. As shown in Figure 4, the process includes steps S410-S440:
步骤S410,解析流程开始,判断是否能读到下一行,如果能,进行步骤S420,否则结束;Step S410: The parsing process starts and determines whether the next line can be read. If so, proceed to step S420; otherwise, it ends;
步骤S420,是否为注释行,如果是,则返回步骤S410,否则进行步骤S430;Step S420, whether it is a comment line, if so, return to step S410, otherwise proceed to step S430;
步骤S430,去掉参数分类标题,按照逗号分开参数项;Step S430, remove the parameter classification title and separate parameter items according to commas;
步骤S440,依次按照“=”分开参数项名和参数值,存入解析结果列表。Step S440: Separate the parameter item name and parameter value according to "=" in sequence, and store them in the parsing result list.
在对origin-file、current-file和mark-file分别解析后,即可进入步骤S240。After analyzing origin-file, current-file and mark-file respectively, step S240 can be entered.
步骤S240,配置项比对:依次获取mark-file中的参数项及其标注项,根据各参数项的标注类型和更新策略对origin-file、current-file中的各参数项进行比对操作,这里的比对过程即为更新过程。Step S240, configuration item comparison: obtain the parameter items and their annotation items in mark-file in turn, and compare each parameter item in origin-file and current-file according to the annotation type and update strategy of each parameter item. The comparison process here is the update process.
步骤S250,生成新配置文件(即,上述的第二配置文件):当所有的标注项执行比对结束之后,对结果进行汇总,生成新的配置文件,此时,配置文件更新升级结束。Step S250: Generate a new configuration file (ie, the above-mentioned second configuration file): After the comparison of all annotated items is completed, the results are summarized and a new configuration file is generated. At this time, the configuration file update and upgrade is completed.
通过本申请实施例在配置文件更新升级前,对配置文件中的每个参数项进行标注,随后遍历标注的参数项,对各参数项执行相应的更新升级策略,之后根据更新升级结果生成新的配置文件。本申请实施例通过对配置文件参数项的标注,表明了各个参数项在升级过程中的更新策略,在此基础上,可以实现对每个参数项的定制化升级,可以克服相关技术中的数据丢失或缺失的问题,同时也提高了配置文件升级的效率和准确性。 Through the embodiment of this application, before the configuration file is updated and upgraded, each parameter item in the configuration file is marked, and then the marked parameter items are traversed, the corresponding update and upgrade strategy is executed for each parameter item, and then a new parameter is generated based on the update and upgrade results. configuration file. The embodiment of this application indicates the update strategy of each parameter item in the upgrade process by annotating the configuration file parameter items. On this basis, customized upgrades of each parameter item can be realized, and data problems in related technologies can be overcome. It also improves the efficiency and accuracy of configuration file upgrades.
图5-图8是本申请实施例提供的服务配置文件更新的示例流程图,其中,图5示出了服务配置文件更新的解析流程,图6示出了服务配置文件更新的准备阶段流程,图7示出了服务配置文件更新的比对阶段流程,图8示出了服务配置文件更新的结果拼接阶段流程。Figures 5 to 8 are example flow charts of service configuration file updates provided by embodiments of the present application. Figure 5 shows the parsing process of service configuration file updates, and Figure 6 shows the preparation phase process of service configuration file updates. Figure 7 shows the comparison phase process of service configuration file update, and Figure 8 shows the result splicing phase process of service configuration file update.
参见图5所示,输入项为三个文件,origin-file、current-file和mark-file,分别解析这三个文件,将mark-file解析为一个数组结构mark Arr,将origin-file解析为字典对象originMap,将current-file解析为currentMap。As shown in Figure 5, the input items are three files, origin-file, current-file and mark-file. These three files are parsed respectively, mark-file is parsed into an array structure mark Arr, and origin-file is parsed into Dictionary object originMap, parses current-file into currentMap.
参见图6所示,为服务配置文件更新的准备阶段,基于mark Arr和currentMap,删除originMap中的废弃参数。As shown in Figure 6, in the preparation stage for updating the service configuration file, based on mark Arr and currentMap, delete the obsolete parameters in originMap.
参见图7所示,为服务配置文件更新的比对阶段,对应于上述步骤S240,根据参数项的标注类型和更新策略(useOrigin、useCurrent、merge、originBaseMerge、currentBaseMerge)进行比对操作。As shown in Figure 7, it is the comparison stage of service configuration file update. Corresponding to the above-mentioned step S240, the comparison operation is performed according to the annotation type and update strategy (useOrigin, useCurrent, merge, originBaseMerge, currentBaseMerge) of the parameter items.
参见图8所示,服务配置文件更新的结果拼接阶段,对应于上述步骤S250,循环读取currentMap中的记录,并将结果字符串转换后写入到destFile中,形成新的配置文件。As shown in Figure 8, the result splicing stage of the service configuration file update corresponds to the above-mentioned step S250. The records in currentMap are cyclically read, and the result string is converted and written into destFile to form a new configuration file.
表6是配置文件参数更新示例,如表6所示:


Table 6 is an example of configuration file parameter update, as shown in Table 6:


表6Table 6
本申请实施例提供的配置文件参数更新方法,基于对每个参数项的类型和更新所需要执行的策略进行预先设置,可以在更新过程中识别参数项、对参数项执行更新策略,实现了参数项的预期更新,例如保留升级前的参数项取值、合并参数项等。本申请实施例通过对配置文件参数项的标注,表明了各个参数项在升级过程中的更新策略,可以实现对每个参数的定制化升级,同时也可以克服相关技术中的数据丢失或缺失的问题,提高升级的效率和准确性。The configuration file parameter update method provided by the embodiment of the present application is based on pre-setting the type of each parameter item and the strategy that needs to be executed for the update. The parameter item can be identified during the update process, and the update strategy can be executed on the parameter item, thereby realizing the parameter Expected updates of items, such as retaining the values of parameter items before the upgrade, merging parameter items, etc. The embodiment of this application indicates the update strategy of each parameter item in the upgrade process by annotating the configuration file parameter items, which can realize customized upgrade of each parameter, and can also overcome the problem of data loss or missing in related technologies. problems and improve the efficiency and accuracy of upgrades.
基于相似的发明构思,本申请实施例还提供一种配置文件更新装置。Based on a similar inventive concept, embodiments of the present application also provide a configuration file updating device.
图9是本申请实施例提供的配置文件更新装置的一种结构示意图,如图9所示,该配置文件更新装置900包括:配置参数获取单元910、更新单元920和第二配置文件生成单元930,其中: Figure 9 is a schematic structural diagram of a configuration file update device provided by an embodiment of the present application. As shown in Figure 9, the configuration file update device 900 includes: a configuration parameter acquisition unit 910, an update unit 920 and a second configuration file generation unit 930 ,in:
配置参数获取单元910,用于获取第一配置文件中的全部配置参数;The configuration parameter acquisition unit 910 is used to acquire all configuration parameters in the first configuration file;
更新单元920,用于根据预先生成的标注信息对每个配置参数进行更新处理,所述标注信息用于指示每个配置参数的更新策略;Update unit 920, configured to update each configuration parameter according to pre-generated annotation information, where the annotation information is used to indicate the update strategy of each configuration parameter;
第二配置文件生成单元930,用于根据所述更新处理的结果生成第二配置文件。The second configuration file generating unit 930 is configured to generate a second configuration file according to the result of the update process.
通过更新单元920根据预先生成的标注信息对配置参数获取单元910获取的第一配置文件中的全部配置参数分别进行更新处理,之后第二配置文件生成单元930根据更新处理结果生成第二配置文件,由于对配置文件中的全部配置参数进行了标注,因而可以克服相关技术中的数据丢失或缺失的问题,从而可以提高配置文件更新的准确性。The update unit 920 updates all the configuration parameters in the first configuration file obtained by the configuration parameter acquisition unit 910 according to the pre-generated annotation information, and then the second configuration file generation unit 930 generates a second configuration file according to the update processing result, Since all configuration parameters in the configuration file are annotated, the problem of data loss or deletion in related technologies can be overcome, thereby improving the accuracy of configuration file updates.
在一种可能的实现方式中,配置文件更新装置还包括:标注信息生成单元,该标注信息生成单元用于根据更新需求信息和上述全部配置参数生成标注信息,上述更新需求信息指示第二配置文件中的配置参数及其更新需求。In a possible implementation, the configuration file updating device further includes: an annotation information generating unit, the annotation information generating unit is configured to generate annotation information according to the update requirement information and all the above configuration parameters, the above update requirement information indicates the second configuration file Configuration parameters and their update requirements.
在一种可能的实现方式中,配置文件更新装置还包括:格式转换单元,用于将上述第一配置文件、标注信息、更新需求信息转换为程序可识别的格式。In a possible implementation, the configuration file updating device further includes: a format conversion unit configured to convert the first configuration file, annotation information, and update requirement information into a program-recognizable format.
在具体实施过程中,上述更新策略包括:废弃、使用当前值、使用更新值、基于当前值为优先级的当前值和更新值的并集、基于更新值为优先级的当前值和更新值的并集等。In the specific implementation process, the above update strategies include: discard, use the current value, use the updated value, the union of the current value and the updated value based on the current value as the priority, and the combination of the current value and the updated value based on the updated value as the priority. Union etc.
当第一配置参数的更新策略为废弃时,根据上述更新需求信息生成该第一配置参数的标注信息为废弃,在更新完成后,该第一配置参数未包含在第二配置文件中。When the update policy of the first configuration parameter is discarded, the annotation information of the first configuration parameter generated according to the above update requirement information is discarded. After the update is completed, the first configuration parameter is not included in the second configuration file.
本申请实施例中的配置文件更新装置可以是装置,也可以是终端中的部 件、集成电路、或芯片。该装置可以是移动终端,也可以为非移动终端,本申请实施例不作具体限定。The configuration file updating device in the embodiment of the present application may be a device or a part in the terminal. components, integrated circuits, or chips. The device may be a mobile terminal or a non-mobile terminal, which is not specifically limited in the embodiments of this application.
本申请实施例中的配置文件更新装置900可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The configuration file updating device 900 in the embodiment of the present application may be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的配置文件更新装置能够实现上述方法实施例中终端实现的各个过程,并达到相同的技术效果,为避免重复,这里不再赘述。The configuration file updating device provided by the embodiment of the present application can implement each process implemented by the terminal in the above method embodiment, and achieve the same technical effect. To avoid duplication, the details will not be described here.
可选的,如图10所示,本申请实施例还提供一种电子设备1000,包括处理器1010和存储器1020,在存储器1020上存储有可在所述处理器1010上运行的程序或指令,例如,该电子设备1000为终端时,该程序或指令被处理器1010执行时实现上述配置文件更新方法实施例的各个过程,且能达到相同的技术效果。为避免重复,这里不再赘述。Optionally, as shown in Figure 10, this embodiment of the present application also provides an electronic device 1000, which includes a processor 1010 and a memory 1020. The memory 1020 stores programs or instructions that can be run on the processor 1010. For example, when the electronic device 1000 is a terminal, when the program or instruction is executed by the processor 1010, each process of the above configuration file update method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述配置文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the above configuration file update method embodiment is implemented, and can achieve The same technical effects will not be repeated here to avoid repetition.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage media includes computer-readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disks or optical disks, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述配置文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the above embodiment of the configuration file update method. Each process can achieve the same technical effect. To avoid repetition, we will not go into details here.
进一步地,本申请实施例还提供了一种计算机程序产品,该计算机程 序产品包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现上述配置文件更新方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Further, embodiments of the present application also provide a computer program product, the computer program The program product includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, each of the above configuration file updating method embodiments is implemented. The process can achieve the same technical effect. To avoid repetition, it will not be described again here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限,按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited. Functions are performed in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. To perform the functions, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。 The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.

Claims (10)

  1. 一种配置文件更新方法,包括:A configuration file update method, including:
    获取第一配置文件中的全部配置参数;Get all configuration parameters in the first configuration file;
    根据预先生成的标注信息对每个配置参数进行更新处理,所述标注信息用于指示每个配置参数的更新策略;Update each configuration parameter according to pre-generated annotation information, where the annotation information is used to indicate the update strategy of each configuration parameter;
    根据所述更新处理的结果生成第二配置文件。A second configuration file is generated according to the result of the update process.
  2. 根据权利要求1所述的配置文件更新方法,其中,所述标注信息通过如下方式生成:The configuration file updating method according to claim 1, wherein the annotation information is generated in the following manner:
    根据更新需求信息和所述全部配置参数生成标注信息,所述更新需求信息指示所述第二配置文件中的配置参数及其更新需求。Annotation information is generated based on the update requirement information and all configuration parameters, where the update requirement information indicates the configuration parameters in the second configuration file and their update requirements.
  3. 根据权利要求2所述的配置文件更新方法,其中,在根据预先生成的标注信息对每个配置参数进行更新处理之前,所述方法还包括:The configuration file updating method according to claim 2, wherein before updating each configuration parameter according to the pre-generated annotation information, the method further includes:
    将所述第一配置文件、所述标注信息、所述更新需求信息转换为程序可识别的格式。Convert the first configuration file, the annotation information, and the update requirement information into a program-recognizable format.
  4. 根据权利要求2所述的配置文件更新方法,其中,所述更新策略包括:废弃,当第一配置参数为废弃时,根据更新需求信息和所述全部配置参数生成标注信息包括:The configuration file updating method according to claim 2, wherein the update strategy includes: discarding, and when the first configuration parameter is discarded, generating annotation information according to the update requirement information and the all configuration parameters includes:
    根据所述更新需求信息生成所述第一配置参数的标注信息为废弃,其中,所述第一配置参数未包含在所述第二配置文件中。Generating the annotation information of the first configuration parameter according to the update requirement information is discarded, wherein the first configuration parameter is not included in the second configuration file.
  5. 根据权利要求1所述的配置文件更新方法,其中,所述更新策略还包括以下之一:使用当前值、使用更新值、基于当前值为优先级的当前值和更新值的并集、基于更新值为优先级的当前值和更新值的并集。The configuration file update method according to claim 1, wherein the update strategy further includes one of the following: using the current value, using the updated value, based on the current value as the union of the current value and the updated value of the priority, based on the updated value. The value is the union of the current value and the updated value of the priority.
  6. 一种配置文件更新装置,其中,所述装置包括:A configuration file updating device, wherein the device includes:
    配置参数获取单元,用于获取第一配置文件中的全部配置参数;A configuration parameter acquisition unit, used to acquire all configuration parameters in the first configuration file;
    更新单元,用于根据预先生成的标注信息对每个配置参数进行更新处理,所述标注信息用于指示每个配置参数的更新策略; An update unit, configured to update each configuration parameter according to pre-generated annotation information, where the annotation information is used to indicate an update strategy for each configuration parameter;
    第二配置文件生成单元,用于根据所述更新处理的结果生成第二配置文件。A second configuration file generating unit is configured to generate a second configuration file according to the result of the update process.
  7. 根据权利要求6所述的配置文件更新装置,其中,所述装置包括:标注信息生成单元,The configuration file updating device according to claim 6, wherein the device includes: a label information generating unit,
    所述标注信息生成单元用于根据更新需求信息和所述全部配置参数生成标注信息,所述更新需求信息指示所述第二配置文件中的配置参数及其更新需求。The annotation information generating unit is configured to generate annotation information according to update requirement information and all configuration parameters, where the update requirement information indicates the configuration parameters in the second configuration file and their update requirements.
  8. 根据权利要求7所述的配置文件更新装置,其中,所述装置还包括:The configuration file updating device according to claim 7, wherein the device further includes:
    格式转换单元,用于将所述第一配置文件、所述标注信息、所述更新需求信息转换为程序可识别的格式。A format conversion unit configured to convert the first configuration file, the annotation information, and the update requirement information into a program-recognizable format.
  9. 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-5任一项所述的配置文件更新方法的步骤。An electronic device, including a processor and a memory. The memory stores programs or instructions that can be run on the processor. When the program or instructions are executed by the processor, the implementation of any one of claims 1-5 is achieved. The steps of the described configuration file update method.
  10. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-5任一项所述的配置文件更新方法的步骤。 A readable storage medium on which a program or instructions are stored. When the program or instructions are executed by a processor, the steps of the configuration file updating method according to any one of claims 1 to 5 are implemented.
PCT/CN2023/111451 2022-08-24 2023-08-07 Configuration file updating method and apparatus, electronic device and readable storage medium WO2024041358A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211016851.6A CN117667129A (en) 2022-08-24 2022-08-24 Configuration file updating method and device, electronic equipment and readable storage medium
CN202211016851.6 2022-08-24

Publications (1)

Publication Number Publication Date
WO2024041358A1 true WO2024041358A1 (en) 2024-02-29

Family

ID=90012499

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/111451 WO2024041358A1 (en) 2022-08-24 2023-08-07 Configuration file updating method and apparatus, electronic device and readable storage medium

Country Status (2)

Country Link
CN (1) CN117667129A (en)
WO (1) WO2024041358A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160291965A1 (en) * 2014-01-02 2016-10-06 Tencent Technology (Shenzhen) Company Limited Method, device and system for updating software configuration parameters
CN108733639A (en) * 2018-04-09 2018-11-02 中国平安人寿保险股份有限公司 A kind of configuration parameter regulation means, device, terminal device and storage medium
CN111831325A (en) * 2020-07-17 2020-10-27 中国工商银行股份有限公司 Method, device, system and medium for updating configuration file in application
CN114090602A (en) * 2021-11-24 2022-02-25 中国海洋石油集团有限公司 Configuration file updating method and device, server and storage medium
US20220100490A1 (en) * 2019-01-18 2022-03-31 Samsung Electronics Co., Ltd. Firmware updating method, and electronic apparatus and storage media for same
CN114721681A (en) * 2022-03-21 2022-07-08 中国银行股份有限公司 Configuration file updating method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160291965A1 (en) * 2014-01-02 2016-10-06 Tencent Technology (Shenzhen) Company Limited Method, device and system for updating software configuration parameters
CN108733639A (en) * 2018-04-09 2018-11-02 中国平安人寿保险股份有限公司 A kind of configuration parameter regulation means, device, terminal device and storage medium
US20220100490A1 (en) * 2019-01-18 2022-03-31 Samsung Electronics Co., Ltd. Firmware updating method, and electronic apparatus and storage media for same
CN111831325A (en) * 2020-07-17 2020-10-27 中国工商银行股份有限公司 Method, device, system and medium for updating configuration file in application
CN114090602A (en) * 2021-11-24 2022-02-25 中国海洋石油集团有限公司 Configuration file updating method and device, server and storage medium
CN114721681A (en) * 2022-03-21 2022-07-08 中国银行股份有限公司 Configuration file updating method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN117667129A (en) 2024-03-08

Similar Documents

Publication Publication Date Title
US11080493B2 (en) Translation review workflow systems and methods
US7254593B2 (en) System and method for tracking annotations of data sources
US8997041B2 (en) Method of managing script, server performing the same and storage media storing the same
CN108762743B (en) Data table operation code generation method and device
WO2012034440A1 (en) Method and device for generating database upgrading script
US10891430B2 (en) Semi-automated methods for translating structured document content to chat-based interaction
RU2618930C2 (en) Method and device for electronic document data updating
CN105302786B (en) The edit methods and device of data
US10394756B2 (en) System and method for customizing archive of a device driver generator tool for a user
US10282174B2 (en) Software layout processing localization
CN114489950A (en) Component adapting method and device, electronic equipment and storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN108694172B (en) Information output method and device
WO2024041358A1 (en) Configuration file updating method and apparatus, electronic device and readable storage medium
US9465687B2 (en) Information processing apparatus and information processing method
WO2011116717A2 (en) Method for generating the customization datum and apparatus thereof
Le Zou et al. On synchronizing with web service evolution
CN105117472A (en) Generation system and introduction system for incremental file
WO2021042532A1 (en) Database information analysis method and apparatus, computer apparatus, and storage medium
CN109684437B (en) Content alignment method, device, storage medium and equipment for file comparison
CN111523294A (en) PDF file-based comment separation processing method and device
WO2023162260A1 (en) Environment construction assistance device, system, and method, and computer-readable medium
CN110955687B (en) Data modification method and device
US20220214996A1 (en) Information importing method and apparatus
Lynch et al. Analyzing and Normalizing Illinois Digital Heritage Hub Type Metadata

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23856448

Country of ref document: EP

Kind code of ref document: A1