CN114706619A - Configuration information processing method and device, electronic equipment and storage medium - Google Patents

Configuration information processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114706619A
CN114706619A CN202011486851.3A CN202011486851A CN114706619A CN 114706619 A CN114706619 A CN 114706619A CN 202011486851 A CN202011486851 A CN 202011486851A CN 114706619 A CN114706619 A CN 114706619A
Authority
CN
China
Prior art keywords
configuration
class
preset
information
variable
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011486851.3A
Other languages
Chinese (zh)
Inventor
张磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN202011486851.3A priority Critical patent/CN114706619A/en
Publication of CN114706619A publication Critical patent/CN114706619A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a method and a device for processing configuration information, electronic equipment and a storage medium, wherein the method comprises the following steps: transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class; analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values; and calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager. The service codes for executing the specific configuration processing logic are extracted and packaged into the preset configuration manager, so that the code coupling degree can be reduced, the code maintainability is improved, the application starting speed is increased, the situation that the application cannot be opened is avoided, and the user experience is improved.

Description

Configuration information processing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for processing configuration information, electronic equipment and a storage medium.
Background
In a method for processing configuration information of an existing software Application (APP), a coupling degree of a configuration code and a start code is high. This is prone to the following technical problems: the code with high coupling degree is not beneficial to later maintenance; if any exception occurs in the data in the configuration code, the application cannot be opened; in addition, if the amount of data in the configuration code is large, the starting speed is also very slow, and the user experience is greatly influenced.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing configuration information, an electronic device, and a storage medium, which can reduce a code coupling degree, so as to improve code maintainability, improve application starting speed, avoid a situation that an application cannot be opened, and improve user experience.
In a first aspect, an embodiment of the present invention provides a method for processing configuration information, including:
transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class;
analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values;
and calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager.
In a second aspect, an embodiment of the present invention provides an apparatus for processing configuration information, including:
the system comprises a transmitting module, a receiving module and a processing module, wherein the transmitting module is used for transmitting a preset generic parameter class into a preset configuration class, and annotation information is correspondingly marked on variables in the generic parameter class;
the analysis module is used for analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values and generating instantiated configuration information according to the variable values;
and the logic processing module is used for calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for processing configuration information according to the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present invention provide a storage medium containing computer-executable instructions, which when executed by a computer processor implement the method for processing configuration information as described in the first aspect above.
The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for processing configuration information, wherein the method comprises the following steps: transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class; analyzing variables in the generic parameter class based on the annotation information through a preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values; and calling the preset configuration manager through the preset configuration class so as to execute the configuration processing logic according to the instantiated configuration information through the preset configuration manager. The service codes for executing the specific configuration processing logic are extracted and packaged into the preset configuration manager, so that the code coupling degree can be reduced, the code maintainability is improved, the application starting speed is increased, the situation that the application cannot be opened is avoided, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present invention and the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a configuration information processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a configuration information processing apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the technical solutions of the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a flowchart illustrating a method for processing configuration information according to an embodiment of the present invention. The method for processing configuration information disclosed in this embodiment is applicable to the processing situation of configuration information of an application, for example, the situation of instantiating a configuration file in a video application and performing processing such as persisting or cleaning on the instantiated configuration file. The method for processing configuration information disclosed in this embodiment may be executed by a device for processing configuration information (which may be simply referred to as a processing device), which may be implemented by hardware and/or hardware and may be configured in an electronic device, such as a smart phone, a computer, and the like.
Referring to fig. 1, the method for processing configuration information includes the following steps:
s110, transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class.
In this embodiment, the generic parameter class is preset as a pre-defined parameter class, and the compatibility of the parameter variable type in the parameter class can be improved by defining the parameter class as the generic class. The preset configuration class is a pre-defined configuration class, wherein the processing logic of the configuration information in the existing class can be rewritten through the defined configuration class, and the processing logic of the configuration information can be defined by the definition so as to realize the processing logic of instantiation, acquisition, data persistence, data cleaning and the like of the configuration information.
In this embodiment, the preset configuration class may be called in the boot code or some other specific code segment of the application. And when the preset configuration class is called, the preset generic parameter class can be used as a parameter to be entered so as to realize the processing logic of the configuration information. The annotation information marking is carried out on the variables in the generic parameter classes, so that the intelligent automatic analysis of the variables in the generic parameter classes is facilitated.
In some optional implementations, the step of presetting the generic parameter class includes: serializing the preset generic parameter classes through a serialization statement; defining variables in the generic parameter classes through variable definition statements of the global variable types; and marking the annotation information of the variables in the generic parameter class through marking sentences.
Taking video application as an example, the predefined sentence of the preset generic parameter class is described in detail, which may specifically be as follows:
Figure BDA0002839514250000041
Figure BDA0002839514250000051
the name of the preset generic parameter class can be defined as, but is not limited to, VodVideoConfig; the method comprises the following steps that a preset generic parameter class can be defined based on a native class definition method public class in the android; the definition statement can include a serialization statement implementers Serializable, and the VodVideoConfig class can be serialized through the serialization statement, so that remote communication of variable data in an object of a preset generic parameter class can be realized.
The variables defined in the preset generic parameter class may include, but are not limited to, a video upload switch variable videoupload switch and a video common channel list variable together channels. When defining variables, the variables are defined as global variable types by variable definition statements public of global variable types. Compared with the traditional scheme that the variable is set as the local variable class, the variable is set as the public type, so that the convenience of variable data access can be improved, and the data access efficiency of the variable data access can be improved.
Before the variable definition sentences public String video upload switch and public List < String > together channels, annotation information of the variables video upload switch and together channels in the generic parameter class can be annotated by annotation sentences @ JSONField (name ═ video upload switch) and @ JSONField (name ═ together channels), respectively. By marking annotation information, dynamic intelligent analysis of variable data based on the annotation information can be realized, and the analysis can also support the set type of List < String >.
In some further implementation manners, if the variable in the preset generic parameter class includes the switch information, the step of predefining the generic parameter class further includes: the switching information is determined by calling an equal determination function of the TextUtils class.
In these further embodiments, referring to the predefined statements of the preset generic parameter class in the above-mentioned video class application, the variables in the VodVideoConfig class contain the switch information videoUploadSwitch, at which time the videoUploadSwitch can be decided by calling the equal decision function textultals. The equal-determination function textutils. equals (), which can be used to determine whether the input parameters are equal, and correspondingly, textutils. equals (videoUploadSwitch, "1") to determine whether the switch information of the videoUploadSwitch is equal to "1".
Compared with the traditional scheme that the switch is judged after the data is subjected to the forced type conversion, the judgment logic of the switch under the non-forced type conversion can be effectively realized through an internal definition method public boilan isovideoupload () and calling of a TextUtils.
And S120, analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values.
In this embodiment, parsing logic codes may be defined in the preset configuration class, so as to dynamically parse variables in the generic parameter class based on the annotation information. And, instantiated configuration information may be generated by injecting parsed variable values into configuration variables. The intelligent analysis function of the variable data is realized through an annotation mode, and the value information can be dynamically analyzed and injected into the variable.
Illustratively, when the annotation information @ JSONField (name ═ is) acts on a Field, its name not only defines the name of the input key, but also defines the name of the output; and then analyzing the variables by a get or set method, and injecting the analyzed variables into the configuration variables by an assignment method to generate instantiated configuration information.
S130, calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager.
In this embodiment, the specific configuration processing logic may be encapsulated and extracted to form the configuration manager. By calling the configuration manager in the preset configuration class, the processing logic of the instantiated configuration information through the preset configuration manager can be realized, high-cohesion low-coupling between the configuration code and the processing logic code is facilitated, so that the code maintainability can be improved, the application starting speed is increased, the situation that the application cannot be opened is avoided, and the user experience is improved.
In some optional implementations, the preset configuration class is inherited from the base configuration class; correspondingly, calling the preset configuration manager through the preset configuration class includes: and calling a configuration processing logic corresponding to the service method in the preset configuration manager through the service method in the duplicated basic configuration class in the preset configuration class.
Taking a video application as an example, the predefined statements of the preset configuration class are described in detail, which may specifically be as follows:
Public class VodVideoConfigIni extends BaseStaticConfigInit<VodVideoConfig>;
the name of the preset configuration class may be, but is not limited to, VodVideoConfigIni; wherein, the preset configuration class can inherit the BaseStatic ConfigInit basic configuration class through the extensions statement; wherein, the VodVideoConfig can characterize the incoming preset generic parameters.
Since the preset configuration class VodVideoConfigIni class inherits basestatconfiginit, a part of service methods in the base configuration class basestatconfiginit can be rewritten in the preset configuration class vodvideoconfignini. The preset configuration class vodvideoconfigugini duplicate service method may include, but is not limited to, a configuration cleaning method onConfigOffline and a configuration persistence method cacheDataToLocal. The onConfigOffline method can be a function which is called back by the system when the configuration needs to be cleaned; the cacheDataToLocal method may be logic that selectively persists data after instantiation of a configuration.
Taking the onConfigOffline and cacheDataToLocal service method as an example, the preset configuration class may specifically be:
@Override
public void onConfigOffline(){};
@Override
public void cacheDataToLocal(VodVideoConfig object,String data){};
in the conventional scheme, after the business method is duplicated, writing of business logic is directly started, so that the high coupling between the business logic and the duplication method is caused, and the high-cohesion low-coupling target cannot be achieved. In order to solve the problem, in these optional embodiments, configuration processing logic corresponding to each service method may be defined in the preset configuration manager, and the corresponding configuration processing logic in the preset configuration manager may be called through the duplicated service method in the preset configuration class, so as to achieve the goal of high-aggregation low-coupling efficiently.
Illustratively, the following statement may be called in public void onConfigOffline () { }toimplement the configuration cleaning logic: vodveoconfigmgr. getself (). clearConfig (); in public void cache datalocal (VodVideoConfig object, String data) { } the following statement can be called to implement configuration persistence logic: vodveoconfigmgr. getself (). saveconfig (data). The vod videoconfigmgr may represent a preset configuration manager class, where the configuration cleaning logic clearConfig () and the configuration persistence logic saveConfig () in the vod videoconfigmgr class are specifically described below.
In some alternative implementations, the step of obtaining the object by the configuration manager includes: defining a configuration manager class through a variable definition statement of a static global variable type; and acquiring the configuration manager object by a method of statically acquiring the self object.
Taking a video application as an example, the statements obtained by the object of the configuration manager are described in detail, which may specifically be as follows:
Figure BDA0002839514250000091
in these alternative implementations, the configuration manager class may be defined based on the native class definition method public class in android, and the name of the defined configuration manager class may be, but is not limited to, VodVideoConfigMgr. In the VodVideoConfigMgr class, a static global variable self may first be defined by public static and may be defined by a self-new VodVideoConfigMgr () statement that is equal to the VodVideoConfigMgr class itself; then, a static getSelf () method for obtaining the self-object can be defined through public static, and the self-object can be returned through a return self method inside the getSelf method, so as to quickly obtain a unique object of the class.
In some optional implementations, if the configuration processing logic is configuration persistence logic, executing the configuration processing logic includes: judging whether the instantiated configuration information is empty or not through an empty judgment function of the TextUtils class; if not, obtaining a key value storage variable in the application, and storing the instantiated configuration information as value information in the key value storage variable.
In these alternative embodiments, if the configuration processing logic is the configuration persistence logic saveConfig (), the specific statements for configuring the persistence logic may be as follows:
Figure BDA0002839514250000092
Figure BDA0002839514250000101
wherein, the parameter of entering into the saveConfig (String config) is the config of String type, and the config can be used to characterize the instantiated configuration information. When executing the configuration processing logic, firstly, whether the instantiated configuration information config is empty can be judged through an empty judgment function TextUtils.isEmpty (config) of a native TextUtils class, so that abnormal behaviors caused by the empty configuration information are avoided, and the safety of data is effectively guaranteed; then, the instantiated configuration information can be returned through an if () statement when the instantiated configuration information is judged not to be empty; then, a DYKV () statement is called to obtain a key-value storage variable dyky in the application, where the type of the key-value storage variable dyky is related to the application, for example, the type may be a DYKV type; finally, the instantiated configuration information CONFIG may be stored as the value information in the dykv structure by calling a dykv. Here, the key information in the key-value storage variable dyky may be, but is not now, represented by MMKV _ CONFIG _ DATA.
In some optional implementations, if the configuration processing logic is a configuration clearing logic, the executing the configuration processing logic includes: and acquiring a key value storage variable in the application, and emptying the instantiated configuration information in the key value storage variable.
In these alternative embodiments, if the configuration processing logic is the configuration cleaning logic clearConfig (), the specific statements of the configuration cleaning logic may be as follows:
public void clearConfig(){
DYKV dykv=DYKV.getKV();
dykv.clearAll();
};
when executing the configuration processing logic, firstly, a DYKV — getkv () statement may be called to obtain a key-value storage variable dyky in an application; clearall () statements can then be invoked to clear instantiated configuration information in the key-value store variable.
It should be noted that in this embodiment and some alternative embodiments, only by taking a video-class application as an example, the steps of presetting a generic parameter class, presetting a configuration class, predefining a configuration manager, and the like are exemplarily described, and relevant steps in other types of applications may be adaptively adjusted according to the description, which is not listed here.
In the method for processing configuration information provided in this embodiment, a preset generic parameter class is transmitted into a preset configuration class, where a variable in the generic parameter class is marked with annotation information correspondingly; analyzing variables in the generic parameter class based on the annotation information through a preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values; and calling the preset configuration manager through the preset configuration class so as to execute the configuration processing logic according to the instantiated configuration information through the preset configuration manager. The service codes for executing the specific configuration processing logic are extracted and packaged into the preset configuration manager, so that the code coupling degree can be reduced, the code maintainability is improved, the application starting speed is increased, the situation that the application cannot be opened is avoided, and the user experience is improved.
Example two
Fig. 2 is a schematic structural diagram of a configuration information processing apparatus according to a second embodiment of the present invention. The queuing and playing device provided by the embodiment of the invention can be suitable for the processing situation of the configuration information of the application, such as the situation of instantiating the configuration file in the video application and the situation of processing the instantiating configuration file such as persistence or cleaning.
Referring to fig. 2, the apparatus for processing configuration information includes:
an import module 210, configured to import a preset generic parameter class into a preset configuration class, where a variable in the generic parameter class is correspondingly marked with annotation information;
the parsing module 220 is configured to parse the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values, and generate instantiated configuration information according to the variable values;
the logic processing module 230 is configured to call the preset configuration manager through the preset configuration class, so as to execute the configuration processing logic according to the instantiated configuration information through the preset configuration manager.
In some optional embodiments, the apparatus for processing configuration information may further include:
the first definition module is used for serializing the preset generic parameter classes through a serialization statement; defining variables in the generic parameter classes through variable definition statements of the global variable types; and marking the annotation information of the variables in the generic parameter class through marking sentences.
In some optional embodiments, if the variable in the preset generic parameter class includes switch information, the first defining module is further configured to:
the switching information is determined by calling an equal determination function of the TextUtils class.
In some alternative embodiments, the preset configuration class is inherited from the base configuration class; correspondingly, the logic processing module is specifically configured to:
and calling a configuration processing logic corresponding to the service method in the preset configuration manager through the service method in the duplicated basic configuration class in the preset configuration class.
In some optional embodiments, the apparatus for processing configuration information may further include:
the second definition module is used for defining the configuration manager class through a variable definition statement of the static global variable type; and acquiring the configuration manager object by a method of statically acquiring the self object.
In some optional embodiments, if the configuration processing logic is the configuration persistence logic, the logic processing module is specifically configured to:
judging whether the instantiated configuration information is empty or not through an empty judgment function of the TextUtils class;
if not, acquiring a key value storage variable in the application, and storing the instantiated configuration information as value information in the key value storage variable.
In some optional embodiments, if the configuration processing logic is a configuration cleaning logic, the logic processing module is specifically configured to:
and acquiring a key value storage variable in the application, and emptying the instantiated configuration information in the key value storage variable.
The device for processing configuration information provided by the embodiment of the invention can execute the method for processing configuration information provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail, reference may be made to a method for processing configuration information provided in any embodiment of the present invention.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. FIG. 3 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing any of the embodiments of the present invention. The electronic device 12 shown in fig. 3 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention. The device 12 is typically an electronic device that undertakes the processing of configuration information.
As shown in FIG. 3, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples the various components (including the memory 28 and the processing unit 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer-readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer device readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 3, and commonly referred to as a "hard drive"). Although not shown in FIG. 3, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product 40, with program product 40 having a set of program modules 42 configured to carry out the functions of embodiments of the invention. Program product 40 may be stored, for example, in memory 28, and such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each of which and some combination of which may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, mouse, camera, etc., and display), one or more devices that enable a user to interact with electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) devices, tape drives, and data backup storage devices, to name a few.
The processor 16 executes various functional applications and data processing by executing programs stored in the memory 28, for example, implementing a processing method of configuration information provided by the above-described embodiment of the present invention, the method including:
transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class; analyzing variables in the generic parameter class based on the annotation information through a preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values; and calling the preset configuration manager through the preset configuration class so as to execute the configuration processing logic according to the instantiated configuration information through the preset configuration manager.
Of course, those skilled in the art can understand that the processor may also implement the technical solution of the method for processing configuration information provided in any embodiment of the present invention.
Example four
The fourth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for processing configuration information, where the method includes:
transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class; analyzing variables in the generic parameter class based on the annotation information through a preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values; and calling the preset configuration manager through the preset configuration class so as to execute the configuration processing logic according to the instantiated configuration information through the preset configuration manager.
Of course, the computer program stored on the computer-readable storage medium provided in the embodiments of the present invention is not limited to the above method operations, and may also perform related operations in the method for processing configuration information provided in any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.

Claims (10)

1. A method for processing configuration information is characterized by comprising the following steps:
transmitting a preset generic parameter class into a preset configuration class, wherein annotation information is correspondingly marked on variables in the generic parameter class;
analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values, and generating instantiated configuration information according to the variable values;
and calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager.
2. The method according to claim 1, wherein the step of pre-defining the predefined generic parameter classes comprises:
serializing the preset generic parameter classes through serialization statements;
defining variables in the generic parameter classes through variable definition statements of global variable types;
and marking the annotation information of the variables in the generic parameter classes through marking sentences.
3. The method according to claim 2, wherein the step of predefining the predefined generic parameter class if the variable in the predefined generic parameter class contains switching information further comprises:
the switch information is determined by calling an equal determination function of the TextUtils class.
4. The method of claim 1, wherein the pre-set configuration class is inherited from a base configuration class; correspondingly, the calling the preset configuration manager through the preset configuration class includes:
and calling a configuration processing logic corresponding to the service method in a preset configuration manager through the service method in the basic configuration class which is duplicated in the preset configuration class.
5. The method of claim 1, wherein the configuration manager object obtaining step comprises:
defining a configuration manager class through a variable definition statement of a static global variable type;
and acquiring the configuration manager object by a method of statically acquiring the self object.
6. The method of claim 1, wherein if the configuration processing logic is configuration persistence logic, the executing the configuration processing logic comprises:
judging whether the instantiated configuration information is null or not through a null judgment function of the TextUtils class;
if not, obtaining a key value storage variable in the application, and storing the instantiated configuration information as value information in the key value storage variable.
7. The method of claim 1, wherein if the configuration processing logic is configuration cleanup logic, the executing the configuration processing logic comprises:
obtaining a key value storage variable in an application, and emptying the instantiated configuration information in the key value storage variable.
8. An apparatus for processing configuration information, comprising:
the system comprises an input module, a configuration module and a processing module, wherein the input module is used for inputting a preset generic parameter class into a preset configuration class, and annotation information is correspondingly marked on variables in the generic parameter class;
the analysis module is used for analyzing the variables in the generic parameter class based on the annotation information through the preset configuration class to obtain variable values and generating instantiated configuration information according to the variable values;
and the logic processing module is used for calling a preset configuration manager through the preset configuration class so as to execute configuration processing logic according to the instantiated configuration information through the preset configuration manager.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of processing configuration information according to any one of claims 1-7 when executing the computer program.
10. A storage medium containing computer-executable instructions which, when executed by a computer processor, implement a method of processing configuration information according to any one of claims 1-7.
CN202011486851.3A 2020-12-16 2020-12-16 Configuration information processing method and device, electronic equipment and storage medium Pending CN114706619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011486851.3A CN114706619A (en) 2020-12-16 2020-12-16 Configuration information processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011486851.3A CN114706619A (en) 2020-12-16 2020-12-16 Configuration information processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114706619A true CN114706619A (en) 2022-07-05

Family

ID=82167488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011486851.3A Pending CN114706619A (en) 2020-12-16 2020-12-16 Configuration information processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114706619A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288893A1 (en) * 2006-06-08 2007-12-13 Microsoft Corporation Extending configuration sections in configuration
CN101667124A (en) * 2009-10-15 2010-03-10 上海宝信软件股份有限公司 System and method for configuring monitoring device based on object model
CN101706716A (en) * 2009-09-08 2010-05-12 南京师范大学 VO-based form customization, configuration and parsing operation method
CN104423983A (en) * 2013-08-29 2015-03-18 国际商业机器公司 Method and device for developing, testing and deploying application
US20150378694A1 (en) * 2014-06-26 2015-12-31 Oracle International Corporation Optimistically Assuming Types in a Dynamically Typed Language
CN106462414A (en) * 2014-04-22 2017-02-22 甲骨文国际公司 Dependency-driven co-specialization of specialized classes
CN107122203A (en) * 2017-03-20 2017-09-01 武汉斗鱼网络科技有限公司 The method to set up and device of a kind of configuration file
CN108259248A (en) * 2018-01-31 2018-07-06 泰康保险集团股份有限公司 The configuration method and device of queue management device
CN108415834A (en) * 2018-02-12 2018-08-17 平安科技(深圳)有限公司 Explain rear end method of calibration, device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070288893A1 (en) * 2006-06-08 2007-12-13 Microsoft Corporation Extending configuration sections in configuration
CN101706716A (en) * 2009-09-08 2010-05-12 南京师范大学 VO-based form customization, configuration and parsing operation method
CN101667124A (en) * 2009-10-15 2010-03-10 上海宝信软件股份有限公司 System and method for configuring monitoring device based on object model
CN104423983A (en) * 2013-08-29 2015-03-18 国际商业机器公司 Method and device for developing, testing and deploying application
CN106462414A (en) * 2014-04-22 2017-02-22 甲骨文国际公司 Dependency-driven co-specialization of specialized classes
US20150378694A1 (en) * 2014-06-26 2015-12-31 Oracle International Corporation Optimistically Assuming Types in a Dynamically Typed Language
CN107122203A (en) * 2017-03-20 2017-09-01 武汉斗鱼网络科技有限公司 The method to set up and device of a kind of configuration file
CN108259248A (en) * 2018-01-31 2018-07-06 泰康保险集团股份有限公司 The configuration method and device of queue management device
CN108415834A (en) * 2018-02-12 2018-08-17 平安科技(深圳)有限公司 Explain rear end method of calibration, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
KIMI-FATHER: "关于spring yml文件动态配置的各种注入方式", pages 1 - 3, Retrieved from the Internet <URL:https://www.cnblogs.com/IT-TOP/p/10599475.html> *

Similar Documents

Publication Publication Date Title
CN108984174B (en) Cross-platform application creation method, device, server and storage medium
CN109300179B (en) Animation production method, device, terminal and medium
EP3971706A2 (en) Method, apparatus and electronic device for deploying operator in deep learning frame work
US20190243912A1 (en) Rapid design, development, and reuse of blockchain environment and smart contracts
CN113296786B (en) Data processing method, device, electronic equipment and storage medium
CN110489310B (en) Method and device for recording user operation, storage medium and computer equipment
CN104346148A (en) Method, device and system for acquiring program performance consumption information
CN111124371A (en) Game-based data processing method, device, equipment and storage medium
CN111954072B (en) Multimedia playing method, device, multimedia player and medium
CN113111131B (en) Method and system for achieving Neo4j data synchronization based on Flink, and integration method and device
CN108595331B (en) Asynchronous interface testing method, medium, device and computing equipment
CN113127050A (en) Application resource packaging process monitoring method, device, equipment and medium
CN116360735A (en) Form generation method, device, equipment and medium
CN116244387A (en) Entity relationship construction method, device, electronic equipment and storage medium
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
EP3519964B1 (en) Electronic apparatus for recording debugging information and control method thereof
CN110045952B (en) Code calling method and device
US20090328001A1 (en) Unloadable managed code
CN109408057B (en) Method, device, medium and computing equipment for automatically generating codes
CN113377342A (en) Project construction method and device, electronic equipment and storage medium
CN111222323A (en) Word slot extraction method, word slot extraction device and electronic equipment
US9201937B2 (en) Rapid provisioning of information for business analytics
CN114706619A (en) Configuration information processing method and device, electronic equipment and storage medium
CN114911541A (en) Configuration information processing method and device, electronic equipment and storage medium
CN113760317A (en) Page display method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination