Business processing method, business processing device, electronic device and readable storage medium
By writing business code into independent business components and determining the execution order based on business scenario identification, the problem of low code reuse rate in the prior art is solved, efficient code reuse and flexibility of business processes are achieved, and redundancy is reduced Yu He's R&D difficulty.
Patent Information
- Application Number
- CN202110469525.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-28
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-04-28
Smart Images

Figure CN113110963B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and more specifically, to a business processing method, a business processing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] In order to meet the ever-increasing business needs, it is necessary to develop business codes for different business scenarios.
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following technical problems in the related art: the code reuse rate in the related art is low. Summary of the invention
[0004] In view of this, embodiments of the present disclosure provide a service processing method, a service processing device, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] One aspect of an embodiment of the present disclosure provides a business processing method, comprising: obtaining a business processing request for processing a pending business, wherein the business processing request includes a business scenario identifier of the pending business; in response to the business processing request, determining, based on the business scenario identifier, a plurality of business components for processing the pending business, wherein each of the business components is created based on business logic; determining an execution order of the plurality of business components; and calling the plurality of business components according to the execution order to process the pending business.
[0006] According to an embodiment of the present disclosure, each of the above-mentioned business components is created according to the business logic, including: creating a component parent class, wherein the above-mentioned component parent class is a class that represents the interface required to be called to process the above-mentioned business logic; creating a component template class, wherein the above-mentioned component template class is a class that represents the ability to provide public functions, and the above-mentioned public functions are obtained by analyzing the above-mentioned business logic; creating a component implementation class, wherein the above-mentioned component implementation class is a class that represents the ability to execute the above-mentioned business logic; and creating the above-mentioned business component according to the above-mentioned component parent class, the above-mentioned component template class and the above-mentioned component implementation class.
[0007] According to an embodiment of the present disclosure, the creation of the component template class includes: creating a common process, wherein the common process is a common process for representing the processing of the business logic; creating a common template, wherein the business template is a common tool required for representing the processing of the business logic; creating process logic, wherein the process logic is a sequence for representing the processing of each process included in the business logic; and creating the component template class according to the common process, the common template and the process logic.
[0008] According to an embodiment of the present disclosure, it also includes: storing the above-mentioned multiple business components in a component list; calling the above-mentioned multiple business components according to the above-mentioned execution order to process the above-mentioned pending business, including: calling the business components in the above-mentioned component list according to the above-mentioned execution order to process the above-mentioned pending business.
[0009] According to an embodiment of the present disclosure, the above-mentioned calling of the business components in the above-mentioned component list according to the above-mentioned execution order to process the above-mentioned pending business includes: calling the first business component from the above-mentioned component list according to the above-mentioned execution order; executing the above-mentioned first business component to process the above-mentioned processing business; deleting the above-mentioned first business component from the above-mentioned component list; and in the case of determining that the execution result of the above-mentioned first business component is successful, if it is determined that the above-mentioned component list is empty, completing the processing of the above-mentioned pending business.
[0010] According to an embodiment of the present disclosure, it also includes: if it is determined that the above component list is not empty, calling the second business component from the above component list according to the above execution order until it is determined that the above component list is empty.
[0011] According to an embodiment of the present disclosure, the method further includes: in a case where it is determined that the execution result of the first business component is an execution failure, if it is determined to re-execute the first business component, then re-execute the first business component.
[0012] Another aspect of the disclosed embodiment provides a business processing device, including: an acquisition module, a first determination module, a second determination module and a processing module. Among them: the acquisition module is used to acquire a business processing request for processing a pending business, wherein the business processing request includes a business scenario identifier of the pending business; the first determination module is used to respond to the business processing request and, according to the business scenario identifier, determine a plurality of business components for processing the pending business, wherein each of the business components is created according to the business logic; the second determination module is used to determine the execution order of the plurality of business components; and the processing module is used to call the plurality of business components according to the execution order to process the pending business.
[0013] Another aspect of an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
[0014] Another aspect of an embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the method described above when executed.
[0015] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the method described above when executed.
[0016] According to the embodiments of the present disclosure, after receiving a business processing request, multiple business components and the execution order of multiple business components for processing the pending business are determined according to the business scenario identifier, and multiple business components are called according to the execution order to process the pending business. Because the business components and the execution order are separated, different business requests can be met by adjusting the execution order and the specific business components involved, and business components can be reused, thereby effectively reducing code redundancy and improving code reuse rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 An exemplary system architecture to which the business processing method according to an embodiment of the present disclosure can be applied is schematically shown;
[0019] Figure 2 A flowchart of a business processing method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A schematic diagram schematically shows a business component included in a business system according to an embodiment of the present disclosure;
[0021] Figure 4 The schematic diagram shows the structure of the service component according to the embodiment of the present disclosure;
[0022] Figure 5 A schematic diagram schematically shows a business process according to an embodiment of the present disclosure;
[0023] Figure 6 A schematic diagram schematically shows the logical relationship between business components in a business step according to an embodiment of the present disclosure;
[0024] Figure 7 A schematic diagram schematically shows a business processing flow according to another embodiment of the present disclosure;
[0025] Figure 8 A schematic diagram schematically shows a data structure of a service execution sequence according to an embodiment of the present disclosure;
[0026] Fig. 9 A block diagram schematically shows a service processing device according to an embodiment of the present disclosure;
[0027] Fig.10A block diagram of an electronic device suitable for implementing a service processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0028] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0029] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0030] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0031] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0032] In the current business scenario, different nodes in different scenarios have their own unique content. Taking the Internet medical service as an example, the consultation process may include: patient pre-consultation, generating a consultation form, payment, consultation, prescription, consultation completion or consultation cancellation; but specifically for the physical examination consultation service, when generating a consultation form, the number of the third-party physical examination report needs to be written into the consultation form, so that the doctor can interpret the imported physical examination report when receiving the consultation. For another example, the consultation process of the post-diagnosis management service may also include: automatically binding the doctor-patient relationship and sending chat rights after generating the consultation form; specifically, for the expert team service, after the payment is successful, a group chat including all the members of the expert team will be created for the patient for consultation; for chronic disease services, a group chat including all the members of the chronic disease team will be created for the patient for consultation when receiving the consultation.
[0033] In order to solve the above unique contents, R&D personnel need to write a large amount of business codes in each node. Since there are many repetitions in these business codes, redundant codes will exist in the nodes.
[0034] Based on the above technical problems, the inventors have proposed a business processing method, which implements complex business by compiling business codes into independent units and controlling the calling order between independent units. This method can reduce the difficulty of research and development, improve the reuse of business codes, improve research and development efficiency, and reduce the redundancy of business codes when business processes change frequently and are constantly adjusted.
[0035] The method provided by the embodiment of the present disclosure is as follows. The embodiment of the present disclosure provides a business processing method, a business processing device, an electronic device, a computer-readable storage medium and a computer program product. The business processing method includes obtaining a business processing request for processing a pending business, wherein the business processing request includes a business scenario identifier of the pending business; in response to the business processing request, determining multiple business components for processing the pending business according to the business scenario identifier, wherein each business component is created according to the business logic; determining the execution order of the multiple business components; and calling the multiple business components according to the execution order to process the pending business.
[0036] Figure 1 The exemplary system architecture to which the business processing method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0037] like Figure 1As shown, the system architecture according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0038] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various client applications can be installed on terminal devices 101, 102, 103, including but not limited to browser applications, communication applications, social applications, etc.
[0039] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0040] The server 105 may be a server that provides various services, and the user may send a business processing request to the server 105 using the client application in the terminal devices 101, 102, and 103. The server 105 may extract the corresponding business component 1061 from the business component library 106 according to the business scenario identifier corresponding to the business processing request, and arrange these business components 1061 according to the execution order preset in the business scenario identifier to obtain a component list 107. By sequentially executing the business components 1061 in the component list 107, the server 105 may complete the user's business processing request and feed back the processing result to the terminal device.
[0041] It should be noted that the service processing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the service processing device provided in the embodiment of the present disclosure can generally be set in the server 105. The service processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the service processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Alternatively, the service processing method provided in the embodiment of the present disclosure can also be executed by the terminal devices 101, 102, or 103, or can also be executed by other terminal devices different from the terminal devices 101, 102, or 103. Accordingly, the service processing device provided in the embodiment of the present disclosure can also be set in the terminal devices 101, 102, or 103, or can be set in other terminal devices different from the terminal devices 101, 102, or 103.
[0042] For example, the pre-set business component library 106 may be originally stored in any one of the terminal devices 101, 102, or 103 (for example, the terminal device 101, but not limited thereto), or stored in an external storage device and may be imported into the terminal device 101. After receiving a business request submitted by a user, the terminal device 101 may locally execute the business processing method provided by the embodiment of the present disclosure, or send the business request submitted by the user and the pre-set business component library 106 to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the business request and the business component library 106 execute the business processing method provided by the embodiment of the present disclosure.
[0043] It should be understood that Figure 1 The number of terminal devices, networks, servers, service components, service component libraries, and component lists in the embodiment is only illustrative. Any number of terminal devices, networks, servers, service components, service component libraries, and component lists may be provided as required.
[0044] Figure 2 The flowchart of the service processing method according to the embodiment of the present disclosure is schematically shown.
[0045] like Figure 2 As shown, the method includes operations S210 to S240.
[0046] In operation S210, a business processing request for processing the business to be processed is obtained, wherein the business processing request includes a business scenario identifier of the business to be processed.
[0047] In operation S220, in response to the business processing request, multiple business components for processing the to-be-processed business are determined according to the business scenario identifier, wherein each business component is created according to the business logic.
[0048] In operation S230 , the execution order of the plurality of service components is determined.
[0049] In operation S240, multiple service components are called according to the execution order to process the service to be processed.
[0050] According to an embodiment of the present disclosure, a business scenario identifier can be a unique identifier for a business process in a business system. After receiving a new business processing request, the business scenario identifier in the new business processing request can be matched with the business scenario identifier stored in the server to extract multiple business components corresponding to the business scenario identifier and the execution order between the multiple business components.
[0051] According to an embodiment of the present disclosure, the execution order between business components may include the execution order between each business step in the business process and the execution order of business components in each business step. The above execution order may include serial, parallel, selection, etc. The execution order may be edited in advance by R&D personnel and stored in a data structure corresponding to the business scenario identifier in the server.
[0052] According to an embodiment of the present disclosure, the execution order between business components can be compiled using a data exchange language, such as XML, JSON, etc.
[0053] According to the embodiments of the present disclosure, the business component can be obtained by developers encapsulating all business logics that need to be executed in the business into standard business blocks, and each business component can be run as an independent node.
[0054] According to the embodiments of the present disclosure, the business components may be implemented by compiling in a variety of programming languages, including but not limited to Javascript, C, JAVA, etc.
[0055] For example, in Internet medical services, there may be a variety of consultation processes, including quick consultation process, emergency consultation process, appointment consultation process, etc. The process name of the above consultation process is used as the business scenario identifier of the consultation process. After receiving the quick consultation service request sent by the user, the specific steps of the process can be called from the server through the business scenario identifier of the quick consultation process. These steps include parameter checking, supplementing request parameters, etc. The above steps are executed in a serial order. In each specific step, multiple business components may be included. For example, the parameter checking step consists of four serially executed business components: business parameter verification, pin attribute verification, sku information verification, and information source judgment.
[0056] According to the embodiments of the present disclosure, after receiving a business processing request, multiple business components and the execution order of multiple business components for processing the pending business are determined according to the business scenario identifier, and multiple business components are called according to the execution order to process the pending business. Because the business components and the execution order are separated, different business requests can be met by adjusting the execution order and the specific business components involved, and the business components can be reused, thereby effectively reducing code redundancy and improving the code reuse rate.
[0057] Reference below Figure 3 to Figure 8 , combined with specific embodiments Figure 2 The method shown is further explained.
[0058] Figure 3 The schematic diagram schematically shows a business component included in the business system according to an embodiment of the present disclosure.
[0059] like Figure 3 As shown, the business components shown in the figure are some of the business components used in the Internet medical business system of the embodiment of the present disclosure.
[0060] According to the embodiments of the present disclosure, the business component may be a standard business block, may be run as an independent node, and may implement a fixed logic. For example, after executing the business component of verifying the pin attribute, the pin attribute verification result of the target user may be obtained. In the application scenario of the present embodiment, the target user may be a doctor or a patient.
[0061] According to the embodiments of the present disclosure, by splitting the business logic and encapsulating it into business components, the same business component can be reused by multiple business processes, which effectively improves the reuse rate of business codes in business components and reduces duplicate and redundant code by more than 60%; at the same time, the use of business components makes the overall test scope clearer, effectively improves the test coverage, and reduces unnecessary workload.
[0062] Figure 4 The structural diagram of the service component according to the embodiment of the present disclosure is schematically shown.
[0063] like Figure 4 As shown in the figure, each business component identifies a minimum business unit, and each business unit can implement a fixed logic. In order to reduce the cost of developing and understanding business components, and adopt the design pattern of the chain of responsibility, you can use inheritance to encapsulate business-irrelevant content into abstract classes, and write these difficult-to-understand contents into the bottom layer of the program through templates.
[0064] According to an embodiment of the present disclosure, the structure of each business component includes a component parent class, a component template class and a component implementation class.
[0065] According to an embodiment of the present disclosure, a component parent class may be a class that represents an interface that is required to be called to process business logic. Specifically, a component parent class may define the interface of a business component by including a standard class provided in a compilation environment and using the interface definition in the standard class. Taking a business component compiled based on C++ as an example, a component parent class may be an abstract class that includes header files such as iostream, defines interface data types, and encapsulates content that is not related to a specific business.
[0066] According to an embodiment of the present disclosure, a component template class may be a class that represents a class that can provide a common function, wherein the common function may be obtained by analyzing a business logic.
[0067] According to the embodiments of the present disclosure, the component template class can be obtained by creating a common process, creating a common and creating a process logic. Among them, the common process can be a common process that represents the processing business logic, such as a common input statement, output statement, etc. in a programming language; the business template can be a common tool required to represent the processing business logic, such as if, when, switch, for, etc. in a programming language for representing logical relationships; the process logic can be the sequence of each process included in the characterization of the processing business logic, and the component template class is completed by combining the common process and the common tools in the order of the process.
[0068] According to an embodiment of the present disclosure, a component implementation class may be a class that represents the ability to execute business logic and is used to implement specific business functions.
[0069] According to the embodiments of the present disclosure, the component template class and the component parent class, the component implementation class and the component template class can be connected by inheritance. Taking the business component compiled based on JAVA as an example, the component template class B can inherit the functions and interfaces of the component parent class A through an inheritance statement, and the inheritance statement can be expressed as public class B extends A.
[0070] According to an embodiment of the present disclosure, different business components may have the same component parent class and component template class. For example, the two business components of verifying PIN attributes and verifying SKU information represent two different component implementation classes, which can respectively implement the verification of PIN attributes and SKU information. These two business components may have the same component template class and component parent class. Among them, the component template class may be an information verification class, which may verify the received information to be verified and output the verification result. The data types of the input interface and the output interface are defined in the component parent class, wherein the input interface may receive a string representing the information to be verified and a string representing the information dictionary of the information to be verified, and the output interface may output a Boolean value representing the verification result.
[0071] According to the embodiments of the present disclosure, by inheriting the component parent class or the component template class, the difficulty of writing business components is effectively reduced and the speed of underlying R&D coding is improved.
[0072] Figure 5 The diagram schematically shows a business process according to an embodiment of the present disclosure.
[0073] like Figure 5 As shown, the illustrated business process is a schematic diagram of the rapid consultation process in the Internet medical business system of an embodiment of the present disclosure.
[0074] According to the embodiments of the present disclosure, for the business scenario identifier of the quick consultation process, the pre-set process includes the following steps: parameter checking, supplementing request parameters, obtaining physician information, obtaining patient information, constructing consultation form parameters, creating consultation form, building middle-office order parameters, business operations before ordering, middle-office order issuance, business operations after ordering, and non-essential compensation logic, and each step is executed sequentially in a serial manner.
[0075] Figure 6 The schematic diagram schematically shows the logical relationship between business components in the business steps according to the embodiment of the present disclosure.
[0076] like Figure 6 As shown, the logical relationship between the business components in the figure is used to characterize the logical relationship between the business components corresponding to each step in the rapid consultation process in the Internet medical business system of the embodiment of the present disclosure.
[0077] According to an embodiment of the present disclosure, each step in the rapid consultation process can be implemented by multiple business components according to a preset component execution order.
[0078] For example, in the parameter checking step, the four business components of business parameter verification, pin attribute verification, sku information verification and information source judgment are executed in serial order; in the supplementary request parameter step, the three business components of obtaining rights and interests information, setting drug sources and modifying business scenarios according to departments are executed serially as the first queue, and the two business components of preventing HTML injection and confirming business types are executed serially as the second queue, and the first queue and the second queue are executed in parallel; in the step of obtaining physician information, only the business component of obtaining doctor information is executed.
[0079] According to the embodiments of the present disclosure, in other steps, multiple business components may also be executed in other logical orders besides serial and parallel, such as conditional, selective, loop, etc. The execution order of business components in the embodiments of the present disclosure may be freely configured as needed and is not limited here.
[0080] According to the embodiments of the present disclosure, through the arrangement and configuration of business components, zero-development configuration is achieved for business needs, the number of online times is reduced, and the online risk is reduced.
[0081] Figure 7 The following is a schematic diagram of a business processing flow according to another embodiment of the present disclosure.
[0082] like Figure 7 As shown, the business processing flow includes operations S701 to S707.
[0083] In operation S701, a first service component is called from a component list according to an execution order.
[0084] In operation S702, a first service component is executed.
[0085] In operation S703, the execution result of the first business component is determined. If it is determined that the execution result of the first business component is successful, operation S704 is performed; if it is determined that the execution result of the first business component is failed, operation S707 is performed.
[0086] In operation S704, the first service component is deleted from the component list.
[0087] In operation S705, it is determined whether the component list is empty. If it is determined that the component list is not empty, operation S706 is performed; if it is determined that the component list is empty, the business processing flow is terminated.
[0088] In operation S706, the second business component is called from the component list according to the execution order, and the second business component is executed according to the method of operation S702 until the component list is empty.
[0089] In operation S707, it is confirmed whether to re-execute. If it is determined to re-execute the first service component, the method of operation S702 is performed to re-execute the first service component; if the re-execution of the first service component is rejected, the service processing flow is terminated.
[0090] According to an embodiment of the present disclosure, multiple business components determined by a business scenario identifier may be stored in a component list, and the processing of the pending business may be completed by calling the business components in the component list according to the execution order.
[0091] Figure 8 A schematic diagram schematically shows a data structure of a service execution sequence according to an embodiment of the present disclosure.
[0092] like Figure 8 As shown, in the embodiment of the present disclosure, JSON statements can be used to complete the pre-setting of the business execution order corresponding to the business scenario identifier. When in use, the main program can call the process execution to execute all business components according to the preset business execution order by parsing the orchestrated JSON string.
[0093] For example, taking the bill of lading process as an example, after receiving the request, the submitOrder of the bill of lading template can be called to obtain the data representing the business execution process, determine the data used to represent the business component corresponding to the business scenario identifier, and write these data into the memory. After that, each business component (BusinessUnit) can be instantiated into an object through the doChain(BusinessContext, configKey) method, and written into the component list according to the preset execution order, and the doing method can be used to execute the business components in sequence to complete the entire business.
[0094] According to the embodiments of the present disclosure, the service execution sequence may also be defined using other programming languages, such as XML, and may also be implemented using different data structures.
[0095] Fig. 9 The block diagram of a service processing device according to an embodiment of the present disclosure is schematically shown.
[0096] like Fig. 9 As shown, the service processing device includes an acquisition module 910 , a first determination module 920 , a second determination module 930 and a processing module 940 .
[0097] The acquisition module 910 is used to acquire a business processing request for processing the business to be processed, wherein the business processing request includes a business scenario identifier of the business to be processed.
[0098] The first determination module 920 is used to determine, in response to a business processing request and according to a business scenario identifier, a plurality of business components for processing the business to be processed, wherein each business component is created according to business logic.
[0099] The second determination module 930 is used to determine the execution order of multiple business components.
[0100] The processing module 940 is used to call multiple business components according to the execution order to process the pending business.
[0101] According to the embodiments of the present disclosure, after receiving a business processing request, multiple business components and the execution order of multiple business components for processing the pending business are determined according to the business scenario identifier, and multiple business components are called according to the execution order to process the pending business. Because the business components and the execution order are separated, different business requests can be met by adjusting the execution order and the specific business components involved, and the business components can be reused, thereby effectively reducing code redundancy and improving the code reuse rate.
[0102] According to an embodiment of the present disclosure, the service processing device further includes a creation module, and the creation module includes a first creation unit, a second creation unit, a third creation unit, and a fourth creation unit.
[0103] in:
[0104] The first creation unit is used to create a component parent class, wherein the component parent class is a class representing an interface that needs to be called to process business logic.
[0105] The second creation unit is used to create a component template class, wherein the component template class represents a class that can provide public functions, and the public functions are obtained by analyzing the business logic.
[0106] The third creation unit is used to create a component implementation class, wherein the component implementation class is a class that represents the ability to execute business logic.
[0107] The fourth creation unit is used to create a business component according to the component parent class, the component template class and the component implementation class.
[0108] According to an embodiment of the present disclosure, the second creation unit includes a first creation subunit, a second creation subunit, a third creation subunit and a fourth creation subunit.
[0109] The first creation subunit is used to create a common process, wherein the common process is a common process representing a processing business logic.
[0110] The second creation subunit is used to create a common template, wherein the business template is a common tool required for representing and processing business logic.
[0111] The third creation subunit is used to create process logic, wherein the process logic represents the sequence of each process included in the processing business logic.
[0112] The fourth creation subunit is used to create a component template class according to the common process, common template and process logic.
[0113] According to an embodiment of the present disclosure, the service processing device further includes a storage module, and the storage module is used to store multiple service components in a component list.
[0114] According to an embodiment of the present disclosure, the processing module 940 is further configured to call the business components in the component list according to the execution order to process the business to be processed.
[0115] According to an embodiment of the present disclosure, the processing module 940 includes a first processing unit, a second processing unit, a third processing unit and a fourth processing unit.
[0116] The first processing unit is used to call the first business component from the component list according to the execution order.
[0117] The second processing unit is used to execute the first service component to process the service.
[0118] The third processing unit is used to delete the first service component from the component list.
[0119] The fourth processing unit is used to complete the processing of the pending business if it is determined that the execution result of the first business component is successful and if it is determined that the component list is empty.
[0120] According to an embodiment of the present disclosure, the processing module 940 further includes a fifth processing unit, wherein the fifth processing unit is configured to call the second business component from the component list according to the execution order when it is determined that the component list is not empty, until it is determined that the component list is empty.
[0121] According to an embodiment of the present disclosure, the processing module 940 further includes a sixth processing unit, wherein the sixth processing unit is configured to re-execute the first business component if it is determined that the execution result of the first business component is execution failure and it is determined that the first business component needs to be re-executed.
[0122] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (Field Programmable Gate Array, FPGA), programmable logic arrays (Programmable Logic Arrays, PLA), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), or can be implemented by hardware or firmware of any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware or by a suitable combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0123] For example, any multiple of the acquisition module 910, the first determination module 920, the second determination module 930, and the processing module 940 can be combined in one module / unit / subunit for implementation, or any one of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more modules / units / subunits in these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the acquisition module 910, the first determination module 920, the second determination module 930, and the processing module 940 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 910 , the first determination module 920 , the second determination module 930 , and the processing module 940 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0124] It should be noted that the business processing device part in the embodiment of the present disclosure corresponds to the business processing method part in the embodiment of the present disclosure. The description of the business processing device part specifically refers to the business processing method part and will not be repeated here.
[0125] Fig.10 A block diagram of an electronic device suitable for implementing a service processing method according to an embodiment of the present disclosure is schematically shown. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0126] like Fig.10As shown, the electronic device 1000 according to the embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0127] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0128] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0129] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0130] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0131] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device.
[0132] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 1002 and / or the RAM 1003 described above and / or one or more memories other than the ROM 1002 and the RAM 1003 .
[0133] The embodiments of the present disclosure also include a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the business processing method provided by the embodiments of the present disclosure.
[0134] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0135] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0136] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any variety of networks, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments and / or claims of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0138] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A business processing method, comprising: Acquire a business processing request for processing the business to be processed, wherein the business processing request includes a business scenario identifier of the business to be processed; In response to the business processing request, determining, according to the business scenario identifier, a plurality of business components for processing the to-be-processed business, wherein each of the business components is created according to business logic; Determining an execution order of the plurality of business components; and Calling the multiple business components according to the execution order to process the pending business; Wherein, each of the business components is created according to business logic, including: Creating a component parent class, wherein the component parent class is a class representing an interface required to be called to process the business logic; Creating a component template class, wherein the component template class is a class that represents a class that can provide a common function, and the common function is obtained by analyzing the business logic; Creating a component implementation class, wherein the component implementation class is a class that represents the ability to execute the business logic; and The business component is created according to the component parent class, the component template class and the component implementation class.
2. The method according to claim 1, wherein: The creation of the component template class includes: Creating a common process, wherein the common process is a common process for representing processing of the business logic; Creating a common template, wherein the common template is a common tool required for representing processing the business logic; Creating a process logic, wherein the process logic represents the order of each process included in processing the business logic; and The component template class is created according to the common process, the common template and the process logic.
3. The method according to claim 1 or 2, further comprising: Storing the multiple business components in a component list; The calling of the plurality of business components according to the execution order to process the to-be-processed business includes: The business components in the component list are called according to the execution order to process the to-be-processed business.
4. The method according to claim 3, wherein: The calling of the business components in the component list according to the execution order to process the to-be-processed business includes: According to the execution order, calling the first business component from the component list; executing the first service component to process the processing service; Deleting the first service component from the component list; and When it is determined that the execution result of the first business component is successful, if it is determined that the component list is empty, the processing of the to-be-processed business is completed.
5. The method according to claim 4, further comprising: If it is determined that the component list is not empty, then according to the execution order, the second service component is called from the component list until it is determined that the component list is empty.
6. The method according to claim 4, further comprising: In the case where it is determined that the execution result of the first business component is an execution failure, if it is determined to re-execute the first business component, the first business component is re-executed.
7. A service processing device, comprising: An acquisition module, used to acquire a business processing request for processing the business to be processed, wherein the business processing request includes a business scenario identifier of the business to be processed; A first determination module, configured to determine, in response to the business processing request and according to the business scenario identifier, a plurality of business components for processing the business to be processed, wherein each of the business components is created according to business logic; A second determining module, configured to determine the execution order of the plurality of service components; and A processing module, used for calling the multiple business components according to the execution order to process the to-be-processed business; Wherein, each of the business components is created according to business logic, including: Creating a component parent class, wherein the component parent class is a class representing an interface required to be called to process the business logic; Creating a component template class, wherein the component template class is a class that represents a class that can provide a common function, and the common function is obtained by analyzing the business logic; Creating a component implementation class, wherein the component implementation class is a class that represents the ability to execute the business logic; and The business component is created according to the component parent class, the component template class and the component implementation class.
8. An electronic device comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein the computer program is used to implement the method according to any one of claims 1 to 6 when executed by a processor.
Citation Information
Patent Citations
Business execution method and device
CN107038042A
Business processing method and device
CN112596871A