Service configuration method and device, electronic equipment, storage medium and program product
By extracting and encapsulating configurable atomic operations in the business platform, the code reuse and extension issues between different business platforms are solved, and efficient business configuration and maintenance are achieved.
Patent Information
- Application Number
- CN202510829111.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-10-14
AI Technical Summary
The differences in business processes between different business platforms lead to low reuse of business configuration codes, high maintenance costs, difficulty in reusing operation interfaces, and difficulty in expanding business platforms.
By extracting the common execution steps and differences in the business platform and encapsulating them into configurable atomic operations, and using the matching logic and atomic operations in the target storage space to build execution objects, the reuse and maintenance of business configurations can be achieved.
It improves the reuse of business configuration code, reduces maintenance costs, and improves the efficiency and scalability of business configuration.
Smart Images

Figure CN120780339A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular to a business configuration method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] With the development of business, different business platforms are provided for different user groups. Since there are differences in business processes between different business platforms, similar businesses for different business platforms need to be developed and maintained separately, the reuse degree of business configuration code is low, resulting in high maintenance cost. SUMMARY
[0003] Therefore, the present disclosure provides a business configuration method and device, electronic equipment, storage medium and program product to solve the problem of high maintenance cost of business configuration code.
[0004] In a first aspect, the present disclosure provides a business configuration method, which comprises:
[0005] In response to a business creation request, obtaining first business information of a target business;
[0006] Based on the first business information, matching in a target storage space to obtain a first business execution step matched with the first business information and a first atomic operation corresponding to first business logic in the first business execution step, the target storage space being configured to store second business information and second business execution steps, second atomic operations corresponding to second business logic in the second business execution steps;
[0007] Based on the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step, constructing an execution object of the target business, the execution object being used to execute the target business.
[0008] In a second aspect, the present disclosure provides a business configuration device, which comprises:
[0009] A data acquisition module configured to, in response to a business creation request, acquire first business information of a target business;
[0010] A data matching module configured to, based on the first business information, match in a target storage space to obtain a first business execution step matched with the first business information and a first atomic operation corresponding to first business logic in the first business execution step, the target storage space being configured to store second business information and second business execution steps, second atomic operations corresponding to second business logic in the second business execution steps;
[0011] The business configuration module is configured to construct an execution object of the target business based on the first business execution step and a first atomic operation corresponding to the first business logic in the first business execution step, and the execution object is used to execute the target business.
[0012] In a third aspect, the present disclosure provides an electronic device, comprising a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor executes the computer instructions to perform the business configuration method of the first aspect or any of the corresponding embodiments thereof.
[0013] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores computer instructions for causing a computer to perform the business configuration method of the first aspect or any of the corresponding embodiments thereof.
[0014] In a fifth aspect, the present disclosure provides a computer program product, which comprises computer instructions for causing a computer to perform the business configuration method of the first aspect or any of the corresponding embodiments thereof.
[0015] The business configuration method provided by the embodiments of the present disclosure extracts the execution step of the common part of the second business information in different business platforms as the second business execution step of the second business information, so that the second business execution step can be reused by multiple business platforms to configure the business. And for the second business logic in the second business execution step, the second business logic is encapsulated into the configurable second atomic operation in the different parts of the second business information in an atomic manner, so that the second atomic operation corresponding to the second business logic can be reused by multiple business platforms to configure the content that needs to be executed. Furthermore, when configuring the target business, the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step in the target storage space can be reused according to the first business information of the target business to form the execution object of the target business, without the need to configure the business execution step and the business logic for each business separately, so as to improve the reuse degree of the business configuration code. Moreover, for the same business logic in different businesses, only the second atomic operation corresponding to the business logic in the target storage space needs to be maintained, thereby effectively reducing the maintenance cost of the business configuration code.
[0016] The beneficial effects of the business configuration device, the electronic device, the storage medium and the program product correspond to the beneficial effects of the business configuration method, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the specific embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0018] Figure 1 is a schematic diagram of an optional application scenario according to an embodiment of the present disclosure;
[0019] Figure 2 is a flowchart of a first service configuration method according to an embodiment of the present disclosure;
[0020] Figure 3 is an execution object configuration diagram according to an embodiment of the present disclosure;
[0021] Figure 4 is a flowchart of a second service configuration method according to an embodiment of the present disclosure;
[0022] Figure 5 is an execution object framework diagram of a recommended service according to an embodiment of the present disclosure;
[0023] Figure 6 is a flowchart of a third service configuration method according to an embodiment of the present disclosure;
[0024] Figure 7 is a running flowchart of an execution object according to an embodiment of the present disclosure;
[0025] Figure 8 is a flowchart of a fourth service configuration method according to an embodiment of the present disclosure;
[0026] Figure 9 is a structural block diagram of a service configuration apparatus according to an embodiment of the present disclosure;
[0027] Figure 10 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the following will combine the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are some of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present disclosure.
[0029] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained through appropriate means according to relevant laws and regulations.
[0030] For example, in response to receiving the active request of the user, the user is sent prompt information to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can voluntarily choose whether to provide the personal information to the software or hardware such as electronic devices, application programs, servers or storage media that perform the operation of the technical solutions of the present disclosure according to the prompt information.
[0031] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user may be, for example, a pop-up window manner, in which the prompt information can be presented in the form of text. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0032] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that meet the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0033] It can be understood that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.
[0034] With the development of business, different business platforms are provided for different user groups. Due to the differences in data models and data structures between different business platforms, and the differences in business processes between business platforms, the business configuration of the business platform faces the following problems:
[0035] 1. The logic of the operation interface of each business platform is independent and has the specificity of the business platform, making it difficult to reuse the operation interface between different business platforms.
[0036] 2. The internal operation interface only controls the business logic through conditional branching logic, without reserving extensions for new business access, making it difficult to extend the business of the business platform.
[0037] 3. The access layer is responsible for scheduling the service layer interface, making it difficult to share the context, and causing some business logic to be executed repeatedly.
[0038] In view of the above problems of business logic reuse and business expansion of multiple platforms and multiple businesses, the related technology proposes the following solutions:
[0039] Scheme one, dividing the business logic boundary and maintaining independently. Specifically, according to certain dimensions, such as business platform, business, product, etc., the business configuration is carried out separately for different business platforms and different businesses of the same platform, so as to distinguish the boundary of each business logic and maintain each business logic independently. However, the business configuration code reuse rate of this scheme is low, the maintenance cost is high, and when the horizontal business logic changes, all affected business platforms and businesses need to be modified.
[0040] Scheme two, object-oriented design. Specifically, the object-oriented design method is adopted, and based on certain design patterns, such as facade pattern and template, the business process unification and business logic reuse are realized based on class inheritance. However, in the case of multiple inheritance, it is difficult to determine the actual executed business logic, thereby affecting the overall business development efficiency.
[0041] Therefore, according to the embodiments of the present disclosure, a business configuration method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0042] As an optional application scenario of the embodiments of the present disclosure, as shown in Figure 1 The entire business configuration scenario includes business platform 1 (such as business platform 11, business platform 12, business platform 13) and business configuration system 2. When the business platform 1 needs to be configured, the business platform 1 can send the business information of the target business to be configured to the business configuration system 2, and the business configuration system 2 can configure the execution object of the target business according to the business information and call the required configuration information (such as business execution steps, atomic operations of business logic in business execution steps). The business platform 1 can execute the target business through the execution object.
[0043] In this embodiment, a first business configuration method is provided, which can be used in the above-mentioned business configuration system 2, Figure 2 is a flowchart of the first business configuration method according to the embodiments of the present disclosure, as shown in Figure 2 The flowchart includes the following steps:
[0044] Step S201, in response to a business creation request, obtaining first business information of a target business.
[0045] The first service information can be input by a user on a service platform, and the service platform generates a service creation request based on the first service information and sends the service creation request to a service configuration system. Alternatively, the first service information can be input by a user on a client of the service configuration system, and the client or a server of the service configuration system generates a service creation request in response to the input first service information.
[0046] Optionally, the first service information includes one or more of a first service type of the target service and a first service scenario, which can be selected and adjusted according to actual conditions.
[0047] In step S202, matching is performed in the target storage space based on the first service information, to obtain a first service execution step matched with the first service information and a first atomic operation corresponding to first service logic in the first service execution step. The target storage space is configured to store second service information, a second service execution step, and a second atomic operation corresponding to second service logic in the second service execution step.
[0048] The first service execution step includes at least one first service logic, and the first service logic has a corresponding operation type, i.e., the first atomic operation corresponding to the first service logic belongs to the operation type corresponding to the first service logic. Understandably, the first service logic is realized by the operation logic of the corresponding first atomic operation.
[0049] Understandably, the first service execution step defines the first service logic required to be configured for the target service (i.e., which types of atomic operations are required to be included in the target service) and the execution order between the first service logics. For example, the first service execution step defines the first service logics required to be configured for the target service, such as parameter verification, data filling, service verification, etc., and defines the execution order between the first service logics. The first atomic operation determines the specific content of the execution of the first service logic.
[0050] Optionally, the second service information includes one or more of a second service type and a second service scenario.
[0051] Optionally, the first atomic operation and the second atomic operation can be data verification operations, data filling operations, data splitting operations, data construction operations, etc., without limitation. In addition, the first atomic operation and the second atomic operation can have branch judgment logic, but should not be too many and too complex, with the goal of being configurable, reusable, and reducing maintenance costs.
[0052] It should be noted that the second service information, the second execution step, and the second atomic operation corresponding to the second service logic in the second execution step are further described with reference to the first service information, the first execution step, and the first atomic operation corresponding to the first service logic in the first execution step, which will not be described again here.
[0053] In step S203, an execution object of the target service is constructed based on the first service execution step and the first atomic operation corresponding to the first service logic in the first service execution step, and the execution object is used to execute the target service.
[0054] Specifically, the first service execution step and the first atomic operation corresponding to the first service logic in the first service execution step jointly constitute the execution object of the target service.
[0055] Optionally, the execution object is an executor.
[0056] The service configuration method provided in this embodiment extracts the execution step of the common part of the second service information in different service platforms as the second service execution step of the second service information, so that the second service execution step can be reused by multiple service platforms to configure services. And for the second service logic in the second service execution step, the second service logic is encapsulated into a configurable second atomic operation in the different parts of the second service information in an atomic manner, so that the second atomic operation corresponding to the second service logic can be reused by multiple service platforms to configure the content that needs to be executed. Furthermore, when a target service is added, the first service execution step and the first atomic operation corresponding to the first service logic in the first service execution step that match the first service information of the target service can be reused from the target storage space to form the execution object of the target service, without the need to configure the service execution step and the service logic for each service separately, so as to improve the reusability of the service configuration code. Moreover, for the same service logic in different services, only the second atomic operation corresponding to the service logic in the target storage space needs to be maintained, thereby effectively reducing the maintenance cost of the service configuration code.
[0057] In some optional embodiments, the first service information includes a first service type and a first service scenario of the target service, and the second service information includes a second service type and a second service scenario. The above step S202 includes:
[0058] In step a1, the first service type and the first service scenario are matched in the target storage space to obtain the first service execution step matching the first service information, and the first service execution step includes at least one first service logic and the execution order between the first service logics.
[0059] In step a2, the first service type and the first service scenario are matched in the target storage space to obtain the first atomic operation corresponding to the first service logic matching the first service information.
[0060] It is worth mentioning that the execution object of the target business determines the business boundary, and therefore the division dimension of the execution object is the content that needs to be defined and considered. In the actual execution process, the business type and the business scenario are mainly used as the boundary of business division. Each business can have different business logic, and a certain business can have different operation logic for the same type of business logic in a specific business scenario. Therefore, the business can be divided according to the business type, and the appropriate atomic operation can be set for different business types. And the atomic operation under the business type is further divided according to the business scenario. For example, according to the recommended business process of the recommended content, it is mainly divided into "new draft", "edit draft", "new intention", "edit intention", "select recommended content", "cancel or modify recommended content", "recommended content is invalid" and the like. Among them, "edit intention" carries two operations of "save recommended content before selecting recommended content" and "save recommended content after selecting recommended content", and "cancel or modify recommended content" carries two operations of "creative editing and cancellation modification" and "cancel selection and delete date". Therefore, the same type of atomic operation in the business logic needs to be further divided according to different business scenarios.
[0061] The business configuration method provided by the embodiment configures the first business execution step to be executed by the target business and the first atomic operation required by each first business logic in the first business execution step from the two dimensions of the first business type and the first business scenario, thereby assembling the execution object of the target business and forming the complete business logic of the target business. Therefore, the accuracy of business configuration can be further improved from the two dimensions of business type and business scenario.
[0062] As a specific application example, see Figure 3The service configuration method of the present disclosure mainly includes configuration of two parts of service logic and atomic operation when configuring a target service. Each service logic corresponds to an operation type. First service execution steps are matched in a target storage space according to first service information, and execution order between service logics of the target service is configured according to first service logics in the first service execution steps and execution order between the first service logics. For example, service logic a, service logic b, and service logic x are executed in sequence. For each operation type corresponding to a service logic, first atomic operations corresponding to the first service logics in the first service execution steps are matched in the target storage space according to the first service information, so as to configure atomic operations corresponding to each service logic of the target service. For example, service logic a corresponds to atomic operation a1, atomic operation a2, …, and atomic operation an, service logic b corresponds to atomic operation b1, atomic operation b2, …, and atomic operation bn, and service logic x corresponds to atomic operation x1, atomic operation x2, …, and atomic operation xn. Thus, according to service logics to be executed by the target service, execution order between the service logics, and atomic operations corresponding to each service logic, an execution object of the target service is assembled to realize overall service logic of the target service.
[0063] In some optional embodiments, a second service configuration method is provided in the present embodiment, which can be used in the service configuration system described above. Figure 4 The flowchart of the second service configuration method according to the embodiment of the present disclosure is shown in FIG. 4, which includes the following steps: Figure 4
[0064] In step S401, first service information of a target service is obtained in response to a service creation request. Please refer to step S201 described above, which will not be repeated here.
[0065] In step S402, first service execution steps and first atomic operations corresponding to first service logics in the first service execution steps are obtained by matching in a target storage space based on the first service information. The target storage space is configured to store second service information, second service execution steps, and second atomic operations corresponding to second service logics in the second service execution steps. Please refer to step S202 described above, which will not be repeated here.
[0066] In step S403, an execution object of the target service is constructed based on the first service execution steps and the first atomic operations corresponding to the first service logics in the first service execution steps, and the execution object is used to execute the target service. Please refer to step S203 described above, which will not be repeated here.
[0067] In step S404, a third service logic to be added is obtained in response to a service logic adding instruction for the target service.
[0068] Specifically, a user (e.g., a developer) can select a target service requiring the addition of service logic and input third service logic to be added at a client of the service configuration system, and the client generates a service logic addition instruction in response to the selected target service and the third service logic to be added.
[0069] In step S405, a third atomic operation corresponding to the third service logic is configured.
[0070] Specifically, step S405 includes obtaining the third atomic operation corresponding to the third service logic in response to a selection instruction for the second atomic operation in the target storage space that matches the third service logic.
[0071] In actual applications, the third service logic can be used to determine the matching second service logic in the target storage space, the second atomic operation corresponding to the second service logic is used as a candidate atomic operation, and a selection instruction is generated in response to a selection operation for the candidate atomic operation to determine the third atomic operation. Alternatively, since the second atomic operation corresponds to an operation logic, the operation logic required by the third service logic can be analyzed by using a model, and the matching second atomic operation in the target storage space is found according to the operation logic required by the third service logic, and a selection instruction is generated to determine the third atomic operation. Alternatively, the user manually inputs the description information of the third atomic operation, finds the matching second atomic operation in the target storage space according to the description information, and generates a selection instruction to determine the third atomic operation, which is not limited herein.
[0072] The embodiment reuses the existing atomic operation in the target storage space to configure the third atomic operation required by the third service logic, so that the code of the third service logic to be added does not need to be configured separately, thereby improving the efficiency of adding service logic and quickly updating the service logic of the target service.
[0073] Further, step S405 further includes obtaining a to-be-configured operation logic corresponding to the third service logic, the to-be-configured operation logic being used to represent the difference between the operation logic required by the third service logic and the operation logic corresponding to the obtained third atomic operation, encapsulating the to-be-configured operation logic, and taking the encapsulation result as the third atomic operation corresponding to the third service logic.
[0074] It should be noted that the obtained third atomic operation refers to the third atomic operation obtained from the target storage space. The user can manually input the to-be-configured operation logic according to the difference between the operation logic required by the third service logic and the operation logic corresponding to the obtained third atomic operation. Alternatively, the service configuration system determines the to-be-configured operation logic according to the difference between the operation logic required by the third service logic and the operation logic corresponding to the obtained third atomic operation.
[0075] It should be noted that the third atomic operation corresponding to the third service logic finally obtained includes the third atomic operation obtained through the target storage space and the third atomic operation obtained by encapsulation.
[0076] The embodiment encapsulates the operation logic to be configured when the atomic operation corresponding to the operation logic to be configured is missing in the target storage space, to obtain a new third atomic operation. Therefore, the added third service logic and the third atomic operation thereof can be ensured to be accurate. Moreover, the code maintenance cost of the service logic can be reduced, and the code change amount of the newly added service logic can be reduced.
[0077] In step S406, the third service logic and the third atomic operation corresponding to the third service logic are added in the first service execution step, to obtain an updated execution object of the target service.
[0078] In addition, an association relationship between the first service information, the third service logic, the third atomic operation, and the updated first service execution step can be established, and the second service execution step corresponding to the first service information in the target storage space, the second service logic in the second service execution step, and the second atomic operation corresponding to the second service logic can be updated according to the association relationship.
[0079] The service configuration method provided by the embodiment is because the service logic of the disclosure is determined by the atomic operation corresponding to the service logic to determine the specific execution content. Therefore, when the third service logic needs to be added, only the third atomic operation corresponding to the third service logic needs to be configured, and the execution object of the target service can be automatically updated to implement the third service logic in the execution process of the target service, thereby effectively improving the adding efficiency of the service logic.
[0080] In some optional embodiments, the service configuration method of the disclosure further includes: in response to an atomic operation adding instruction for the second service logic corresponding to the second service information in the target storage space, configuring a fourth atomic operation; and updating the second atomic operation corresponding to the second service logic based on the fourth atomic operation.
[0081] With a specific application example, assume that the target service is a recommendation service for recommending content. Although the recommendation process of the recommended content on multiple service platforms is different, each service platform has its own recommended content, and different recommended content has its own personalized logic in different service scenarios. However, the recommendation process of the recommended content in multiple service platforms includes several business logics such as "data mapping", "business logic verification", "data splitting", etc. A specific data structure (such as business execution steps) can be constructed based on these business logics and saved to the target storage space. Therefore, the same business logic of the recommendation service in the data model of different service platforms can be extracted for reuse by each service platform in different service scenarios of the recommendation service. However, the same business logic will differ in different service platforms and different recommended content, so these differences can be further abstracted as atomic operations, and each independent operation logic of the business logic is encapsulated as a configurable atomic operation. Whether the atomic operation needs to be used is determined by the service platform and the recommended content, and each atomic operation executes its operation logic on the same data context to achieve the desired effect of the recommendation service.
[0082] Specifically, when the business configuration system receives a service creation request for the recommendation service, it obtains the service information of the recommendation service, loads the configuration information from the target storage space on demand according to the service information (refer to the first business execution step, the first atomic operation corresponding to the first business logic in the first business execution step), and constructs the execution object of the recommendation service. Referring to Figure 5 , Figure 5 is a framework diagram of an execution object of a recommendation service. The first business logic included in the execution object of the recommendation service includes: parameter verification (Validator), data filling (Filler), business logic verification (Validator), data splitting (Splitter), data mapping (Projector), data post-processing (Processor), custom processing, data view fission (Bomb), data persistence (Persiter), and asynchronous event distribution (EventPublisher). Each first business logic is configured with a first atomic operation corresponding thereto.
[0083] Among them, the definition of each business logic is as follows: 1, parameter verification: the input parameters of the execution object are verified, and the verification logic is only dependent on the current input parameters, not dependent on other data (such as local database, downstream interface, etc.), which can be used as parameter verification. For example, name length verification, name verification, etc. 2, data filling: the logic of filling the context data can be used as data filling. For example, loading existing data from the database, cleaning useless parameters transmitted by the front end, supplementing the operator's information to the input parameters, etc. 3, business logic verification: the business verification logic of the current context data can be used as business verification. The main difference between business verification and parameter verification is whether it depends on other data, such as inventory quantity verification, etc. 4, data splitting: used for splitting business data to target dimensions as needed, which will determine the data type of each business data, such as adding, deleting, updating, adjusting, etc. According to the difference of recommended content, the splitting logic can be distinguished. 5, data mapping: used for mapping the current context data to generate other data, in addition to the data of the local database, it also needs to be mapped into other data structures, so as to synchronize or preprocess the business data that needs to be associated. The specific implementation can be realized by designing a project. 6, data post-processing and custom processing: used for some business logic processing of the current context data, which can also be used to trigger events within the transaction. 7, data view fission: used for the connection of context data and data to be persisted before data persistence, and fission operation is performed on the business data to be saved in the context data as needed, for example, splitting the business data to be saved according to the city dimension. 8, data persistence: used for in-database processing of business data in the context data, and ensuring the accuracy of the transaction. 9, asynchronous event publishing: used for triggering recommended events, such as triggering recommended events after transaction, which can also process recommended events immediately, or use asynchronous tasks to realize recommended events. Further, the recommended business of recommended content is realized together.
[0084] In this embodiment, a third business configuration method is provided, which can be used in the above-mentioned business configuration system, Figure 6 is a flowchart of the third business configuration method according to the embodiments of the present disclosure, as Figure 6 shown, the flow includes the following steps:
[0085] Step S601, in response to the business creation request, obtaining the first business information of the target business. Please refer to the related description of step S201 above, which will not be repeated here.
[0086] At step S602, the first business information is matched in the target storage space based on the first business information, to obtain a first business execution step matched with the first business information and a first atomic operation corresponding to the first business logic in the first business execution step. The target storage space is configured to store second business information and a second business execution step, and a second atomic operation corresponding to the second business logic in the second business execution step. For details, please refer to the description of step S202 above, which will not be repeated here.
[0087] At step S603, an execution object of the target business is constructed based on the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step, and the execution object is used to execute the target business. For details, please refer to the description of step S203 above, which will not be repeated here.
[0088] At step S604, in response to a running instruction of the execution object, the first atomic operation in the execution object is executed based on the execution order between the first business logics in the first business execution step and the dependency relationship of the first atomic operation, to obtain a business processing result of the target business.
[0089] It should be noted that the execution order between the first business logics can be externally specified, or a default execution order between the first business logics can be pre-set.
[0090] It should be noted that in order to ensure the atomicity, logical accuracy and business matching of the atomic operation, all the first atomic operations have a Matches method, and when the execution object calls the first atomic operation, it will first judge whether the first atomic operation needs to be executed through the Matches method. In the Matches method, the control can be performed through information such as whether the parameter is empty, whether it enters the delivery, and whether it is a certain business platform.
[0091] In some optional embodiments, the step S604 includes:
[0092] At step b1, the execution priority of the first atomic operation is determined based on the dependency relationship of the first atomic operation.
[0093] At step b2, the first atomic operation corresponding to the first business logic in the execution object is executed based on the execution order between the first business logics, and in the execution process, the first atomic operation corresponding to the same first business logic is executed based on the execution priority of the first atomic operation.
[0094] It is worth noting that the first atomic operation is created at the time of execution, and the data dependency relationship at the time of execution determines the dependency relationship between the first atomic operations. Therefore, according to the dependency relationship of the first atomic operation, the execution priority of the first atomic operation can be constructed, and when executing the first atomic operation corresponding to the same first business logic, the first atomic operation is executed in series according to the execution priority of the first atomic operation, and the first atomic operations with the same execution priority are executed in parallel.
[0095] The business configuration method provided by the embodiment is based on the execution order between the first business logics in the first business execution step and the execution priority reflected by the dependency relationship of the first atomic operation, and executes the first atomic operation in the execution object. Therefore, the business processing flow of the target business can be ensured to be accurate, and the accuracy of the business processing result can be ensured.
[0096] As one of the specific application examples, see Figure 7 , the user inputs the first business type and the first business scenario of the target business to be created, so that the client of the business platform or the business configuration system of the user generates a business creation request. The business configuration system responds to the business creation request, parses the business creation request, and obtains the first business type and the first business scenario of the target task. According to the first business type and the first business scenario, the constructor of the execution object of the target object is obtained from the target storage space, and the constructor is configured with the first business execution step. The constructor loads the execution configuration, including the first business logic (such as the first business logic 1, the first business logic 2,..., the first business logic k) and the first atomic operation corresponding to the first business logic, and generates the execution object of the target business. The execution object is run to convert the input parameters and initialize the global context. The execution object executes the first atomic operation corresponding to each first business logic according to the execution order of the first business logic. According to the configuration of the first atomic operation, the instance of the corresponding first atomic operation is obtained from the target storage space. According to the dependency relationship of the first atomic operation, the execution priority of the first atomic operation is constructed. The first atomic operation corresponding to the first business logic is executed in series according to the execution priority, and the first atomic operations with the same execution priority are executed in parallel. Then, the execution object performs asynchronous event publishing based on the execution result of the first atomic operation, converts the output parameters of the execution object, and feeds back the task processing result of the target task to the calling party of the execution object.
[0097] In some optional embodiments, see Figure 8 , the business configuration method of the disclosure further comprises:
[0098] In step S801, the second business execution step corresponding to the second business information is obtained, and the second business execution step includes the second business logic corresponding to the second business information and the execution order between the second business logics.
[0099] In some optional embodiments, the step S801 comprises:
[0100] Step c1, obtaining at least one service execution step sample of the second service information.
[0101] Step c2, obtaining the second service logic corresponding to the second service information based on the same service logic in the at least one service execution step sample.
[0102] Step c3, obtaining the second service execution step corresponding to the second service information based on the second service logic and the execution order of the second service logic in the at least one service execution step sample.
[0103] It can be understood that the second service execution step is a fixed data structure in the service execution step sample. The contexts are shared between the second service logics, and the operation contents of each second service logic are determined by the second atomic operation corresponding to the second service logic.
[0104] In this embodiment, in order to simplify the configuration logic of the second service logic, a limited number of fixed execution method templates and corresponding general configurations are defined according to the second service information to obtain the second service execution step. The second atomic operation corresponding to the second service logic is additionally configured for each second service information.
[0105] Step S802, configuring the second atomic operation corresponding to the second service logic.
[0106] Specifically, the operation logic of the second service logic that is different and independent in different service execution step samples can be encapsulated into the second atomic operation.
[0107] Step S803, establishing the association relationship between the second service information, the second service execution step and the second atomic operation.
[0108] Step S804, storing the second service information, the second service execution step and the second atomic operation to the target storage space according to the association relationship.
[0109] The service configuration method provided in this embodiment obtains the second service execution step corresponding to the second service information, configures the second atomic operation corresponding to the second service logic in the second service execution step, and then stores the second service information, the second service execution step and the second atomic operation to the target storage space according to the association relationship between the second service information, the second service execution step and the second atomic operation, so as to reuse these contents when creating a new service, thereby improving the service creation efficiency.
[0110] As a specific application example, a target program is configured on a business configuration system, and the target program is used to execute the business configuration method of the present disclosure. The business configuration system is connected with multiple business platforms, and a user configures first business information of a target business to be configured on a client of the business configuration system or a business platform, and generates a business creation request. When the business creation request is received, the business configuration system runs the target program to configure the target business.
[0111] The business configuration method of the present disclosure can manage the business orchestration in a process, and can construct the overall business logic of a business through custom business logic and atomic operations to be executed in each business logic. At the same time, the business logic and the atomic operations can be reused, and have good scalability, which can improve the stability of business configuration. In addition, the style of the business configuration code written by the developer can be standardized, and the problems of poor readability and poor maintainability of the business process code can be solved.
[0112] Specifically, the business configuration method of the present disclosure can realize the reuse of a single atomic operation in different business types and different business scenarios through the division of atomic operations, which can effectively reduce code logic redundancy, reduce code complexity, and improve business logic reuse rate. At the same time, new atomic operations can be easily added through atomic design and interface driving to realize new business logic, which has good scalability. In addition, through the configuration method, new businesses can be flexibly assembled to realize new business logic, which can effectively reduce the access cost of new businesses and new business logic. Moreover, the business execution process and the code writing process are standardized, and subsequent business expansion will not corrode the logic and architecture of the existing business. In addition, through the concurrent execution of atomic operations, the overall business logic execution performance can be improved.
[0113] In the present embodiment, a business configuration apparatus is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0114] The present embodiment provides a business configuration apparatus, as shown in Figure 9 The business configuration apparatus comprises:
[0115] The data acquisition module 901 is configured to acquire first business information of a target business in response to a business creation request.
[0116] The data matching module 902 is configured to perform matching in the target storage space based on the first service information, to obtain first service execution steps matched with the first service information and first atomic operations corresponding to first service logics in the first service execution steps, and the target storage space is configured to store second service information, second service execution steps, and second atomic operations corresponding to second service logics in the second service execution steps.
[0117] The service configuration module 903 is configured to construct an execution object of the target service based on the first service execution steps and the first atomic operations corresponding to the first service logics in the first service execution steps, and the execution object is used to execute the target service.
[0118] In some optional embodiments, the first service information includes a first service type and a first service scenario of the target service. The data matching module 902 includes:
[0119] The first matching unit is configured to perform matching in the target storage space based on the first service type and the first service scenario, to obtain the first service execution steps matched with the first service information, and the first service execution steps include at least one first service logic and an execution order between the first service logics.
[0120] The second matching unit is configured to perform matching in the target storage space based on the first service type and the first service scenario, to obtain the first atomic operations corresponding to the first service logics matched with the first service information.
[0121] In some optional embodiments, the service configuration apparatus of the present disclosure further includes:
[0122] The instruction response module is configured to, in response to a service logic adding instruction for the target service, obtain a third service logic to be added.
[0123] The operation obtaining module is configured to configure a third atomic operation corresponding to the third service logic.
[0124] The logic adding module is configured to add the third service logic and the third atomic operation corresponding to the third service logic in the first service execution steps, to obtain an updated execution object of the target service.
[0125] In some optional embodiments, the operation obtaining module includes:
[0126] The operation matching unit is configured to, in response to a selection instruction for the second atomic operations matched with the third service logic in the target storage space, obtain the third atomic operation corresponding to the third service logic.
[0127] In some optional embodiments, the operation obtaining module further includes:
[0128] a difference processing unit, configured to obtain to-be-configured operation logic corresponding to the third service logic, the to-be-configured operation logic being used to represent a difference between operation logic required by the third service logic and operation logic corresponding to the obtained third atomic operation;
[0129] a logic packaging unit, configured to package the to-be-configured operation logic, and take a packaging result as the third atomic operation corresponding to the third service logic.
[0130] In some optional embodiments, the service configuration apparatus of the present disclosure further includes:
[0131] a service processing module, configured to execute the first atomic operation in the execution object based on the execution order between the first service logics and the dependency relationship of the first atomic operation in the first service execution step, in response to a running instruction of the execution object, to obtain a service processing result of the target service.
[0132] In some optional embodiments, the service processing module includes:
[0133] a priority determining unit, configured to determine an execution priority of the first atomic operation based on the dependency relationship of the first atomic operation;
[0134] an operation execution unit, configured to execute the first atomic operation corresponding to the first service logic in the execution object based on the execution order between the first service logics, and execute the first atomic operation corresponding to the same first service logic based on the execution priority of the first atomic operation in the execution process.
[0135] In some optional embodiments, the service configuration apparatus of the present disclosure further includes:
[0136] a step obtaining module, configured to obtain a second service execution step corresponding to second service information, the second service execution step including second service logics corresponding to the second service information and an execution order between the second service logics;
[0137] an operation configuration module, configured to configure second atomic operations corresponding to the second service logics;
[0138] an association establishing module, configured to establish an association relationship between the second service information, the second service execution step, and the second atomic operations;
[0139] a data storage module, configured to store the second service information, the second service execution step, and the second atomic operations to a target storage space according to the association relationship.
[0140] In some optional embodiments, the step obtaining module includes:
[0141] a sample obtaining unit, configured to obtain at least one service execution step sample of the second service information;
[0142] a logic analysis unit, configured to obtain second business logic corresponding to the second business information based on same business logic in the at least one business execution step sample;
[0143] a step determination unit, configured to obtain second business execution steps corresponding to the second business information based on the second business logic and execution order of the second business logic in the at least one business execution step sample.
[0144] The business configuration apparatus provided by the embodiments of the present disclosure can perform the business configuration method provided by any of the embodiments of the present disclosure, and has the corresponding function modules and beneficial effects of the execution method. The business configuration apparatus of the present disclosure forms the execution object of the target business by multiplexing the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step in the target storage space through the first business information of the target business, without the need to separately configure the business execution step and the business logic for each business, so as to improve the multiplexing degree of the business configuration code and reduce the maintenance cost of the business configuration code.
[0145] Further function descriptions of the above-mentioned modules and units are the same as those of the corresponding embodiments, and will not be repeated here.
[0146] Figure 10 A structural block diagram of an electronic device provided by the embodiments of the present disclosure.
[0147] The following will be specifically described with reference to Figure 10 which shows a structural block diagram of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device can include a processor (such as a central processor, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device are also stored. The processor 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0148] Generally, the following devices can be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 10Electronic devices are shown with various apparatuses, but it should be understood that all of the illustrated apparatuses are not required, and that more or less apparatuses can be implemented.
[0149] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication apparatus 1009, or installed from the storage 1008, or installed from the ROM 1002. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the service configuration method of embodiments of the present disclosure are executed.
[0150] Figure 10 The electronic device shown is merely an example and should not impose any limitation on the functions and scope of use of embodiments of the present disclosure.
[0151] Embodiments of the present disclosure also provide a computer-readable storage medium, the above-mentioned method according to embodiments of the present disclosure can be implemented in hardware, firmware, or as computer code recordable on a storage medium, or as computer code originally stored in a remote storage medium or non-transitory machine-readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general-purpose computer, a special-purpose processor, or programmable or special-purpose hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that the computer, processor, microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code, when the software or computer code is accessed and executed by the computer, processor or hardware, the service configuration method shown in the above embodiments is implemented.
[0152] Part of the present disclosure can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present disclosure can be invoked or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0153] Although the embodiments of the present disclosure are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present disclosure, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A service configuration method, characterized in that: The method comprises: In response to the service creation request, obtaining first service information of the target service; Matching the first business information in the target storage space to obtain a first business execution step that matches the first business information and a first atomic operation corresponding to the first business logic in the first business execution step, and configuring the target storage space to store the second business information, the second business execution step, and a second atomic operation corresponding to the second business logic in the second business execution step; Based on the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step, an execution object of the target business is constructed, and the execution object is used to execute the target business.
2. The method according to claim 1, characterized in that The first business information includes a first business type and a first business scenario of the target business; the second business information includes a second business type and a second business scenario; and the matching in the target storage space based on the first business information to obtain a first business execution step that matches the first business information and a first atomic operation corresponding to the first business logic in the first business execution step includes: performing a match in the target storage space based on the first business type and the first business scenario, obtaining the first business execution step that matches the first business information, the first business execution step including at least one first business logic and an execution order between the first business logics; A match is performed in the target storage space based on the first business type and the first business scenario to obtain a first atomic operation corresponding to the first business logic that matches the first business information.
3. The method according to claim 1, characterized in that The method further comprises: In response to a business logic adding instruction for the target business, obtaining a third business logic to be added; Configuring a third atomic operation corresponding to the third business logic; The third business logic and the third atomic operation corresponding to the third business logic are added to the first business execution step to obtain the updated execution object of the target business.
4. The method according to claim 3, characterized in that The configuring of the third atomic operation corresponding to the third business logic includes: In response to a selection instruction for a second atomic operation matching the third business logic in the target storage space, a third atomic operation corresponding to the third business logic is obtained.
5. The method according to claim 4, characterized in that The configuring of the third atomic operation corresponding to the third business logic further includes: Obtaining the to-be-configured operation logic corresponding to the third business logic, where the to-be-configured operation logic is used to represent the difference between the operation logic required by the third business logic and the obtained operation logic corresponding to the third atomic operation; The operation logic to be configured is encapsulated, and the encapsulation result is used as the third atomic operation corresponding to the third business logic.
6. The method according to claim 1, characterized in that The method further comprises: In response to the running instruction of the execution object, based on the execution order between the first business logic in the first business execution step and the dependency relationship of the first atomic operation, the first atomic operation in the execution object is executed to obtain the business processing result of the target business.
7. The method according to claim 6, characterized in that The step of executing the first atomic operation in the execution object based on the execution order of the first business logic in the first business execution step and the dependency relationship of the first atomic operation to obtain the business processing result of the target business includes: Determining an execution priority of the first atomic operation based on the dependency relationship of the first atomic operation; Based on the execution order between the first business logics, the first atomic operation corresponding to the first business logic in the execution object is executed, and during the execution process, the first atomic operation corresponding to the same first business logic is executed based on the execution priority of the first atomic operation.
8. The method according to claim 1, characterized in that The method further comprises: Obtaining a second business execution step corresponding to the second business information, where the second business execution step includes a second business logic corresponding to the second business information and an execution order between the second business logics; Configuring a second atomic operation corresponding to the second business logic; Establishing an association relationship between the second business information, the second business execution step, and the second atomic operation; The second business information, the second business execution steps, and the second atomic operation are stored in the target storage space according to the association relationship.
9. The method according to claim 8, characterized in that The step of obtaining the second service execution corresponding to the second service information includes: Obtain at least one business execution step sample of the second business information; Based on the same business logic in the at least one business execution step sample, obtaining second business logic corresponding to the second business information; Based on the second business logic and the execution order of the second business logic in the at least one business execution step sample, a second business execution step corresponding to the second business information is obtained.
10. A service configuration device, characterized in that: The device comprises: A data acquisition module, configured to acquire first business information of a target business in response to a business creation request; a data matching module, configured to perform a match in a target storage space based on the first business information to obtain a first business execution step that matches the first business information and a first atomic operation corresponding to a first business logic in the first business execution step, wherein the target storage space is configured to store second business information, a second business execution step, and a second atomic operation corresponding to a second business logic in the second business execution step; The business configuration module is used to construct an execution object of the target business based on the first business execution step and the first atomic operation corresponding to the first business logic in the first business execution step, and the execution object is used to execute the target business.
11. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the service configuration method according to any one of claims 1 to 9 by executing the computer instructions.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the service configuration method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the service configuration method according to any one of claims 1 to 9.