Disclosure of Invention
The invention aims to provide a method for automatically constructing a functional component based on multi-scenario application, and aims to solve the problems that in the prior art, a bank needs to be developed according to the requirements of each type of customers, a large amount of repeated development is needed, and a large amount of human resources are consumed.
In order to achieve the above object, the present invention provides a method for automatically constructing a functional component based on multi-scenario application, which comprises the following steps:
s1: functional module standardization and componentization: listing the services provided by the accessed application scenes;
s2: registering the newly added component: reusing the existing functional components in the scene component library, and newly adding missing functional components;
s3: configuration files: determining application requirements, and defining an exclusive configuration file of an accessed application scene according to the application requirements;
s4: the scheduling mechanism takes effect, and logic processing is carried out: after the configuration file is defined, the analysis of the exclusive configuration file of the application scene is completed through the cooperation of an analysis system and a scheduling mechanism, and the corresponding functional component is called to complete application processing.
Furthermore, the configuration file is used for recording the logic flow that the application scenario needs to be executed successively from the service providing.
Further, the S1 includes the following steps before accessing the application scenario:
s00: accessing a new application scene, and determining functional components which need to be provided by the application scene;
s01: fuzzy search is carried out in the scene component library record list according to the names and the functions of the functional components, and whether the required functional components exist in the scene component library record list is judged;
s02: subscribing the required functional components existing in the scene component library record table, newly adding the required functional components not existing in the scene component library record table, and removing the dependency relationship among the components;
s03: and adding the newly added functional components in the S02 to the scene component library record table.
Further, the adding of the newly added functional component to the scene component library record table in S03 further includes: and sequentially recording the names of the newly added functional components, the function summaries, the input parameters and the output parameters, defining the output values and the abnormal output values of the newly added components after the successfully executed components, and defining the names of the subsequent flow components corresponding to the abnormal output values of each definition.
Furthermore, the scene component library record table is used for recording the developed functional component information, defining the input and output parameters of the functional component and an exception handling process.
Further, the S4 specifically includes the following sub-steps:
s41: initializing a business scene control table;
s42: starting an analysis mechanism and reading a flow configuration file;
s43: reading the name of the previous flow component, the name of the current flow component and the name of the next flow component by using an analysis mechanism;
s44: updating a business scene control table, and updating the three component names read by the analysis mechanism into the business scene control table;
s45: the platform executes a scheduling mechanism and executes the functional components of the current flow;
s46: updating the service scene control table, and writing the execution result of the functional component in the S45 into the service scene control table;
s47: querying a scene component library, judging whether the execution result of the component is successful, if so, jumping to S48, and if not, jumping to S49;
s48: judging whether the next process is finished, if so, finishing the service, otherwise, repeating the step S43 and executing the functional component of the next process;
s49: and executing an abnormal flow according to the definition of the scene component library record table, and ending the application service.
Further, in S47, the scene component library record table is queried by obtaining the output parameter and the functional component name of the functional component.
Furthermore, the service scene control table records the component information executed by the current logic flow of the scene.
The beneficial effect of this application:
(1) development cost is effectively reduced, and business requirements can be quickly realized through configuration management of functional components and customization, loading and operation of a series of components;
(2) the risk of production and operation accidents of new projects can be effectively reduced by multiplexing the functional components in use;
(3) all projects with common requirements can be upgraded iteratively through upgrading of a single functional component, and labor development cost is greatly reduced;
(4) through newly-increased functional component development standardization, unification, it is strong to realize platform subassembly source code readability, is convenient for upgrade, transformation, debugging processing, effectively reduces all customized project later stage operation and maintenance costs.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
It should be noted that all the directional indicators (such as up, down, left, right, front, and rear … …) in the embodiment of the present invention are only used to explain the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the drawing), and if the specific posture is changed, the directional indicator is changed accordingly.
In addition, the technical solutions in the embodiments may be combined with each other, but it must be based on the realization of those skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should be considered to be absent and not within the protection scope of the present invention.
The method aims at the condition that the customer requirements accepted by the banking industry are consistent in main body, but each customer additionally puts forward a distinctive requirement under the condition that the basic requirements are met, so that the demand development is carried out on each type of customer requirements in a bank, a large amount of repeated development is caused, and a large amount of human resources are consumed. For example: when a bank accepts a batch issuance commission initiated by each group client, a client A requires to issue an issuance completion short message notification, a client B requires to examine and verify before the bank accepts a task, a client C requires to provide issuance data statistics, and a client D requires to issue an approval and needs to double recheck and other various characteristic requirements.
In order to solve the technical problems, a method for automatically constructing a functional component based on multi-scenario application is particularly provided.
For ease of understanding, the following specific examples are set forth:
in this embodiment, as shown in fig. 1, the present invention provides a method for automatically building a functional component based on a multi-scenario application, which includes the following steps:
s1: functional module standardization and componentization: listing the services provided by the accessed application scenes;
s2: registering the newly added component: reusing the existing functional components in the scene component library, and newly adding missing functional components;
s3: configuration files: determining application requirements, and defining an exclusive configuration file of an accessed application scene according to the application requirements;
s4: the scheduling mechanism takes effect, and logic processing is carried out: after the configuration file is defined, the analysis of the exclusive configuration file of the application scene is completed through the cooperation of an analysis system and a scheduling mechanism, and the corresponding functional component is called to complete application processing.
In this embodiment, the configuration file is used to record a logic flow that the application scenario needs to be executed successively from the time of providing the service.
In this embodiment, the S1 includes the following steps before accessing the application scenario:
s00: accessing a new application scene, and determining functional components which need to be provided by the application scene;
s01: fuzzy search is carried out in the scene component library record list according to the names and the functions of the functional components, and whether the required functional components exist in the scene component library record list is judged;
s02: subscribing the required functional components existing in the scene component library record table, newly adding the required functional components not existing in the scene component library record table, and removing the dependency relationship among the components;
s03: and adding the newly added functional components in the S02 to the scene component library record table.
In this embodiment, the adding of the newly added functional component to the scene component library record table in S03 further includes: and sequentially recording the names of the newly added functional components, the function summaries, the input parameters and the output parameters, defining the output values and the abnormal output values of the newly added components after the successfully executed components, and defining the names of the subsequent flow components corresponding to the abnormal output values of each definition.
In this embodiment, the scene component library record table is used to record the developed functional component information, and define the input/output parameters and the exception handling procedures of the functional component.
In this embodiment, the S4 specifically includes the following sub-steps:
s41: initializing a business scene control table;
s42: starting an analysis mechanism and reading a flow configuration file;
s43: reading the name of the previous flow component, the name of the current flow component and the name of the next flow component by using an analysis mechanism;
s44: updating a business scene control table, and updating the three component names read by the analysis mechanism into the business scene control table;
s45: the platform executes a scheduling mechanism and executes the functional components of the current flow;
s46: updating the service scene control table, and writing the execution result of the functional component in the S45 into the service scene control table;
s47: querying a scene component library, judging whether the execution result of the component is successful, if so, jumping to S48, and if not, jumping to S49;
s48: judging whether the next process is finished, if so, finishing the service, otherwise, repeating the step S43 and executing the functional component of the next process;
s49: and executing an abnormal flow according to the definition of the scene component library record table, and ending the application service.
In this embodiment, in S47, the scene component library record table is queried by acquiring the output parameter and the functional component name of the functional component.
In this embodiment, the service scenario control table records component information executed by the current logic flow of the scenario.
Specifically, the method provides a strategy for rapidly realizing multiple application scenes with common requirements, avoids repeated development of common functional components, and improves universality and reusability of codes.
The method carries out listing on the service provided by the accessed application scene, reuses the existing functional components in the scene component library, and simultaneously adds the missing functional components; after the application requirement is determined, namely the externally provided service is definite, defining an exclusive configuration file for the accessed application scene, wherein the configuration file records a logic flow which needs to be executed successively from the service providing of the application scene, and which functional component is executed first and which component is executed subsequently; after the configuration file is defined, the analysis mechanism and the scheduling mechanism of the method cooperate to finish the explanation of the configuration file of the application scene and call the corresponding functional component to finish the whole application processing.
As shown in fig. 2, in the preparation stage of accessing a new application scenario, it is necessary to ensure that all functional components required by the application scenario are included in the scenario component library record table 1, and then customize the configuration file of the application scenario according to the actual application requirements.
Firstly, the application requirements are determined, and the function list required to be provided by the application scene is determined. Fuzzy search is carried out on the sorted functional components in a scene component library according to component names or functions, and matched functional components are subscribed; for the missing functional components, performing new addition processing, performing functional modularization and componentization of new addition following units, standardizing input and output, and removing the dependency relationship among the components; after the development and encapsulation of the newly added functional component are completed, the newly added functional component is added to the scene component library record table 1, the newly added component name, the function summary, the input parameters and the output parameters are sequentially recorded, the output value (default output 0) and the abnormal output value of the successfully executed newly added component are defined, and the name of the subsequent process component corresponding to each defined abnormal output value is defined. After determining that all functional components required by the application scene are in the scene component library record table 1, defining a configuration file of the application scene according to format requirements defined by the method, and recording a first functional component name, a second component name and a third component name in the configuration file according to the sequence of the logic processing flow.
After the preparation work of accessing a new application scene is finished, the device can provide services to the outside, and the configuration file for explaining the application scene and the corresponding functional components are called to finish the whole application processing by matching the analysis mechanism and the scheduling mechanism of the method.
As shown in fig. 3, when the present apparatus starts to provide service for a new application scenario, a service scenario control table 2 is initialized, a parsing mechanism is started to read the names of the first two functional components (the first component name and the second component name) and write the names into the current component column and the next component column in the service scenario control table 2, respectively; starting a scheduling mechanism to execute the functional components in the current component column in the service scene control table 2, obtaining an output parameter i of the component after the execution is finished, querying a scene component library record table 1 according to the output parameter i and the functional component names, and judging whether the execution result of the component is a result or an abnormal result: if the abnormal process is abnormal, executing the abnormal process according to the definition of the scene component library record table 1, and ending the application service; if the component is executed successfully, the scheduling mechanism of the device executes the component of the next component column in the business scenario control table 2. And after the first round of functional components is executed, reading a second round of functional component list of the configuration file of the application scene by an analysis mechanism of the device, updating the service scene control table 2, and calling the components of the second round.
The beneficial effect of this application:
(1) development cost is effectively reduced, and business requirements can be quickly realized through configuration management of functional components and customization, loading and operation of a series of components;
(2) the risk of production and operation accidents of new projects can be effectively reduced by multiplexing the functional components in use;
(3) all projects with common requirements can be upgraded iteratively through upgrading of a single functional component, and labor development cost is greatly reduced;
(4) through newly-increased functional component development standardization, unification, it is strong to realize platform subassembly source code readability, is convenient for upgrade, transformation, debugging processing, effectively reduces all customized project later stage operation and maintenance costs.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.