CN115964074A - Component-based service processing method and device, electronic equipment and storage medium - Google Patents

Component-based service processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115964074A
CN115964074A CN202211633728.9A CN202211633728A CN115964074A CN 115964074 A CN115964074 A CN 115964074A CN 202211633728 A CN202211633728 A CN 202211633728A CN 115964074 A CN115964074 A CN 115964074A
Authority
CN
China
Prior art keywords
service
component
service component
routing
configuration
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
CN202211633728.9A
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 Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202211633728.9A priority Critical patent/CN115964074A/en
Publication of CN115964074A publication Critical patent/CN115964074A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides a component-type service processing method and device, electronic equipment and a storage medium, and belongs to the technical field of network services, wherein a second service component is obtained by instantiating a first service component through an application container and service scene information, and a service component list for representing the routing configuration of the second service component is generated according to the second service component, i.e. components with different configurations can be initialized according to different scenes, so that the multiplexing of component logic is realized, the instantiation and configuration injection of the components are effectively realized, and the flexibility of service processing is favorably improved; and the mechanism of multi-level routing units is abstracted based on the service scene routing to realize the arrangement of the service component list, thereby providing a more effective and reliable mode for the routing execution of the service component list, greatly improving the expansibility of the service arrangement execution and being beneficial to improving the service development and maintenance efficiency.

Description

Component-based service processing method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network service technologies, and in particular, to a component-based service processing method and apparatus, an electronic device, and a storage medium.
Background
For the single Service with higher Service complexity, because the internal Service processing logic is thick and heavy, the calling relationship is relatively complex, the personalized adjustment for different scenes is difficult to configure when Software As A Service (SAAS) is executed, the flexibility of Service processing is not high, and the adjustment offline of the Service function needs to follow the version, so that the arrangement and execution of the Service processing are simpler, and the Service development and maintenance efficiency is not high. Therefore, how to improve the flexibility of service processing and improve the service development and maintenance efficiency becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the present application mainly aims to provide a component-based service processing method and apparatus, an electronic device, and a storage medium, and aims to improve flexibility of service processing and improve service development and maintenance efficiency.
In order to achieve the above object, a first aspect of the embodiments of the present application provides a component-based service processing method, where the method includes:
under the condition of acquiring a plurality of pieces of service scene information, for each piece of service scene information, instantiation processing is carried out on a predefined first service component according to a pre-configured application container and the service scene information to obtain a second service component;
for each second service component, generating a service component list according to the second service component, wherein the service component list represents the routing configuration of the second service component;
storing each service scene information and each service component list in a preset target database;
under the condition of receiving a service request, inquiring service scene information corresponding to the service request from the target database according to the service request;
according to the service scene information, at least one service scene route matched with the service scene information is obtained by inquiring from the target database, wherein the service scene route comprises a plurality of route units arranged according to a preset sequence, and each route unit is provided with the service component list corresponding to the route unit;
and for each service scene route, sequentially executing each routing unit according to the preset sequence so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
In some embodiments, the instantiating a predefined first service component according to a preconfigured application container and the service context information to obtain a second service component includes:
reading a configuration information interface of the first service component from a pre-configured application container;
and re-registering the first service component to the application container according to the service scene information and the configuration information interface to obtain a second service component.
In some embodiments, the performing service processing on the service component lists configured for the routing units respectively to generate a service processing result includes:
when the service component list configured by one of the routing units is a continuous type list, performing serial service processing on each service component list to generate a service processing result;
alternatively, the first and second electrodes may be,
when the service component list configured by one of the routing units is a distributed type list, performing parallel service processing on each service component list to generate a plurality of intermediate service processing results, and combining the plurality of intermediate service processing results to generate a service processing result.
In some embodiments, the performing parallel service processing on each service component list to generate a plurality of intermediate service processing results includes:
under the condition that a service configuration parameter is obtained through calculation based on the service request, all service component lists meeting preset service conditions are screened out from all the service component lists as target service component lists according to the service configuration parameter and preset service configuration ranges of all the service component lists, wherein the preset service conditions are that the service configuration parameter is located in the preset service configuration ranges;
and performing parallel service processing on all the target service component lists to generate a plurality of intermediate service processing results.
In some embodiments, said generating a business component list from said second business component comprises:
and performing routing configuration injection on the second service component according to the service scene information to generate a service component list.
In some embodiments, the performing, according to the service scenario information, route configuration injection on the second service component to generate a service component list includes:
and under the condition that a route configuration method is predefined in a parameter configuration interface of the second service component, performing route configuration injection on the second service component by adopting the route configuration method according to the service scene information to generate a service component list.
In some embodiments, before the executing each routing unit in sequence according to the preset order, the method further includes:
screening at least one routing unit from each routing unit as a transition routing unit;
and carrying out batch multiplexing processing on the service component list configured by the transition routing unit.
In order to achieve the above object, a second aspect of the embodiments of the present application provides a component-type service processing apparatus, including:
the instantiation processing module is used for instantiating a predefined first service component according to a pre-configured application container and the service scene information for each piece of service scene information under the condition of acquiring a plurality of pieces of service scene information to obtain a second service component;
a routing configuration module, configured to generate, for each second service component, a service component list according to the second service component, where the service component list represents a routing configuration of the second service component;
the storage module is used for storing the service scene information and the service component lists in a preset target database;
the first query module is used for querying the target database according to the service request to obtain service scene information corresponding to the service request under the condition of receiving the service request;
a second query module, configured to query, according to the service scenario information, the target database to obtain at least one service scenario route matched with the service scenario information, where the service scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with the service component list corresponding to the routing unit;
and the service processing module is used for sequentially executing each routing unit according to the preset sequence for each service scene route so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
In order to achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program, and the computer program realizes the method of the first aspect when executed by a processor.
According to the component-type service processing method and device, the electronic equipment and the storage medium, the instantiation processing is performed on the first service component through the application container and the service scene information to obtain the second service component, and the service component list representing the routing configuration of the second service component is generated according to the second service component, namely, the components with different configurations can be initialized according to different scenes, the multiplexing of component logic is realized, the instantiation and configuration injection of the components are effectively realized, and the flexibility of service processing is favorably improved; and the mechanism of multi-level routing units is abstracted based on the service scene routing to realize the arrangement of the service component list, thereby providing a more effective and reliable mode for the routing execution of the service component list, greatly improving the expansibility of the service arrangement execution and being beneficial to improving the service development and maintenance efficiency.
Drawings
FIG. 1 is a flow diagram of a modular business process method according to an embodiment of the present application;
fig. 2 is a flowchart of step S101 in fig. 1;
FIG. 3 is a flowchart of step S102 in FIG. 1;
fig. 4 is a flowchart of step S301 in fig. 3;
FIG. 5 is a flow diagram of step S502 for one embodiment;
FIG. 6 is a flowchart prior to step S106 in FIG. 1;
FIG. 7 is a schematic diagram illustrating a modular business process method according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a modular business process method according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of a modular service processing apparatus according to an embodiment of the present application;
fig. 10 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
First, several terms referred to in the present application are resolved:
spring container: the method is a core of a Spring framework in Java, has a function of managing objects, can create objects, connection objects and configuration objects, and is managed by the objects through an Inversion of Control (IoC) technology, and the whole life cycle of a series object is from creation to destruction.
Monomer service: it means that an item contains all the codes in the item, and an application finds all the functions, that is, in a single service item, each module is generally distinguished by a package (package). The advantage of the monomer service is that: the deployment is simple, the maintenance is convenient, and the cost is low; the disadvantages are that: when the project scale is large, the user access frequency is high, the concurrency amount is large or the data amount is large, the program execution efficiency can be greatly reduced, even the server is down and the like, so that the method is mainly applicable to traditional management projects, small-size internet projects and the like.
SpringBean object: the SpringBean is a type of JavaBean, and the JavaBean is a software component model for describing Java; in the Java model, the functions of the Java program can be extended through the SpringBean, and a new application program can be generated quickly based on the combination of the SpringBean. And the SpringBean can realize the repeated utilization of the codes, and has great significance for the maintenance of the program. For example, if a shopping cart program is to realize the function of adding a commodity in a shopping cart, a SpringBean operated by the shopping cart can be written, a public AddItem method is established, the method is directly called in a foreground Jsp file to realize the function, if whether the commodity exists in the stock needs to be judged when the commodity is added and the commodity cannot be purchased is considered, the AddItem method of the SpringBean can be directly modified and realized by adding a processing statement, so that the foreground jsP program is not modified at all, and great convenience is realized.
At present, for a single service with higher service complexity, the internal service processing logic is heavy, the calling relationship is complex, the personalized adjustment aiming at different scenes is difficult to configure during SAAS, and the offline adjustment of the service function needs to follow the version, so that the development efficiency is low, and the maintenance difficulty is high. In order to solve the problem, in the industry, a business function is generally divided into small modules for componentization, the sequence of the modules is fixed through code logic, a set of corresponding modules are matched by scene identifiers, then the modules are executed in a fixed serial or parallel manner by a program, the configuration of a switch is provided, and an online offline service module is supported.
Based on this, the embodiment of the present application provides a component-based service processing method and apparatus, an electronic device, and a storage medium, and aims to improve flexibility of service processing and improve service development and maintenance efficiency.
The component-based service processing method and apparatus, the electronic device, and the storage medium provided in the embodiments of the present application are specifically described in the following embodiments, and first, the component-based service processing method in the embodiments of the present application is described.
The embodiment of the application provides a component-type service processing method, and relates to the technical field of network services. The component-based service processing method provided by the embodiment of the application can be applied to a terminal, a server side and software running in the terminal or the server side. In some embodiments, the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, or the like; the server side can be configured into an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and cloud servers for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content delivery network) and big data and artificial intelligence platforms; the software may be an application or the like that implements a component-based business processing method, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In each embodiment of the present application, when it is required to perform relevant processing on data related to the identity or characteristics of a user, such as user information, user behavior data, user history data, and user location information, for example, when it is required to receive a user or an external service request in the embodiment of the present application, permission or approval of the user or the external is obtained, and the collection, use, and processing of the data comply with relevant laws and regulations and standards of relevant countries and regions. In addition, when the embodiment of the present application needs to acquire sensitive personal information of a user, individual permission or individual consent of the user is obtained through a pop-up window or a jump to a confirmation page, and after the individual permission or individual consent of the user is definitely obtained, necessary user-related data for enabling the embodiment of the present application to operate normally is acquired.
Fig. 1 is an optional flowchart of a component-based service processing method provided in this embodiment, where the method in fig. 1 may include, but is not limited to, steps S101 to S106.
Step S101, when a plurality of service scene information is acquired, instantiation processing is carried out on a predefined first service component according to a pre-configured application container and the service scene information for each service scene information, and a second service component is obtained;
step S102, for each second service component, generating a service component list according to the second service component, wherein the service component list represents the routing configuration of the second service component;
step S103, storing each service scene information and each service component list in a preset target database;
step S104, under the condition of receiving the service request, inquiring the service scene information corresponding to the service request from the target database according to the service request;
step S105, at least one service scene route matched with the service scene information is obtained by inquiring from a target database according to the service scene information, wherein the service scene route comprises a plurality of route units arranged according to a preset sequence, and each route unit is provided with a service component list corresponding to the route unit;
and step S106, for each service scene route, sequentially executing each routing unit according to a preset sequence so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
In steps S101 to S106 illustrated in the embodiment of the present application, an instantiation process is performed on a first service component through an application container and service scenario information to obtain a second service component, and a service component list representing a routing configuration of the second service component is generated according to the second service component, that is, components with different configurations can be initialized according to different scenarios, so that multiplexing of component logic is realized, instantiation and configuration injection of the components are effectively realized, and flexibility of service processing is improved; and the mechanism of multi-level routing units is abstracted based on the service scene routing to realize the arrangement of the service component list, thereby providing a more effective and reliable mode for the routing execution of the service component list, greatly improving the expansibility of the service arrangement execution and being beneficial to improving the service development and maintenance efficiency.
In step S101 of some embodiments, the types of the application container and the first service component are not limited, and may be determined according to different application platforms, for example, the types of the application container and the first service component may be a Spring container under Java, where the predefined first service component is an initial Spring bean object in the Spring container, that is, the Spring bean object is not instantiated or configured.
In step S101 of some embodiments, the service scenario information is associated with a specific service scenario, and may be presented as any aspect of the service scenario, which is not limited herein, for example, the service scenario information may be an identity (including a scenario id, feature information, and the like) unique to a single scenario.
In step S102 of some embodiments, specific contents of the routing configuration are not limited, and the routing configuration in different service scenarios may be different, which is not limited herein.
In step S103 of some embodiments, the service scenario information and the service component list are stored in a preset target database, so as to enrich the target database, so that corresponding queries can be performed from the target database in subsequent steps, which also indicates that the data in the target database can be updated in real time, which ensures that the data in the target database is not distorted.
In step S103 of some embodiments, the type of the target database may be set according to a specific application scenario, which is not limited herein.
In step S104 of some embodiments, the service scenario information corresponding to the service request may be one or more.
In step S105 of some embodiments, the service component list configured by each routing unit may be in the form of a configuration table, which is advantageous for being flexibly executed.
In step S106 of some embodiments, the preset order may not be fixed, that is, the preset order in different application scenarios may be changed accordingly, which is beneficial to more flexibly execute each routing unit.
Referring to fig. 2, in some embodiments, step S101 may include, but is not limited to, step S201 to step S202:
step S201, reading a configuration information interface of a first service component from a pre-configured application container;
step S202, according to the service scene information and the configuration information interface, the first service assembly is registered to the application container again, and a second service assembly is obtained.
In this step, the configuration information interface of the first service component is read from the application container, so that the configuration condition of the first service component can be obtained, and the first service component is registered again in the application container according to the service scene information and in combination with the configuration condition of the configuration information interface, so that the instantiated service component can be obtained; because the service scene information under different scenes is different, instantiated service components can be obtained respectively for each scene, the service components are not interfered with each other, and the functions of dependent injection of an application container and the like are conveniently utilized.
In step S201 of some embodiments, the configuration information interface may be inherent in the first service component, or may be externally disposed on the first service component, which is not limited herein.
Referring to fig. 3, in some embodiments, step S102 may include, but is not limited to, step S301:
step S301, according to the service scene information, the second service component is injected with route configuration, and a service component list is generated.
In this step, route configuration injection is performed for different second service components according to different service scenario information, and it is ensured that personalized route configuration injection of each second service component is performed, so that a service component list under each service scenario is formed, and further execution of calling the service component list is facilitated.
Referring to fig. 4, in some embodiments, step S301 may include, but is not limited to including, step S401:
step S401, under the condition that a routing configuration method is predefined in a parameter configuration interface of the second service component, the routing configuration method is adopted to perform routing configuration injection on the second service component according to service scene information, and a service component list is generated.
In this step, since the parameter configuration interface of each second service component is predefined with the route configuration method, the route configuration method can be directly called to perform route configuration injection under the condition that the route configuration injection is required, so that the stability of generating the service component list is improved.
In step S401 of some embodiments, the parameter configuration interface is set according to actual needs, for example, it may be set on the top layer or the bottom layer of the component; the route configuration method may be triggered by receiving a preset parameter through the parameter configuration interface, which may ensure that the route configuration method may be stably invoked.
In order to better explain the working principle and content of the above embodiments, a specific example is given below for explanation.
Example one:
for example, java is used as an example, after a service module is componentized, a proper way is needed to instantiate a component to provide a service, and a reflection way is usually adopted in Java language to call a construction method containing parameters of the component to instantiate the component, but an object created in this way is not a SpringBean, cannot directly use functions such as dependency injection of a Spring framework, and is very inconvenient in development.
In order to solve the above technical deficiencies, in the present example, a service component of a Spring Bean type is uniformly used to implement an instantiation process, a Bean Definition (defining a configuration meta information interface of a Bean) of the service component is read from a Spring container, and then a scene component id is used as a new Bean name (Bean name _ { scene component id }) and the Bean Definition is re-registered with the Spring container to form a new Spring Bean object, so that the Spring Bean objects formed by each scene are independent objects and do not interfere with each other, thereby skillfully solving the instantiation problem of the service component, and also being capable of effectively utilizing functions of dependency injection of the Spring framework, and the like.
In addition, a top-level interface of the business component defines a configuration method with json as a parameter, each component can realize the configuration method, and attributes inside the component are initialized by receiving the json parameter. In the instantiation process, after a new SpringBean object is formed, the personalized configuration of the component in the scene can be injected through the configuration method, all the personalized configuration is processed in the top-level framework, the specific bottom-level component is not sensed, and no interference influence is generated.
It can be seen from the above that, the example solves the problem of componentization and configuration of the service logic, and ingeniously implements instantiation and configuration injection of the components by using the Spring framework, and can initialize the components with different configurations according to different scenes, thereby implementing multiplexing of the component logic, improving the flexibility of the project, not only solving the problem of difficulty in personalized configuration and instantiation of the service components, but also improving the flexibility of service processing and distribution.
In some embodiments, step S106 may include, but is not limited to including, step S501 or step S502:
step S501, when the service component list configured by one of the routing units is a continuous type list, performing serial service processing on each service component list to generate a service processing result;
alternatively, the first and second electrodes may be,
step S502, when the service component list configured by one of the routing units is a distributed type list, parallel service processing is performed on each service component list to generate a plurality of intermediate service processing results, and the plurality of intermediate service processing results are combined to generate a service processing result.
In this step, corresponding service processing actions are performed on the service component list according to different types of the service component list, so that the efficiency of processing the service component list can be improved to the greatest extent, and the real-time requirements of service processing can be met.
In step S501 and step S502 of some embodiments, different manners of serial service processing and parallel service processing do not generate too large divergence for the final service processing result, and both of them only belong to different execution manners, and the execution content is mainly associated with the service component list; besides the serial service processing and parallel service processing manners, other manners for performing service processing on the service component list may also be determined according to a specific application scenario, for example, other types of the service component list, and the like, which is not limited herein.
Referring to fig. 5, in some embodiments, step S502 may include, but is not limited to include, steps S601 to S602:
step S601, under the condition that a service configuration parameter is obtained through calculation based on a service request, all service component lists meeting preset service conditions are screened out from all the service component lists as target service component lists according to the service configuration parameter and preset service configuration ranges of all the service component lists, wherein the preset service conditions are that the service configuration parameter is located in the preset service configuration ranges;
step S602, performing parallel service processing on all the target service component lists, and generating a plurality of intermediate service processing results.
In this step, whether the service configuration parameters are within the preset service configuration range of each service component list is compared to determine which service component lists are subjected to service processing, that is, different component processing logics can be respectively executed according to the upper and lower limit values of the component configuration, so that the flow of the client is shunted, and the service logic comparison test in the single service is facilitated.
In step S601 in some embodiments, the service configuration parameter and the preset service configuration range of each service component list may be predefined, and the specific value is associated with the corresponding service scenario.
Referring to fig. 6, in some embodiments, step S106 further includes, but is not limited to, step S701 to step S702:
s701, screening at least one routing unit from each routing unit to serve as a transition routing unit;
step S702, perform batch multiplexing on the service component list configured by the transition routing unit.
In this step, at least one routing unit is screened from each routing unit as a transition routing unit, so that batch multiplexing of the service component list is realized based on the intermediate level of the multi-level routing, great convenience is provided for arrangement and expansion, and split processing inside the single service is favorably realized.
In step S702 of some embodiments, batch multiplexing of the service component list may be implemented, but is not limited to, by packing the service component list.
In order to better explain the working principle and content of the above embodiments, a specific example is given below for explanation.
Example two:
referring to fig. 7 and 8, fig. 7 is a schematic diagram illustrating a component-based service processing method according to an embodiment of the present application, and fig. 8 is a schematic diagram illustrating a component-based service processing method according to another embodiment of the present application, specifically:
as shown in fig. 7, the component route configuration is stored in the target database in a table form, where channel represents a channel scene, route represents a scene route (i.e., route1 represents scene route 1), one scene corresponds to at least one scene route, and the route includes multiple routing units, each routing Unit carries one component list, and the routing units may have multiple types (types), and when a type is a serial type, the internal service component lists are executed in series, that is, component a and component b are executed in series in route Unit1, and when a type is a parallel type, the internal service component lists are executed in parallel, that is, component c, component d, and component e are executed in parallel in route Unit2, and then a result set is obtained by merging.
The Route Unit is used as an intermediate layer of the Route, bears the function executed by the service component list, and can realize the batch multiplexing of the components by packing the service component list, for example, service logic which is packed by the Route Unit and is not changed frequently in an actual project can be greatly isolated and changed, so that the flexibility of the project is improved; in addition, the route Unit also provides batch switching of a group of components, and the routing flexibility is greatly improved.
Under the framework shown in fig. 7, when a project is started, all routing configuration information is pulled from a target database, a service component list under all route units is instantiated according to parameters of service components and stored in a memory of the target database, when an external request of a client is received, corresponding multi-level routing information is matched through a channel, then the route units are sequentially executed, the route units process internal service component lists in different execution modes according to types, and finally a result is returned.
As shown in fig. 8, the route Unit middle layer also provides more possibilities for expansion, and the expandable type shown in fig. 8 is route Unit3 of byPass, where two service component lists are maintained, and each service component list is configured with corresponding upper and lower limits, that is, the corresponding upper and lower limits of componentF are 0-40, and the corresponding upper and lower limits of componentg are 41-100. When the Route Unit3 executes, a hash value of the client id in the request parameter is calculated and modulo 100, that is, client-hash code%100 is calculated, and the obtained value may respectively execute different component processing logics according to upper and lower limit values of component configuration, for example, if a part of calculation results is 25, the part may execute a component processing logic corresponding to component f, and if a part of calculation results is 60, the part may execute a component processing logic corresponding to component g, so that a offloading process for client traffic may be realized, which is beneficial to performing a service logic comparison test inside a monolithic service.
It can be seen from the above that, the present example uses the form of the service configuration table to implement the effective arrangement of the components, and the mechanism for abstracting the multi-level routing provides a plurality of ways for the routing execution of the components; and the middle level of the multi-level routing provides great convenience for the expansion of batch multiplexing and arrangement of the components, the shunting processing inside a single service can be realized, and the expansibility of service processing and the efficiency of development and maintenance are greatly improved.
Referring to fig. 9, an embodiment of the present application further provides a component-based service processing apparatus, which can implement the component-based service processing method, where the apparatus includes:
the instantiation processing module is used for instantiating a predefined first service component according to a pre-configured application container and service scene information for each service scene information under the condition of acquiring a plurality of service scene information to obtain a second service component;
the routing configuration module is used for generating a service component list according to each second service component, wherein the service component list represents the routing configuration of the second service component;
the storage module is used for storing the information of each service scene and each service component list in a preset target database;
the first query module is used for querying and obtaining service scene information corresponding to the service request from the target database according to the service request under the condition of receiving the service request;
the second query module is used for querying at least one service scene route matched with the service scene information from the target database according to the service scene information, wherein the service scene route comprises a plurality of route units arranged according to a preset sequence, and each route unit is provided with a service component list corresponding to the route unit;
and the service processing module is used for sequentially executing each routing unit according to a preset sequence for each service scene route so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
The specific implementation of the assembly-type service processing apparatus is substantially the same as the specific implementation of the assembly-type service processing method, and belongs to the same inventive concept, which is not described herein again.
The embodiment of the application also provides electronic equipment, wherein the electronic equipment comprises a memory and a processor, the memory stores a computer program, and the processor realizes the component-type service processing method when executing the computer program. The electronic equipment can be any intelligent terminal including a tablet computer, a vehicle-mounted computer and the like.
Referring to fig. 10, fig. 10 illustrates a hardware structure of an electronic device according to another embodiment, where the electronic device includes:
the processor 901 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a relevant program to implement the technical solution provided in the embodiment of the present application;
the memory 902 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 902 may store an operating system and other application programs, and when the technical solution provided in the embodiments of the present disclosure is implemented by software or firmware, the relevant program codes are stored in the memory 902, and the processor 901 calls to execute the component-based service processing method according to the embodiments of the present disclosure;
an input/output interface 903 for implementing information input and output;
a communication interface 904, configured to implement communication interaction between the device and another device, where communication may be implemented in a wired manner (e.g., USB, network cable, etc.), and communication may also be implemented in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between various components of the device (e.g., the processor 901, memory 902, input/output interface 903, and communication interface 904);
wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 are communicatively connected to each other within the device via a bus 905.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for processing a service in a component manner is implemented.
Memory is a non-transitory computer readable storage medium that may be used to store non-transitory software programs as well as non-transitory computer executable programs. Additionally, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state memory device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The component-based service processing method and device, the electronic device, and the storage medium provided in the embodiments of the present application obtain the second service component by instantiating the first service component using the application container and the service context information, and generate the service component list representing the routing configuration of the second service component according to the second service component, that is, the components with different configurations can be initialized according to different contexts, thereby realizing multiplexing of component logic, effectively realizing instantiation and configuration injection of the components, and facilitating improvement of flexibility of service processing; and the mechanism of multi-level routing units is abstracted based on the service scene routing to realize the arrangement of the service component list, thereby providing a more effective and reliable mode for the routing execution of the service component list, greatly improving the expansibility of the service arrangement execution and being beneficial to improving the service development and maintenance efficiency.
The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided in the embodiments of the present application, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
While certain embodiments of the present application have been described above, other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily have to be in the particular order shown or in sequential order to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the apparatus, device, and computer-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The apparatus, the device, the computer-readable storage medium, and the method provided in the embodiments of the present application correspond to each other, and therefore, the apparatus, the device, and the nonvolatile computer storage medium also have advantageous technical effects similar to those of the corresponding method.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules.
For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an integrated circuit chip, such programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development, and the original code before compiling is also written by a specific programming Language, which is called Hardware Description Language (HDL), and HDL is not only one kind but many kinds, for example:
ABEL (Advanced Boolean Expression Language); AHDL (Altera Hardware Description Language); confluent; CUPL (corner University Programming Language); HDCal; and JHDL (Java Hardware Description Language); lava, lola, myHDL, PALSM, RHDL (Ruby Hardware Description Language), etc.; at present, VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and the Language Verilog are more commonly used among the technologies in the art by comparison. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers:
ARC 625D, atmel AT91SAM, microchIP address PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units can be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the embodiment of the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present specification has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information and/or data which can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises that element.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Embodiments of the application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. Embodiments of the application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present application are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A modular business processing method, comprising:
under the condition of acquiring a plurality of pieces of service scene information, for each piece of service scene information, instantiation processing is carried out on a predefined first service component according to a pre-configured application container and the service scene information to obtain a second service component;
for each second service component, generating a service component list according to the second service component, wherein the service component list represents the routing configuration of the second service component;
storing each service scene information and each service component list in a preset target database;
under the condition of receiving a service request, inquiring service scene information corresponding to the service request from the target database according to the service request;
according to the service scene information, at least one service scene route matched with the service scene information is obtained by inquiring from the target database, wherein the service scene route comprises a plurality of routing units arranged according to a preset sequence, and each routing unit is provided with the service component list corresponding to the routing unit;
and for each service scene route, sequentially executing each routing unit according to the preset sequence so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
2. The method of claim 1, wherein instantiating a predefined first service component according to a preconfigured application container and the service context information to obtain a second service component comprises:
reading a configuration information interface of the first service component from a pre-configured application container;
and re-registering the first service component to the application container according to the service scene information and the configuration information interface to obtain a second service component.
3. The method according to claim 1, wherein the performing service processing on the service component lists configured for the routing units respectively to generate a service processing result comprises:
when the service component list configured by one of the routing units is a continuous type list, performing serial service processing on each service component list to generate a service processing result;
alternatively, the first and second electrodes may be,
when the service component list configured by one of the routing units is a distributed type list, performing parallel service processing on each service component list to generate a plurality of intermediate service processing results, and combining the plurality of intermediate service processing results to generate a service processing result.
4. The modular service processing method according to claim 3, wherein said performing parallel service processing on each of the service component lists to generate a plurality of intermediate service processing results comprises:
under the condition that a service configuration parameter is obtained through calculation based on the service request, all service component lists meeting preset service conditions are screened out from all the service component lists as target service component lists according to the service configuration parameter and preset service configuration ranges of all the service component lists, wherein the preset service conditions are that the service configuration parameter is located in the preset service configuration ranges;
and performing parallel service processing on all the target service component lists to generate a plurality of intermediate service processing results.
5. The modular business processing method of claim 1, wherein said generating a business component list according to said second business component comprises:
and performing routing configuration injection on the second service component according to the service scene information to generate a service component list.
6. The modular service processing method according to claim 5, wherein the performing routing configuration injection on the second service module according to the service scenario information to generate a service module list comprises:
and under the condition that a route configuration method is predefined in a parameter configuration interface of the second service component, performing route configuration injection on the second service component by adopting the route configuration method according to the service scene information to generate a service component list.
7. The modular service processing method according to claim 1, wherein before the routing units are sequentially executed according to the preset order, the method further comprises:
screening at least one routing unit from each routing unit to be used as a transition routing unit;
and carrying out batch multiplexing processing on the service component list configured by the transition routing unit.
8. A component-based service processing method, the device comprising:
the instantiation processing module is used for instantiating a predefined first service component according to a pre-configured application container and the service scene information for each service scene information under the condition of acquiring a plurality of service scene information to obtain a second service component;
a routing configuration module, configured to generate, for each second service component, a service component list according to the second service component, where the service component list represents a routing configuration of the second service component;
the storage module is used for storing the service scene information and the service component lists in a preset target database;
the first query module is used for querying the target database according to the service request to obtain service scene information corresponding to the service request under the condition of receiving the service request;
a second query module, configured to query, according to the service scenario information, the target database to obtain at least one service scenario route matched with the service scenario information, where the service scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with the service component list corresponding to the routing unit;
and the service processing module is used for sequentially executing each routing unit according to the preset sequence for each service scene route so as to respectively perform service processing on the service component lists configured by each routing unit and generate a service processing result.
9. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the modular service processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the modular traffic processing method according to any one of claims 1 to 7.
CN202211633728.9A 2022-12-19 2022-12-19 Component-based service processing method and device, electronic equipment and storage medium Pending CN115964074A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211633728.9A CN115964074A (en) 2022-12-19 2022-12-19 Component-based service processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211633728.9A CN115964074A (en) 2022-12-19 2022-12-19 Component-based service processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115964074A true CN115964074A (en) 2023-04-14

Family

ID=87362934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211633728.9A Pending CN115964074A (en) 2022-12-19 2022-12-19 Component-based service processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115964074A (en)

Similar Documents

Publication Publication Date Title
CN107545030B (en) Method, device and equipment for processing data blood relationship
CN110134668B (en) Data migration method, device and equipment applied to blockchain
CN111400681B (en) Data authority processing method, device and equipment
CN107578338B (en) Service publishing method, device and equipment
CN111784468B (en) Account association method and device and electronic equipment
CN116185532A (en) Task execution system, method, storage medium and electronic equipment
CN110020004B (en) Data calculation method and engine
CN111443944B (en) Program construction method, device and equipment
CN106156050B (en) Data processing method and device
CN111459573B (en) Method and device for starting intelligent contract execution environment
CN110941443B (en) Method and device for modifying file name in SDK (software development kit) and electronic equipment
CN115964074A (en) Component-based service processing method and device, electronic equipment and storage medium
CN111273965A (en) Container application starting method, system and device and electronic equipment
CN113992429B (en) Event processing method, device and equipment
CN107402749B (en) Method and device for realizing picture loading library
CN114518894A (en) Program update processing method and device
CN115391378A (en) Attribute graph query method, device and equipment
CN115390852A (en) Method and device for generating uniform abstract syntax tree and program analysis
CN114968422A (en) Method and device for automatically executing contracts based on variable state
CN114358936A (en) Intelligent contract operation method based on micro-service block chain
CN112596780A (en) Service execution method and device
CN115225638B (en) Service deployment method, device, electronic equipment and computer readable storage medium
CN109636324B (en) Electronic service contract processing method and device
CN117519733B (en) Project deployment method and device, storage medium and electronic equipment
US11934887B1 (en) Distributed model compilation

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