CN111694586A - Program initialization method, program initialization device, terminal device, and storage medium - Google Patents

Program initialization method, program initialization device, terminal device, and storage medium Download PDF

Info

Publication number
CN111694586A
CN111694586A CN202010503277.1A CN202010503277A CN111694586A CN 111694586 A CN111694586 A CN 111694586A CN 202010503277 A CN202010503277 A CN 202010503277A CN 111694586 A CN111694586 A CN 111694586A
Authority
CN
China
Prior art keywords
parameter
target
program
target parameter
initialization
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
CN202010503277.1A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010503277.1A priority Critical patent/CN111694586A/en
Publication of CN111694586A publication Critical patent/CN111694586A/en
Priority to PCT/CN2020/123756 priority patent/WO2021114902A1/en
Pending legal-status Critical Current

Links

Images

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
    • 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

Abstract

The application is applicable to the technical field of research and development management, and provides a program initialization method, a program initialization device, a terminal device and a computer storage medium, which comprise the following steps: acquiring a first target parameter in a target program, wherein the first target parameter is an initialization parameter with a preset identifier; searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database; and initializing the target program according to the parameter value of the second target parameter. By the method, the flexible configuration of the program initialization parameters is effectively realized.

Description

Program initialization method, program initialization device, terminal device, and storage medium
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to a program initialization method, a program initialization apparatus, a terminal device, and a computer storage medium.
Background
Program initialization is the process of initializing initialization parameters (e.g., data objects or variables) in a program before the program runs. In the prior art, the initial parameter value is usually written directly into the corresponding parameter position in the program.
However, in practical applications, situations are often encountered where parameter values need to be changed. In this case, in the prior art, it is necessary to modify the parameter values of the initialization parameters in the program one by one, and then reissue the new version of the program. Therefore, the existing program initialization process cannot flexibly configure parameters, resulting in poor program practicability.
Disclosure of Invention
The embodiment of the application provides a program initialization method, a program initialization device, a terminal device and a computer storage medium, which can effectively realize flexible configuration of program initialization parameters.
In a first aspect, an embodiment of the present application provides a program initialization method, including:
acquiring a first target parameter in a target program, wherein the first target parameter is an initialization parameter with a preset identifier;
searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database;
and initializing the target program according to the parameter value of the second target parameter.
In a possible implementation manner of the first aspect, before acquiring the initialization parameter with the preset identifier in the target program, the method further includes:
acquiring initialization parameters in the target program, and acquiring parameters to be configured in the initialization parameters, wherein the parameters to be configured are configurable parameters in the initialization parameters;
adding the preset identification to each parameter to be configured to obtain the first target parameter;
adding the first target parameter to the configuration table of the preset database.
In a possible implementation manner of the first aspect, the method further includes:
when a parameter modification instruction is monitored, acquiring parameter information in the parameter modification instruction, wherein the parameter information comprises a parameter name and a parameter modification value;
and searching a third target parameter corresponding to the parameter name in the configuration table of the preset database, and replacing the parameter value of the third target parameter with the parameter modification value.
In a possible implementation manner of the first aspect, the initializing the target program according to the parameter value of the second target parameter includes:
acquiring a parameter value of the first target parameter, and comparing the parameter value of the first target parameter with a parameter value of the second target parameter;
and if the parameter value of the first target parameter is the same as the parameter value of the second target parameter, initializing the target program according to the parameter value of the first target parameter.
In a possible implementation manner of the first aspect, the initializing the target program according to the parameter value of the second target parameter includes:
acquiring a parameter value of the first target parameter, and comparing the parameter value of the first target parameter with a parameter value of the second target parameter;
if the parameter value of the first target parameter is different from the parameter value of the second target parameter, updating the parameter value of the first target parameter by using the parameter value of the second target parameter, and initializing the target program according to the updated parameter value of the first target parameter.
In a possible implementation manner of the first aspect, the updating the parameter value of the first target parameter by using the parameter value of the second target parameter includes:
generating a byte code file with a preset format for the parameter value of the second target parameter, wherein the preset format is the same as the format of the parameter value of the first target parameter;
and loading the byte code file to the position of the first target parameter in the target program through a class loader.
In a possible implementation manner of the first aspect, after the preset identifier is added to each parameter to be configured, respectively, to obtain the first target parameter, the method further includes:
and uploading the first target parameter and the parameter value of the first target parameter to a block chain.
In a second aspect, an embodiment of the present application provides a program initialization apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first target parameter in a target program, and the first target parameter is an initialization parameter with a preset identifier;
the searching unit is used for searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database;
and the initialization unit is used for initializing the target program according to the parameter value of the first target parameter and the parameter value of the second target parameter.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the program initialization method according to any one of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and the embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program, when executed by a processor, implements the program initialization method according to any one of the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that:
the method and the device for initializing the target program obtain a first target parameter in the target program, namely an initialization parameter with a preset identifier, then search a second target parameter corresponding to the first target parameter from a configuration table of a preset database, and finally initialize the target program according to a parameter value of the second target parameter. Since the parameter value of the second target parameter in the preset database can be flexibly modified, the initialization parameter can be flexibly configured by modifying the parameter value of the second target parameter in the preset database in the process of initializing the target program according to the parameter value of the second target parameter. By the method, the flexible configuration of the program initialization parameters is effectively realized.
It is understood that the beneficial effects of the second to fourth aspects can be seen from the description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic diagram of a program initialization system provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a parameter configuration method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a program initialization method according to an embodiment of the present application;
fig. 4 is a block diagram of a program initialization device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when.. or" upon "or" in response to a determination "or" in response to a detection ".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise.
Referring to fig. 1, a schematic diagram of a program initialization system according to an embodiment of the present application is provided. As shown in fig. 1, by way of example and not limitation, the program initialization system includes a processor 101 and a storage medium 102 storing a preset database. The processor 101 is used to initialize and run a target program. The storage medium 102 is a device or device including a storage space, such as a usb disk, a removable hard disk random access memory, or a read only memory, and the preset database is stored in the storage space of the storage medium. The processor is communicatively coupled to the storage medium 102 so that the processor may retrieve information from the storage medium in a predetermined database. Of course, in practical applications, the preset database may also be stored in a storage space inside the processor.
In an application scenario, the interactive process of the program initialization method includes:
in the program development process, a processor acquires a preset identifier input by a user, and adds the preset identifier to an initialization parameter needing to be configured in a target program to obtain a first target parameter; and then adding the first target parameter to a configuration table of a preset database.
When the parameters need to be modified, the user modifies the parameter values of the second target parameters in the configuration table of the preset database, and sends parameter modification instructions to the processor after modification; after receiving the parameter modification instruction, the processor obtains parameter information (the parameter information includes a parameter name and a parameter modification value) in the parameter modification instruction, searches a third target parameter corresponding to the parameter name in the configuration table of the preset database, and replaces the parameter value of the third target parameter with the parameter modification value.
In the program initialization stage, a user sends an initialization instruction to a processor; after receiving the initialization instruction, the processor acquires a first target parameter (the first target parameter is an initialization parameter with a preset identifier) in a target program, and searches a second target parameter corresponding to the first target parameter from a configuration table of a preset database; and initializing the target program according to the parameter value of the second target parameter.
Although the initialized parameters in the developed target program cannot be changed, the user can modify the parameters in the preset database, and then initialize the target program according to the modified parameters in the preset database, so as to realize the flexible configuration of the initialized parameters of the program.
In practical applications, the parameter configuration process is usually performed in the program development stage. After the program is developed and before the program is run, a program initialization process is performed. The parameter configuration process and the program initialization process can be executed by different processors, or can be executed by the same processor in sequence. The procedure of parameter configuration is described below.
Referring to fig. 2, which is a schematic flow chart of a parameter configuration method provided in an embodiment of the present application, by way of example and not limitation, the method may include the following steps:
s201, acquiring initialization parameters in the target program, and acquiring parameters to be configured in the initialization parameters.
The target program is a development object, namely an application program in the development process. In the prior art, a set of applications may serve different users. For example: the administrative platform is an application system for administrative management, and can be used for managing administrative affairs of different companies, i.e. serving different company users. In practice, if a set of applications is developed for each user, the development workload is very large and is almost impossible to realize. Therefore, in general, during the development of the application program, the general program framework is fixed and invariable, but some configurable parameters may be set, so that the application program can be adapted to different users by modifying the parameters.
The initialization parameter is a parameter to be initialized during the initialization of the program, such as a data object or a variable in the program. The following are exemplary: during program initialization, there is a step of public static Stringname ═ PA 002. In the program initialization step, "name" is a common static variable, and "PA 002" is an initial value to be assigned to "name", that is, the variable "name" is assigned to "PA 002". Wherein "name" is an initialization parameter.
There are typically a number of initialization parameters in the program. One type of these initialization parameters is used for initializing the program framework, and the parameter value of this type of parameter is usually fixed, in other words, during the program initialization process, the initial value assigned to the program framework parameter is a fixed value (i.e. the initial value is the same at each initialization); some of the parameters are initialized for different users, and the parameter values of the parameters are usually changeable, i.e. configurable, in other words, the initial values assigned to the parameters are not fixed values during the program initialization (i.e. the initial values may be different from the previous values at each initialization). In the embodiment of the present application, the parameter to be configured in the initialization parameter refers to a configurable parameter in the initialization parameter.
S202, adding the preset identification to each parameter to be configured respectively to obtain the first target parameter.
The preset identifier may be preset according to actual needs, and is usually defined in the process of program development. The preset identifier is equivalent to a flag, and can be used to distinguish which parameters are parameters to be configured and which parameters do not belong to parameters to be configured (i.e., parameters not to be configured).
The preset identifier may be a predefined symbol added before or after the name of the parameter to be configured. For example, assuming that the preset identifier is "#", after the preset identifier is added to the parameter "name" to be configured, the parameter with the label is "# name". The preset identifier may also be embodied by changing the format of the name of the parameter to be configured. For example, assume that the name of the parameter to be configured is capital letter, and the name of the parameter not to be configured is lowercase letter. For example, in two parameters "NAME" and "time", NAME "is the parameter to be configured, and" time "is the parameter not to be configured. It should be noted that the representation form of the preset identifier may be other situations as long as the preset identifier can be used for distinguishing the parameter to be configured from the parameter not to be configured, and the representation form is not specifically limited.
In the process of adding the preset identifier, the preset identifier may be added only to the parameter to be configured. For example: assuming that the parameter "name" is a parameter to be configured, the parameter "time" is a parameter not to be configured, and the preset identifier is "#", only the preset identifier, i.e., "# name", is added to the "name", and the parameter not to be configured is still "time".
In the process of adding the preset identifier, identifiers may also be added to all initialization parameters, but different identifiers need to be set for the parameter to be configured and the parameter not to be configured. Illustratively, the parameter "name" is used to represent a user's code, such as: the public static String name ═ PA001 "indicates that the code of user a is PA001, and the public static String name ═ PA 002" indicates that the code of user B is PA 002. Since the encoding of the user may be changed, the parameter "name" belongs to the parameter to be configured, and then a preset tag may be added to the parameter "name", for example, adding @ myconstantconfig to the parameter name, that is, the parameter to be configured after adding the preset identifier is "name @ myconstantconfig". If a parameter does not belong to the parameter to be configured, @ ignorattr can be added to the parameter, for example, "time @ ignorattr" is obtained after adding @ ignore r to the parameter to be configured, "time". Thus, it can be distinguished by different marks which parameters are parameters to be configured and which parameters do not belong to the parameters to be configured. It should be noted that the foregoing is only an example of the preset identifier, and the content or the form of the preset identifier is not specifically limited.
S203, adding the first target parameter to the configuration table of the preset database.
The configuration table of the preset database is used for storing the names of all the parameters to be configured in the target program and the respective corresponding parameter values. In other words, in the initialization process of the object program, which parameters need to be given initial values, the parameters and their respective initial values are stored in the configuration table of the preset database. In essence, the parameters and their parameter values in the configuration table of the preset database are in one-to-one correspondence with the parameters and their parameter values in the target program.
Generally, after the program development is completed, the program is inconvenient to modify; if the program is modified, the new version of the program needs to be released again, which is equivalent to the process of secondary development, and thus the workload of developers is increased; in addition, in the application process, a new version of the program needs to be reloaded and installed, which reduces the experience of the user. However, since the data in the database is convenient to modify, by the above method, the names of all the parameters to be configured in the target program and the respective corresponding parameter values thereof are stored in the preset database, and when the parameter value of a certain parameter to be configured needs to be modified, only the parameter value of the parameter to be configured stored in the configuration table of the preset database needs to be modified, and the target program does not need to be modified, so that the workload of developers is reduced, and the user experience is improved.
In an embodiment, after the preset identifier is added to each parameter to be configured to obtain the first target parameter, the method may further include: and uploading the first target parameter and the parameter value of the first target parameter to a block chain.
In the embodiment of the present application, the scheme for configuring the parameter may be executed by one processor, or may be executed by a plurality of processors. When a plurality of processors execute a parameter configuration task together, the situation of task conflict is easy to find. Each processor participating in the task of executing the parameter configuration uploads the configured first target parameter and the parameter value thereof to the block chain, so that the safety and the fairness transparency of the block chain can be ensured. Each processor participating in the task of executing the parameter, or other user equipment desiring to query the parameter, may download the first target parameter and its parameter value from the blockchain, so as to verify whether the parameter value of the first target parameter is tampered with. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
After the parameter configuration, before the program is run, a program initialization process is performed. The details are as follows.
Referring to fig. 3, a flow chart of a program initialization method provided in the embodiment of the present application is schematically illustrated, and by way of example and not limitation, the method may include the following steps:
s301, a first target parameter in a target program is obtained, wherein the first target parameter is an initialization parameter with a preset identifier.
As described in step S202, the initialization parameter with the preset identifier indicates that the parameter is a configurable parameter.
S302, searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database.
The "first" and "second" herein are used only for distinguishing the target parameter, and are not used for counting.
The first target parameter is stored in a target program, and the second target parameter is stored in a configuration table of a preset database. As described in step S203, the parameters in the configuration table of the preset database correspond to the parameters in the target program one to one, that is, the first target parameter corresponds to the second target parameter.
The first target parameter and the second target parameter represent the same parameter. The second target parameter corresponding to the first target parameter may be that the name of the first target parameter is the same as the name of the second target parameter. For example: and if the first target parameter is ' name ', looking up a parameter with the name ' in a configuration table of a preset database to be a second target parameter.
However, due to reasons such as the language of the object program and the language of the preset database may be different, the name of the first object parameter and the name of the second object parameter corresponding to the first object parameter or the data format of the name of the first object parameter may be different. For example, assuming that the language of the object program is java, the language of the database is SQL, and the first object parameter and the second object parameter both represent the user number, but the name of the first object parameter is java language, and the name of the second object parameter is SQL language. For another example, the first target parameter and the second target parameter both represent a user number, but the parameter name of the first target parameter is "name", and the parameter name of the second target parameter is "ID".
S303, initializing the target program according to the parameter value of the second target parameter.
In one embodiment, S303 may specifically include the following steps:
s3031, obtaining the parameter value of the first target parameter, and comparing the parameter value of the first target parameter with the parameter value of the second target parameter.
The parameter values of the first target parameter are stored in the target program and the parameter values of the second target parameter are stored in the database. The parameter value of the first target parameter is obtained by obtaining the parameter value of the first target parameter from the target program.
S3032, if the parameter value of the first target parameter is the same as the parameter value of the second target parameter, initializing the target program according to the parameter value of the first target parameter.
The parameter value of the first target parameter is the same as the parameter value of the second target parameter, which indicates that the parameter value of the first target parameter is not modified, so the target program is initialized according to the original parameter value.
S3033, if the parameter value of the first target parameter is different from the parameter value of the second target parameter, updating the parameter value of the first target parameter by using the parameter value of the second target parameter, and initializing the target program according to the updated parameter value of the first target parameter.
If the parameter value of the first target parameter is different from the parameter value of the second target parameter, which indicates that the parameter value of the first target parameter is modified, the target program needs to be initialized according to the modified parameter value.
Optionally, the updating the parameter value of the first target parameter by using the parameter value of the second target parameter may include:
generating a byte code file with a preset format for the parameter value of the second target parameter, wherein the preset format is the same as the format of the parameter value of the first target parameter; and loading the byte code file to the position of the first target parameter in the target program through a class loader.
Illustratively, the parameter value of the second target parameter may be generated into a bytecode file using a Code Generation Library (CGLIB) tool. The CGLIB is a powerful, high-performance and high-quality Code generation class library, and can extend Java classes and realize Java interfaces in a running period. The principle of CGLIB is to convert bytecodes and generate new classes by using a small and fast bytecode processing framework ASM.
Of course, in addition to the CGLIB package, scripting languages such as Groovy and beenshell also use ASM to generate the bytecode of java, and thus may also be used to generate the bytecode file from the parameter value of the second target parameter.
The class loader is part of the execution environment and is responsible for dynamically loading classes in code into the memory space of the virtual machine. For example, the Java class loader is responsible for dynamically loading Java classes into the memory space of the Java virtual machine. After the bytecode file is loaded into the target program through the class loader, the target program can run the bytecode file.
In one embodiment, the user can modify the parameters in the configuration table of the preset database at any time.
Specifically, the method can comprise the following steps:
when a parameter modification instruction is monitored, acquiring parameter information in the parameter modification instruction, wherein the parameter information comprises a parameter name and a parameter modification value; and searching a third target parameter corresponding to the parameter name in the configuration table of the preset database, and replacing the parameter value of the third target parameter with the parameter modification value.
The user can modify the parameters in the preset database, and then send a parameter modification instruction to the processor after modification. Or after the user modifies the parameters in the preset database, the server corresponding to the preset database feeds back a parameter modification instruction to the processor.
Certainly, in practical applications, an update period may be preset, and the processor may detect whether the parameters in the configuration table of the preset database need to be updated according to the preset update period.
The specific detection process may be: the processor acquires first target parameters in a target program and acquires second target parameters corresponding to each first target parameter in a configuration table of a preset database; comparing the parameter value of the first target parameter with the parameter value of the second target parameter; if the parameter value of the first target parameter is different from the parameter value of the second target parameter, the parameter value of the first target parameter is updated by using the parameter value of the second target parameter (the updating method may join the description in S4033).
The method and the device for initializing the target program obtain a first target parameter in the target program, namely an initialization parameter with a preset identifier, then search a second target parameter corresponding to the first target parameter from a configuration table of a preset database, and finally initialize the target program according to a parameter value of the second target parameter. Since the parameter value of the second target parameter in the preset database can be flexibly modified, the initialization parameter can be flexibly configured by modifying the parameter value of the second target parameter in the preset database in the process of initializing the target program according to the parameter value of the second target parameter. By the method, the flexible configuration of the program initialization parameters is effectively realized.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 4 is a block diagram of a program initialization device according to an embodiment of the present application, which corresponds to the program initialization method described in the foregoing embodiment, and only the relevant portions of the embodiment of the present application are shown for convenience of illustration.
Referring to fig. 4, the apparatus 4 includes:
the obtaining unit 41 is configured to obtain a first target parameter in a target program, where the first target parameter is an initialization parameter with a preset identifier.
The searching unit 42 is configured to search a configuration table of a preset database for a second target parameter corresponding to the first target parameter.
An initializing unit 43, configured to initialize the target program according to the parameter value of the first target parameter and the parameter value of the second target parameter.
Optionally, the apparatus 4 further comprises:
the scanning unit 44 is configured to, before acquiring an initialization parameter with a preset identifier in a target program, acquire an initialization parameter in the target program, and acquire a parameter to be configured in the initialization parameter, where the parameter to be configured is a configurable parameter in the initialization parameter.
An identification unit 45, configured to add the preset identification to each parameter to be configured, respectively, to obtain the first target parameter;
an adding unit 46, configured to add the first target parameter to the configuration table of the preset database.
Optionally, the apparatus 4 further comprises:
the monitoring unit is used for acquiring parameter information in the parameter modification instruction when the parameter modification instruction is monitored, wherein the parameter information comprises a parameter name and a parameter modification value.
And the replacing unit is used for searching a third target parameter corresponding to the parameter name in the configuration table of the preset database and replacing the parameter value of the third target parameter with the parameter modification value.
Optionally, the initialization unit 43 includes:
and the comparison module is used for acquiring the parameter value of the first target parameter and comparing the parameter value of the first target parameter with the parameter value of the second target parameter.
And the first initialization module is used for initializing the target program according to the parameter value of the first target parameter if the parameter value of the first target parameter is the same as the parameter value of the second target parameter.
Optionally, the initialization unit 43 includes:
the comparison module is further configured to obtain a parameter value of the first target parameter, and compare the parameter value of the first target parameter with a parameter value of the second target parameter.
And the second initialization module is used for updating the parameter value of the first target parameter by using the parameter value of the second target parameter if the parameter value of the first target parameter is different from the parameter value of the second target parameter, and initializing the target program according to the updated parameter value of the first target parameter.
Optionally, the second initialization module is further configured to:
generating a byte code file with a preset format for the parameter value of the second target parameter, wherein the preset format is the same as the format of the parameter value of the first target parameter;
and loading the byte code file to the position of the first target parameter in the target program through a class loader.
Optionally, the apparatus 4 further comprises:
and the uploading unit is used for uploading the first target parameter and the parameter value of the first target parameter to a block chain after the preset identifier is added to each parameter to be configured to obtain the first target parameter.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
The program initialization device shown in fig. 4 may be a software unit, a hardware unit, or a combination of software and hardware unit built in the existing terminal device, may be integrated into the terminal device as a separate pendant, or may exist as a separate terminal device.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: at least one processor 50 (only one shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and executable on the at least one processor 50, the processor 50 implementing the steps in any of the various program initialization method embodiments described above when executing the computer program 52.
The terminal device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The terminal device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that fig. 5 is only an example of the terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a terminal device, enables the terminal device to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to an apparatus/terminal device, recording medium, computer Memory, Read-Only Memory (ROM), Random-access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for program initialization, the method comprising:
acquiring a first target parameter in a target program, wherein the first target parameter is an initialization parameter with a preset identifier;
searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database;
and initializing the target program according to the parameter value of the second target parameter.
2. The program initialization method of claim 1, wherein prior to obtaining initialization parameters with preset identification in the target program, the method further comprises:
acquiring initialization parameters in the target program, and acquiring parameters to be configured in the initialization parameters, wherein the parameters to be configured are configurable parameters in the initialization parameters;
adding the preset identification to each parameter to be configured to obtain the first target parameter;
adding the first target parameter to the configuration table of the preset database.
3. The program initialization method of claim 1, wherein the method further comprises:
when a parameter modification instruction is monitored, acquiring parameter information in the parameter modification instruction, wherein the parameter information comprises a parameter name and a parameter modification value;
and searching a third target parameter corresponding to the parameter name in the configuration table of the preset database, and replacing the parameter value of the third target parameter with the parameter modification value.
4. The program initialization method according to any one of claims 1 to 3, wherein the initializing the object program according to the parameter value of the second object parameter includes:
acquiring a parameter value of the first target parameter, and comparing the parameter value of the first target parameter with a parameter value of the second target parameter;
and if the parameter value of the first target parameter is the same as the parameter value of the second target parameter, initializing the target program according to the parameter value of the first target parameter.
5. The program initialization method according to any one of claims 1 to 3, wherein the initializing the object program according to the parameter value of the second object parameter includes:
acquiring a parameter value of the first target parameter, and comparing the parameter value of the first target parameter with a parameter value of the second target parameter;
if the parameter value of the first target parameter is different from the parameter value of the second target parameter, updating the parameter value of the first target parameter by using the parameter value of the second target parameter, and initializing the target program according to the updated parameter value of the first target parameter.
6. The program initialization method of claim 5, wherein the updating the parameter value of the first target parameter with the parameter value of the second target parameter comprises:
generating a byte code file with a preset format for the parameter value of the second target parameter, wherein the preset format is the same as the format of the parameter value of the first target parameter;
and loading the byte code file to the position of the first target parameter in the target program through a class loader.
7. The program initialization method according to claim 2, after adding the preset identifier to each of the parameters to be configured to obtain the first target parameter, further comprising:
and uploading the first target parameter and the parameter value of the first target parameter to a block chain.
8. A program initialization device, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first target parameter in a target program, and the first target parameter is an initialization parameter with a preset identifier;
the searching unit is used for searching a second target parameter corresponding to the first target parameter from a configuration table of a preset database;
and the initialization unit is used for initializing the target program according to the parameter value of the first target parameter and the parameter value of the second target parameter.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010503277.1A 2020-06-05 2020-06-05 Program initialization method, program initialization device, terminal device, and storage medium Pending CN111694586A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010503277.1A CN111694586A (en) 2020-06-05 2020-06-05 Program initialization method, program initialization device, terminal device, and storage medium
PCT/CN2020/123756 WO2021114902A1 (en) 2020-06-05 2020-10-26 Program initialization method, program initialization device, terminal device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010503277.1A CN111694586A (en) 2020-06-05 2020-06-05 Program initialization method, program initialization device, terminal device, and storage medium

Publications (1)

Publication Number Publication Date
CN111694586A true CN111694586A (en) 2020-09-22

Family

ID=72479438

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010503277.1A Pending CN111694586A (en) 2020-06-05 2020-06-05 Program initialization method, program initialization device, terminal device, and storage medium

Country Status (2)

Country Link
CN (1) CN111694586A (en)
WO (1) WO2021114902A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021114902A1 (en) * 2020-06-05 2021-06-17 平安科技(深圳)有限公司 Program initialization method, program initialization device, terminal device, and storage medium
CN116701501A (en) * 2022-11-21 2023-09-05 荣耀终端有限公司 Camera calibration data loading method and device and terminal equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5913218A (en) * 1995-11-06 1999-06-15 Sun Microsystems, Inc System and method for retrieving and updating configuration parameter values for application programs in a computer network
CN103064919A (en) * 2012-12-20 2013-04-24 北京思特奇信息技术股份有限公司 Method and device for preserving configuration parameters in business system
CN108268289A (en) * 2016-12-30 2018-07-10 阿里巴巴集团控股有限公司 Method for parameter configuration, the apparatus and system of web applications
CN109766123A (en) * 2018-12-24 2019-05-17 北京奇安信科技有限公司 Application program packaging method and device
CN110502272A (en) * 2019-08-16 2019-11-26 济南浪潮数据技术有限公司 One parameter configuration method, device, storage medium and computer equipment
CN110955455A (en) * 2018-09-26 2020-04-03 Oppo(重庆)智能科技有限公司 Terminal initialization configuration method and device, electronic equipment and storage medium
CN111104133A (en) * 2018-10-25 2020-05-05 深圳市茁壮网络股份有限公司 Configuration parameter updating system, method and storage medium
CN111124523A (en) * 2018-10-15 2020-05-08 百度在线网络技术(北京)有限公司 Method and apparatus for initializing applications

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6629113B1 (en) * 1999-06-30 2003-09-30 International Business Machines Corporation Method and system for dynamically adjustable and configurable garbage collector
CN104022894B (en) * 2014-05-12 2017-06-06 东软熙康健康科技有限公司 Manage method, the method for configuration application parameter of application configuration parameter concentratedly
CN105630562A (en) * 2016-01-07 2016-06-01 东莞钜威新能源有限公司 Method and device for initializing battery management system
CN107508846B (en) * 2016-06-14 2021-02-26 北京京东尚科信息技术有限公司 Updating method and system of application client and terminal equipment
CN111694586A (en) * 2020-06-05 2020-09-22 平安科技(深圳)有限公司 Program initialization method, program initialization device, terminal device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5913218A (en) * 1995-11-06 1999-06-15 Sun Microsystems, Inc System and method for retrieving and updating configuration parameter values for application programs in a computer network
CN103064919A (en) * 2012-12-20 2013-04-24 北京思特奇信息技术股份有限公司 Method and device for preserving configuration parameters in business system
CN108268289A (en) * 2016-12-30 2018-07-10 阿里巴巴集团控股有限公司 Method for parameter configuration, the apparatus and system of web applications
CN110955455A (en) * 2018-09-26 2020-04-03 Oppo(重庆)智能科技有限公司 Terminal initialization configuration method and device, electronic equipment and storage medium
CN111124523A (en) * 2018-10-15 2020-05-08 百度在线网络技术(北京)有限公司 Method and apparatus for initializing applications
CN111104133A (en) * 2018-10-25 2020-05-05 深圳市茁壮网络股份有限公司 Configuration parameter updating system, method and storage medium
CN109766123A (en) * 2018-12-24 2019-05-17 北京奇安信科技有限公司 Application program packaging method and device
CN110502272A (en) * 2019-08-16 2019-11-26 济南浪潮数据技术有限公司 One parameter configuration method, device, storage medium and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021114902A1 (en) * 2020-06-05 2021-06-17 平安科技(深圳)有限公司 Program initialization method, program initialization device, terminal device, and storage medium
CN116701501A (en) * 2022-11-21 2023-09-05 荣耀终端有限公司 Camera calibration data loading method and device and terminal equipment
CN116701501B (en) * 2022-11-21 2024-04-12 荣耀终端有限公司 Camera calibration data loading method and device and terminal equipment

Also Published As

Publication number Publication date
WO2021114902A1 (en) 2021-06-17

Similar Documents

Publication Publication Date Title
CN109542399B (en) Software development method and device, terminal equipment and computer readable storage medium
CN100349124C (en) Mechanism to control hardware interrupt acknowledgement in a virtual machine system
CN111736922B (en) Plug-in calling method and device, electronic equipment and storage medium
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
CN111428451B (en) Text online editing method and device, electronic equipment and storage medium
CN111694586A (en) Program initialization method, program initialization device, terminal device, and storage medium
US10241759B2 (en) Detecting open source components built into mobile applications
CN111694638A (en) Rule package loading method, rule package executing method and terminal equipment
CN112001376B (en) Fingerprint identification method, device, equipment and storage medium based on open source component
CN110765067A (en) Data processing method and device
CN114218315A (en) Interface generation method and device, computer equipment and storage medium
CN112068874A (en) Software project continuous integration method and device, terminal equipment and storage medium
US20020174082A1 (en) Reusable parts for assembled software systems
CN109542398B (en) Business system generation method and device and computer readable storage medium
CN111176685A (en) Upgrading method and device
CN112363997B (en) Data version management method, device and storage medium
CN112580079A (en) Authority configuration method and device, electronic equipment and readable storage medium
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN110955415A (en) Method for adapting projection multi-platform service
US9830204B2 (en) Facilitating communication between software components that use middleware
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN113971019A (en) Data type creating method, device, server and medium
CN114356379A (en) Backup-based service upgrading method, device, equipment and storage medium
CN112925523A (en) Object comparison method, device, equipment and computer readable medium
CN111142965A (en) Language configuration method and device, electronic 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