CN113485770A - Method and device for determining service configuration data, electronic equipment and storage medium - Google Patents
Method and device for determining service configuration data, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113485770A CN113485770A CN202110842350.2A CN202110842350A CN113485770A CN 113485770 A CN113485770 A CN 113485770A CN 202110842350 A CN202110842350 A CN 202110842350A CN 113485770 A CN113485770 A CN 113485770A
- Authority
- CN
- China
- Prior art keywords
- service configuration
- service
- data
- configuration data
- class
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 98
- 238000011161 development Methods 0.000 claims abstract description 6
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 230000008569 process Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000007796 conventional method Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention discloses a method and a device for determining service configuration data, electronic equipment and a storage medium. The method comprises the following steps: receiving a configuration data acquisition instruction of a target service, and determining a target service identifier of the target service; determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier; acquiring service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object, and acquiring configuration data corresponding to a target service based on the service configuration data; the method for generating the service configuration class comprises the following steps: the technical scheme of the embodiment of the invention solves the technical problem of high code error rate of the traditional method for determining the service configuration data, and realizes the improvement of software development and development efficiency.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for determining service configuration data, electronic equipment and a storage medium.
Background
In a conventional method for determining service configuration data, a program developer manually edits an entity class carrying configuration items, and obtains the service configuration data through the written entity class. However, the conventional method for determining the service configuration data has the technical problems that a program developer has a high code error rate and consumes a long time in the software development process, so that the software development efficiency is reduced.
Disclosure of Invention
The embodiment of the invention provides a method and a device for determining service configuration data, electronic equipment and a storage medium, which are used for automatically generating service configuration classes for bearing configuration items, reducing the code error rate in the software development process and reducing time consumption, thereby improving the software development efficiency.
In a first aspect, an embodiment of the present invention provides a method for determining service configuration data, where the method includes:
receiving a configuration data acquisition instruction of a target service, and determining a target service identifier of the target service;
determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier;
acquiring service configuration data corresponding to the service configuration item object from a data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data;
the method for generating the service configuration class comprises the following steps:
and determining a corresponding service configuration interface according to the service configuration item compiling instruction, and calling a service configuration generation method according to the service configuration interface to obtain a service configuration.
In a second aspect, an embodiment of the present invention further provides a device for determining service configuration data, where the device includes:
the target service identification determining module is used for receiving a configuration data acquisition instruction of a target service and determining a target service identification of the target service;
a service configuration item object determining module, configured to determine, according to the target service identifier, a service configuration item object in a service configuration class corresponding to the target service identifier;
a configuration data obtaining module, configured to obtain, according to the service configuration item object, service configuration data corresponding to the service configuration item object from a data cache region, and obtain, based on the service configuration data, configuration data corresponding to the target service;
and the service configuration class generation module is used for determining a corresponding service configuration interface according to the service configuration item class compiling instruction and calling a service configuration class generation method according to the service configuration interface to obtain a service configuration class.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
storage means for storing one or more programs;
when executed by the processor, the program causes the processor to implement the method for determining service configuration data as provided by any of the embodiments of the present invention.
In a fourth aspect, an 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 the method for determining service configuration data according to any embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, the target service identifier of the target service is determined by receiving the configuration data acquisition instruction of the target service. And determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier. And acquiring service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data. The method for generating the service configuration class can determine a corresponding service configuration interface according to a service configuration item class compiling instruction, call a service configuration class generating method according to the service configuration interface to obtain the service configuration class, realize automatic generation of the service configuration class bearing the configuration items, solve the technical problems that a program developer has high code error rate and long time consumption in a software development process in the conventional method for determining the service configuration data, and achieve the technical effects of reducing the code error rate and time consumption in the software development process and improving the efficiency of the software development.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a schematic flowchart of a method for determining service configuration data according to an embodiment of the present invention;
fig. 2 is a block diagram of a flow chart of generating a service configuration class according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of a method for determining service configuration data according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of a module of a service configuration data determination apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flow chart of a method for determining service configuration data according to an embodiment of the present invention, where the embodiment is applicable to a case where configuration data corresponding to a target service is obtained through a service configuration class, the method may be executed by a device for determining service configuration data, the device for determining service configuration data may be implemented in a software and/or hardware manner, and the device for determining service configuration data may be integrated in an electronic device such as a computer or a server.
As shown in fig. 1, the method of the present embodiment includes:
s110, receiving a configuration data acquisition instruction of the target service, and determining a target service identifier of the target service.
The target service may be a service to be processed at the current time. The configuration data acquisition instruction may be understood as an instruction for acquiring configuration data of a target service.
Specifically, a configuration data acquisition instruction of the target service is received. And analyzing the configuration data acquisition instruction, and further determining the target service identifier of the target service.
Optionally, there may be multiple ways of receiving the configuration data acquisition instruction of the target service, which are not limited herein, and may be that a configuration data acquisition instruction generated by a user triggering and preset for acquiring configuration data is received; it is also possible to receive a command or the like for obtaining configuration data and generating configuration data, which is input by a user based on an input device.
And S120, determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier.
The service configuration class may be a pre-generated class, such as CfgConstant { }. At least one business configuration item object may be included in the business configuration class. The service configuration item object can be understood as an object for configuring configuration data of a target service. Alternatively, the type of the service configuration item object may be a final type (constant type). The correspondence between the target service identification and the service configuration item object may be one-to-one or one-to-many.
Specifically, after the target service identifier is determined, a service configuration class generated in advance may be obtained. After the service configuration class is obtained, a service configuration item object corresponding to the target service identifier in the service configuration class can be determined according to the target service identifier.
Optionally, determining, according to the target service identifier, a service configuration item object in the service configuration class corresponding to the target service identifier includes:
and comparing the target service identifier with each service identifier contained in the service configuration class in a consistent manner, and if the service configuration class contains the target service identifier, determining a service configuration item object corresponding to the target service identifier in the service configuration class based on the pre-established corresponding relationship between the target service identifier and the service configuration item object.
The method for generating the service configuration class comprises the following steps:
and according to the business configuration item compiling instruction, determining a corresponding business configuration interface, and calling a business configuration generation method according to the business configuration interface to obtain a business configuration.
The service configuration item class compiling instruction may be an instruction for obtaining the service configuration item class by compiling the source program. The service configuration class generation method may be a predefined method, and may be used for generating the service configuration class. The service configuration interface may be an interface that calls a service configuration class generation method.
Specifically, a service configuration class generation method is predefined. When a service configuration item type compiling instruction is received, a service configuration interface corresponding to the service configuration item type compiling instruction can be determined according to the service configuration item type compiling instruction. After the corresponding service configuration interface is determined, a service configuration class generation method can be called according to the service configuration interface. And may generate a service configuration class.
It should be noted that, the service configuration Interface class may be a cfg.java Interface in an API (Application Programming Interface) module, for example, a code of the cfg.java Interface may be:
@ConfigDefineAnno
Public interface Cfg{}
it should also be noted that the cfg. This interface corresponds to the cut-in point for the JSR269 feature.
Optionally, after obtaining the service configuration class, the method further includes: and storing the service configuration class to a preset service resource position. Specifically, the service resource location is preset, and after the service configuration class is generated, or when the service configuration class is generated, the service configuration class may be stored in the preset service resource location. The advantage of storing the service configuration class to the preset service resource position is that: facilitating the management of program code and facilitating subsequent maintenance of the code.
To reduce the coupling of program code, the business configuration class generation method may be a predefined Processor (configuration item constant class generation tool). The advantages of using a Processor are that: the program can be deployed without packaging the Processor into a deployment file, the Processor is used for storing the Processor into a dependent warehouse (nexus) after compiling the source program once, and the subsequent release does not need to be compiled again.
Referring to fig. 2, in the process of compiling the API, the compiler calls the Processor to generate the service configuration class in the service layer through the cfg. Alternatively, the compiler may be a java compiler.
Optionally, before invoking the service configuration class generating method according to the service configuration interface, the method further includes:
and detecting the current program environment, and if the current environment is a development environment, executing the operation of calling the service configuration class generation method according to the service configuration interface.
Wherein the current program environment may be the program environment at the current time. The program environment may include, but is not limited to, the following: a development environment, a test environment, and a compilation environment.
Specifically, before calling the service configuration class generation method according to the service configuration interface, the current program environment may be detected, and then the current program environment is determined. If the current environment is a development environment, the operation of calling the service configuration class generation method according to the service configuration interface can be executed.
Optionally, the calling a service configuration class generation method according to the service configuration interface to obtain the service configuration class includes:
calling a service configuration class generation method according to the service configuration interface, acquiring a service configuration item and a configuration data type corresponding to the service configuration item, and generating a service configuration class according to the service configuration item and the configuration data type.
Wherein, the service configuration item can be understood as a configuration item of the target service. The configuration data type may be a data type corresponding to the service configuration item. The configuration data types may include, but are not limited to, the following data types: integer type, string type, boolean type, and floating point type.
Specifically, the service configuration interface calls the service configuration class generation method, so that the service configuration item and the configuration data type corresponding to the service configuration item can be obtained. Furthermore, the service configuration class can be generated according to the service configuration item and the configuration data type.
In order to improve the type security of the program, improve the readability of the code, and reduce the complexity of the code, a service configuration class may be generated, and the parameter type of the generated service configuration class is generalized, so that the generated service configuration class is CfgConstant.
Illustratively, the CfgConstant class may include code for:
public class CfgConstant<T>{
public static final CfgConstant<String>service_code_pre=new CfgConstant<>(cfgcode:“service_code_pre”,java.lang.Integer.calss,java.lang.Void.class,isSys:false);
}
wherein, the service _ code _ pre is a service configuration item object.
Optionally, the service configuration class is generated by the following steps:
step one, creating a class file to be processed.
Writing a key field in the class file to be processed, wherein the key field comprises a service configuration item and a configuration data type.
And step three, after the key field is written, generating a constructor in the class file to be processed according to the service configuration item and the configuration data type.
And step four, after the constructor is generated, the service configuration item and the configuration data type corresponding to the service configuration item can be obtained. After the service configuration item and the configuration data type corresponding to the service configuration item are obtained, the type of the service configuration item object may be set to final type.
And step five, after the type of the service configuration item object is set to be the final type, writing the predefined equals method and hashcode method into the class file to be processed.
Step six, after writing the predefined equals method and hashcode method, the written class file to be processed can be used as the service configuration class file, and then the service configuration class can be determined based on the service configuration class file.
Optionally, the calling a service configuration class generation method according to the service configuration interface to obtain the service configuration item and the configuration data type corresponding to the service configuration item includes:
and calling a service configuration class generation method according to the service configuration interface, and acquiring a service configuration item contained in the service configuration item definition table and a configuration data type corresponding to the service configuration item.
The service configuration item definition table may be a table predefined in a database, and may be used to store the service configuration item and a configuration data type corresponding to the service configuration item. Illustratively, the service configuration item definition table may be a config _ define table. The service configuration item definition table may include, but is not limited to, the following key fields: code (encoding) and java _ type (data type). Illustratively, the code may be cfgcode, and the java _ type may be Integer type.
Specifically, a service configuration item definition table is predefined, and a service configuration item and a configuration data type corresponding to the service configuration item are predefined in the service configuration item definition table. The service configuration interface calls the service configuration class generation method, so that the service configuration items predefined in the service configuration item definition table and the configuration data types corresponding to the service configuration items can be obtained.
S130, according to the service configuration item object, service configuration data corresponding to the service configuration item object are obtained from the data cache region, and based on the service configuration data, configuration data corresponding to the target service are obtained.
The data cache region may be a cache region for storing service configuration data corresponding to the service configuration item object.
Specifically, after the service configuration item object is determined, the cache region where the service configuration data corresponding to the service configuration item object is located may be determined according to the service configuration item object, and after the cache region where the service configuration data is located is determined, the service configuration data corresponding to the service configuration item object may be acquired from the data cache region. Furthermore, the configuration data corresponding to the target service can be obtained according to the service configuration data.
According to the technical scheme of the embodiment of the invention, the target service identifier of the target service is determined by receiving the configuration data acquisition instruction of the target service. And determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier. And acquiring service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data. The method for generating the service configuration class can determine a corresponding service configuration interface according to a service configuration item class compiling instruction, call a service configuration class generating method according to the service configuration interface to obtain the service configuration class, realize automatic generation of the service configuration class bearing the configuration items, solve the technical problems that a program developer has high code error rate and long time consumption in a software development process in the conventional method for determining the service configuration data, and achieve the technical effects of reducing the code error rate and time consumption in the software development process and improving the efficiency of the software development.
Example two
Fig. 3 is a schematic flow chart of a method for determining service configuration data according to a second embodiment of the present invention, and on the basis of the foregoing embodiment, optionally before acquiring, according to a service configuration item object, service configuration data corresponding to the service configuration item object from a data cache region, the method further includes: and judging whether the data cache region has service configuration data corresponding to the service configuration item object, if so, executing operation of acquiring the service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object.
Optionally, the obtaining configuration data corresponding to the target service based on the service configuration data includes: and converting the data type of the service configuration data into the data type corresponding to the type information according to the type information of the service configuration item object, and taking the service configuration data after data type conversion as the configuration data corresponding to the target service.
The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 3, the method of the present embodiment may specifically include:
s210, receiving a configuration data acquisition instruction of the target service, and determining a target service identifier of the target service.
S220, determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier.
S230, judging whether the data cache region has service configuration data corresponding to the service configuration item object, if not, executing S240; if so, S250 is performed.
Specifically, after the service configuration item object is determined, whether service configuration data corresponding to the service configuration item object exists in the data cache region may be determined, and if not, the operation of S240 may be performed; if so, the operation of S250 may be performed.
S240, acquiring service configuration data corresponding to the service configuration item object from a configuration value storage table in the database, and storing the acquired service configuration data in a data cache region.
The configuration value storage table may be a table predefined in a database, and may be used to store service configuration data corresponding to the service configuration item object. Illustratively, the configuration value storage table may be a config _ value table. The configuration value storage table may include, but is not limited to, the following key fields: code, bid, and value
Specifically, a configuration value storage table is predefined in the database, and service configuration data is stored in the configuration value storage table in advance. If the data cache region does not have the service configuration data corresponding to the service configuration item object, the service configuration data corresponding to the service configuration item object can be acquired from a configuration value storage table in the database. After the service configuration data is obtained from the database, the obtained service configuration data may be stored in the data cache region.
And S250, acquiring service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object.
S260, converting the data type of the service configuration data into the data type corresponding to the type information according to the type information of the service configuration item object, and taking the service configuration data after the data type conversion as the configuration data corresponding to the target service.
Wherein, the type information can be the type information of the service configuration item object. The type information may include, but is not limited to, the following: the data type of the service configuration item object, the access type of the service configuration item object and the like. The access type may be public, private, and protected.
Specifically, after the service configuration data corresponding to the service configuration item object is acquired from the data cache region, the type information of the service configuration item object may be determined. Furthermore, the data type of the service configuration data may be converted into the data type corresponding to the type information according to the type information of the service configuration item object, and then, the service configuration data after the data type conversion may be used as the configuration data corresponding to the target service. And then the configuration data corresponding to the target service can be obtained.
In the technical solution of this embodiment, before the service configuration data corresponding to the service configuration item object is acquired from the data cache area according to the service configuration item object, it is determined whether the service configuration data corresponding to the service configuration item object exists in the data cache area, and if the service configuration data corresponding to the service configuration item object exists in the data cache area, the operation of acquiring the service configuration data corresponding to the service configuration item object from the data cache area according to the service configuration item object is performed. If the configuration data does not exist, the service configuration data corresponding to the service configuration item object is obtained from the configuration value storage table in the database, and the obtained service configuration data is stored in the data cache region, so that the service configuration data can be obtained more quickly and conveniently. By the processing mode that the data type of the service configuration data is converted into the data type corresponding to the type information according to the type information of the service configuration item object, and the service configuration data after the data type conversion is used as the configuration data corresponding to the target service, the reusability of codes is improved, and the technical problems of reducing the code error rate in the software development process and improving the software development efficiency are achieved.
EXAMPLE III
Fig. 4 is a schematic diagram of a module of a device for determining service configuration data according to a third embodiment of the present invention, where the device for determining service configuration data includes: a target service identification determining module 310, a service configuration item object determining module 320, a configuration data obtaining module 330 and a service configuration class generating module 340.
The target service identifier determining module 310 is configured to receive a configuration data obtaining instruction of a target service, and determine a target service identifier of the target service; a service configuration item object determining module 320, configured to determine, according to the target service identifier, a service configuration item object in a service configuration class corresponding to the target service identifier; a configuration data obtaining module 330, configured to obtain, according to the service configuration item object, service configuration data corresponding to the service configuration item object from a data cache region, and obtain, based on the service configuration data, configuration data corresponding to the target service; the service configuration class generating module 340 is configured to determine a corresponding service configuration interface according to the service configuration item class compiling instruction, and call a service configuration class generating method according to the service configuration interface to obtain a service configuration class.
According to the technical scheme of the embodiment of the invention, the target service identification determining module receives the configuration data acquisition instruction of the target service and determines the target service identification of the target service. And determining a service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier by using a service configuration item object determination module. And acquiring the service configuration data corresponding to the service configuration item object from the data cache region through the configuration data acquisition module according to the service configuration item object, and acquiring the configuration data corresponding to the target service based on the service configuration data. The method comprises the steps of determining a corresponding service configuration interface according to a service configuration item class compiling instruction through a service configuration class generating module, calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class, realizing automatic generation of the service configuration class bearing configuration items, solving the technical problems of high code error rate and long time consumption of program developers in the software development process of the traditional service configuration data determining method, and achieving the technical effects of reducing the code error rate and time consumption in the software development process and improving the software development efficiency.
Optionally, before the invoking the service configuration class generating method according to the service configuration interface, the apparatus further includes: and the program environment detection module is used for detecting the current program environment, and if the current environment is a development environment, executing the operation of calling the service configuration class generation method according to the service configuration interface.
Optionally, the service configuration class generating module 340 is configured to call a service configuration class generating method according to the service configuration interface, obtain a service configuration item and a configuration data type corresponding to the service configuration item, and generate a service configuration class according to the service configuration item and the configuration data type.
Optionally, the service configuration class generating module 340 is configured to call a service configuration class generating method according to the service configuration interface, and obtain a service configuration item included in a service configuration item definition table and a configuration data type corresponding to the service configuration item.
Optionally, before acquiring, according to the service configuration item object, service configuration data corresponding to the service configuration item object from the data cache region, the apparatus further includes: and the service configuration data judging module is used for judging whether the data cache region has service configuration data corresponding to the service configuration item object, and if so, executing operation of acquiring the service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object.
Optionally, the service configuration data determining module is further configured to, if the service configuration data does not exist, obtain service configuration data corresponding to the service configuration item object from a configuration value storage table in a database, and store the obtained service configuration data in the data cache region.
Optionally, the configuration data obtaining module 330 is configured to convert the data type of the service configuration data into a data type corresponding to the type information according to the type information of the service configuration item object, and use the service configuration data after data type conversion as configuration data corresponding to a target service.
The device can execute the method for determining the service configuration data provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method for determining the service configuration data.
It should be noted that, the units and modules included in the device for determining service configuration data are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 5 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. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention. The device 12 is typically an electronic device that undertakes the processing of configuration information.
As shown in FIG. 5, 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).
The processor 16 executes various functional applications and data processing by running the program stored in the memory 28, for example, to implement the method for determining service configuration data provided by the above-mentioned embodiment of the present invention, the method includes:
receiving a configuration data acquisition instruction of a target service, and determining a target service identifier of the target service; determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier; acquiring service configuration data corresponding to the service configuration item object from a data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data; the method for generating the service configuration class comprises the following steps: and determining a corresponding service configuration interface according to the service configuration item compiling instruction, and calling a service configuration generation method according to the service configuration interface to obtain a service configuration.
Of course, those skilled in the art will appreciate that the processor may also implement the method for determining the service configuration data provided in any embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor, and for example, the method for determining service configuration data provided in the foregoing embodiment of the present invention includes:
receiving a configuration data acquisition instruction of a target service, and determining a target service identifier of the target service;
determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier;
acquiring service configuration data corresponding to the service configuration item object from a data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data;
the method for generating the service configuration class comprises the following steps:
and determining a corresponding service configuration interface according to the service configuration item compiling instruction, and calling a service configuration generation method according to the service configuration interface to obtain a service configuration.
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 many 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 embodiments 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 and 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 described 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 greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A method for determining service configuration data is characterized by comprising the following steps:
receiving a configuration data acquisition instruction of a target service, and determining a target service identifier of the target service;
determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier;
acquiring service configuration data corresponding to the service configuration item object from a data cache region according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data;
the method for generating the service configuration class comprises the following steps:
and determining a corresponding service configuration interface according to the service configuration item compiling instruction, and calling a service configuration generation method according to the service configuration interface to obtain a service configuration.
2. The method of claim 1, prior to said invoking a service configuration class generation method according to the service configuration interface, further comprising:
and detecting a current program environment, and if the current environment is a development environment, executing the operation of calling a service configuration class generation method according to the service configuration interface.
3. The method according to claim 1, wherein the calling a service configuration class generation method according to the service configuration interface to obtain a service configuration class comprises:
calling a service configuration class generation method according to the service configuration interface, acquiring a service configuration item and a configuration data type corresponding to the service configuration item, and generating a service configuration class according to the service configuration item and the configuration data type.
4. The method according to claim 3, wherein the calling a service configuration class generation method according to the service configuration interface to obtain a service configuration item and a configuration data type corresponding to the service configuration item includes:
and calling a service configuration class generation method according to the service configuration interface, and acquiring a service configuration item contained in a service configuration item definition table and a configuration data type corresponding to the service configuration item.
5. The method according to claim 1, before obtaining the service configuration data corresponding to the service configuration item object from a data cache according to the service configuration item object, further comprising:
and judging whether the data cache region has service configuration data corresponding to the service configuration item object, if so, executing operation of acquiring the service configuration data corresponding to the service configuration item object from the data cache region according to the service configuration item object.
6. The method of claim 5, further comprising:
and if the service configuration item does not exist, acquiring the service configuration data corresponding to the service configuration item object from a configuration value storage table in a database, and storing the acquired service configuration data in the data cache region.
7. The method according to claim 1, wherein obtaining the configuration data corresponding to the target service based on the service configuration data comprises:
and converting the data type of the service configuration data into the data type corresponding to the type information according to the type information of the service configuration item object, and taking the service configuration data after data type conversion as the configuration data corresponding to the target service.
8. An apparatus for determining service configuration data, comprising:
the target service identification determining module is used for receiving a configuration data acquisition instruction of a target service and determining a target service identification of the target service;
a service configuration item object determining module, configured to determine, according to the target service identifier, a service configuration item object in a service configuration class corresponding to the target service identifier;
a configuration data obtaining module, configured to obtain, according to the service configuration item object, service configuration data corresponding to the service configuration item object from a data cache region, and obtain, based on the service configuration data, configuration data corresponding to the target service;
and the service configuration class generation module is used for determining a corresponding service configuration interface according to the service configuration item class compiling instruction and calling a service configuration class generation method according to the service configuration interface to obtain a service configuration class.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
storage means for storing one or more programs;
when executed by the processor, cause the processor to implement the method of determining service profile data according to any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of determining service configuration data according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110842350.2A CN113485770B (en) | 2021-07-26 | 2021-07-26 | Method and device for determining service configuration data, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110842350.2A CN113485770B (en) | 2021-07-26 | 2021-07-26 | Method and device for determining service configuration data, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113485770A true CN113485770A (en) | 2021-10-08 |
CN113485770B CN113485770B (en) | 2024-03-22 |
Family
ID=77943585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110842350.2A Active CN113485770B (en) | 2021-07-26 | 2021-07-26 | Method and device for determining service configuration data, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113485770B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080235661A1 (en) * | 2007-03-21 | 2008-09-25 | Computer Associates Think, Inc. | System and method for using annotations to automatically generate a framework for a custom javaserver faces (jsf) component |
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN105204871A (en) * | 2015-10-30 | 2015-12-30 | 亚信科技(南京)有限公司 | Plug-in type development method and device |
CN105487864A (en) * | 2015-11-26 | 2016-04-13 | 北京京东尚科信息技术有限公司 | Method and device for automatically generating code |
CN108156022A (en) * | 2017-12-04 | 2018-06-12 | 北京奇艺世纪科技有限公司 | A kind of service calling method, device and electronic equipment |
CN109189379A (en) * | 2018-09-04 | 2019-01-11 | 百度在线网络技术(北京)有限公司 | code generating method and device |
KR20190030974A (en) * | 2017-09-15 | 2019-03-25 | 주식회사 티맥스 소프트 | Easy-to-use type of compile-time dependency injection method and device in the java platform |
CN110941423A (en) * | 2019-11-22 | 2020-03-31 | 深圳市航通智能技术有限公司 | Java-based method for quickly generating codes |
CN111026404A (en) * | 2019-12-13 | 2020-04-17 | 上海米哈游天命科技有限公司 | Method and device for generating parameter configuration code, electronic product and storage medium |
CN111064621A (en) * | 2019-12-25 | 2020-04-24 | 南京三百云信息科技有限公司 | Service data docking method and device |
-
2021
- 2021-07-26 CN CN202110842350.2A patent/CN113485770B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080235661A1 (en) * | 2007-03-21 | 2008-09-25 | Computer Associates Think, Inc. | System and method for using annotations to automatically generate a framework for a custom javaserver faces (jsf) component |
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN105204871A (en) * | 2015-10-30 | 2015-12-30 | 亚信科技(南京)有限公司 | Plug-in type development method and device |
CN105487864A (en) * | 2015-11-26 | 2016-04-13 | 北京京东尚科信息技术有限公司 | Method and device for automatically generating code |
KR20190030974A (en) * | 2017-09-15 | 2019-03-25 | 주식회사 티맥스 소프트 | Easy-to-use type of compile-time dependency injection method and device in the java platform |
CN108156022A (en) * | 2017-12-04 | 2018-06-12 | 北京奇艺世纪科技有限公司 | A kind of service calling method, device and electronic equipment |
CN109189379A (en) * | 2018-09-04 | 2019-01-11 | 百度在线网络技术(北京)有限公司 | code generating method and device |
CN110941423A (en) * | 2019-11-22 | 2020-03-31 | 深圳市航通智能技术有限公司 | Java-based method for quickly generating codes |
CN111026404A (en) * | 2019-12-13 | 2020-04-17 | 上海米哈游天命科技有限公司 | Method and device for generating parameter configuration code, electronic product and storage medium |
CN111064621A (en) * | 2019-12-25 | 2020-04-24 | 南京三百云信息科技有限公司 | Service data docking method and device |
Non-Patent Citations (1)
Title |
---|
毛毛: "通过注释自动生成类文件:APT实战(AbstractProcessor)", pages 1 - 8, Retrieved from the Internet <URL:2.https://cloud.tencent.com/developer/article/1695282> * |
Also Published As
Publication number | Publication date |
---|---|
CN113485770B (en) | 2024-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9442828B2 (en) | Generating test scripts through application integration | |
CN113127050B (en) | Application resource packaging process monitoring method, device, equipment and medium | |
CN113704102B (en) | Application program compliance detection method, device, equipment and medium | |
CN113515271B (en) | Service code generation method and device, electronic equipment and readable storage medium | |
CN113296786B (en) | Data processing method, device, electronic equipment and storage medium | |
US10831642B2 (en) | Detecting potential class loader problems using the class search path sequence for each class loader | |
US20190324782A1 (en) | Class splitting in object-oriented environments | |
CN114205156A (en) | Message detection method and device for tangent plane technology, electronic equipment and medium | |
CN113760491A (en) | Task scheduling system, method, equipment and storage medium | |
CN113485770B (en) | Method and device for determining service configuration data, electronic equipment and storage medium | |
WO2023138923A1 (en) | Failure prediction using informational logs and golden signals | |
CN113687880B (en) | Method, device, equipment and medium for calling component | |
CN111124423B (en) | Compiling detection method, device, server and medium based on multiple platforms | |
CN112748930A (en) | Compilation detection method, device, equipment and storage medium | |
CN112114811A (en) | Compiling method, device and equipment | |
US10102109B2 (en) | Exception resolution in a software development session | |
CN113127002B (en) | Method, device, equipment and medium for monitoring code compiling process | |
CN113127051B (en) | Application resource packaging process monitoring method, device, equipment and medium | |
US9280441B2 (en) | Detection and correction of race conditions in workflows | |
US8839207B2 (en) | Debugging extensible markup language | |
CN113590223A (en) | Starting method and device of engine editor, electronic equipment and storage medium | |
CN115167825A (en) | Method and device for processing C + + object in Java, electronic equipment and storage medium | |
CN115408003A (en) | Data access method and device in virtual machine, electronic equipment and medium | |
CN114385279A (en) | Subprocess management method, device, equipment and medium | |
CN113760345A (en) | Application program generation 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |