CN116775158A - Method, device, equipment and storage medium for processing configuration file - Google Patents

Method, device, equipment and storage medium for processing configuration file Download PDF

Info

Publication number
CN116775158A
CN116775158A CN202310767572.1A CN202310767572A CN116775158A CN 116775158 A CN116775158 A CN 116775158A CN 202310767572 A CN202310767572 A CN 202310767572A CN 116775158 A CN116775158 A CN 116775158A
Authority
CN
China
Prior art keywords
configuration file
data
processing
java object
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310767572.1A
Other languages
Chinese (zh)
Inventor
徐彬
贾俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202310767572.1A priority Critical patent/CN116775158A/en
Publication of CN116775158A publication Critical patent/CN116775158A/en
Pending legal-status Critical Current

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
    • 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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a configuration file processing method, a device, equipment and a storage medium, which dynamically reads data in a configuration file by using a reflection mechanism, then converts the data into a corresponding Java object, finally converts the Java object into a corresponding character string according to the Java object, and writes the corresponding character string into the configuration file, so that the technical problems that a great deal of transaction data can be processed every day by banks at present, the data can be finally displayed to users in a bill form through APP (application) through each system, transaction information in the bill is more and more abundant, displayed newly added fields can be transmitted through files between source systems, service code development is required for supporting new services each time, and the support on the services is not rapid, so that the labor cost is increased and the efficiency is low are solved.

Description

Method, device, equipment and storage medium for processing configuration file
Technical Field
The present application relates to the technical field of financial science and technology, and in particular, to a method, an apparatus, a device, and a storage medium for processing a configuration file.
Background
The financial industry refers to banking and related funds agencies, as well as insurance industry, and other economically relevant financial industries besides industrial economic activities. The financial industry refers to a particular industry that operates financial goods, including banking, insurance, trust, securities, and leasing industries. When the financial business service is carried out, the financial business service cannot be carried out through the Internet, and along with the development of the Internet and the arrival of the digital age, the development of the financial business is faster and faster, and the file transmission between the upstream system and the downstream system is more and more.
Currently, the financial industry, such as banks, processes a large amount of transaction data daily, which is ultimately presented to the user via the APP via the various systems in the form of a bill. Along with the development of business types, transaction information in bills is more and more rich, and displayed newly added fields are also transmitted through files between source systems, so that the development of business codes is required for supporting new businesses each time in the traditional mode, the support of the businesses is not rapid, and the technical problems of labor cost increase and low efficiency are caused.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for processing configuration files, which solve the technical problems that at present, banks can process a large amount of transaction data every day, the data can be finally displayed to users through various systems in the form of bills through APP, the transaction information in the bills is more and more rich, the displayed newly added fields can be transmitted through files among source systems, each time of supporting new business is required to develop business codes, the support of the business is not fast, and the labor cost is increased and the efficiency is low.
In view of this, a first aspect of the present application provides a method for processing a configuration file, where the method includes:
s1, dynamically reading data in a configuration file by using a reflection mechanism;
s2, converting the data into corresponding Java objects;
s3, converting the Java object into a corresponding character string according to the Java object, and writing the character string into the configuration file.
Preferably, before step S1, the method further comprises:
s4, defining a data structure of the configuration file format.
Preferably, step S4 specifically further includes:
a class loader is created for dynamically loading classes defined in the configuration file at runtime.
Preferably, step S1 specifically includes:
s11, dynamically reading data in the configuration file by using a reflection mechanism;
s12, dynamically loading the classes defined in the configuration file through the classload.
Preferably, step S3 specifically includes:
s31, converting the Java object type into a character string representation corresponding to the configuration file format according to the Java object type;
s32, writing the character string into the configuration file.
Preferably, step S3 further comprises:
s5, dynamically loading data processing of the configuration file according to the acquired service processing request, and converting the data processing into a corresponding Java object.
Preferably, the data structure includes strings, numbers, boolean values, arrays, objects.
A second aspect of the present application provides a configuration file processing apparatus, the apparatus comprising:
a data reading unit for dynamically reading data in the configuration file by using a reflection mechanism;
the data conversion unit is used for converting the data into corresponding Java objects;
and the data writing unit is used for converting the Java object into a corresponding character string according to the Java object and writing the character string into the configuration file.
A third aspect of the present application provides a configurable file processing apparatus, the apparatus comprising a processor and a memory:
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is configured to execute the steps of the method for processing a configuration file as described in the first aspect according to instructions in the program code.
A fourth aspect of the present application provides a computer readable storage medium storing program code for performing the steps of the above described method for processing a configuration file of the first aspect.
From the above technical solutions, the embodiment of the present application has the following advantages:
the application provides a configuration file processing method, which dynamically reads data in a configuration file by using a reflection mechanism, then converts the data into a corresponding Java object, finally converts the Java object into a corresponding character string according to the Java object, and writes the corresponding character string into the configuration file, so that the technical problems that a great deal of transaction data can be processed every day by banks at present, the data can be finally displayed to users in a bill form through APP through each system, transaction information in the bill is more and more rich, the displayed newly added fields can be transmitted through files between source systems, service code development is required for supporting new services each time, and the support on the services is not fast, so that the labor cost is increased and the efficiency is low are solved.
Furthermore, the application uses reflection and classload technology, can support the self-defined data type, so that the configuration file can be more flexibly adapted to different business demands, the format and the data type of the configuration file can be dynamically expanded according to the specific demands due to the self-defined data type, so that the configuration file is more suitable for complex business scenes, the class loader is used, so that the class defined in the configuration file can be dynamically loaded during operation, the system can be dynamically adapted to different environments and requirements, and the program can automatically read and write the configuration file due to the adoption of reflection technology, thereby greatly simplifying the processing flow of the configuration file and reducing unnecessary errors and anomalies.
Drawings
FIG. 1 is a flow chart of one embodiment of a method for configuring a file processing method in an embodiment of the present application;
FIG. 2 is a schematic diagram of a configuration file processing device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a configuration file processing device in an embodiment of the present application.
Detailed Description
In order to make the present application better understood by those skilled in the art, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The application designs a method, a device, equipment and a storage medium for processing configuration files, which solve the technical problems that at present, banks can process a large amount of transaction data every day, the data can be finally displayed to users through various systems in the form of bills through APP, the transaction information in the bills is more and more rich, the displayed newly added fields can be transmitted through files among source systems, each time of supporting new business is required to develop business codes, the support of the business is not fast, and the labor cost is increased and the efficiency is low.
For easy understanding, referring to fig. 1, fig. 1 is a flowchart of a method for processing a configuration file according to an embodiment of the present application, as shown in fig. 1, specifically:
s1, dynamically reading data in a configuration file by using a reflection mechanism;
at present, banks can process a large amount of transaction data every day, the data can be finally displayed to users in a bill form through APP (application) by each system, transaction information in the bill is more and more rich, displayed newly added fields can be transmitted through files among source systems, each time a new service is supported, development of service codes is required, the service support is not rapid, and the data in configuration files are required to be dynamically read by using a reflection mechanism.
It is understood that a reflection mechanism refers primarily to an ability of a program to access, detect and modify its own state or behavior, and to adjust or modify the state and associated semantics of the behavior described by the application based on the state and results of its own behavior. Reflection is a powerful tool in java that enables us to easily create flexible code that can be assembled during re-run without requiring source code links between components.
The role of the reflection mechanism:
1. decompiling: class- >. Java
2. Accessing the attribute of the java object through a reflection mechanism, a method, a construction method and the like;
class in the reflection mechanism specifically provided:
java.lang.Class;
java.lang.reflect.Constructor;java.lang.reflect.Field;
java.lang.reflect.Method;
java.lang.reflect.Modifier;
many operations in reflection, attributes, etc. we can query from these four classes.
Further, the database link character strings and the like are read more conveniently by reflection, and the configuration files are added by reflection, so that the program is more flexible.
It can be understood that, before step S1, the method further includes:
s4, defining a data structure of a configuration file format, specifically defining a configuration file format, wherein the configuration file format supports various types of data structures such as character strings, numbers, boolean values, arrays, objects and the like.
Further, the method further comprises the following steps:
a class loader is created for dynamically loading classes defined in the configuration file at runtime.
S2, converting the data into corresponding Java objects;
after dynamically reading the data in the configuration file by using the reflection mechanism, the data is converted into a corresponding Java object.
It should be noted that, by dynamically reading the data in the configuration file by using the reflection mechanism, the class defined in the configuration file is dynamically loaded by the classload, and in this process, the class defined in the configuration file may be dynamically loaded by the classload so as to support the custom data type.
It will be appreciated that when we write a Java program, whether CS or BS applications, a complete Java application is organized from a number of class files, when the program is running, an entry function of the program is called to call the relevant functions of the system, and these functions are all encapsulated in different class files, so that methods in another class file are often called from this class file, and if another file does not exist, a system exception may be raised. When the program is started, all class files needed by the program are not loaded at one time, but a certain class file is dynamically loaded into a memory through a class loading mechanism (class loader) of Java according to the requirement of the program, so that the class file can be referenced by other classes only after the class file is loaded into the memory. The ClassLoader is used to dynamically load class files into memory.
The class loader has mainly the following three:
(1) A boot class loader (Bootstrap ClassLoader) -which is used to load the core library of Java, is implemented in native code and is not inherited from Java.
This class loader is responsible for loading class libraries (identified only by filename, such as rt.jar, class libraries whose name does not match, but is not loaded even if placed in the specified path) that are deposited under java_home/lib, or in the path specified by the-xbootclaspath parameter, and that are identified by the virtual machine, into the virtual machine memory; the boot class loader cannot be directly referenced by the Java program;
(2) An extension class loader (Extension ClassLoader) -it is used to load an extension library of Java;
this loader is responsible for loading all class libraries in the java_home/lib/ext directory or in the path specified by the JAVA. Ext. Dirs system variables, and the developer can directly use the extended class loader;
(3) An application class loader (Application ClassLoader) -it loads Java classes according to the class path (CLASSPATH) of the Java application;
this loader is the return value of the getSystemClassLoader () method in the ClassLoader (which can be obtained by this method), so it is also commonly referred to as a system class loader. It is responsible for loading class libraries specified on the class path (Classpath) of the user, and can directly use this loader, which is typically the default class loader in the program if the application does not customize its class loader.
S3, converting the Java object into a corresponding character string according to the Java object, and writing the character string into the configuration file.
After converting the data into the corresponding Java object, the Java object needs to be converted into the corresponding character string and written into the configuration file.
Further, the Java object type is converted into a character string representation corresponding to the configuration file format according to the Java object type, and the character string is written into the configuration file.
It can be understood that the data processing of dynamically loading the configuration file is performed according to the acquired service processing request, and converted into the corresponding Java object, and in the application program, the configuration file can be dynamically loaded, converted into the Java object, and the corresponding service processing is performed by using the Java object.
According to the configuration file processing method, data in the configuration file is dynamically read by using a reflection mechanism, then the data is converted into corresponding Java objects, finally the Java objects are converted into corresponding character strings according to the Java objects and written into the configuration file, so that the technical problems that a great amount of transaction data can be processed every day by banks at present, the data can be finally displayed to users in a bill form through APP through each system, transaction information in the bill is more and more rich, displayed newly added fields can be transmitted through files among source systems, development of service codes is required for supporting new services each time, support on the services is not rapid, and labor cost is increased and efficiency is low are solved.
Furthermore, the application uses reflection and classload technology, can support the self-defined data type, so that the configuration file can be more flexibly adapted to different business demands, the format and the data type of the configuration file can be dynamically expanded according to the specific demands due to the self-defined data type, so that the configuration file is more suitable for complex business scenes, the class loader is used, so that the class defined in the configuration file can be dynamically loaded during operation, the system can be dynamically adapted to different environments and requirements, and the program can automatically read and write the configuration file due to the adoption of reflection technology, thereby greatly simplifying the processing flow of the configuration file and reducing unnecessary errors and anomalies.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a configuration file processing device according to an embodiment of the present application, as shown in fig. 2, specifically:
a data reading unit 201 for dynamically reading data in the configuration file by using a reflection mechanism;
a data conversion unit 202 for converting data into corresponding Java objects;
the data writing unit 203 is configured to convert the Java object into a corresponding character string according to the Java object, and write the character string into the configuration file.
According to the configuration file processing device in the embodiment, the data in the configuration file is dynamically read by the data reading unit 201 through a reflection mechanism, then the data is converted into the corresponding Java object by the data conversion unit 202, finally the Java object is converted into the corresponding character string by the data writing unit 203 and written into the configuration file, so that the technical problems that a great deal of transaction data can be processed every day by a bank at present, the data can be finally displayed to a user in a bill form through an APP (application) through each system, transaction information in the bill is more and more abundant, the displayed newly added fields can be transmitted through files among source systems, development of service codes is required for supporting new services each time, support on the services is not fast, and labor cost is increased and efficiency is low are solved.
Furthermore, the application uses reflection and classload technology, can support the self-defined data type, so that the configuration file can be more flexibly adapted to different business demands, the format and the data type of the configuration file can be dynamically expanded according to the specific demands due to the self-defined data type, so that the configuration file is more suitable for complex business scenes, the class loader is used, so that the class defined in the configuration file can be dynamically loaded during operation, the system can be dynamically adapted to different environments and requirements, and the program can automatically read and write the configuration file due to the adoption of reflection technology, thereby greatly simplifying the processing flow of the configuration file and reducing unnecessary errors and anomalies.
The embodiment of the present application further provides another configuration file processing device, as shown in fig. 3, for convenience of explanation, only the portion relevant to the embodiment of the present application is shown, and specific technical details are not disclosed, please refer to the method portion of the embodiment of the present application. The terminal can be any terminal equipment including a mobile phone, a tablet personal computer, a personal digital assistant (English full name: personal DigitalAssistant, english abbreviation: PDA), a sales terminal (English full name: point of sales, english abbreviation: POS), a vehicle-mounted computer and the like, taking the mobile phone as an example of the terminal:
fig. 3 is a block diagram showing a part of a structure of a mobile phone related to a terminal provided by an embodiment of the present application. Referring to fig. 3, the mobile phone includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (wireless fidelity, wiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 3 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
The following describes the components of the mobile phone in detail with reference to fig. 3:
the RF circuit 1010 may be used for receiving and transmitting signals during a message or a call, and particularly, after receiving downlink information of a base station, the signal is processed by the processor 1080; in addition, the data of the design uplink is sent to the base station. Generally, RF circuitry 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (English full name: lowNoiseAmplifier, english abbreviation: LNA), a duplexer, and the like. In addition, the RF circuitry 1010 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (english: global System ofMobile communication, english: GSM), general packet radio service (english: generalPacket Radio Service, GPRS), code division multiple access (english: code Division Multiple Access, english: CDMA), wideband code division multiple access (english: wideband Code DivisionMultipleAccess, english: WCDMA), long term evolution (english: long TermEvolution, english: LTE), email, short message service (english: shortMessaging Service, SMS), and the like.
The memory 1020 may be used to store software programs and modules that the processor 1080 performs various functional applications and data processing of the handset by executing the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 1020 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state memory device.
The input unit 1030 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the handset. In particular, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1031 or thereabout using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 1031 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 1080 and can receive commands from the processor 1080 and execute them. Further, the touch panel 1031 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 1030 may include other input devices 1032 in addition to the touch panel 1031. In particular, other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a track ball, a mouse, a joystick, etc.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the mobile phone. The display unit 1040 may include a display panel 1041, and alternatively, the display panel 1041 may be configured in the form of a liquid crystal display (english full name: liquid Crystal Display, acronym: LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel 1031 may overlay the display panel 1041, and when the touch panel 1031 detects a touch operation thereon or thereabout, the touch panel is transferred to the processor 1080 to determine a type of touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of touch event. Although in fig. 3, the touch panel 1031 and the display panel 1041 are two independent components for implementing the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to implement the input and output functions of the mobile phone.
The handset may also include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the mobile phone moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the handset are not described in detail herein.
Audio circuitry 1060, a speaker 1061, and a microphone 1062 may provide an audio interface between a user and a cell phone. Audio circuit 1060 may transmit the received electrical signal after audio data conversion to speaker 1061 for conversion by speaker 1061 into an audio signal output; on the other hand, microphone 1062 converts the collected sound signals into electrical signals, which are received by audio circuit 1060 and converted into audio data, which are processed by audio data output processor 1080 for transmission to, for example, another cell phone via RF circuit 1010 or for output to memory 1020 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and a mobile phone can help a user to send and receive emails, browse webpages, access streaming media and the like through a WiFi module 1070, so that wireless broadband Internet access is provided for the user. Although fig. 3 shows a WiFi module 1070, it is understood that it does not belong to the necessary constitution of the handset, and can be omitted entirely as required within the scope of not changing the essence of the application.
Processor 1080 is the control center of the handset, connects the various parts of the entire handset using various interfaces and lines, and performs various functions and processes of the handset by running or executing software programs and/or modules stored in memory 1020, and invoking data stored in memory 1020, thereby performing overall monitoring of the handset. Optionally, processor 1080 may include one or more processing units; preferably, processor 1080 may integrate an application processor primarily handling operating systems, user interfaces, applications, etc., with a modem processor primarily handling wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1080.
The handset further includes a power source 1090 (e.g., a battery) for powering the various components, which may preferably be logically connected to the processor 1080 by a power management system, such as to provide for managing charging, discharging, and power consumption by the power management system.
Although not shown, the mobile phone may further include a camera, a bluetooth module, etc., which will not be described herein.
In an embodiment of the present application, the processor 1080 included in the terminal further has the following functions:
s1, acquiring a communication call request, and extracting call information corresponding to the communication call request;
s2, matching the call information with a real-name database, and if the matching is unsuccessful, executing a step S3;
s3, carrying out the unauthenticated marking on the call information and sending the call information to the called terminal through the communication line to carry out the call prompt.
The embodiments of the present application also provide a computer readable storage medium storing program code for executing any one of the foregoing configuration file processing methods of the respective embodiments.
In the embodiment of the application, a method, a device, equipment and a storage medium for processing a configuration file are provided, data in the configuration file is dynamically read by using a reflection mechanism, then the data is converted into a corresponding Java object, and finally the Java object is converted into a corresponding character string according to the Java object and written into the configuration file, so that the technical problems that a great amount of transaction data can be processed every day by a bank at present, the data can be finally displayed to a user in a bill form through an APP (application) through each system, transaction information in the bill is more and more abundant, the displayed newly added fields can be transmitted through files among source systems, development of service codes is required for supporting new services each time, and the support for the services is not rapid, so that the labor cost is increased and the efficiency is low are solved.
Furthermore, the application uses reflection and classload technology, can support the self-defined data type, so that the configuration file can be more flexibly adapted to different business demands, the format and the data type of the configuration file can be dynamically expanded according to the specific demands due to the self-defined data type, so that the configuration file is more suitable for complex business scenes, the class loader is used, so that the class defined in the configuration file can be dynamically loaded during operation, the system can be dynamically adapted to different environments and requirements, and the program can automatically read and write the configuration file due to the adoption of reflection technology, thereby greatly simplifying the processing flow of the configuration file and reducing unnecessary errors and anomalies.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The terms "first," "second," "third," "fourth," and the like in the description of the application and in the above figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for processing a configuration file, comprising:
s1, dynamically reading data in a configuration file by using a reflection mechanism;
s2, converting the data into corresponding Java objects;
s3, converting the Java object into a corresponding character string according to the Java object, and writing the character string into the configuration file.
2. The method for processing a configuration file according to claim 1, further comprising, before the step S1:
and S4, defining the data structure of the configuration file format.
3. The method for processing a configuration file according to claim 2, wherein the step S4 specifically further comprises:
a class loader is created for dynamically loading classes defined in the configuration file at runtime.
4. The method for processing a configuration file according to claim 1, wherein the step S1 specifically includes:
s11, dynamically reading data in the configuration file by using a reflection mechanism;
s12, dynamically loading the classes defined in the configuration file through the classload.
5. The method for processing a configuration file according to claim 1, wherein the step S3 specifically includes:
s31, converting the Java object type into the character string representation corresponding to the configuration file format according to the Java object type;
s32, writing the character string into the configuration file.
6. The method for processing a configuration file according to claim 1, wherein the step S3 further comprises:
s5, dynamically loading data processing of the configuration file according to the acquired service processing request, and converting the data processing into a corresponding Java object.
7. The method of claim 2, wherein the data structure comprises a string, a number, a boolean value, an array, an object.
8. A configurable document processing device, comprising:
a data reading unit for dynamically reading data in the configuration file by using a reflection mechanism;
the data conversion unit is used for converting the data into corresponding Java objects;
and the data writing unit is used for converting the Java object into a corresponding character string according to the Java object and writing the character string into the configuration file.
9. A configured document processing device, the device comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the method of configurable file handling of any of claims 1-7 according to instructions in the program code.
10. A computer readable storage medium, characterized in that the computer readable storage medium is for storing a program code for executing the method of the configuration file processing of any one of claims 1 to 7.
CN202310767572.1A 2023-06-27 2023-06-27 Method, device, equipment and storage medium for processing configuration file Pending CN116775158A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310767572.1A CN116775158A (en) 2023-06-27 2023-06-27 Method, device, equipment and storage medium for processing configuration file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310767572.1A CN116775158A (en) 2023-06-27 2023-06-27 Method, device, equipment and storage medium for processing configuration file

Publications (1)

Publication Number Publication Date
CN116775158A true CN116775158A (en) 2023-09-19

Family

ID=88011251

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310767572.1A Pending CN116775158A (en) 2023-06-27 2023-06-27 Method, device, equipment and storage medium for processing configuration file

Country Status (1)

Country Link
CN (1) CN116775158A (en)

Similar Documents

Publication Publication Date Title
CN107329985B (en) Page collection method and device and mobile terminal
CN107908952B (en) Method and device for identifying real machine and simulator and terminal
CN107423794B (en) Code scanning method and device for graphic coding and mobile terminal
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
WO2020238351A1 (en) Application downloading and classification method and terminal device
CN112148579B (en) User interface testing method and device
CN110869902A (en) Method for browsing application folder and electronic equipment
CN106959859B (en) Calling method and device of system calling function
CN111459565B (en) Client page rendering method and device and mobile terminal
CN111966491B (en) Method for counting occupied memory and terminal equipment
CN111770009B (en) Data transmission method and related equipment
CN111880675B (en) Interface display method and device and electronic equipment
CN110046497B (en) Function hook realization method, device and storage medium
CN106202422B (en) The treating method and apparatus of Web page icon
CN116644716A (en) Method, device, equipment and storage medium for formatting ppt document
CN116303085A (en) Test reason analysis method, device, equipment and storage medium
CN116775158A (en) Method, device, equipment and storage medium for processing configuration file
CN104376235A (en) Archived file package signing method and device
CN109189576B (en) Redis-based request processing method, server and computer-readable storage medium
CN111459528B (en) Frequency band upgrading method, system, storage medium and mobile terminal
US11782596B2 (en) Apparatus and method for providing content search using keypad in electronic device
CN107944021B (en) File replacement method and device and terminal equipment
CN116681438A (en) Custom generation method, device, equipment and storage medium for collection interface
CN117011023A (en) Full link regression data management method, device, equipment and storage medium
CN107317919B (en) Communication message reply method and device and mobile terminal

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