Component-based business processing method and apparatus, electronic device, storage medium
By using a component-based and multi-level routing unit mechanism, the problem of flexible configuration of monolithic services in SaaS is solved, which improves the flexibility of business processing and the efficiency of development and maintenance, and enhances the reusability of component logic and the scalability of business orchestration.
Patent Information
- Application Number
- CN202211633728.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-12-19
AI Technical Summary
In existing technologies, monolithic services with high business complexity are difficult to configure flexibly and individually in Software as a Service (SaaS), resulting in low flexibility in business processing and low development and maintenance efficiency.
By componentizing business functions and instantiating them using an application container, a list of business components is generated. Routing configuration is then performed based on business scenario information, and a multi-level routing unit mechanism is abstracted to achieve flexible instantiation and configuration injection of components.
It improves the flexibility of business processing and the efficiency of development and maintenance, enhances the scalability of business orchestration and execution, and increases the reusability of component logic and the flexibility of business processing.
Smart Images

Figure CN115964074B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network service technology, and in particular to a component-based service processing method and apparatus, electronic device, and storage medium. Background Technology
[0002] For monolithic services with high business complexity, the heavy internal business logic and relatively complex call relationships make it difficult to configure personalized adjustments for different scenarios when executing Software-As-A-Service (SaaS). This results in low flexibility in business processing, and the need to update and deprecate business functions according to version control leads to a relatively monotonous orchestration and execution of business processes, lacking strong scalability and consequently, low efficiency in business development and maintenance. Therefore, improving the flexibility of business processing and increasing the efficiency of business development and maintenance have become urgent technical problems to be solved. Summary of the Invention
[0003] The main objective of this application is to propose a component-based business processing method, apparatus, electronic device, and storage medium, which aims to improve the flexibility of business processing and increase the efficiency of business development and maintenance.
[0004] To achieve the above objectives, a first aspect of this application proposes a component-based business processing method, the method comprising:
[0005] When multiple business scenario information is obtained, for each business scenario information, a predefined first business component is instantiated according to the pre-configured application container and the business scenario information to obtain a second business component;
[0006] For each of the second service components, a service component list is generated based on the second service component, wherein the service component list represents the routing configuration of the second service component;
[0007] The information of each business scenario and the list of each business component are stored in a preset target database;
[0008] Upon receiving a business request, the system retrieves the business scenario information corresponding to the business request from the target database.
[0009] Based on the business scenario information, at least one business scenario route matching the business scenario information is obtained from the target database. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit.
[0010] For each of the aforementioned business scenario routes, each of the aforementioned routing units is executed sequentially according to the preset order, so as to perform business processing on the list of business components configured in each of the aforementioned routing units and generate business processing results.
[0011] In some embodiments, the instantiation of a predefined first business component based on a pre-configured application container and the business scenario information to obtain a second business component includes:
[0012] The interface for reading the configuration information of the first business component from the pre-configured application container;
[0013] Based on the business scenario information and the configuration information interface, the first business component is re-registered with the application container to obtain the second business component.
[0014] In some embodiments, the process of performing service processing on the service component list configured for each of the routing units to generate service processing results includes:
[0015] When one of the routing units is configured with a list of service components that is a continuous type list, serial service processing is performed on each of the service component lists to generate a service processing result;
[0016] or,
[0017] When one of the routing units is configured with a list of service components that is a distributed list, parallel service processing is performed on each of the service component lists to generate multiple intermediate service processing results. The multiple intermediate service processing results are then merged to generate a final service processing result.
[0018] In some embodiments, the parallel processing of each of the lists of business components to generate multiple intermediate business processing results includes:
[0019] When the service configuration parameters are calculated based on the service request, according to the service configuration parameters and the preset service configuration range of each of the service component lists, all the service component lists that meet the preset service conditions are selected from each of the service component lists as the target service component list, wherein the preset service condition is that the service configuration parameters are within the preset service configuration range;
[0020] Parallel business processing is performed on all the target business component lists to generate multiple intermediate business processing results.
[0021] In some embodiments, generating a list of business components based on the second business component includes:
[0022] Based on the business scenario information, the second business component is injected with route configuration to generate a list of business components.
[0023] In some embodiments, the step of injecting route configuration into the second business component based on the business scenario information to generate a business component list includes:
[0024] If the parameter configuration interface of the second business component has a predefined routing configuration method, the routing configuration method is used to inject routing configuration into the second business component according to the business scenario information to generate a business component list.
[0025] In some embodiments, before executing each of the routing units sequentially in the preset order, the method further includes:
[0026] At least one routing unit is selected from each of the routing units as a transitional routing unit;
[0027] The service component list configured in the transition routing unit is batch reused.
[0028] To achieve the above objectives, a second aspect of this application provides a component-based service processing apparatus, the apparatus comprising:
[0029] The instantiation processing module is used to, when multiple business scenario information is obtained, instantiate a predefined first business component for each business scenario information according to the pre-configured application container and the business scenario information to obtain a second business component;
[0030] A routing configuration module is used to generate a list of service components for each of the second service components, wherein the list of service components represents the routing configuration of the second service components;
[0031] The storage module is used to store the information of each of the business scenarios and the list of each of the business components in a preset target database;
[0032] The first query module is used to query the target database to obtain business scenario information corresponding to the business request based on the business request when a business request is received.
[0033] The second query module is used to query at least one business scenario route that matches the business scenario information from the target database based on the business scenario information. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit.
[0034] The business processing module is used to execute each of the routing units in a preset order for each of the business scenario routes, so as to perform business processing on the business component list configured in each of the routing units and generate business processing results.
[0035] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.
[0036] To achieve the above objectives, a fourth aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in the first aspect.
[0037] The component-based business processing method, apparatus, electronic device, and storage medium proposed in this application instantiate a first business component using application containers and business scenario information to obtain a second business component, and generate a list of business components representing the routing configuration of the second business component. This enables the initialization of components with different configurations according to different scenarios, achieving component logic reuse and effectively realizing component instantiation and configuration injection, thus improving the flexibility of business processing. Furthermore, based on business scenario routing, a mechanism for abstracting multi-level routing units is used to orchestrate the business component list, providing a more effective and reliable method for routing execution of the business component list, greatly improving the scalability of business orchestration execution, and enhancing the efficiency of business development and maintenance. Attached Figure Description
[0038] Figure 1 This is a flowchart of a component-based business processing method provided in one embodiment of this application;
[0039] Figure 2 yes Figure 1 The flowchart of step S101 in the text;
[0040] Figure 3 yes Figure 1 The flowchart of step S102 in the document;
[0041] Figure 4 yes Figure 3 The flowchart of step S301 in the process;
[0042] Figure 5 This is a flowchart of step S502 in one embodiment;
[0043] Figure 6 yes Figure 1 The flowchart preceding step S106;
[0044] Figure 7 This is a schematic diagram illustrating the principle of a component-based business processing method provided in one embodiment of this application;
[0045] Figure 8 This is a schematic diagram illustrating the principle of a component-based business processing method provided in another embodiment of this application;
[0046] Figure 9 This is a schematic diagram of the structure of a component-based business processing device provided in one embodiment of this application;
[0047] Figure 10 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0050] Unless otherwise defined, 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 this application only and is not intended to limit this application.
[0051] First, let's analyze some of the terms used in this application:
[0052] Spring container: The core of the Spring framework in Java, it has the function of managing objects. It can create objects, connect objects, and configure objects, and manage them through Inversion of Control (IoC) technology, connecting the entire life cycle of objects from creation to destruction.
[0053] A monolithic service refers to a project containing all the code within that project, with a single application handling all functionalities. In other words, monolithic service projects typically use packages to differentiate each module. The advantages of monolithic services are simple deployment, convenient maintenance, and low cost. The disadvantages are that when the project is large, with high user access frequency, high concurrency, or large data volume, it can significantly reduce program execution efficiency and even cause server crashes. Therefore, it is mainly suitable for traditional management projects and small internet projects.
[0054] SpringBean objects: SpringBean is a type of JavaBean, which describes a software component model for Java. In the Java model, SpringBeans can extend the functionality of Java programs, and new applications can be quickly generated by combining SpringBeans. Furthermore, SpringBeans enable code reuse, which is significant for program maintenance. For example, to implement the functionality of adding an item to a shopping cart, a SpringBean for cart operations can be written, with a public `AddItem` method. This method can be directly called in the front-end JSP file. If it's necessary to check the inventory before adding an item, and prevent purchase if the item is unavailable, the `AddItem` method of the SpringBean can be modified by adding processing statements. This eliminates the need to modify the front-end JSP program, making it very convenient.
[0055] Currently, for monolithic services with high business complexity, their internal business processing logic is heavy and the call relationships are complex. In SaaS, it's difficult to configure personalized adjustments for different scenarios, and adjustments to business functions must be updated and decommissioned according to version changes. All of this leads to low development efficiency and high maintenance difficulty. To address this issue, the industry typically divides business functions into small modules for componentization. The order of components is fixed through code logic, and a corresponding set of components is matched by a scenario identifier. The program then executes these components sequentially or in parallel, and provides on / off configuration to support online and offline service modules. However, this approach still suffers from difficulties in personalized configuration of components for different scenarios and a lack of flexibility in component orchestration and execution.
[0056] Based on this, embodiments of this application provide a component-based business processing method and apparatus, electronic device, and storage medium, aiming to improve the flexibility of business processing and increase the efficiency of business development and maintenance.
[0057] The component-based business processing method, apparatus, electronic device, and storage medium provided in this application are specifically described through the following embodiments. First, the component-based business processing method in this application is described.
[0058] The component-based business processing method provided in this application relates to the field of network service technology. This component-based business processing method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the component-based business processing method, but is not limited to the above forms.
[0059] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via communication networks. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0060] It should be noted that in various specific embodiments of this application, when processing is required based on user information, user behavior data, user historical data, and user location information, or for example, when receiving business requests from users or external entities, permission or consent from the user or external entity will be obtained first. Furthermore, the collection, use, and processing of this data will comply with relevant laws, regulations, and standards of the relevant countries and regions. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user will be obtained through pop-ups or redirects to confirmation pages. Only after obtaining the user's separate permission or consent will the necessary user-related data for the normal operation of the embodiments of this application be obtained.
[0061] Figure 1 This is an optional flowchart of the component-based business processing method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.
[0062] Step S101: When multiple business scenario information is obtained, for each business scenario information, the predefined first business component is instantiated according to the pre-configured application container and business scenario information to obtain the second business component.
[0063] Step S102: For each second service component, generate a service component list based on the second service component, wherein the service component list represents the routing configuration of the second service component;
[0064] Step S103: Store the information of each business scenario and the list of each business component in the preset target database;
[0065] Step S104: Upon receiving a business request, retrieve the business scenario information corresponding to the business request from the target database.
[0066] Step S105: Based on the business scenario information, query the target database to obtain at least one business scenario route that matches the business scenario information. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit.
[0067] Step S106: For each business scenario route, execute each routing unit in a preset order to process the business components configured in each routing unit and generate business processing results.
[0068] Steps S101 to S106, as illustrated in this embodiment, instantiate the first business component using application container and business scenario information to obtain the second business component. A list of business components representing the routing configuration of the second business component is then generated. This allows for the initialization of components with different configurations based on different scenarios, achieving component logic reuse and effectively realizing component instantiation and configuration injection, thus improving the flexibility of business processing. Furthermore, the mechanism of abstracting multi-level routing units based on business scenario routing to orchestrate the business component list provides a more effective and reliable method for routing execution of the business component list, greatly improving the scalability of business orchestration execution and enhancing business development and maintenance efficiency.
[0069] In step S101 of some embodiments, the types of application container and first business component are not limited and can be determined according to different application platforms. For example, it can be a Spring container under Java. At this time, the predefined first business component is the initial SpringBean object in the Spring container, that is, the SpringBean object has not been instantiated or configured.
[0070] In step S101 of some embodiments, the business scenario information is associated with a specific business scenario and can be presented as any aspect of the business scenario. This is not limited here. For example, the business scenario information can be a unique identity identifier for a single scenario (including scenario ID, feature information, etc.).
[0071] In some embodiments, the specific content of the routing configuration in step S102 is not limited, and the routing configuration can be different in different business scenarios. It is not limited here.
[0072] In step S103 of some embodiments, information on various business scenarios and lists of various business components are stored in a preset target database. The purpose is to enrich the target database so that corresponding queries can be performed from the target database in subsequent steps. This also shows 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.
[0073] In step S103 of some embodiments, the type of the target database can be selected and set according to the specific application scenario, and is not limited here.
[0074] In step S104 of some embodiments, the business scenario information corresponding to the business request can be one or more.
[0075] In step S105 of some embodiments, the list of service components configured for each routing unit can be in the form of a configuration table, which facilitates its flexible execution.
[0076] In step S106 of some embodiments, the preset order can be non-fixed, that is, the preset order can be changed in different application scenarios, which is beneficial to execute each routing unit more flexibly.
[0077] Please see Figure 2 In some embodiments, step S101 may include, but is not limited to, steps S201 to S202:
[0078] Step S201: Read the configuration information interface of the first business component from the pre-configured application container;
[0079] Step S202: Based on the business scenario information and configuration information interface, re-register the first business component with the application container to obtain the second business component.
[0080] In this step, by reading the configuration information interface of the first business component from the application container, the configuration status of the first business component can be obtained. Then, based on the business scenario information and the configuration status of the configuration information interface, the first business component is re-registered with the application container, thus obtaining an instantiated business component. Since the business scenario information is different in different scenarios, instantiated business components can be obtained separately for each scenario without interference, which also facilitates the use of the application container's dependency injection and other functions.
[0081] In step S201 of some embodiments, the configuration information interface may be inherent to the first service component or may be externally set on the first service component; this is not limited here.
[0082] Please see Figure 3 In some embodiments, step S102 may include, but is not limited to, step S301:
[0083] Step S301: Inject route configuration into the second business component based on the business scenario information to generate a list of business components.
[0084] In this step, routing configurations are injected for different second business components based on different business scenario information to ensure personalized routing configuration injection for each second business component, thereby forming a list of business components for each business scenario, so as to facilitate further execution and invocation of the business component list.
[0085] Please see Figure 4 In some embodiments, step S301 may include, but is not limited to, step S401:
[0086] Step S401: If the parameter configuration interface of the second business component has a predefined routing configuration method, the routing configuration method is used to inject routing configuration into the second business component according to the business scenario information, and a list of business components is generated.
[0087] In this step, since each second business component's parameter configuration interface predefines a route configuration method, when route configuration injection is required, this route configuration method can be directly called to perform route configuration injection, thereby improving the stability of generating the business component list.
[0088] In step S401 of some embodiments, the parameter configuration interface is set according to actual needs, for example, it can be set at the top or bottom layer of the component; the route configuration method can be triggered by receiving preset parameters through the parameter configuration interface, which can ensure that the route configuration method can be called stably.
[0089] To better illustrate the working principle and content of the above embodiments, a specific example is given below.
[0090] Example 1:
[0091] Taking Java as an example, after the business module is componentized, a suitable way is needed to instantiate the component to provide services. In Java, reflection is usually used to call the parameterized constructor of the component for instantiation. However, the object created in this way is not a SpringBean and cannot directly use the dependency injection and other functions of the Spring framework, which is extremely inconvenient in development.
[0092] To address the shortcomings of the aforementioned techniques, this example uniformly uses SpringBean type business components to implement the instantiation process. First, the Bean Definition (the interface for defining Bean configuration meta-information) of the business component is read from the Spring container. Then, the scene component id is used as the new Bean name (BeanName_{scene component id}) and the BeanDefinition are re-registered with the Spring container to form a new SpringBean object. This ensures that the SpringBean objects formed for each scene are independent objects that do not interfere with each other, thus cleverly solving the instantiation problem of business components and effectively utilizing the dependency injection and other functions of the Spring framework.
[0093] Furthermore, the top-level interface of the business components defines a configuration method that takes JSON as a parameter. Each component can implement this configuration method, using the JSON parameter to initialize the component's internal properties. During instantiation, after a new SpringBean object is created, the customized configuration for that scenario can be injected through this configuration method. All of this will be handled at the top-level framework level, without affecting the underlying components and causing no interference.
[0094] As can be seen, this example solves the problem of componentization and configuration of business logic, and cleverly uses the Spring framework to implement component instantiation and configuration injection. It can initialize components with different configurations according to different scenarios, realize the reuse of component logic, and improve the flexibility of the project. It can not only solve the problems of personalized configuration and instantiation difficulties of business components, but also improve the flexibility of business processing and distribution.
[0095] In some embodiments, step S106 may include, but is not limited to, step S501 or step S502:
[0096] Step S501: When the service component list configured in one of the routing units is a continuous type list, perform serial service processing on each service component list to generate service processing results.
[0097] or,
[0098] Step S502: When the service component list configured in one of the routing units is a scattered type list, parallel service processing is performed on each service component list to generate multiple intermediate service processing results, and the multiple intermediate service processing results are merged to generate the service processing result.
[0099] In this step, corresponding business processing actions are performed on the business component list according to its different types, which can maximize the efficiency of business component list processing so as to meet the real-time needs of business processing.
[0100] In steps S501 and S502 of some embodiments, the different methods of serial service processing and parallel service processing will not cause significant differences in the final service processing result. They are merely different execution methods, and the execution content is mainly related to the service component list. In addition to the methods of serial service processing and parallel service processing, other methods of processing the service component list can be determined according to the specific application scenario, such as other types of service component lists. This is not limited here.
[0101] Please see Figure 5 In some embodiments, step S502 may include, but is not limited to, steps S601 to S602:
[0102] Step S601: After calculating the business configuration parameters based on the business request, according to the business configuration parameters and the preset business configuration range of each business component list, select all business component lists that meet the preset business conditions as the target business component list. The preset business condition is that the business configuration parameters are within the preset business configuration range.
[0103] Step S602: Perform parallel business processing on all target business component lists to generate multiple intermediate business processing results.
[0104] In this step, by comparing whether the business configuration parameters are within the preset business configuration range of each business component list, it is determined which business component lists to process. This enables the execution of different component processing logic based on the upper and lower limits of the component configuration, thereby achieving traffic diversion for the client and facilitating business logic comparison testing within a single service.
[0105] In step S601 of some embodiments, the service configuration parameters and the preset service configuration range of each service component list can be predefined, and the specific values are associated with the corresponding service scenarios.
[0106] Please see Figure 6 In some embodiments, steps S701 to S702 are included, but are not limited to, preceding step S106:
[0107] Step S701: Select at least one routing unit from each routing unit as a transitional routing unit;
[0108] Step S702: Perform batch reuse processing on the service component list configured in the transition routing unit.
[0109] In this step, at least one routing unit is selected from each routing unit as a transitional routing unit to facilitate the batch reuse of the business component list based on the intermediate level of multi-level routing. This greatly facilitates orchestration expansion and is beneficial for realizing traffic splitting within a monolithic service.
[0110] In step S702 of some embodiments, the batch reuse of the business component list can be achieved, but is not limited to, by packaging the business component list.
[0111] To better illustrate the working principle and content of the above embodiments, a specific example is given below.
[0112] Example 2:
[0113] Please see Figure 7 and Figure 8 , Figure 7The diagram illustrates the principle of a component-based business processing method according to an embodiment of this application. Figure 8 The diagram illustrates the principle of a component-based business processing method according to another embodiment of this application, specifically:
[0114] like Figure 7 As shown, the component routing configuration is stored in the target database in the form of a table. Here, channel represents channel scenario and route represents scenario route (i.e., route1 represents scenario route 1). A scenario corresponds to at least one scenario route. A route contains multiple route units. Each route unit carries a list of components. A route unit can have multiple types. When the type is serial, the internal business component list will be executed serially. That is, componentA and componentB will be executed serially in route unit1. When the type is parallel, the internal business component list will be executed in parallel. That is, componentC, componentD and componentE will be executed in parallel in route unit2. Then, the results are merged to obtain the result set.
[0115] As an intermediate layer for routing, the Route Unit handles the execution of a list of business components. Furthermore, it can package the list of business components to enable batch reuse of components. For example, in real-world projects, using the Route Unit to package infrequently changing business logic can greatly isolate changes and improve project flexibility. In addition, the Route Unit also provides a set of batch switches for components, significantly enhancing routing flexibility.
[0116] exist Figure 7 In the architecture shown, when the project starts, it pulls all the routing configuration information from the target database and instantiates the list of business components under all route units according to the parameters of the business components, and stores it in the memory of the target database. When an external request from a client is received, the corresponding multi-level routing information is first matched through the channel, and then the route units are executed in sequence. The route unit selects different execution methods according to the type to process the internal list of business components and finally returns the result.
[0117] like Figure 8 As shown, the route unit intermediate layer also provides more possibilities for expansion. Figure 8The route unit 3 shown is extensible with the type "byPass". It maintains two lists of business components, each configured with upper and lower limits. Specifically, component F has upper and lower limits of 0-40, and component G has upper and lower limits of 41-100. When RouteUnit 3 executes, it calculates the hash value of the client ID in the request parameters and takes the modulo of 100 (i.e., calculates `clientld.hashCode % 100`). The resulting value is used to execute different component processing logic based on the configured upper and lower limits. For example, if some calculation results are 25, then the component processing logic corresponding to component F will be executed; if some calculation results are 60, then the component processing logic corresponding to component G will be executed. This enables the distribution of client traffic, which is beneficial for comparing and testing business logic within a monolithic service.
[0118] As can be seen, this example uses a business configuration table to achieve effective component orchestration, abstracts a multi-level routing mechanism to provide multiple ways for component routing execution, and the intermediate level of multi-level routing greatly facilitates the batch reuse of components and the expansion of orchestration, enabling traffic splitting within a single service, greatly improving the scalability of business processing and the efficiency of development and maintenance.
[0119] Please see Figure 9 This application also provides a component-based business processing apparatus that can implement the above-described component-based business processing method. The apparatus includes:
[0120] The instantiation processing module is used to instantiate a predefined first business component for each business scenario information obtained, based on the pre-configured application container and business scenario information, to obtain a second business component.
[0121] The routing configuration module is used to generate a list of business components for each second business component, wherein the list of business components represents the routing configuration of the second business component;
[0122] The storage module is used to store information about various business scenarios and lists of various business components in a preset target database;
[0123] The first query module is used to retrieve business scenario information corresponding to the business request from the target database when a business request is received.
[0124] The second query module is used to query the target database to obtain at least one business scenario route that matches the business scenario information based on the business scenario information. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit.
[0125] The business processing module is used to execute each routing unit in a preset order for each business scenario route, so as to perform business processing on the business component list configured in each routing unit and generate business processing results.
[0126] The specific implementation of this component-based business processing device is basically the same as the specific implementation of the component-based business processing method described above, and they belong to the same inventive concept, so they will not be described again here.
[0127] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned component-based business processing method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0128] Please see Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0129] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0130] The memory 902 can be implemented in the form of read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the component-based business processing methods of the embodiments of this application.
[0131] The input / output interface 903 is used to implement information input and output;
[0132] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0133] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0134] The processor 901, memory 902, input / output interface 903, and communication interface 904 communicate with each other within the device via bus 905.
[0135] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned component-based business processing method.
[0136] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state memory device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0137] The component-based business processing method, apparatus, electronic device, and storage medium provided in this application instantiate a first business component using application containers and business scenario information to obtain a second business component, and generate a list of business components representing the routing configuration of the second business component. This enables the initialization of components with different configurations according to different scenarios, achieving component logic reuse and effectively realizing component instantiation and configuration injection, thus improving the flexibility of business processing. Furthermore, the mechanism of abstracting multi-level routing units based on business scenario routing to orchestrate the business component list provides a more effective and reliable way to execute the routing of the business component list, greatly improving the scalability of business orchestration execution and enhancing the efficiency of business development and maintenance.
[0138] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0139] The foregoing has described specific embodiments of this application; other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than those shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily have to follow the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0140] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and computer-readable storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0141] The apparatus, device, computer-readable storage medium and method provided in the embodiments of this application are corresponding. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and computer storage medium will not be described again here.
[0142] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement to the methodology cannot be implemented using hardware physical modules.
[0143] For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system onto a PLD themselves, eliminating the need for chip manufacturers to design and fabricate dedicated integrated circuit chips. Furthermore, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented using "logic compiler" software, similar to the software compiler used in program development. The source code before compilation must be written in a specific programming language called a Hardware Description Language (HDL). There is not just one type of HDL, but many, such as:
[0144] ABEL (Advanced Boolean Expression Language); AHDL (Altera Hardware Description Language); Confluence; CUPL (Cornell University Programming Language); HDCal; and JHDL (Java Hardware Description Language); Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, among the technologies in this field, VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are more commonly used. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using the aforementioned hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0145] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) that can be executed by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers:
[0146] The memory controller, including the ARC 625D, Atmel AT91SAM, Microchip IP address PIC18F26K20, and Silicon Labs C8051F320, can also be implemented as part of the memory's control logic. Those skilled in the art will also recognize that, in addition to implementing the controller as purely computer-readable program code, the same functionality can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices included within it for implementing various functions can also be considered structures within that hardware component. Alternatively, the devices for implementing various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0147] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0148] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing the embodiments of this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0149] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can 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, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0151] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0152] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0153] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0154] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0155] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0156] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0157] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, A and B simultaneously, or B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related 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 can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.
[0158] The embodiments of this application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.
[0159] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0160] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A component-based business processing method, characterized in that, include: When multiple business scenario information is obtained, for each business scenario information, a predefined first business component is instantiated according to the pre-configured application container and the business scenario information to obtain a second business component; For each of the second service components, a service component list is generated based on the second service component, wherein the service component list represents the routing configuration of the second service component; The information of each business scenario and the list of each business component are stored in a preset target database; Upon receiving a business request, the system retrieves the business scenario information corresponding to the business request from the target database. Based on the business scenario information, at least one business scenario route matching the business scenario information is obtained from the target database. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit. For each of the aforementioned business scenario routes, each of the aforementioned routing units is executed sequentially according to the preset order, so as to perform business processing on the list of business components configured in each of the aforementioned routing units and generate business processing results; The step of performing service processing on the service component list configured for each of the routing units to generate service processing results includes: When one of the routing units is configured with a list of service components that is a continuous type list, serial service processing is performed on each of the service component lists to generate a service processing result; or, When one of the routing units is configured with a list of service components that is a distributed list, parallel service processing is performed on each of the service component lists to generate multiple intermediate service processing results. The multiple intermediate service processing results are then merged to generate a final service processing result.
2. The component-based business processing method according to claim 1, characterized in that, The instantiation of a predefined first business component based on a pre-configured application container and the business scenario information to obtain a second business component includes: The interface for reading the configuration information of the first business component from the pre-configured application container; Based on the business scenario information and the configuration information interface, the first business component is re-registered with the application container to obtain the second business component.
3. The component-based business processing method according to claim 1, characterized in that, The parallel processing of each of the aforementioned business component lists to generate multiple intermediate business processing results includes: When the service configuration parameters are calculated based on the service request, according to the service configuration parameters and the preset service configuration range of each of the service component lists, all the service component lists that meet the preset service conditions are selected from each of the service component lists as the target service component list, wherein the preset service condition is that the service configuration parameters are within the preset service configuration range; Parallel business processing is performed on all the target business component lists to generate multiple intermediate business processing results.
4. The component-based business processing method according to claim 1, characterized in that, The step of generating a list of business components based on the second business component includes: Based on the business scenario information, the second business component is injected with route configuration to generate a list of business components.
5. The component-based business processing method according to claim 4, characterized in that, The step of injecting route configuration into the second business component based on the business scenario information to generate a business component list includes: If the parameter configuration interface of the second business component has a predefined routing configuration method, the routing configuration method is used to inject routing configuration into the second business component according to the business scenario information to generate a business component list.
6. The component-based business processing method according to claim 1, characterized in that, Before executing each routing unit in the preset order, the method further includes: At least one routing unit is selected from each of the routing units as a transitional routing unit; The service component list configured in the transition routing unit is batch reused.
7. A component-based business processing method apparatus, characterized in that, The device includes: The instantiation processing module is used to, when multiple business scenario information is obtained, instantiate a predefined first business component for each business scenario information according to the pre-configured application container and the business scenario information to obtain a second business component. A routing configuration module is used to generate a list of service components for each of the second service components, wherein the list of service components represents the routing configuration of the second service components; The storage module is used to store the information of each of the business scenarios and the list of each of the business components in a preset target database; The first query module is used to query the target database to obtain business scenario information corresponding to the business request based on the business request when a business request is received. The second query module is used to query at least one business scenario route that matches the business scenario information from the target database based on the business scenario information. The business scenario route includes multiple routing units arranged in a preset order, and each routing unit is configured with a list of business components corresponding to the routing unit. The business processing module is used to execute each of the routing units in the preset order for each of the business scenario routes, so as to perform business processing on the business component list configured in each of the routing units and generate business processing results. The step of performing service processing on the service component list configured for each of the routing units to generate service processing results includes: When one of the routing units is configured with a list of service components that is a continuous type list, serial service processing is performed on each of the service component lists to generate a service processing result; or, When one of the routing units is configured with a list of service components that is a distributed list, parallel service processing is performed on each of the service component lists to generate multiple intermediate service processing results. The multiple intermediate service processing results are then merged to generate a final service processing result.
8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the component-based business processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the component-based business processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Electric communication application software frame for NGN operation development
CN101216761A
Service request processing method and device, equipment and medium
CN109739474A