Disclosure of Invention
The application aims to provide a service processing method, a service processing device, an electronic device and a computer readable storage medium, which meet the differentiated requirements of services and obviously reduce the complexity of service processing.
in order to achieve the above object, the present application provides a service processing method, including:
acquiring a service request and a query request aiming at service processing priority;
Acquiring corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance;
Determining target configuration information with the highest priority from the priority configuration information;
and analyzing the target configuration information so as to process the service request based on the analyzed configuration information.
Optionally, the method further includes:
acquiring service configuration data input by a user side, and determining a priority level according to the service configuration data;
and generating current priority configuration information based on the service configuration data and the priority level, and storing the current priority configuration information into a pre-established preset configuration library.
Optionally, the service configuration data includes configuration identifier information, a configuration value, and a corresponding priority level;
correspondingly, the generating current priority configuration information based on the service configuration data and the priority level, and storing the current priority configuration information in a pre-established preset configuration library includes:
Converting the configuration value into character string information, and binding and generating the current priority configuration information according to the character string information and the corresponding information of the priority level;
And determining the configuration identification information as the identification information of the current priority configuration information, and correspondingly storing the current priority configuration information and the corresponding identification information into the preset configuration library.
optionally, before storing the current priority configuration information in a preset configuration library created in advance, the method further includes:
Judging whether corresponding configuration information exists in the preset configuration library or not based on the configuration identification information of the current priority configuration information;
if the corresponding configuration information does not exist in the preset configuration library, directly starting the step of storing the current priority configuration information into the preset configuration library;
if the corresponding configuration information exists in the preset configuration library, judging whether the historical priority configuration information corresponding to the first identification information is consistent with the current priority configuration information;
And if the historical priority configuration information is inconsistent with the current priority configuration information, starting a step of storing the current priority configuration information into the preset configuration library.
Optionally, the obtaining, according to the query request, corresponding priority configuration information from a preset configuration library includes:
analyzing the query request to obtain a query parameter;
and assembling an SQL query statement according to the query parameters, and acquiring corresponding priority configuration information from the preset configuration library by using the SQL query statement.
optionally, analyzing the target configuration information includes:
Acquiring the corresponding relation between the priority configuration information and the data type;
And determining the data type corresponding to the target configuration information by utilizing the corresponding relation, and analyzing the target configuration information into the analyzed configuration information of the corresponding data type.
In order to achieve the above object, the present application provides a service processing apparatus, including:
The request acquisition module is used for acquiring a service request and an inquiry request aiming at the service processing priority;
The configuration acquisition module is used for acquiring corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance;
the priority determining module is used for determining target configuration information with the highest priority from the priority configuration information;
and the service processing module is used for analyzing the target configuration information so as to process the service request based on the analyzed configuration information.
Optionally, the method further includes:
the configuration acquisition module is used for acquiring service configuration data input by a user party and determining a priority level according to the service configuration data;
and the configuration storage module is used for generating current priority configuration information based on the service configuration data and the priority level and storing the current priority configuration information into a pre-established preset configuration library.
to achieve the above object, the present application provides an electronic device including:
A memory for storing a computer program;
and the processor is used for realizing the steps of the service processing method when the computer program is executed.
to achieve the above object, the present application provides a computer-readable storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of the service processing method as described above.
according to the above scheme, the service processing method provided by the application includes: acquiring a service request and a query request aiming at service processing priority; acquiring corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance; determining target configuration information with the highest priority from the priority configuration information; and analyzing the target configuration information so as to process the service request based on the analyzed configuration information. As can be seen from the above, according to the query request for the service processing priority, the corresponding priority configuration information is obtained from the preset configuration library, so that the configuration information with the highest priority can be determined according to the priority configuration information to process the current service request, the priority corresponding to the service configuration can be dynamically adjusted, the differentiation requirement of the same service is met, and the service processing complexity is remarkably reduced.
the application also discloses a business processing device, an electronic device and a computer readable storage medium, which can also realize the technical effects.
it is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Detailed Description
the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
in the related art, the configuration of a service generally has a plurality of configuration levels, and accordingly, the configuration levels have a certain priority, and the configuration priorities may be different between different services.
Therefore, the embodiment of the application discloses a service processing method, which meets the differentiated requirements of services and obviously reduces the complexity of service processing.
Referring to fig. 1, a service processing method disclosed in the embodiment of the present application includes:
S101: acquiring a service request and a query request aiming at service processing priority;
In the embodiment of the application, a server is used for acquiring a service request initiated by a user and acquiring a query request. Specifically, the service request may be obtained based on a preset interface, and the query request may specifically be a request for querying a service processing priority.
s102: acquiring corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance;
It should be noted that, in the embodiment of the present application, a preset configuration library is established in advance by using all priority configuration information, and after the query request is obtained, the corresponding priority configuration information is obtained from the preset configuration library according to the query request.
in specific implementation, firstly, service configuration data entered by a user side can be obtained, and a priority level is determined according to the service configuration data; and then generating current priority configuration information based on the service configuration data and the priority level, and storing the current priority configuration information into a pre-established preset configuration library.
it is understood that the user may submit the service configuration data to the server, which may specifically include, but is not limited to, the configured configuration identification information key, the specific configuration value, and the corresponding priority level, for example: transaction data, user ID, organization information, and zoning information, and the server determines a priority level according to the service configuration data, for example: level1 is the transaction type, level2 is the zoning information, level3 is the organization information, level4 is the user ID, and then priority configuration information is generated and stored in the preset configuration library.
s103: determining target configuration information with the highest priority from the priority configuration information;
in this step, after the priority configuration information is obtained, the priority is sorted according to the configured priority, and the target configuration information with the highest priority is taken out. Specifically, it may be set that the higher the priority, the smaller the corresponding numerical value.
s104: and analyzing the target configuration information so as to process the service request based on the analyzed configuration information.
After the target configuration information with the highest priority is determined, the target configuration information is analyzed, so that the service request can be processed based on the configuration information obtained after analysis.
for example, if a user needs to go to a bank to handle business and needs to query the bank, a request for querying the bank is initiated, corresponding priority configuration is queried, and if the corresponding priority configuration is queried to be the highest zoning level priority and the lower provincial and municipal level priority, the current query request is responded based on the zoning level with the highest priority, namely, the bank in a nearby administrative area is returned to the user according to the zoning level priority.
according to the above scheme, the service processing method provided by the application includes: acquiring a service request and a query request aiming at service processing priority; acquiring corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance; determining target configuration information with the highest priority from the priority configuration information; and analyzing the target configuration information so as to process the service request based on the analyzed configuration information. As can be seen from the above, according to the query request for the service processing priority, the corresponding priority configuration information is obtained from the preset configuration library, so that the configuration information with the highest priority can be determined according to the priority configuration information to process the current service request, the priority corresponding to the service configuration can be dynamically adjusted, the differentiation requirement of the same service is met, and the service processing complexity is remarkably reduced.
A specific creation process of the preset configuration library in the service processing method provided in the embodiment of the present application is described below. Specifically, referring to fig. 2, the process includes:
s201: acquiring service configuration data input by a user side, and determining a priority level according to the service configuration data;
s202: converting the configuration numerical value in the service configuration data into character string information, and binding and generating the current priority configuration information according to the character string information and the corresponding information of the priority level;
S203: determining configuration identification information in the service configuration data as identification information of the current priority configuration information;
S204: judging whether corresponding configuration information exists in the preset configuration library or not based on the configuration identification information of the current priority configuration information; if no corresponding configuration information exists, directly entering step S206; if the corresponding configuration information exists, go to step S205;
s205: judging whether the historical priority configuration information corresponding to the first identification information is consistent with the current priority configuration information; if not, go to step S206;
S206: and correspondingly storing the current priority configuration information and the corresponding identification information into the preset configuration library.
in the embodiment of the application, after the service configuration data is acquired, the configuration numerical values in the service configuration data are converted into the character string information to be stored, a toJson method of new Gson can be used during conversion, and codes can be expressed as new Gson (). toJson (value).
before storing the current priority configuration information into the preset configuration library, the embodiment may determine the configuration identification information in the service configuration data as the identification information of the current priority configuration information, determine whether the corresponding configuration information already exists in the preset configuration library based on the configuration identification information of the current priority configuration information, if so, further determine whether the current priority configuration information is consistent with the historical priority configuration information corresponding to the identification information, if so, discard the current priority configuration information without repeated storage; and if the current priority configuration information is inconsistent with the current priority configuration information, updating the historical priority configuration information. If the preset configuration library does not contain the configuration information corresponding to the current configuration identification information, the current priority configuration information can be directly stored in the preset configuration library.
The embodiment of the present application discloses another service processing method, and compared with the previous embodiment, the present embodiment further describes and optimizes the technical solution. Referring to fig. 3, specifically:
S301: acquiring a service request and a query request aiming at service processing priority;
s302: analyzing the query request to obtain a query parameter;
s303: generating an SQL query statement according to the query parameter assembly, and acquiring corresponding priority configuration information from the preset configuration library by using the SQL query statement; the preset configuration library is a library established by utilizing all priority configuration information in advance;
S304: determining target configuration information with the highest priority from the priority configuration information;
s305: acquiring the corresponding relation between the priority configuration information and the data type;
S306: and determining the data type corresponding to the target configuration information by utilizing the corresponding relation, and analyzing the target configuration information into analyzed configuration information of the corresponding data type so as to process the service request based on the analyzed configuration information.
In the embodiment of the application, after a user inputs a query request, the query request is analyzed to obtain query parameters, and further, an SQL query statement is generated by assembling the query parameters, so that corresponding priority configuration information is obtained from a preset configuration library by using the SQL query statement. For example, a user may input configuration identification information, level1, level2, level3, level4, and assemble to generate SQL query statements, e.g., select from table _ configuration _ recordwher key, configuration identification information and level1, level1 and level2 in (none, level2) and level3in (none, level3) and level4 in (none, level 4).
It should be noted that, in the embodiment of the present application, a corresponding relationship between priority configuration information and a data type of the priority configuration information is maintained in advance, and after target configuration information is determined, a corresponding data type is determined based on the corresponding relationship, so that target configuration information is analyzed and converted into analyzed configuration information of the corresponding data type. In a specific implementation, the correspondence between the priority configuration information and the data type thereof may be stored by using a table. For example, table 1 shows an example of a kind of configuration information and its data type correspondence in a specific implementation.
TABLE 1
| key | value type |
| Priority configuration information 1 | java.lang.Integer |
| Priority configuration information 2 | java.lang.Boolean |
| Priority configuration information 3 | java.uti.List |
| Priority configuration information 4 | mypackage.MyClass |
It can be understood that, in the embodiment of the present application, the configuration value can be converted into a character string during writing, and the configuration information is analyzed according to the configured data type during reading, so that configuration data in multiple data formats can be supported, and convenience in service processing is improved.
In the following, a service processing apparatus provided in an embodiment of the present application is introduced, and a service processing apparatus described below and a service processing method described above may be referred to each other.
referring to fig. 4, a service processing apparatus provided in an embodiment of the present application includes:
a request obtaining module 401, configured to obtain a service request and a query request for a service processing priority;
A configuration obtaining module 402, configured to obtain corresponding priority configuration information from a preset configuration library according to the query request; the preset configuration library is a library established by utilizing all priority configuration information in advance;
a priority determining module 403, configured to determine target configuration information with the highest priority from the priority configuration information;
a service processing module 404, configured to parse the target configuration information, so as to process the service request based on the parsed configuration information.
For the specific implementation process of the modules 401 to 404, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.
On the basis of the foregoing embodiment, as a preferred implementation, the service processing apparatus further includes:
the configuration acquisition module is used for acquiring service configuration data input by a user party and determining a priority level according to the service configuration data;
and the configuration storage module is used for generating current priority configuration information based on the service configuration data and the priority level and storing the current priority configuration information into a pre-established preset configuration library.
On the basis of the above embodiment, as a preferred implementation, the service configuration data includes configuration identification information, a configuration value, and a corresponding priority level;
Correspondingly, the configuration saving module includes:
A configuration generating unit, configured to convert the configuration value into character string information, and generate the current priority configuration information according to the character string information and the corresponding information of the priority hierarchy;
and the corresponding storage unit is used for determining the configuration identification information as the identification information of the current priority configuration information, and correspondingly storing the current priority configuration information and the corresponding identification information into the preset configuration library.
on the basis of the foregoing embodiment, as a preferred implementation, the service processing apparatus further includes:
the first judging module is used for judging whether the corresponding configuration information exists in the preset configuration library or not based on the configuration identification information of the current priority configuration information;
the first starting module is used for directly starting the working process of the configuration storage module if the corresponding configuration information does not exist in the preset configuration library;
A second determining module, configured to determine whether historical priority configuration information corresponding to the first identifier is consistent with the current priority configuration information if the corresponding configuration information exists in the preset configuration library;
and the second starting module is used for starting the working process of the configuration storage module if the historical priority configuration information is inconsistent with the current priority configuration information.
on the basis of the foregoing embodiment, as a preferred implementation manner, the configuration acquiring module 402 includes:
The request analysis unit is used for analyzing the query request to obtain query parameters;
and the statement generating unit is used for assembling an SQL query statement according to the query parameters and acquiring corresponding priority configuration information from the preset configuration library by using the SQL query statement.
On the basis of the foregoing embodiment, as a preferred implementation, the service processing module 404 includes:
The relation acquisition unit is used for acquiring the corresponding relation between the priority configuration information and the data type;
And the type determining unit is used for determining the data type corresponding to the target configuration information by using the corresponding relation and analyzing the target configuration information into analyzed configuration information of the corresponding data type.
The present application further provides an electronic device, and as shown in fig. 5, an electronic device provided in an embodiment of the present application includes:
A memory 100 for storing a computer program;
the processor 200, configured to execute the computer program, may implement the steps of the service processing method provided in any of the above embodiments.
Specifically, the memory 100 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operating system and the computer-readable instructions in the non-volatile storage medium to run. The processor 200 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments, and provides computing and controlling capability for the electronic device, and when executing the computer program stored in the memory 100, the steps of the service processing method disclosed in any of the foregoing embodiments may be implemented.
on the basis of the above embodiment, as a preferred implementation, referring to fig. 6, the electronic device further includes:
And an input interface 300 connected to the processor 200, for acquiring computer programs, parameters and instructions imported from the outside, and storing the computer programs, parameters and instructions into the memory 100 under the control of the processor 200. The input interface 300 may be connected to an input device for receiving parameters or instructions manually input by a user. The input device may be a touch layer covered on a display screen, or a button, a track ball or a touch pad arranged on a terminal shell, or a keyboard, a touch pad or a mouse, etc.
And a display unit 400 connected to the processor 200 for displaying data processed by the processor 200 and for displaying a visualized user interface. The display unit 400 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like.
and a network port 500 connected to the processor 200 for performing communication connection with each external terminal device. The communication technology adopted by the communication connection can be a wired communication technology or a wireless communication technology, such as a mobile high definition link (MHL) technology, a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a wireless fidelity (WiFi), a bluetooth communication technology, a low power consumption bluetooth communication technology, an ieee802.11 s-based communication technology, and the like.
Fig. 6 shows only an electronic device having components 100-500, and those skilled in the art will appreciate that the structure shown in fig. 6 does not constitute a limitation of the electronic device, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
the present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The storage medium has a computer program stored thereon, and the computer program realizes the steps of the service processing method disclosed in any one of the foregoing embodiments when executed by the processor.
according to the method and the device, the corresponding priority configuration information is obtained from the preset configuration library according to the query request aiming at the service processing priority, so that the configuration information with the highest priority can be determined according to the priority configuration information to process the current service request, the priority corresponding to the service configuration can be dynamically adjusted, the differentiation requirement of the same service is met, and the service processing complexity is remarkably reduced.
the embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.