Processor interface management methods, devices, equipment and storage media

By decomposing business logic into business points and writing them into processor components, and using the processor component manager to manage the interfaces, the problems of unclear business logic and verbose code are solved, achieving clear logic and independence from changes.

CN114968622BActive Publication Date: 2025-12-02CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210579720.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-12-02
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

In existing backend development scenarios with long processes, business points are concentrated in the business layer, resulting in unclear logic, verbose code, and difficulty in unit testing.

Method used

By acquiring the business logic, breaking it down into business points, determining the processor type, and writing it into the corresponding processor component, the processor component manager is used for management. The interface name is specified, and the corresponding processor component is called to execute the business request.

Benefits of technology

It achieves clear business logic, avoids verbose code, simplifies unit tests, and ensures that new changes do not trigger cascading modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968622B_ABST
    Figure CN114968622B_ABST
Patent Text Reader

Abstract

This invention relates to the field of R&D management and discloses a processor interface management method, apparatus, device, and storage medium. The method includes: decomposing business logic to obtain at least one business point; determining the processor type based on the programming semantics of the executable code corresponding to the business point, and writing the business point into the corresponding processor component; managing the processor component through the corresponding processor component manager based on the processor type to obtain the corresponding processor interface, specifying the name of the processor interface, and determining the corresponding interface name; when a business request is obtained, calling the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request. This method enables the processor component manager to uniformly organize interface business through componentization, avoiding unclear business layer logic and verbose code. Furthermore, componentization after decoupling by business points prevents cascading modifications when new changes are made.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of research and development management, and in particular to a processor interface management method, apparatus, device, and storage medium. Background Technology

[0002] Currently, Java backend development commonly adopts a three-tier architecture: the controller layer, the business layer, and the persistence layer. In scenarios with long processes and diverse process nodes, such as auto insurance pricing, there are multiple process nodes, including quote preparation, renewal check, policyholder identity verification, vehicle information processing, policyholder information processing, vehicle owner information processing, quote settlement and channel performance attribution, quote scheme recommendation, quote configuration information acquisition, quote log list distribution, and quote log recording. When attributing performance, quote settlement may be based on invitation codes, channel settings, PRS (Pricing Status Reference), and salesperson information, depending on the scenario. When recommending quote schemes, sources may include historical quote schemes, last year's policy schemes, real-time channel recommendations, and a unified default recommendation. In these business scenarios, all business points are concentrated in the business layer, leading to unclear business logic, verbose code, and requiring direct modifications to the entire business layer code, which can easily affect the entire process and makes unit testing difficult. Summary of the Invention

[0003] The main objective of this invention is to solve the technical problem that in existing backend development, business points are concentrated in the business layer in scenarios with long processes, resulting in unclear business layer logic and verbose code.

[0004] The first aspect of this invention provides a processor interface management method, comprising: acquiring input business logic and decomposing the business logic to obtain at least one business point corresponding to the business logic; acquiring the execution code corresponding to the business point, determining the processor type corresponding to the business point based on the programming semantics of the execution code, and writing the business point into the corresponding processor component; managing the processor component through the corresponding processor component manager based on the processor type to obtain the corresponding processor interface, and specifying the name of the processor interface to determine the interface name corresponding to each processor interface; when a business request is acquired, calling the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request.

[0005] Optionally, in a first implementation of the first aspect of the present invention, the step of obtaining the input business logic and decomposing the business logic to obtain at least one business point corresponding to the business logic includes: obtaining the input business logic and parsing the business logic to obtain a logic relation table corresponding to the business logic; decomposing the business logic into business variables and expressions according to the logic relation table; and determining at least one business point corresponding to the business logic according to the business variables and expressions.

[0006] Optionally, in a second implementation of the first aspect of the present invention, the step of obtaining the execution code corresponding to the business point, determining the processor type corresponding to the business point based on the programming semantics of the execution code, and writing the business point into the corresponding processor component includes: obtaining the execution code corresponding to the business point, inputting the execution code into a preset syntax analyzer, obtaining an abstract syntax tree corresponding to the execution code through the syntax analyzer; parsing the programming semantics corresponding to the execution code based on the nodes in the abstract syntax tree; determining the processor type corresponding to the business point based on the programming semantics, and writing the business point into the corresponding processor component.

[0007] Optionally, in a third implementation of the first aspect of the present invention, the step of obtaining the execution code corresponding to the business point and inputting the execution code into a preset syntax analyzer, and obtaining the abstract syntax tree corresponding to the execution code through the syntax analyzer, includes: obtaining the execution code corresponding to the business point and inputting the execution code into the syntax analyzer; scanning the execution code line by line and decomposing it into lexical units through the syntax analyzer, wherein the lexical units are basic word symbols in string form in a programming language; combining the sequence of lexical units into an array; performing syntax analysis on the execution code according to the array to determine whether the syntax of the execution code is correct; if so, generating a syntax analysis tree corresponding to the execution code according to a preset execution code language specification; calling the node object creation method corresponding to each node in the syntax analysis tree to create node objects, and generating an abstract syntax tree based on the node objects.

[0008] Optionally, in a fourth implementation of the first aspect of the present invention, determining the processor type corresponding to the business point based on the programming semantics and writing the business point into the corresponding processor component includes: determining the processor type corresponding to the business point based on the programming semantics, wherein the processor type includes a sequential processor and a strategy processor; if the processor type corresponding to the business point is a strategy processor, determining the number of implementation methods of the business point and writing the business point into the corresponding number of strategy processor components; if the processor type corresponding to the business point is a sequential processor, setting the order value of the business point according to the order in which the business logic is split; and writing the business point whose processor type corresponding to the business logic is a sequential processor into the sequential processor component.

[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the step of calling a corresponding processor component from the processor component manager to execute the business request based on the interface name of the processor interface called by the business request includes: calling the corresponding processor component in the processor component manager based on the interface name of the processor interface called by the business request; if the called processor component is a sequential processor component, determining the execution order of the sequential processor component based on the order value of the called sequential processor component, and executing the business request using the called sequential processor component according to the execution order; if the called processor component is a strategy processor component, determining the implementation method corresponding to the business request based on the request parameters in the business request, and determining the strategy processor component to be executed based on the implementation method corresponding to the business request; and executing the business request through the executed strategy processor component.

[0010] Optionally, in a sixth implementation of the first aspect of the present invention, after calling the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface invoked according to the business request, the method further includes: obtaining a business logic modification request, and determining the business point to be modified according to the business logic modification request; determining the processor component to be modified corresponding to the business point to be modified through the processor component manager; modifying the processor component to be modified according to the business logic modification request, and managing the modified processor component to be modified through the corresponding processor component manager.

[0011] A second aspect of the present invention provides a processor interface management device, comprising: a decomposition module, configured to acquire input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic; a component module, configured to acquire the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component; an interface module, configured to manage the processor component through the corresponding processor component manager based on the processor type, obtain the corresponding processor interface, and specify the name of the processor interface to determine the interface name corresponding to each processor interface; and an execution module, configured to, when a business request is acquired, call the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request.

[0012] Optionally, in a first implementation of the second aspect of the present invention, the decomposition module is specifically used for: acquiring input business logic, parsing the business logic to obtain a logical relationship table corresponding to the business logic; decomposing the business logic into business variables and expressions according to the logical relationship table; and determining at least one business point corresponding to the business logic according to the business variables and expressions.

[0013] Optionally, in a second implementation of the second aspect of the present invention, the component module specifically includes: a syntax tree construction unit, used to obtain the execution code corresponding to the business point, and input the execution code into a preset syntax analyzer to obtain an abstract syntax tree corresponding to the execution code through the syntax analyzer; a parsing unit, used to parse the programming semantics corresponding to the execution code according to the nodes in the abstract syntax tree; and a component writing unit, used to determine the processor type corresponding to the business point based on the programming semantics, and write the business point into the corresponding processor component.

[0014] Optionally, in a third implementation of the second aspect of the present invention, the syntax tree construction unit is specifically used for: obtaining the execution code corresponding to the business point, inputting the execution code into the syntax analyzer, scanning the execution code line by line and decomposing it into lexical units, wherein the lexical units are basic word symbols in the form of strings in a programming language; combining the sequence of lexical units into an array; performing syntax analysis on the execution code according to the array to determine whether the syntax of the execution code is correct; if so, generating a syntax analysis tree corresponding to the execution code according to a preset execution code language specification; calling the node object creation method corresponding to each node in the syntax analysis tree to create node objects, and generating an abstract syntax tree based on the node objects.

[0015] Optionally, in a fourth implementation of the second aspect of the present invention, the component writing unit is specifically used to: determine the processor type corresponding to the business point based on the programming semantics, wherein the processor type includes a sequential processor and a strategy processor; if the processor type corresponding to the business point is a strategy processor, determine the number of implementation methods of the business point and write the business point to the corresponding number of strategy processor components; if the processor type corresponding to the business point is a sequential processor, set the order value of the business point according to the order of splitting the business point according to the business logic; the business point whose processor type corresponding to the business logic is a sequential processor is written to the sequential processor component.

[0016] Optionally, in a fifth implementation of the second aspect of the present invention, the execution module is specifically configured to: call the corresponding processor component in the processor component manager according to the interface name of the processor interface called by the business request; if the called processor component is a sequential processor component, determine the execution order of the sequential processor component according to the order value of the called sequential processor component, and execute the business request using the called sequential processor component according to the execution order; if the called processor component is a strategy processor component, determine the implementation method corresponding to the business request according to the request parameters in the business request, and determine the strategy processor component to be executed according to the implementation method corresponding to the business request; and execute the business request through the executed strategy processor component.

[0017] Optionally, in a sixth implementation of the second aspect of the present invention, the processor interface management device further includes a component modification module, which is specifically used for: obtaining a business logic modification request and determining a business point to be modified based on the business logic modification request; determining the processor component to be modified corresponding to the business point to be modified through the processor component manager; modifying the processor component to be modified according to the business logic modification request, and managing the modified processor component to be modified through the corresponding processor component manager.

[0018] A third aspect of the present invention provides a processor interface management device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a circuit; the at least one processor invokes the instructions in the memory to cause the processor interface management device to perform the steps of the processor interface management method described above.

[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the processor interface management method described above.

[0020] In the technical solution of this invention, the input business logic is acquired and decomposed to obtain at least one business point corresponding to the business logic; the execution code corresponding to the business point is acquired, and based on the programming semantics of the execution code, the processor type corresponding to the business point is determined, and the business point is written into the corresponding processor component; based on the processor type, the processor component is managed through the corresponding processor component manager to obtain the corresponding processor interface, and the processor interface is named to determine the interface name corresponding to each processor interface; when a business request is acquired, the corresponding processor component is called from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request. This method enables the processor component manager to uniformly organize interface business through componentization, avoiding unclear business layer logic and verbose code. Furthermore, through componentization after decoupling by business points, new changes will not cause cascading modifications. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the first embodiment of the processor interface management method in this invention;

[0022] Figure 2 This is a schematic diagram of a second embodiment of the processor interface management method in this invention;

[0023] Figure 3 This is a schematic diagram of a third embodiment of the processor interface management method in this invention;

[0024] Figure 4 This is a schematic diagram of one embodiment of the processor interface management device in this invention;

[0025] Figure 5 This is a schematic diagram of another embodiment of the processor interface management device in this invention;

[0026] Figure 6 This is a schematic diagram of one embodiment of the processor interface management device in this invention. Detailed Implementation

[0027] In the technical solution of this invention, the input business logic is acquired and decomposed to obtain at least one business point corresponding to the business logic; the execution code corresponding to the business point is acquired, and based on the programming semantics of the execution code, the processor type corresponding to the business point is determined, and the business point is written into the corresponding processor component; based on the processor type, the processor component is managed through the corresponding processor component manager to obtain the corresponding processor interface, and the processor interface is named to determine the interface name corresponding to each processor interface; when a business request is acquired, the corresponding processor component is called from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request. This method enables the processor component manager to uniformly organize interface business through componentization, avoiding unclear business layer logic and verbose code. Furthermore, through componentization after decoupling by business points, new changes will not cause cascading modifications.

[0028] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the processor interface management method in this invention includes:

[0030] 101. Obtain the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic;

[0031] It is understood that the executing entity of this invention can be a processor interface management device, a terminal, or a server, and is not specifically limited here. This embodiment of the invention uses a server as an example for illustration. The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0032] In practical applications, taking auto insurance quoting as an example, the process includes multiple processing nodes such as quotation preparation, renewal check, policyholder identity confirmation, vehicle information processing, policyholder information processing, vehicle owner information processing, quotation settlement channel performance attribution, quotation scheme recommendation, quotation configuration information acquisition, quotation log list distribution, and quotation log recording. When attributing performance, quotation settlement is carried out based on different scenarios using information such as invitation codes, channel settings, PRS, and salesperson information. When recommending quotation schemes, there may be sources such as historical quotation schemes, last year's policy schemes, channel real-time recommended schemes, and unified default recommended schemes. Based on the multiple business processes of auto insurance quoting, the business logic of auto insurance quoting can be decomposed to obtain multiple business points of the business logic of multiple auto insurance quoting business processes.

[0033] In this embodiment, decomposition refers to the breakdown of business processes. The decomposition principle is the single responsibility principle, which means that the business process is broken down into a single business point, and each business point performs a single task. The auto insurance quotation business includes multiple business points such as quotation preparation, renewal check, policyholder identity confirmation, vehicle information processing, policyholder information processing, vehicle owner information processing, quotation settlement channel performance attribution, quotation scheme recommendation, quotation configuration information acquisition, quotation log list distribution, and quotation log recording. Each business point can be distinguished by the business parameters and logical expressions required for each business point, and the business logic is decomposed to obtain the business points.

[0034] 102. Obtain the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component;

[0035] In this embodiment, programmers can write corresponding execution code and input it according to different business points. After the business is decomposed, the specific implementation relies on the execution of the code. It is necessary to implement the code of the corresponding processor for the corresponding business point. Alternatively, it can be pre-set execution code. After the business logic is decomposed, the execution code corresponding to the business point is obtained through the preset mapping relationship.

[0036] In this embodiment, two different processor types are defined: OrderedHandler and StrategicHandler. OrderedHandler represents the sequential execution of business logic. Multiple processors with the same name constitute a business process in a given order. StrategicHandler represents control semantics. It can strategically componentize the original complex switch statements and if-else statements. When a business point requires different implementation methods under different conditions, it is expressed in the code through switch statements and if-else statements. For example, if there are three implementations, A, B, and C, then three strategic processors are needed to implement them respectively. This is equivalent to strategically componentizing each conditional branch of the conditional statement.

[0037] In practical applications, two common programming semantics are sequential execution, where code runs in the order it was written, and control statements, where code execution is determined by predefined conditions. A business function can be viewed as composed of multiple business points with a specific order of execution. We implement these sequentially executed business points using sequential processors, and the processor type corresponding to these business points is called a sequential processor. A business point may be processed differently under different conditions; these different conditions correspond to different strategies. These different processing methods are implemented using strategy processors, and the processor type corresponding to these business points is called a strategy processor.

[0038] 103. Based on the processor type, manage the processor components through the corresponding processor component manager to obtain the corresponding processor interface, and specify the name of the processor interface to determine the interface name corresponding to each processor interface.

[0039] In this embodiment, a sequential processor component manager and a policy processor component manager are developed. The sequential processor component manager is used for organization. The processor component manager stores all implemented business processors and stores them sequentially in groups according to a specified name and order. An implementation of an interface only needs to tell the manager the identifier name of the interface, and the manager will schedule the processor with the corresponding name and execute it in sequence.

[0040] In this embodiment, an interface refers to the business function provided to the outside world. The business function of an interface may contain multiple business points, and a processor is an implementation of a business point. It can be seen that an interface is worked by multiple processors working together. The processor component manager manages the processors corresponding to multiple business points of the same type in the business logic in a unified manner. Multiple processors of a set of business logic provide the business functions corresponding to the business logic to the outside world as an interface, and assign a name to the interface. This name will be associated with a series of processors corresponding to the interface. There may be multiple processors identified by one name. The name of the interface uniquely identifies an interface. Because the processor manager manages various processors, it needs to use a name to tell the processor which processors are working together to complete the interface function that the business logic is implementing.

[0041] 104. When a business request is received, the corresponding processor component is called from the processor component manager to execute the business request based on the interface name of the processor interface called by the business request.

[0042] In this embodiment, using a processor-based component-based programming framework, taking auto insurance pricing as an example, the following processes are implemented using a sequential processor component: pricing preparation, renewal check, policyholder identity verification, vehicle information processing, policyholder information processing, vehicle owner information processing, pricing settlement channel performance attribution, pricing scheme recommendation, pricing configuration information acquisition, pricing log list distribution, and pricing log recording. These process node processors are then chained together through a sequential processor component manager. This allows each process node to be independently decoupled while collaboratively completing the entire pricing process. For process nodes involving performance attribution and scheme recommendation that determine processing schemes based on different conditions, a strategy processor is used to implement various processing schemes. The strategy pattern is used through the strategy processor manager to determine and select the appropriate processing method to fulfill the business request.

[0043] In this embodiment, the input business logic is acquired and decomposed to obtain at least one business point corresponding to the business logic; the execution code corresponding to the business point is acquired, and based on the programming semantics of the execution code, the processor type corresponding to the business point is determined, and the business point is written into the corresponding processor component; based on the processor type, the processor component is managed through the corresponding processor component manager to obtain the corresponding processor interface, and the processor interface is named to determine the interface name corresponding to each processor interface; when a business request is acquired, the corresponding processor component is called from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request. This method enables the processor component manager to uniformly organize interface business through componentization, avoiding unclear business layer logic and verbose code. Furthermore, through componentization after decoupling by business points, new changes will not cause cascading modifications.

[0044] Please see Figure 2 The second embodiment of the processor interface management method in this invention includes:

[0045] 201. Obtain the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic;

[0046] 202. Obtain the execution code corresponding to the business point and input the execution code into the parser. The parser will scan the execution code line by line and decompose it into lexical units.

[0047] 203. Combine the lexical unit sequences into an array;

[0048] In this embodiment, each statement of the executed code is scanned during lexical analysis, and word segmentation is performed simultaneously to obtain lexical units for each statement. A lexical unit is a basic building block of a statement and can be a keyword, variable name, operator, constant, etc. For example, if the executed code is "const a=1,const b=a+1;", scanning the first statement "const a=1," will first detect "const" and generate a lexical unit representing "const" as a keyword; then it will detect "a" and generate a lexical unit representing "a" as a variable name; then it will detect "=" and generate a lexical unit representing "=" as an operator; then it will detect the constant "1" and generate a lexical unit representing "1" as a constant; finally, it will detect the punctuation mark "," and generate a lexical unit representing "," as a punctuation mark. During lexical analysis, the lexical units of the statement "const a=1," are grouped into an array {const a=1,}. Similarly, the lexical subsystem converts the statement "const b = a + 1;" into an array of lexical units {const b = a + 1;}.

[0049] 204. Perform syntax analysis on the executable code based on the array to determine whether the syntax of the executable code is correct;

[0050] 205. If so, then generate a syntax analysis tree corresponding to the executable code according to the preset executable code language specification;

[0051] 206. Call the node object creation method corresponding to each node in the parsing tree to create node objects and generate an abstract syntax tree based on the node objects;

[0052] In this embodiment, if the executable code contains a syntax error, the error message can be fed back to the user. The parser receives the modified executable code returned by the user, performs lexical analysis on the modified code, converts it into an array of lexical units, and generates the abstract syntax tree based on this array. For example, the parser analyzes the executable code "const a = 1, const b = a + 1;" and determines that the first statement "const a = 1," has a syntax error because it should end with a semicolon instead of a comma. The parser feeds back the error message to the user and receives the modified executable code returned by the user. For example, it receives the modified executable code "const a = 1; const b = a + 1;". The lexical analyzer performs lexical analysis on the modified executable code, obtaining an array of lexical units, such as {const a = 1;} and {const b = a + 1;}. The parser then generates the abstract syntax tree based on this array.

[0053] In this embodiment, the abstract syntax tree is built upon the syntax analysis tree. Its operation involves parsing and analyzing the strings in the syntax tree based on the grammar of the custom abstract syntax tree, extracting token information, and simultaneously calling the corresponding methods of different nodes at each level, such as the root node, class nodes, and method nodes, to create node objects, thereby generating the program's abstract syntax tree.

[0054] 207. Based on the nodes in the abstract syntax tree, parse the programming semantics corresponding to the executable code;

[0055] In this embodiment, two common programming semantics are sequential execution, which means that the code runs in the order it was written, and control statements, which means that during the code execution process, the code will determine which part of the code to execute based on the set conditions. By using the nodes in the abstract syntax tree, it is possible to identify whether the code contains switch statements and if-else statements, and then determine the processor type of the business point corresponding to the code to be executed.

[0056] 208. Based on programming semantics, determine the processor type corresponding to the business point, where the processor type includes sequential processors and policy processors;

[0057] 209. If the processor type corresponding to the business point is a strategy processor, then determine the number of implementation methods for the business point and write the business point to the corresponding number of strategy processor components.

[0058] In this embodiment, when a business point requires different implementation methods under different conditions, it is expressed in the code through switch statements and if-else statements. For example, if there are three implementations, A, B, and C, then three strategy processors are needed to implement them respectively, which is equivalent to componentizing each conditional branch of the conditional statement into a strategy component.

[0059] 210. If the processor type corresponding to the business point is a sequential processor, then the order of splitting the business points according to the business logic should be set, and the order value of the business points should be set accordingly.

[0060] 211. Write the business logic corresponding to the sequential processor type into the sequential processor component;

[0061] In this embodiment, each sequential processor has a sequence value. Processors with the same name are the implementations of various service points of a service. The execution order of these service points is based on the preset sequence value, from smallest to largest.

[0062] 212. Based on the processor type, manage the processor components through the corresponding processor component manager to obtain the corresponding processor interface, and specify the name of the processor interface to determine the interface name corresponding to each processor interface.

[0063] 213. When a business request is received, the corresponding processor component is called from the processor component manager to execute the business request based on the interface name of the processor interface called by the business request.

[0064] This embodiment, based on the previous embodiment, describes in detail the process of obtaining the execution code corresponding to the business point, determining the processor type corresponding to the business point based on the programming semantics of the execution code, and writing the business point into the corresponding processor component. This involves obtaining the execution code corresponding to the business point and inputting it into a preset syntax analyzer to obtain an abstract syntax tree corresponding to the execution code; parsing the programming semantics corresponding to the execution code based on the nodes in the abstract syntax tree; determining the processor type corresponding to the business point based on the programming semantics; and writing the business point into the corresponding processor component. This method uses a component-based approach to enable the processor component manager to uniformly organize interface business, avoiding unclear business layer logic and verbose code. Furthermore, by decoupling business points and using componentization, new changes will not cause cascading modifications.

[0065] Please see Figure 3 The third embodiment of the processor interface management method in this invention includes:

[0066] 301. Obtain the input business logic, parse the business logic, and obtain the logical relationship table corresponding to the business logic;

[0067] 302. Decompose the business logic into business variables and expressions based on the logical relationship table;

[0068] 303. Based on business variables and expressions, determine at least one business point corresponding to the business logic;

[0069] In this embodiment, the business logic includes multiple business points. By decomposing the business logic into business variables and expressions, and then using a preset mapping relationship to determine the business points corresponding to the decomposed business variables and expressions, at least one business point corresponding to the business logic can be determined.

[0070] 304. Obtain the executable code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the executable code, and write the business point into the corresponding processor component;

[0071] 305. Based on the processor type, manage the processor components through the corresponding processor component manager to obtain the corresponding processor interface, and specify the name of the processor interface to determine the interface name corresponding to each processor interface.

[0072] 306. Based on the interface name of the processor interface called by the business request, call the corresponding processor component in the processor component manager. The processor component includes the sequence processor component and the strategy processor component.

[0073] 307. If the called processor component is a sequential processor component, the execution order of the sequential processor component is determined according to the order value of the called sequential processor component, and the business request is executed by the called sequential processor component according to the execution order.

[0074] 308. If the called processor component is a strategy processor component, then determine the implementation method corresponding to the business request based on the request parameters in the business request, and determine the strategy processor component to be executed based on the implementation method corresponding to the business request.

[0075] 309. Execute business requests through the policy processor component;

[0076] 310. Obtain business logic modification requests and determine the business points to be modified based on the business logic modification requests;

[0077] 311. Use the processor component manager to determine the processor component to be modified corresponding to the business point to be modified;

[0078] 312. Based on the business logic modification request, modify the processor component to be modified, and manage the modified processor component through the corresponding processor component manager.

[0079] In this embodiment, when an interface needs to add a new business point, it is only necessary to add a processor component that implements the corresponding business point and hand the corresponding component over to the manager to achieve the addition; or if an existing business point needs to be changed, it is only necessary to modify the corresponding business point component without affecting other business components to achieve the change.

[0080] This embodiment, based on the previous embodiment, describes in detail the process of acquiring input business logic and decomposing the business logic to obtain at least one business point corresponding to the business logic. By acquiring the input business logic and parsing it, a logical relationship table corresponding to the business logic is obtained. Based on the logical relationship table, the business logic is decomposed into business variables and expressions. Based on the business variables and expressions, at least one business point corresponding to the business logic is determined. This method uses a component-based approach to enable the processor component manager to uniformly organize interface business, avoiding unclear business layer logic and verbose code. Furthermore, by decoupling business points through componentization, new additions or changes will not cause cascading modifications.

[0081] The processor interface management method in the embodiments of the present invention has been described above. The processor interface management device in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 4 One embodiment of the processor interface management device in this invention includes:

[0082] The decomposition module 401 is used to acquire the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic.

[0083] Component module 402 is used to obtain the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component;

[0084] The interface module 403 is used to manage the processor component through the corresponding processor component manager based on the processor type, obtain the corresponding processor interface, specify the name of the processor interface, and determine the interface name corresponding to each processor interface.

[0085] The execution module 404 is used to, when a business request is obtained, call the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request.

[0086] In this embodiment of the invention, the processor interface management device runs the aforementioned processor interface management method. The processor interface management device acquires input business logic and decomposes it to obtain at least one business point corresponding to the business logic; acquires the execution code corresponding to the business point, determines the processor type corresponding to the business point based on the programming semantics of the execution code, and writes the business point into the corresponding processor component; based on the processor type, manages the processor component through the corresponding processor component manager to obtain the corresponding processor interface, and assigns a name to the processor interface to determine the interface name corresponding to each processor interface; when a business request is acquired, the corresponding processor component is called from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request. This method uses a component-based approach to enable the processor component manager to uniformly organize interface businesses, avoiding unclear business layer logic and verbose code. Furthermore, by decoupling business points and using componentization, new changes will not cause cascading modifications.

[0087] Please see Figure 5 A second embodiment of the processor interface management device in this invention includes:

[0088] The decomposition module 401 is used to acquire the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic.

[0089] Component module 402 is used to obtain the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component;

[0090] The interface module 403 is used to manage the processor component through the corresponding processor component manager based on the processor type, obtain the corresponding processor interface, specify the name of the processor interface, and determine the interface name corresponding to each processor interface.

[0091] The execution module 404 is used to, when a business request is obtained, call the corresponding processor component from the processor component manager to execute the business request according to the interface name of the processor interface called by the business request.

[0092] In this embodiment, the decomposition module 401 is specifically used for: acquiring the input business logic, parsing the business logic to obtain a logical relationship table corresponding to the business logic; decomposing the business logic into business variables and expressions according to the logical relationship table; and determining at least one business point corresponding to the business logic according to the business variables and expressions.

[0093] In this embodiment, the component module 402 specifically includes: a syntax tree construction unit 4021, used to obtain the execution code corresponding to the business point, and input the execution code into a preset syntax analyzer to obtain an abstract syntax tree corresponding to the execution code through the syntax analyzer; a parsing unit 4022, used to parse the programming semantics corresponding to the execution code according to the nodes in the abstract syntax tree; and a component writing unit 4023, used to determine the processor type corresponding to the business point based on the programming semantics, and write the business point into the corresponding processor component.

[0094] In this embodiment, the syntax tree construction unit 4021 is specifically used for: obtaining the execution code corresponding to the business point, inputting the execution code into the syntax analyzer, scanning the execution code line by line and decomposing it into lexical units, wherein the lexical units are basic word symbols in the form of strings in a programming language; combining the sequence of lexical units into an array; performing syntax analysis on the execution code based on the array to determine whether the syntax of the execution code is correct; if so, generating a syntax analysis tree corresponding to the execution code according to a preset execution code language specification; calling the node object creation method corresponding to each node in the syntax analysis tree to create node objects, and generating an abstract syntax tree based on the node objects.

[0095] In this embodiment, the component writing unit 4023 is specifically used for: determining the processor type corresponding to the business point based on the programming semantics, wherein the processor type includes a sequential processor and a strategy processor; if the processor type corresponding to the business point is a strategy processor, determining the number of implementation methods of the business point, and writing the business point to the corresponding number of strategy processor components; if the processor type corresponding to the business point is a sequential processor, setting the order value of the business point according to the order in which the business logic is split; and writing the business point whose processor type corresponding to the business logic is a sequential processor to the sequential processor component.

[0096] In this embodiment, the execution module 404 is specifically used to: call the corresponding processor component in the processor component manager according to the interface name of the processor interface called by the service request; if the called processor component is a sequential processor component, determine the execution order of the sequential processor component according to the order value of the called sequential processor component, and execute the service request using the called sequential processor component according to the execution order; if the called processor component is a strategy processor component, determine the implementation method corresponding to the service request according to the request parameters in the service request, and determine the strategy processor component to be executed according to the implementation method corresponding to the service request; and execute the service request through the executed strategy processor component.

[0097] In this embodiment, the processor interface management device further includes a component modification module 405, which is specifically used for: obtaining a business logic modification request and determining the business point to be modified based on the business logic modification request; determining the processor component to be modified corresponding to the business point to be modified through the processor component manager; modifying the processor component to be modified according to the business logic modification request, and managing the modified processor component to be modified through the corresponding processor component manager.

[0098] This embodiment, based on the previous embodiment, describes in detail the specific functions of each module. By using the modules on the processor interface management device in a componentized manner, the processor component manager can uniformly organize interface services, avoiding unclear business logic and verbose code. Furthermore, by decoupling business points and using componentization, new additions or changes will not cause cascading modifications.

[0099] above Figure 4 and Figure 5 The processor interface management device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The processor interface management device in this embodiment of the invention is described in detail below from the perspective of hardware processing.

[0100] Figure 6 This is a schematic diagram of a processor interface management device 600 provided in an embodiment of the present invention. The processor interface management device 600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 633 or data 632. The memory 620 and storage media 630 may be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the processor interface management device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute a series of instruction operations in the storage media 630 on the processor interface management device 600 to implement the steps of the aforementioned processor interface management method.

[0101] The processor interface management device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The processor interface management device structure shown does not constitute a limitation on the processor interface management device provided in this application. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0102] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the processor interface management method.

[0103] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0104] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A processor interface management method, characterized in that, The processor interface management method includes: Obtain the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic; Obtain the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component; Based on the processor type, the processor components are managed through the corresponding processor component manager to obtain the corresponding processor interfaces, and the names of the processor interfaces are specified to determine the interface names corresponding to each processor interface. When a business request is received, the corresponding processor component is invoked from the processor component manager to execute the business request based on the interface name of the processor interface invoked by the business request. The step of obtaining the execution code corresponding to the business point, determining the processor type corresponding to the business point based on the programming semantics of the execution code, and writing the business point into the corresponding processor component includes: Obtain the execution code corresponding to the business point, and input the execution code into a preset syntax analyzer to obtain the abstract syntax tree corresponding to the execution code through the syntax analyzer; Based on the nodes in the abstract syntax tree, the programming semantics corresponding to the executable code are parsed. Based on the programming semantics, the processor type corresponding to the service point is determined, and the service point is written into the corresponding processor component.

2. The processor interface management method according to claim 1, characterized in that, The business logic for obtaining input, and the decomposition of the business logic to obtain at least one business point corresponding to the business logic, includes: Obtain the input business logic, parse the business logic, and obtain the logical relationship table corresponding to the business logic; Based on the logical relationship table, the business logic is decomposed into business variables and expressions; Based on the business variables and expressions, at least one business point corresponding to the business logic is determined.

3. The processor interface management method according to claim 1, characterized in that, The step of obtaining the execution code corresponding to the business point and inputting the execution code into a preset syntax analyzer, and obtaining the abstract syntax tree corresponding to the execution code through the syntax analyzer, includes: The execution code corresponding to the business point is obtained and input into the syntax analyzer. The syntax analyzer scans the execution code line by line and decomposes it into lexical units, wherein the lexical units are basic word symbols in the form of strings in the programming language. The lexical unit sequences are combined into an array; The executable code is parsed based on the array to determine whether the syntax of the executable code is correct; If so, then a syntax analysis tree corresponding to the executable code is generated according to the preset executable code language specification; Call the node object creation method corresponding to each node in the parsing tree to create node objects, and generate an abstract syntax tree based on the node objects.

4. The processor interface management method according to claim 1, characterized in that, The step of determining the processor type corresponding to the business point based on the programming semantics and writing the business point into the corresponding processor component includes: Based on the programming semantics, the processor type corresponding to the business point is determined, wherein the processor type includes sequential processors and policy processors; If the processor type corresponding to the business point is a policy processor, then determine the number of implementation methods for the business point and write the business point to the corresponding number of policy processor components; If the processor type corresponding to the service point is a sequential processor, then the order value of the service point is set according to the order in which the service points are split according to the business logic. The business logic corresponding to the sequential processor type of the business point is written to the sequential processor component.

5. The processor interface management method according to claim 4, characterized in that, The step of calling the corresponding processor component from the processor component manager to execute the business request based on the interface name of the processor interface invoked in the business request includes: Based on the interface name of the processor interface invoked in the business request, the corresponding processor component in the processor component manager is invoked; If the invoked processor component is a sequential processor component, the execution order of the sequential processor component is determined according to the order value of the invoked sequential processor component, and the business request is executed using the invoked sequential processor component in accordance with the execution order; If the invoked processor component is a strategy processor component, then the implementation method corresponding to the business request is determined according to the request parameters in the business request, and the strategy processor component to be executed is determined according to the implementation method corresponding to the business request. The business request is executed by the policy processor component.

6. The processor interface management method according to any one of claims 1-5, characterized in that, After invoking the corresponding processor component from the processor component manager to execute the business request based on the interface name of the processor interface invoked according to the business request, the process further includes: Obtain a business logic modification request, and determine the business points to be modified based on the business logic modification request; The processor component manager determines the processor component to be modified corresponding to the service point to be modified. Based on the business logic modification request, the processor component to be modified is modified, and the modified processor component is managed through the corresponding processor component manager.

7. A processor interface management device, characterized in that, The processor interface management device includes: The decomposition module is used to acquire the input business logic and decompose the business logic to obtain at least one business point corresponding to the business logic. The component module is used to obtain the execution code corresponding to the business point, determine the processor type corresponding to the business point based on the programming semantics of the execution code, and write the business point into the corresponding processor component; The interface module is used to manage the processor components through the corresponding processor component manager based on the processor type, obtain the corresponding processor interface, specify the name of the processor interface, and determine the interface name corresponding to each processor interface. The execution module is used to, when a business request is received, call the corresponding processor component from the processor component manager to execute the business request based on the interface name of the processor interface called by the business request; The step of obtaining the execution code corresponding to the business point, determining the processor type corresponding to the business point based on the programming semantics of the execution code, and writing the business point into the corresponding processor component includes: Obtain the execution code corresponding to the business point, and input the execution code into a preset syntax analyzer to obtain the abstract syntax tree corresponding to the execution code through the syntax analyzer; Based on the nodes in the abstract syntax tree, the programming semantics corresponding to the executable code are parsed. Based on the programming semantics, the processor type corresponding to the service point is determined, and the service point is written into the corresponding processor component.

8. A processor interface management device, characterized in that, The processor interface management device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the processor interface management device to perform the steps of the processor interface management method as described in any one of claims 1-6.

9. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the processor interface management method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Insuring flow generation method, insuring request processing method, device and electronic device

    CN107274023A

  • Service interface management method and device, storage medium and terminal

    CN109327499A