CN115242871B - Service method and device of business gateway, storage medium and electronic equipment - Google Patents

Service method and device of business gateway, storage medium and electronic equipment Download PDF

Info

Publication number
CN115242871B
CN115242871B CN202210928269.0A CN202210928269A CN115242871B CN 115242871 B CN115242871 B CN 115242871B CN 202210928269 A CN202210928269 A CN 202210928269A CN 115242871 B CN115242871 B CN 115242871B
Authority
CN
China
Prior art keywords
service
flow
request
target
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210928269.0A
Other languages
Chinese (zh)
Other versions
CN115242871A (en
Inventor
黄鹏杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Soufun Science & Technology Development Co ltd
Original Assignee
Beijing Soufun Science & Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Soufun Science & Technology Development Co ltd filed Critical Beijing Soufun Science & Technology Development Co ltd
Priority to CN202210928269.0A priority Critical patent/CN115242871B/en
Publication of CN115242871A publication Critical patent/CN115242871A/en
Application granted granted Critical
Publication of CN115242871B publication Critical patent/CN115242871B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a service method and a device for a service gateway, a storage medium and electronic equipment, wherein the method comprises the following steps: when the service gateway receives a service request, the service gateway performs type analysis to obtain a target service type; determining a target flow file corresponding to the target service type in a flow file library; determining the input parameter data information corresponding to the target flow file; according to the input parameter data information, carrying out parameter analysis on the service request to obtain request data; creating a corresponding flow instance according to the target flow file and the request data; executing a flow instance to obtain a request result corresponding to the service request; and sending the request result to the client to complete the service process of the business gateway. By applying the method of the invention, the business gateway can realize service based on the business flow described by the flow file, and when business logic changes, the business flow in the related flow file is configured, so that the code amount required to be written is less, the workload can be reduced, and the development efficiency can be improved.

Description

Service method and device of business gateway, storage medium and electronic equipment
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a service method and apparatus of a service gateway, a storage medium, and an electronic device.
Background
With the development of computer technology, a micro-service architecture has become one of the mainstream business system architectures. In a service system based on a micro-service architecture, there are usually some service logics associated with gateway services, and if these service logics are deployed in a conventional API gateway, a large amount of interface aggregation easily occurs, and a large amount of service logics can bring about great challenges to stability, maintainability, operation and maintenance efficiency and other aspects of the API gateway.
In an actual service scenario, the service logic can be carried by adding a new service gateway, so that adverse effects on the API gateway can be avoided, and the service gateway is BFF (BackendForFrontend) gateway. Currently, service logic deployed in a service gateway generally relies on technicians to write codes to perform service orchestration, and the service gateway implements service based on codes corresponding to the service logic. In the actual business service process, the business logic is changed frequently. Based on the existing service mode, in the development or operation and maintenance process of the service gateway, a large amount of codes are required to be written by technicians, the workload is large, the development efficiency is low, and the maintainability is poor.
Disclosure of Invention
In view of this, the embodiment of the invention provides a service method of a service gateway, so as to solve the problem that in the service process of implementing the service gateway, technicians are required to write codes to perform service arrangement, and the development efficiency is low.
The embodiment of the invention also provides a service device of the service gateway, which is used for ensuring the practical realization and application of the method.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
a service method of a service gateway, comprising:
when a service gateway of a service system receives a service request sent by a client, carrying out type analysis on the service request to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
determining the input parameter data information corresponding to the target flow file;
according to the incoming parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request;
creating a flow instance corresponding to the service request according to the target flow file and the request data;
executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
and sending the request result to the client to finish the service gateway service process corresponding to the service request.
In the above method, optionally, the determining, in the constructed flow file library, the target flow file corresponding to the target service type includes:
determining a service identifier corresponding to each flow file;
determining a target service identifier corresponding to the target service type in each service identifier;
and determining the flow file corresponding to the target service identifier as a target flow file corresponding to the target service type.
The method, optionally, the generating process of the flow file includes:
when a flow configuration instruction sent by a user through a front-end interface is received, displaying a visual configuration interface in the front-end interface based on a preset visual configuration module so that the user configures a business flow through the visual configuration interface;
when a flow saving instruction sent by the user through the visual configuration interface is received, determining a current business flow configured by the user through the visual configuration interface;
and generating a flow file corresponding to the current business flow according to a preset extensible markup language file generation strategy.
The method, optionally, the executing the flow example includes:
determining a plurality of flow nodes corresponding to the flow instance and an execution sequence corresponding to each flow node;
and sequentially executing the flow tasks corresponding to each flow node according to the execution sequence corresponding to each flow node.
In the above method, optionally, each flow file in the flow file library is preloaded in a memory space corresponding to the service gateway.
A service device of a service gateway, comprising:
the first analysis unit is used for carrying out type analysis on the service request when a service gateway of the service system receives the service request sent by the client, so as to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
the first determining unit is used for determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
the second determining unit is used for determining the input parameter data information corresponding to the target flow file;
the second analyzing unit is used for carrying out parameter analysis on the service request according to the incoming parameter data information to obtain request data corresponding to the service request;
the creating unit is used for creating a flow instance corresponding to the service request according to the target flow file and the request data;
the execution unit is used for executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
and the sending unit is used for sending the request result to the client to finish the service gateway service process corresponding to the service request.
The above apparatus, optionally, the first determining unit includes:
a first determining subunit, configured to determine a service identifier corresponding to each flow file;
a second determining subunit, configured to determine, in each service identifier, a target service identifier corresponding to the target service type;
and the third determining subunit is used for determining the flow file corresponding to the target service identifier as the target flow file corresponding to the target service type.
The above device, optionally, further comprises:
the configuration unit is used for displaying a visual configuration interface in the front-end interface based on a preset visual configuration module when receiving a flow configuration instruction sent by a user through the front-end interface, so that the user configures a business flow through the visual configuration interface;
the third determining unit is used for determining the current business flow configured by the user through the visual configuration interface when receiving a flow preservation instruction sent by the user through the visual configuration interface;
and the generating unit is used for generating a flow file corresponding to the current business flow according to a preset extensible markup language file generating strategy.
A storage medium comprising stored instructions, wherein the instructions, when executed, control a device on which the storage medium resides to perform a service method of a service gateway as described above.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform a service method of a traffic gateway as described above.
Based on the service method of the service gateway provided by the embodiment of the invention, the service method comprises the following steps: when a service gateway of a service system receives a service request sent by a client, the service gateway carries out type analysis on the service request to obtain a target service type corresponding to the service request. And determining a target flow file corresponding to the target service type in the constructed flow file library, wherein the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the service flow based on a service flow modeling and labeling protocol (BPMN). And determining the input parameter data information corresponding to the target flow file, and carrying out parameter analysis on the service request according to the input parameter data information to obtain request data corresponding to the service request. Creating a flow instance according to the target flow file and the request data, and executing the flow instance to execute a business flow corresponding to the business request, thereby obtaining a request result corresponding to the business request. And sending the request result to the client to complete the service process of the business gateway corresponding to the business request. By applying the method provided by the embodiment of the invention, when the business gateway receives a business request, the business gateway can create a flow instance based on the flow file, the processing of the business flow is realized by executing the flow instance, when the business logic of the business gateway changes, the staff only needs to reconfigure the business flow described by the flow file, the code amount required to be written is less, the workload can be reduced, the development efficiency is improved, and the maintainability of the system is improved. Secondly, the flow file is a file generated based on a BPMN protocol, and the protocol is a public protocol, so that the universality is high.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for providing a service method for a service gateway according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of a service gateway according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a service device of a service gateway according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a service device of a service gateway according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the invention provides a service method of a service gateway, the method can be applied to the service gateways of various service systems, an execution subject of the method can be a server for deploying the service gateway, and a flow chart of the method is shown in figure 1 and comprises the following steps:
s101: when a service gateway of a service system receives a service request sent by a client, carrying out type analysis on the service request to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
in the method provided by the embodiment of the invention, the service system is a system based on the construction of a micro-service architecture, and the corresponding server is provided with a service gateway BFF. In the process of providing service for clients, the clients of the service system respond to the service requirements and can request the server to perform corresponding service processing, and service requests associated with the service gateway are sent to the service gateway by the clients and call each micro service in the service system to perform service processing through the service gateway. When the service gateway deployed on the server receives the service request sent by the client, the service gateway can analyze the type according to the request identifier carried by the service request, determine the service type corresponding to the request identifier based on preset service type information, and take the service type as the target service type.
S102: determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
in the method provided by the embodiment of the invention, when the service requirement is generated, a worker can set a service flow based on the service requirement, namely, the service gateway faces to the workflow required to be executed by the type of service, the service flow can be constructed through a flow engine based on a service flow modeling and labeling (BusinessProcessModelingNotation, BPMN) protocol, and the service flow is stored in a file form of an extensible markup language (ExtensibleMarkup Language, XML) to generate a corresponding flow file. The pre-generated individual flow files may be stored in a pre-built flow file library.
In the method provided by the embodiment of the invention, the flow file matched with the target service type can be searched in the flow file library, and the flow file matched with the target service type is used as the target flow file.
S103: determining the input parameter data information corresponding to the target flow file;
in the method provided by the embodiment of the invention, the related business process is defined in the target process file, wherein the related business process comprises the type of request data required to be provided by the business process, namely the related information of the entering parameters. The target flow file can be analyzed to obtain the input parameter data information recorded in the target flow file.
S104: according to the incoming parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request;
in the method provided by the embodiment of the invention, the request content of the service request can be subjected to parameter analysis according to the input parameter data information, and the request data corresponding to the input parameter data information, namely the input parameters required by the service flow, are extracted from the service request.
S105: creating a flow instance corresponding to the service request according to the target flow file and the request data;
in the method provided by the embodiment of the invention, the flow instance corresponding to the service request can be created according to the service flow defined in the target flow file and the request data corresponding to the service request, namely, specific workflow of the service gateway aiming at the service request.
S106: executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
in the method provided by the embodiment of the invention, the created process instance can be executed by the preset process execution engine, namely, each process operation is executed according to the business process, for example, related micro-service is called, feedback of the micro-service is received, and the like. After the execution of the process instance is finished, a final execution result of the business process, namely a request result corresponding to the business request, can be obtained.
S107: and sending the request result to the client to finish the service gateway service process corresponding to the service request.
In the method provided by the embodiment of the invention, the request result can be used as the response of the service request, the request result is sent to the client, and the service gateway service process of the current service request is ended. The client may provide services to the client based on the results of the received requests.
Based on the method provided by the embodiment of the invention, when a service gateway of a service system receives a service request sent by a client, the service request is subjected to type analysis to obtain a corresponding target service type; the business system is a system built based on a micro-service architecture; determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN); determining the input parameter data information corresponding to the target flow file; according to the input parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request; creating a flow instance corresponding to the service request according to the target flow file and the request data; executing a flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request; and sending the request result to the client to complete the service process of the business gateway corresponding to the business request. By applying the method provided by the embodiment of the invention, the service gateway can realize the processing of the service flow by executing the created flow instance in the process of processing the service request, and when the service logic of the service gateway changes, a worker only needs to reconfigure the service flow described by the flow file, so that the code amount required to be written is less, the workload can be reduced, the development efficiency can be improved, and the maintainability of the system can be improved. Secondly, the flow file is a file generated based on a BPMN protocol, and the protocol is a public protocol, so that the universality is high. In addition, the business process is recorded through the process file, and the version management of the business logic is convenient.
On the basis of the method provided by the above embodiment, in the method provided by the embodiment of the present invention, in the constructed flow file library, the process of determining the target flow file corresponding to the target service type mentioned in step S102 includes:
determining a service identifier corresponding to each flow file;
in the method provided by the embodiment of the invention, each flow file and the corresponding service identifier can be bound and stored in the flow file library, or the corresponding service identifier can be marked in the flow file. The service identifier is a preset identifier and is used for representing the service type corresponding to the service flow described by the flow file. The service identifier corresponding to each flow file can be read from the flow file library.
Determining a target service identifier corresponding to the target service type in each service identifier;
in the method provided by the embodiment of the invention, each service identifier can be respectively matched with the target service type, specifically, the target service type can be characterized in an identifier form, and whether the service identifier is matched with the target service type can be judged by comparing the service identifier with the identifier of the target service type. And if the currently matched service identifier is matched with the target service type, the service identifier is used as the target service identifier.
And determining the flow file corresponding to the target service identifier as a target flow file corresponding to the target service type.
In the method provided by the embodiment of the invention, the flow file corresponding to the target service identifier can be selected from the flow file library and used as the target flow file.
In order to better explain the method provided by the embodiment of the present invention, referring to the flowchart shown in fig. 2, the embodiment of the present invention provides a service method of a service gateway, and on the basis of the method shown in fig. 1, in the method provided by the embodiment of the present invention, a process for generating a flow file includes:
s201: when a flow configuration instruction sent by a user through a front-end interface is received, displaying a visual configuration interface in the front-end interface based on a preset visual configuration module so that the user configures a business flow through the visual configuration interface;
in the method provided by the embodiment of the invention, a front-end interface for configuring the flow and a visual configuration module for developing and constructing the business flow based on the BPMN protocol can be arranged. When the user (i.e. the staff) needs to configure the business process, the user can send a process configuration instruction through the front-end interface. When the server receives the flow configuration instruction, a preset visual configuration module can be called, and a visual interface for configuring the business flow is displayed in the front-end interface, namely the visual configuration interface. The user can select corresponding flow elements through drag operation in the visual configuration interface, connect the flow elements and configure the flow parameters to obtain visual business flow views.
S202: when a flow saving instruction sent by the user through the visual configuration interface is received, determining a current business flow configured by the user through the visual configuration interface;
in the method provided by the embodiment of the invention, after the user completes the configuration work of the business process, the user can click the control for saving the process, and the visual configuration interface responds to the operation of saving the process by the user and can send the corresponding process saving instruction to the visual configuration module. When the visual configuration module receives the flow preservation instruction, the business flow configured in the visual configuration interface by the user can be obtained, and the business flow specifically comprises contents such as various flow elements, connection relations, flow parameters and the like.
S203: and generating a flow file corresponding to the current business flow according to a preset extensible markup language file generation strategy.
In the method provided by the embodiment of the invention, the visual configuration module stores the business process configured by the user based on the XML format of the extensible markup language, and can store specific information of the current business process based on a preset XML file generation strategy to generate a process file corresponding to the current business process, wherein the process file is an XML file.
Based on the method provided by the embodiment of the invention, a worker can configure the business processes in the related process files through the visual interface, the arrangement of business process logic and the generation of the process files are completed based on the visual interface, and the code segments of the business logic stored in the system can be reused in the process, so that the aim of low codes is fulfilled, and the development efficiency can be further improved.
Further, based on the method shown in fig. 1, in the method provided by the embodiment of the present invention, the process for executing the flow example mentioned in step S106 includes:
determining a plurality of flow nodes corresponding to the flow instance and an execution sequence corresponding to each flow node;
and sequentially executing the flow tasks corresponding to each flow node according to the execution sequence corresponding to each flow node.
In the method provided by the embodiment of the invention, the flow instance can be analyzed to obtain each corresponding flow node and the execution sequence of each flow node. And executing the flow tasks corresponding to each flow node in turn according to the execution sequence. For example, the current service request is a request for inquiring information, the flow instance includes a flow node a and a flow node B, the flow node a is a node for identity authentication, the flow node B is a node for inquiring information, the execution sequence is the flow node a-flow node B, and the process of executing the flow instance may be that, based on the user identity information included in the service request, invoking a micro-service for identity authentication to a user (i.e. an object for inquiring information), that is, executing a flow task of the flow node a. If the authentication result of the user identity authentication is received, executing the flow task of the flow node B, specifically, for calling the micro-service of the information inquiry, inquiring the required information from the corresponding information system, and when the information fed back by the micro-service is received, ending the execution process of the flow instance, wherein the inquired information is the request result corresponding to the service request.
It should be noted that, in a specific implementation process, the execution sequence corresponding to each flow node may be serial or parallel, which is determined by specific service logic, so that the implementation function of the method provided by the embodiment of the present invention is not affected.
Furthermore, in the method provided by the embodiment of the present invention, each flow file in the flow file library is preloaded in a memory space corresponding to the service gateway.
In the method provided by the embodiment of the invention, when the service gateway is started, namely when the service is started, each flow file in the flow file library can be loaded into the memory, and the flow file can be read from the corresponding memory space in the service process of the service gateway.
In order to better explain the method provided by the embodiment of the present invention, on the basis of the method provided by the foregoing embodiment, the embodiment of the present invention provides a service method of a service gateway, so as to briefly explain a specific implementation of the method provided by the present invention.
In the method provided by the embodiment of the invention, the configuration module of the business process is developed based on the BPMN protocol, and the non-core logic of interface interaction is realized by expanding the customized protocol to realize the call of the http and the interceptor of the http. The main business logic is developed through the grovy script, so that the dynamic adjustment and update of the business logic are facilitated. XML is used for describing the business process, so that the business process can be versioned and visualized.
The business process is expressed by XML, and the external interface, the internal dynamic script and the like are collectively called Task. The engine completes the realization of the code layers of skip, circulation, branching and the like of each Task according to the flow description of XML, thereby completing the service requirement. And the tasks communicate with each other through the operation of the context on the shared variable.
When the service gateway is started, the engine firstly loads the flow information in the database into the memory, and the step can improve the performance. When a service request is received, the engine matches to the corresponding flow according to certain screening conditions, and then binds the variables into the context and the variables of the current Task. The engine then performs subsequent processing of the business logic according to the configuration of the XML and then writes the results to the client.
The XML file describing the business process can be dragged and configured through a visual configuration module in the background. After the configuration is completed, the XML file is exported from the background and then loaded into the flow engine so as to be called by the client. The goals of improving project usability, stability and the like are achieved.
Based on the method provided by the embodiment of the invention, visual configuration and real-time test can be realized, the method can be used immediately after the configuration, and the understanding of all parties to the service can be improved while the working efficiency of transfer development is improved. The version can be instantly rolled back, so that the accident response speed is improved. The component code logic only needs to be written once and can be called for multiple times, and the item generality, openness and reusability can be improved.
Corresponding to the service method of the service gateway shown in fig. 1, the embodiment of the invention also provides a service device of the service gateway, which is used for implementing the method shown in fig. 1, and the structure schematic diagram is shown in fig. 3, and includes:
a first parsing unit 301, configured to, when a service gateway of a service system receives a service request sent by a client, perform type parsing on the service request to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
a first determining unit 302, configured to determine, in a constructed flow file library, a target flow file corresponding to the target service type; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
a second determining unit 303, configured to determine incoming parameter data information corresponding to the target flow file;
the second parsing unit 304 is configured to perform parameter parsing on the service request according to the incoming parameter data information, so as to obtain request data corresponding to the service request;
a creating unit 305, configured to create a flow instance corresponding to the service request according to the target flow file and the request data;
an execution unit 306, configured to execute the flow instance to execute a service flow corresponding to the service request, and obtain a request result corresponding to the service request;
and the sending unit 307 is configured to send the request result to the client, and complete a service gateway service procedure corresponding to the service request.
Based on the device provided by the embodiment of the invention, when the service gateway of the service system receives the service request sent by the client, the service request is subjected to type analysis to obtain the corresponding target service type; the business system is a system built based on a micro-service architecture; determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN); determining the input parameter data information corresponding to the target flow file; according to the input parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request; creating a flow instance corresponding to the service request according to the target flow file and the request data; executing a flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request; and sending the request result to the client to complete the service process of the business gateway corresponding to the business request. By applying the device provided by the embodiment of the invention, the service gateway can realize the processing of the service flow by executing the created flow instance in the process of processing the service request, and when the service logic of the service gateway changes, a worker only needs to reconfigure the service flow described by the flow file, so that the code amount required to be written is less, the workload can be reduced, the development efficiency can be improved, and the maintainability of the system can be improved. Secondly, the flow file is a file generated based on a BPMN protocol, and the protocol is a public protocol, so that the universality is high. In addition, the business process is recorded through the process file, and the version management of the business logic is convenient.
On the basis of the apparatus provided by the foregoing embodiment, in the apparatus provided by the embodiment of the present invention, the first determining unit 302 includes:
a first determining subunit, configured to determine a service identifier corresponding to each flow file;
a second determining subunit, configured to determine, in each service identifier, a target service identifier corresponding to the target service type;
and the third determining subunit is used for determining the flow file corresponding to the target service identifier as the target flow file corresponding to the target service type.
The embodiment of the invention provides a service device of a service gateway, a structural schematic diagram of which is shown in fig. 4, and on the basis of the device shown in fig. 3, the device provided by the embodiment of the invention further comprises:
the configuration unit 308 is configured to, when receiving a flow configuration instruction sent by a user through a front-end interface, display a visual configuration interface in the front-end interface based on a preset visual configuration module, so that the user configures a service flow through the visual configuration interface;
a third determining unit 309, configured to determine, when receiving a flow saving instruction sent by the user through the visual configuration interface, a current business flow configured by the user through the visual configuration interface;
the generating unit 310 is configured to generate a flow file corresponding to the current business flow according to a preset extensible markup language file generating policy.
On the basis of the apparatus provided by the foregoing embodiment, in the apparatus provided by the embodiment of the present invention, the executing unit 306 includes:
a fourth determining subunit, configured to determine a plurality of flow nodes corresponding to the flow instance and an execution sequence corresponding to each flow node;
and the execution subunit is used for sequentially executing the flow tasks corresponding to each flow node according to the execution sequence corresponding to each flow node.
Based on the device provided in the foregoing embodiment, in the device provided in the embodiment of the present invention, each flow file in the flow file library is preloaded in a memory space corresponding to the service gateway.
The embodiment of the invention also provides a storage medium, which comprises stored instructions, wherein the equipment where the storage medium is located is controlled to execute the service method of the service gateway when the instructions run.
The embodiment of the present invention further provides an electronic device, whose structural schematic diagram is shown in fig. 5, specifically including a memory 401, and one or more instructions 402, where the one or more instructions 402 are stored in the memory 401, and configured to be executed by the one or more processors 403 to perform the following operations by the one or more instructions 402:
when a service gateway of a service system receives a service request sent by a client, carrying out type analysis on the service request to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
determining the input parameter data information corresponding to the target flow file;
according to the incoming parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request;
creating a flow instance corresponding to the service request according to the target flow file and the request data;
executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
and sending the request result to the client to finish the service gateway service process corresponding to the service request.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for a system or system embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, with reference to the description of the method embodiment being made in part. The systems and system embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (8)

1. A service method of a service gateway, comprising:
when a service gateway of a service system receives a service request sent by a client, carrying out type analysis on the service request to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN); the process for generating the flow file comprises the following steps: when a flow configuration instruction sent by a user through a front-end interface is received, displaying a visual configuration interface in the front-end interface based on a preset visual configuration module, acquiring a user service demand, and constructing a service flow through the service flow modeling and a flow engine of the labeling protocol BPMN according to the service demand; when a flow saving instruction sent by the user through the visual configuration interface is received, determining a current business flow configured by the user through the visual configuration interface; generating a flow file corresponding to the current business flow according to a preset extensible markup language file generation strategy;
determining the input parameter data information corresponding to the target flow file; the entry parameter data information represents the type of request data required to be provided by the business process;
according to the incoming parameter data information, carrying out parameter analysis on the service request to obtain request data corresponding to the service request; the request data are input parameters required by the business process;
creating a flow instance corresponding to the service request according to the target flow file and the request data;
executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
and sending the request result to the client to finish the service gateway service process corresponding to the service request.
2. The method according to claim 1, wherein determining, in the constructed flow file library, the target flow file corresponding to the target service type includes:
determining a service identifier corresponding to each flow file;
determining a target service identifier corresponding to the target service type in each service identifier;
and determining the flow file corresponding to the target service identifier as a target flow file corresponding to the target service type.
3. The method of claim 1, wherein the executing the flow instance comprises:
determining a plurality of flow nodes corresponding to the flow instance and an execution sequence corresponding to each flow node;
and sequentially executing the flow tasks corresponding to each flow node according to the execution sequence corresponding to each flow node.
4. The method of claim 1, wherein each flow file in the flow file library is preloaded in a memory space corresponding to the service gateway.
5. A service device of a service gateway, comprising:
the first analysis unit is used for carrying out type analysis on the service request when a service gateway of the service system receives the service request sent by the client, so as to obtain a target service type corresponding to the service request; the service system is a system built based on a micro-service architecture;
the first determining unit is used for determining a target flow file corresponding to the target service type in the constructed flow file library; the flow file library comprises a plurality of pre-generated flow files, and each flow file is an extensible markup language file for describing the business flow based on a business flow modeling and labeling protocol (BPMN);
the second determining unit is used for determining the input parameter data information corresponding to the target flow file; the entry parameter data information represents the type of request data required to be provided by the business process;
the second analyzing unit is used for carrying out parameter analysis on the service request according to the incoming parameter data information to obtain request data corresponding to the service request; the request data are input parameters required by the business process;
the creating unit is used for creating a flow instance corresponding to the service request according to the target flow file and the request data;
the execution unit is used for executing the flow instance to execute a service flow corresponding to the service request and obtain a request result corresponding to the service request;
the sending unit is used for sending the request result to the client to finish the service gateway service process corresponding to the service request;
the configuration unit is used for displaying a visual configuration interface in the front-end interface based on a preset visual configuration module when receiving a flow configuration instruction sent by a user through the front-end interface, acquiring a user service demand, and constructing a service flow through the service flow modeling and the flow engine of the labeling protocol BPMN according to the service demand;
the third determining unit is used for determining the current business flow configured by the user through the visual configuration interface when receiving a flow preservation instruction sent by the user through the visual configuration interface;
and the generating unit is used for generating a flow file corresponding to the current business flow according to a preset extensible markup language file generating strategy.
6. The apparatus according to claim 5, wherein the first determining unit includes:
a first determining subunit, configured to determine a service identifier corresponding to each flow file;
a second determining subunit, configured to determine, in each service identifier, a target service identifier corresponding to the target service type;
and the third determining subunit is used for determining the flow file corresponding to the target service identifier as the target flow file corresponding to the target service type.
7. A storage medium comprising stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform a service method of a service gateway according to any one of claims 1 to 4.
8. An electronic device comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by the one or more processors to perform the service method of the traffic gateway of any of claims 1-4.
CN202210928269.0A 2022-08-03 2022-08-03 Service method and device of business gateway, storage medium and electronic equipment Active CN115242871B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210928269.0A CN115242871B (en) 2022-08-03 2022-08-03 Service method and device of business gateway, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210928269.0A CN115242871B (en) 2022-08-03 2022-08-03 Service method and device of business gateway, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN115242871A CN115242871A (en) 2022-10-25
CN115242871B true CN115242871B (en) 2024-03-01

Family

ID=83677713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210928269.0A Active CN115242871B (en) 2022-08-03 2022-08-03 Service method and device of business gateway, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115242871B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523457A (en) * 2023-04-06 2023-08-01 广东公信智能会议股份有限公司 Workflow processing method, device, equipment and storage medium based on business process

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN110768914A (en) * 2019-10-23 2020-02-07 上海交通大学 Decentralized Internet of things gateway system based on semantic scene instance migration
CN112099768A (en) * 2020-08-04 2020-12-18 北京奇艺世纪科技有限公司 Business process processing method and device and computer readable storage medium
CN113709166A (en) * 2021-08-31 2021-11-26 广州艾美网络科技有限公司 Distributed service gateway implementation method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365751A (en) * 2019-06-26 2019-10-22 口碑(上海)信息技术有限公司 Method for processing business, device and the equipment of gateway system
CN110768914A (en) * 2019-10-23 2020-02-07 上海交通大学 Decentralized Internet of things gateway system based on semantic scene instance migration
CN112099768A (en) * 2020-08-04 2020-12-18 北京奇艺世纪科技有限公司 Business process processing method and device and computer readable storage medium
CN113709166A (en) * 2021-08-31 2021-11-26 广州艾美网络科技有限公司 Distributed service gateway implementation method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN115242871A (en) 2022-10-25

Similar Documents

Publication Publication Date Title
CN111078315B (en) Microservice arranging and executing method and system, architecture, equipment and storage medium
CN104541247B (en) System and method for adjusting cloud computing system
US9904585B1 (en) Error handling in executing workflow state machines
US11635974B2 (en) Providing a different configuration of added functionality for each of the stages of predeployment, deployment, and post deployment using a layer of abstraction
CN114115852A (en) Visual service arranging method, device, equipment and medium
US9766927B1 (en) Data flow management in processing workflows
US10803413B1 (en) Workflow service with translator
CN108415710A (en) The method and system of API is issued, called in Intelligent dialogue development platform
CN115242871B (en) Service method and device of business gateway, storage medium and electronic equipment
CN114924858A (en) Task scheduling method and device, storage medium and electronic equipment
Samea et al. A UML profile for multi-cloud service configuration (UMLPMSC) in event-driven serverless applications
Prehofer et al. Modeling restful web of things services: Concepts and tools
Golis et al. Creating Microservices and using infrastructure as code within the CI/CD for dynamic container creation
CN115794659B (en) Distributed parallel testing method, device, equipment and medium for CFD software
US10397342B2 (en) Web service contract selection
US9323509B2 (en) Method and system for automated process distribution
US20120221304A1 (en) Integration of workflows from various systems
Holm et al. CloudFlow-an infrastructure for engineering workflows in the cloud
Tragatschnig et al. Runtime process adaptation for bpel process execution engines
CN112418796A (en) Sub-process node activation method and device, electronic equipment and storage medium
Rodríguez-Echeverría et al. Model-driven Generation of a REST API from a Legacy Web Application
Ettazi et al. Micats: Middleware for context-aware transactional services
Gao On Provisioning and configuring ensembles of IoT, network functions and cloud resources
US9235382B2 (en) Input filters and filter-driven input processing
Galic et al. Multivocal Survey of the Function Management Layer in the Open-Source Serverless Platforms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant