CN113485770B - 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 PDF

Info

Publication number
CN113485770B
CN113485770B CN202110842350.2A CN202110842350A CN113485770B CN 113485770 B CN113485770 B CN 113485770B CN 202110842350 A CN202110842350 A CN 202110842350A CN 113485770 B CN113485770 B CN 113485770B
Authority
CN
China
Prior art keywords
service configuration
service
class
configuration data
data
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.)
Active
Application number
CN202110842350.2A
Other languages
Chinese (zh)
Other versions
CN113485770A (en
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.)
Guahao Net Hangzhou Technology Co Ltd
Original Assignee
Guahao Net Hangzhou Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guahao Net Hangzhou Technology Co Ltd filed Critical Guahao Net Hangzhou Technology Co Ltd
Priority to CN202110842350.2A priority Critical patent/CN113485770B/en
Publication of CN113485770A publication Critical patent/CN113485770A/en
Application granted granted Critical
Publication of CN113485770B publication Critical patent/CN113485770B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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 area 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: according to the service configuration item class compiling instruction, a corresponding service configuration interface is determined, and a service configuration class generating method is called according to the service configuration interface to obtain the service configuration class.

Description

Method and device for determining service configuration data, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a device for 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 entity classes carrying configuration items, and acquires the service configuration data through writing the completed entity classes. However, the conventional method for determining service configuration data has the technical problems that code error rate is high and time consumption is long in the software development process of program developers, so that the efficiency of software development and development is reduced.
Disclosure of Invention
The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for determining service configuration data, which are used for automatically generating service configuration types of bearing configuration items, reducing code error rate in a software development process and time consumption, thereby improving the efficiency of software development.
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 area 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 class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class.
In a second aspect, an embodiment of the present invention further provides a device for determining service configuration data, where the device includes:
the system comprises a target service identification determining module, a target service identification determining module and a service processing module, wherein 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;
the service configuration item object determining module is used for determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier;
the configuration data obtaining module is used for obtaining service configuration data corresponding to the service configuration item object from a data cache area according to the service configuration item object and obtaining configuration data corresponding to the target service based on the service configuration data;
and the service configuration class generating 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 generating 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, including:
one or more processors;
a storage means for storing one or more programs;
the program, when executed by the processor, causes the processor to implement a method for determining service configuration data as provided by any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for determining service configuration data as provided in any embodiment of the present invention.
According to the technical scheme, the target service identification 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 area 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 compiling instruction, and call the service configuration class generating method according to the service configuration interface to obtain the service configuration class, thereby realizing automatic generation of the service configuration class carrying the configuration item, solving the technical problems of higher code error rate and longer time consumption of program developers in the software development process in the traditional method for determining the service configuration data, and achieving 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 and development.
Drawings
In order to more clearly illustrate the technical solution of the exemplary embodiments of the present invention, a brief description is given below of the drawings required for describing the embodiments. It is obvious that the drawings presented are only drawings of some of the embodiments of the invention to be described, and not all the drawings, and that other drawings can be made according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for determining service configuration data according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a method for generating a service configuration class according to a first embodiment of the present invention;
fig. 3 is a flow chart 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 determining device module of service configuration data 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 invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a method for determining service configuration data according to a first embodiment of the present invention, where the method may be performed by a service configuration data determining device, and the service configuration data determining device may be implemented in software and/or hardware, and the service configuration data determining device 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 identification 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 the target service.
Specifically, a configuration data acquisition instruction of a target service is received. And analyzing the configuration data acquisition instruction, and further, determining the target service identification of the target service.
Optionally, the manner of receiving the configuration data acquisition instruction of the target service may be various, which is not limited herein, and may be that receiving the configuration data acquisition instruction generated by triggering a preset configuration data acquisition instruction by a user; it is also possible to receive an instruction or the like for generating configuration data based on the configuration data acquired inputted by the user based on the input device.
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 class generated in advance, for example, cfgconstate { }. At least one service configuration item object may be included in the service configuration class. A service configuration item object may be understood as an object for configuring configuration data of a target service. Alternatively, the type of the service profile 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 determining the target service identifier, a service configuration class generated in advance may be obtained. After the service configuration class is acquired, 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 the service configuration item object corresponding to the target service identifier in the service configuration class according to the target service identifier includes:
and comparing the consistency of the target service identifier with each service identifier contained in the service configuration class, and if the service configuration class contains the target service identifier, determining the service configuration item object corresponding to the target service identifier in the service configuration class based on the pre-established corresponding relation between the target service identifier and the service configuration item object.
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 class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class.
The service configuration item class compiling instruction may be an instruction for compiling a source program to obtain a service configuration item class. The service configuration class generation method may be a predefined method, and may be a method for generating a service configuration class. The service configuration interface may be an interface that invokes a service configuration class generation method.
Specifically, a service configuration class generation method is predefined. When the service configuration item class compiling instruction is received, a service configuration interface corresponding to the service configuration item class compiling instruction can be determined according to the service configuration item class compiling instruction. After determining the corresponding service configuration interface, the service configuration class generating method can be called according to the service configuration interface. And may further 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, application program 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.java interface labels custom notes. This interface corresponds to the entry point of JSR269 nature.
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 when the service configuration class is generated or when the service configuration class is generated, the service configuration class may be stored to the preset service resource location. Wherein, storing the service configuration class to the preset service resource position has the following advantages: and the management of the program codes is facilitated, and the subsequent maintenance of the codes is facilitated.
In order to reduce the coupling of the program code, the service configuration class generation method may be a predefined Processor (configuration item constant class generation tool). The benefits of using a Processor are: when the program is deployed, the Processor is not required to be packaged into a deployment file, the Processor is used for compiling the source program once, the Processor is stored into a dependency repository (nexus), and the subsequent release is not required to be compiled again.
Referring to fig. 2, in the process of compiling an API, a compiler uses a cfg.java interface as an access point, and invokes a Processor in a service layer through the cfg.java interface to generate a service configuration class. Alternatively, the compiler may be a java compiler.
Optionally, before the service configuration class generating method is called according to the service configuration interface, the method further comprises:
detecting the current program environment, and if the current environment is a development environment, executing the operation of calling the service configuration class generating method according to the service configuration interface.
The current program environment may be the program environment at the current time. Program environments may include, but are not limited to, the following: development environment, test environment, and compilation environment.
Specifically, before the service configuration class generating method is called according to the service configuration interface, the current program environment can be detected, and then the current program environment is determined. If the current environment is a development environment, an operation of calling a service configuration class generation method according to a service configuration interface may be performed.
Optionally, calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class, including:
and calling a service configuration class generating 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.
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 a 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 item and the configuration data type corresponding to the service configuration item can be obtained by calling the service configuration class generation method through the service configuration interface. Further, a service configuration class may be generated based on the service configuration item and the configuration data type.
In order to improve the type safety of the program, improve the readability of the code and reduce the complexity of the code, a service configuration class can be generated, and the parameter types of the generated service configuration class are subjected to generalization, so that the generated service configuration class is CfgConstat.
Illustratively, the cfgconstate class may include code to:
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 service_code_pre is a service configuration item object.
Optionally, the service configuration class is generated by:
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 generating the constructor, acquiring the service configuration item and the configuration data type corresponding to the service configuration item. After the service profile and the profile data type corresponding to the service profile are acquired, the type of the service profile object may be set to a final type.
And fifthly, after setting the type of the service configuration item object as the final type, writing a predefined equality method and a hash code method into the class file to be processed.
And step six, after writing in a predefined equivalent method and a hash method, the written pending class file can be used as a service configuration class file, and then the service configuration class can be determined based on the service configuration class file.
Optionally, invoking a service configuration class generating method according to the service configuration interface to obtain a service configuration item and a configuration data type corresponding to the service configuration item, including:
and calling a service configuration class generating 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 a service configuration item and a configuration data type corresponding to the service configuration item. The service profile definition table may be a config_definition table, for example. 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 an intelger type.
Specifically, a service configuration item definition table is predefined, and service configuration items and configuration data types corresponding to the service configuration items are predefined in the service configuration item definition table. The service configuration item definition table is used for defining the service configuration item and the configuration data type corresponding to the service configuration item.
S130, according to the service configuration item object, service configuration data corresponding to the service configuration item object is obtained from the data cache area, and configuration data corresponding to the target service is obtained based on the service configuration data.
The data buffer area may be a buffer area storing service configuration data corresponding to the service configuration item object.
Specifically, after the service configuration item object is determined, a buffer area 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 buffer area where the service configuration data is located is determined, the service configuration data corresponding to the service configuration item object may be obtained from the data buffer area. Furthermore, the configuration data corresponding to the target service can be obtained according to the service configuration data.
According to the technical scheme, the target service identification 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 area 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 compiling instruction, and call the service configuration class generating method according to the service configuration interface to obtain the service configuration class, thereby realizing automatic generation of the service configuration class carrying the configuration item, solving the technical problems of higher code error rate and longer time consumption of program developers in the software development process in the traditional method for determining the service configuration data, and achieving 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 and development.
Example two
Fig. 3 is a flow chart of a method for determining service configuration data according to a second embodiment of the present invention, optionally, before obtaining service configuration data corresponding to a service configuration item object from a data cache area according to the service configuration item object, further includes: judging whether the data buffer area has service configuration data corresponding to the service configuration item object, if so, executing the operation of acquiring the service configuration data corresponding to the service configuration item object from the data buffer area according to the service configuration item object.
Optionally, the obtaining, based on the service configuration data, configuration data corresponding to the target service 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 with the converted data type as the configuration data corresponding to the target service.
Wherein, the technical terms identical to or corresponding to the above embodiments are not repeated herein.
As shown in fig. 3, the method of this embodiment may specifically include:
s210, receiving a configuration data acquisition instruction of a target service, and determining a target service identification of the target service.
S220, according to the target service identification, determining a service configuration item object corresponding to the target service identification in the service configuration class.
S230, judging whether the data buffer area has service configuration data corresponding to the service configuration item object, and if not, executing S240; if so, S250 is performed.
Specifically, after determining the service configuration item object, it may be determined whether the service configuration data corresponding to the service configuration item object exists in the data buffer area, 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 area.
The configuration value storage table may be a table predefined in a database and may be used to store service configuration data corresponding to a service configuration item object. The configuration value storage table may be a config_value table, for example. The configuration value storage table may include, but is not limited to, the following key fields: code, bid (service key) and value (service configuration data)
Specifically, a configuration value storage table is predefined in the database, and service configuration data is pre-stored in the configuration value storage table. If the data buffer area 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 obtained 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 buffer.
S250, according to the service configuration item object, service configuration data corresponding to the service configuration item object is obtained from the data cache area.
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.
The type information may be type information of a 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 types may be public, private, and protected.
Specifically, after service configuration data corresponding to the service configuration item object is obtained from the data buffer, the type information of the service configuration item object may be determined. Further, 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 further, configuration data corresponding to the target service can be obtained.
According to the technical scheme of the embodiment, before service configuration data corresponding to the service configuration item object is obtained from the data cache area according to the service configuration item object, whether the service configuration data corresponding to the service configuration item object exists in the data cache area is judged, and if so, the operation of obtaining the service configuration data corresponding to the service configuration item object from the data cache area according to the service configuration item object is executed. If the service configuration data does not exist, service configuration data corresponding to the service configuration item object is obtained from a configuration value storage table in the database, and the obtained service configuration data is stored in a data cache area, so that the service configuration data can be obtained more quickly and conveniently. The processing mode improves the code reusability, and achieves the technical problems of reducing the code error rate in the software development process and improving the software development and development efficiency by 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.
Example III
Fig. 4 is a schematic block diagram of a service configuration data determining device according to a third embodiment of the present invention, where the present invention provides a service configuration data determining device, and the device includes: a target service identification determination module 310, a service configuration item object determination module 320, a configuration data acquisition module 330, and a service configuration class generation module 340.
The target service identifier determining module 310 is configured to receive a configuration data acquisition 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 area, and obtain configuration data corresponding to the target service based on the service configuration data; 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 of the target service is determined by receiving the configuration data acquisition instruction of the target service by the target service identification determining module. And determining a service configuration item object corresponding to the target service identifier in the service configuration class by a service configuration item object determining module according to the target service identifier. And acquiring service configuration data corresponding to the service configuration item object from the data cache area by the configuration data acquisition module according to the service configuration item object, and acquiring configuration data corresponding to the target service based on the service configuration data. The service configuration class generating module can 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, so that the service configuration class of the bearing configuration item is automatically generated, the technical problems of higher code error rate and longer time consumption of program developers in the software development process in the traditional service configuration data determining method are solved, and the technical effects of reducing the code error rate and time consumption in the software development process are achieved, thereby improving the efficiency of software development and development.
Optionally, before the service configuration class generating method is called according to the service configuration interface, the device further includes: and the program environment detection module is used for detecting the current program environment, and executing the operation of calling the service configuration class generation method according to the service configuration interface if the current environment is a development environment.
Optionally, the service configuration class generating module 340 is configured to invoke 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 invoke 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 service configuration data corresponding to the service configuration item object from the data buffer according to the service configuration item object, the apparatus further includes: and the service configuration data judging module is used for judging whether the data buffer area has service configuration data corresponding to the service configuration item object, and if so, executing the operation of acquiring the service configuration data corresponding to the service configuration item object from the data buffer area according to the service configuration item object.
Optionally, the service configuration data judging module is further configured to acquire service configuration data corresponding to the service configuration item object from a configuration value storage table in the database if the service configuration data does not exist, and store the acquired service configuration data in the data cache area.
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 with the converted data type as the configuration data corresponding to the target service.
The device can execute the service configuration data determining method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the service configuration data determining method.
It should be noted that, each unit and module included in the above-mentioned service configuration data determining device are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present invention.
Example IV
Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Fig. 5 shows a block diagram of an exemplary electronic device 12 suitable for use in implementing any of the embodiments of the invention. The electronic device 12 shown in fig. 5 is merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention. Device 12 is typically an electronic device that undertakes the processing of configuration information.
As shown in fig. 5, the electronic device 12 is in the form of a general purpose computing device. Components of the 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 connecting the different components, including the memory 28 and the processing unit 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry standard architecture (Industry Standard Architecture, ISA) bus, micro channel architecture (Micro Channel Architecture, MCA) bus, enhanced ISA bus, video electronics standards association (Video Electronics Standards Association, VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.
Electronic device 12 typically includes a variety of computer-readable media. Such media can be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer device readable media in the form of volatile memory, such as random access memory (Random Access Memory, RAM) 30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in the drawings, a disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from and writing to a removable nonvolatile optical disk (e.g., a Compact Disc-Read Only Memory (CD-ROM), digital versatile Disc (Digital Video Disc-Read Only Memory, DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product 40, with program product 40 having a set of program modules 42 configured to perform the functions of embodiments of the present invention. Program product 40 may be stored, for example, in memory 28, such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, mouse, camera, etc., and display), with one or more devices that enable a user to interact with the electronic device 12, and/or with any device (e.g., network card, modem, etc.) that enables the electronic device 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., local area network (Local Area Network, LAN), wide area network Wide Area Network, WAN) and/or a public network, such as the internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 over the bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 12, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) devices, tape drives, data backup storage devices, and the like.
The processor 16 executes various functional applications and data processing by running a program stored in the memory 28, for example, to implement a method of determining service configuration data provided by the above-described embodiment of the present invention, the method comprising:
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 area 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 class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class.
Of course, those skilled in the art will appreciate that the processor may also implement the method for determining service configuration data provided in any of the embodiments of the present invention.
Example five
A fifth embodiment of the present invention also provides a computer readable storage medium having a computer program stored thereon, where the program, when executed by a processor, is a method for determining service configuration data provided by the foregoing embodiment of the present invention, the method including:
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 area 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 class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A method for determining service configuration data, comprising:
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 area 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:
determining a corresponding service configuration interface according to the service configuration class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class;
the method for generating the service configuration class according to the service configuration interface is called to obtain the service configuration class, and comprises the following steps:
and calling a service configuration class generating 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.
2. The method of claim 1, further comprising, prior to said invoking a service configuration class generation method in accordance with said service configuration interface:
detecting a current program environment, and executing the operation of calling a service configuration class generating method according to the service configuration interface if the current program environment is a development environment.
3. The method according to claim 1, wherein the calling a service configuration class generating method according to the service configuration interface, obtaining a service configuration item and a configuration data type corresponding to the service configuration item, includes:
and calling a service configuration class generating method according to the service configuration interface to acquire a service configuration item contained in a service configuration item definition table and a configuration data type corresponding to the service configuration item.
4. The method of claim 1, further comprising, prior to retrieving service configuration data corresponding to a service configuration item object from a data cache area based on the service configuration item object:
judging whether the data buffer area has service configuration data corresponding to the service configuration item object, if so, executing the operation of acquiring the service configuration data corresponding to the service configuration item object from the data buffer area according to the service configuration item object.
5. The method according to claim 4, wherein the method further comprises:
and if the service configuration data 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 into the data cache area.
6. The method according to claim 1, wherein 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 with the converted data type as the configuration data corresponding to the target service.
7. A service configuration data determining apparatus, comprising:
the system comprises a target service identification determining module, a target service identification determining module and a service processing module, wherein 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;
the service configuration item object determining module is used for determining a service configuration item object corresponding to the target service identifier in a service configuration class according to the target service identifier;
the configuration data obtaining module is used for obtaining service configuration data corresponding to the service configuration item object from a data cache area according to the service configuration item object and obtaining configuration data corresponding to the target service based on the service configuration data;
the service configuration class generating module is used for determining a corresponding service configuration interface according to the service configuration class compiling instruction, and calling a service configuration class generating method according to the service configuration interface to obtain a service configuration class;
the service configuration class generating module is used for calling a service configuration class generating 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.
8. An electronic device, the electronic device comprising:
one or more processors;
a storage means for storing one or more programs;
the program, when executed by the processor, causes the processor to implement a method of determining service configuration data according to any one of claims 1 to 6.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a method of determining service configuration data according to any of claims 1-6.
CN202110842350.2A 2021-07-26 2021-07-26 Method and device for determining service configuration data, electronic equipment and storage medium Active CN113485770B (en)

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 CN113485770A (en) 2021-10-08
CN113485770B true 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 (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471282B2 (en) * 2007-03-21 2016-10-18 Ca, Inc. System and method for using annotations to automatically generate a framework for a custom javaserver faces (JSF) component

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113485770A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
US10007596B2 (en) Generating test scripts through application integration
US10169034B2 (en) Verification of backward compatibility of software components
WO2022142896A1 (en) Generation method and apparatus for visualizable template, device, and storage medium
US20170277664A1 (en) Graphical data presented in code editor along with code
US20080134062A1 (en) Method and apparatus for obtaining user interface information from executable program code
US20170371763A1 (en) Automated globalization enablement on development operations
CN110688111A (en) Configuration method, device, server and storage medium of business process
US10831642B2 (en) Detecting potential class loader problems using the class search path sequence for each class loader
CN113485770B (en) Method and device for determining service configuration data, electronic equipment and storage medium
US20110246967A1 (en) Methods and systems for automation framework extensibility
CN113127050B (en) Application resource packaging process monitoring method, device, equipment and medium
US10776255B1 (en) Automatic verification of optimization of high level constructs using test vectors
CN113515271A (en) Service code generation method and device, electronic equipment and readable storage medium
CN112380142A (en) Interface document management method and device and test equipment
CN112114811A (en) Compiling method, device and equipment
US9280441B2 (en) Detection and correction of race conditions in workflows
CN112748930B (en) Compilation detection method, device, equipment and storage medium
CN112799954B (en) Method, apparatus and computer readable medium for quickly constructing test environment
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
CN116009951A (en) Code processing method, device, equipment and storage medium
CN114296705A (en) Application package generation method and device, electronic equipment and storage medium
CN116795867A (en) Data processing method, device, electronic equipment and medium
CN116541029A (en) Method and device for generating application program installation package, 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
GR01 Patent grant
GR01 Patent grant