CN114675820A - Service arrangement data processing method and device, electronic equipment and storage medium - Google Patents

Service arrangement data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114675820A
CN114675820A CN202210380675.8A CN202210380675A CN114675820A CN 114675820 A CN114675820 A CN 114675820A CN 202210380675 A CN202210380675 A CN 202210380675A CN 114675820 A CN114675820 A CN 114675820A
Authority
CN
China
Prior art keywords
component
components
definition file
data
generating
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.)
Pending
Application number
CN202210380675.8A
Other languages
Chinese (zh)
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210380675.8A priority Critical patent/CN114675820A/en
Publication of CN114675820A publication Critical patent/CN114675820A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a processing method and device of service arrangement data, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises: responding to a generation instruction of service arrangement, acquiring graph data corresponding to the generation instruction so as to identify a plurality of components in the graph data and a connection sequence among the components; querying a first component connected by the starting component according to the connection sequence; querying a second component matched with the first component from the plurality of components, determining the components with the connection sequence between the first component and the second component, and acquiring corresponding component parameters to generate a logic flow definition file; and responding to the condition that the third component is an ending component, calling a preset file generation model to generate a target flow definition file of service arrangement based on the generated logic flow definition file. The implementation method can solve the problems of long time and low efficiency in constructing the service arrangement process due to complex coding grammar rules and long content.

Description

Service arrangement data processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing service orchestration data, an electronic device, and a storage medium.
Background
With the development of micro-service technology and the complication of business scenarios, a complex business scenario may involve the invocation of multiple services and various types of logic, so that service orchestration technology is gradually emerging to set the logic of service execution by building a service orchestration flow. In the prior art, service arrangement is usually realized by adopting a coding mode, namely manual coding by developers, but in the coding realization mode, as the coding grammar rule is complex and the content is long, the time for constructing the service arrangement flow is long and the efficiency is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for processing service orchestration data, which can solve the problems of a complex coding syntax rule and a long content in a coding implementation manner, resulting in a long time spent on constructing a service orchestration flow and a low efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, a method for processing service orchestration data is provided.
The processing method of the service arrangement data comprises the following steps: responding to a generation instruction of service arrangement, acquiring graph data corresponding to the generation instruction so as to identify a plurality of components in the graph data and a connection sequence between the components; reading a starting component in the plurality of components, and inquiring a first component connected by the starting component according to the connection sequence; querying a second component matched with the first component from the plurality of components, determining the components with connection sequence between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters; inquiring a third component connected with the second component from the plurality of components, updating the third component to be a new first component in response to the third component not being an end component, and executing the operation of generating the logic flow definition file; and in response to the third component being an end component or an execution-to-end component, calling a preset file generation model to generate a target flow definition file of the service arrangement based on the generated logic flow definition file.
In one embodiment, querying a second component from the plurality of components that matches the first component comprises:
in response to the first component being a logical component, querying the plurality of components for a second component that matches the first component;
responding to the fact that the first component is not a logic component, obtaining component parameters of the first component, generating a corresponding data structure file, and updating the first component to be a second component;
generating, by the server, a target process definition file of the service orchestration based on the generated logic process definition file, including:
and generating a target process definition file of the service arrangement based on the generated logic process definition file and the data structure file.
In another embodiment, obtaining component parameters of the first component and generating a corresponding data structure file comprises:
calling a preset HTTP (Hyper Text Transfer Protocol) data structure template, acquiring the component parameters of the first component, filling the component parameters into the data structure template, and generating a corresponding data structure file.
In another embodiment, before the generating instructions in response to service orchestration, further comprising:
responding to a graph generation instruction of the service arrangement, and displaying an initialized graph interface;
receiving a first input instruction, and acquiring a connection relation between components in the first input instruction;
receiving a second input instruction, and acquiring component parameters corresponding to each component in the second instruction;
and generating the service layout graph data based on the connection relation between the components in the first input instruction and the component parameters in the second input instruction.
In yet another embodiment, the displaying an initialized graphical interface comprises:
and acquiring a graph identifier in the graph generation instruction, and inquiring historical graph data corresponding to the graph identifier from a historical record of the graph data so as to display the historical graph data in a graphical interface.
In another embodiment, determining the components with the connection order between the first component and the second component to obtain the corresponding component parameters, and generating the logic flow definition file based on the component parameters includes:
determining a connecting component which is located between the first component and the second component in a connecting sequence and corresponds to the logical branch based on the logical branch corresponding to the first component, so as to obtain component data of the connecting component, and generate a definition file corresponding to the logical branch;
and acquiring a corresponding logic assembly model based on the logic type of the first assembly so as to assemble the definition file to obtain a logic flow definition file.
In yet another embodiment, the first component is a judgment logic component;
acquiring the component data of the connecting component to generate a definition file corresponding to the logical branch, including:
acquiring component data of the connecting component to determine a conditional expression of each judgment branch corresponding to the judgment logic component, and generating an instance of each judgment branch;
and generating a corresponding definition file based on the example of each judgment branch.
In another embodiment, invoking a preset file generation model to generate the process definition file of the service orchestration based on the data structure file and the logic process definition file comprises:
determining a serial execution sequence of the data structure file and the logic flow definition file based on the connection sequence;
and assembling the data structure file and the logic flow definition file based on the serial execution sequence to generate the flow definition file of the service arrangement.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a processing apparatus for service orchestration data.
The processing device for service arrangement data of the embodiment of the invention comprises: the acquisition unit is used for responding to a generation instruction of service arrangement, acquiring the graph data corresponding to the generation instruction so as to identify a plurality of components in the graph data and a connection sequence between the components; the query unit is used for reading a starting component in the plurality of components and querying a first component connected with the starting component according to the connection sequence; the processing unit is used for inquiring a second component matched with the first component from the plurality of components, determining the components with the connection sequence between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters; the processing unit is further configured to query a third component connected to the second component from the multiple components, update the third component to a new first component in response to the third component not being an end component, and execute the operation of generating the logic flow definition file; and the generating unit is used for responding to the condition that the third component is an ending component or an execution-to-ending component, calling a preset file generating model, and generating the target process definition file of the service arrangement based on the generated logic process definition file.
In an embodiment, the processing unit is specifically configured to:
in response to the first component being a logical component, querying the plurality of components for a second component that matches the first component;
responding to the fact that the first assembly is not a logic assembly, acquiring assembly parameters of the first assembly, generating a corresponding data structure file, and updating the first assembly to be a second assembly;
the generating unit is specifically configured to:
and generating a target process definition file of the service arrangement based on the generated logic process definition file and the data structure file.
In another embodiment, the processing unit is specifically configured to:
and calling a preset HTTP data structure template to obtain the component parameters of the first component, filling the component parameters in the data structure template, and generating a corresponding data structure file.
In yet another embodiment, the apparatus further comprises:
the display unit is used for responding to the graph generation instruction of the service arrangement and displaying the initialized graph interface;
the acquisition unit is further used for receiving a first input instruction and acquiring the connection relation between the components in the first input instruction;
the acquiring unit is further configured to receive a second input instruction, and acquire component parameters corresponding to components in the second instruction;
the generating unit is further configured to generate the service layout graph data based on the connection relationship between the components in the first input instruction and the component parameters in the second input instruction.
In another embodiment, the display unit is specifically configured to:
and acquiring a graph identifier in the graph generation instruction, and inquiring historical graph data corresponding to the graph identifier from a historical record of the graph data so as to display the historical graph data in a graphical interface.
In another embodiment, the processing unit is specifically configured to:
determining a connecting component which is located between the first component and the second component in a connecting sequence and corresponds to the logical branch based on the logical branch corresponding to the first component, so as to obtain component data of the connecting component, and generate a definition file corresponding to the logical branch;
and acquiring a corresponding logic assembly model based on the logic type of the first assembly so as to assemble the definition file to obtain a logic flow definition file.
In yet another embodiment, the first component is a judgment logic component;
the processing unit is specifically configured to:
acquiring component data of the connecting component to determine a conditional expression of each judgment branch corresponding to the judgment logic component, and generating an instance of each judgment branch;
and generating a corresponding definition file based on the example of each judgment branch.
In another embodiment, the generating unit is specifically configured to:
determining a serial execution sequence of the data structure file and the logic flow definition file based on the connection sequence;
and assembling the data structure file and the logic flow definition file based on the serial execution sequence to generate the flow definition file of the service arrangement.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing the service orchestration data provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, which, when executed by a processor, implements a processing method of service orchestration data provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, the graphic data arranged by the service is stored in advance, and when a generation instruction is responded, the graphic data can be acquired, so that the connection relation between the components in the graphic data is obtained; in the embodiment of the invention, the components can be sequentially processed according to the connection sequence of the components from the beginning of the components, each component is taken as a first component, a second component matched with the first component is firstly inquired, and the component parameters of the components connected between the first component and the second component are used for generating a corresponding logic flow definition file; after the component processing is completed, a preset file generation model may be invoked to generate a process definition file for the service orchestration based on the generated logical process definition file. In the embodiment of the invention, the flow definition file of the service arrangement can be automatically generated based on the graphic data of the service arrangement, so that professional developers are not required to encode the service arrangement, the time for constructing the service arrangement flow is greatly simplified, and the efficiency for constructing the service arrangement flow is improved. In addition, in the embodiment of the invention, when the service arrangement is updated, the graphic data can be updated, and then the updated process definition file is generated based on the updated graphic data, so that developers do not need to encode the service arrangement again, the updating time of the service arrangement process is simplified, and the updating efficiency of the service arrangement process is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a display diagram of a graphical interface according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a main flow of a processing method of service orchestration data according to an embodiment of the invention;
FIG. 3 is a schematic diagram of another main flow of a processing method of service orchestration data according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main elements of a service orchestration data processing device according to an embodiment of the invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
The embodiment of the invention provides a processing system of service arrangement data, which can be used for processing a scene of service arrangement. And in particular to a scenario that can be used to generate a flow definition file from service-orchestrated graphical data.
In the embodiment of the present invention, the processing system for service orchestration data may include a client and a server. The client side can comprise a display device, the display device can be used for displaying a graphical interface of the service arrangement, a user can input graphical data of the service arrangement through the graphical interface, and the graphical data of the service arrangement can be sent to the server side for storage after being obtained by the client side. The service end can generate a process definition file of service arrangement based on the stored graphic data, the process definition file of service arrangement reflects the execution process of the service, and the process definition file based on service arrangement can be registered to the service end of the engine so as to run the process definition file through the service end of the engine and realize the service execution process in the service arrangement corresponding to the service scene, thereby realizing the service processing in the service scene.
In the embodiment of the present invention, the image data of the service layout includes a plurality of components, connection relationships between the components, and component data of the components. The user may enter graphical data for the service orchestration through a graphical interface displayed by the client. FIG. 1 is a schematic diagram of a graphical interface. As shown in fig. 1, the graphical interface includes a component list in the left part, a graphical design interface for service orchestration in the middle part, and a component parameter configuration interface in the right part. When a user designs a graph arranged by the service, the user can select a required component from a left component list of the graphical interface, drag the component to the middle graphical design interface, add connection relations to the components, and when the user drags or selects a non-logical component in the graph, the right side of the graphical interface can display component data configuration data of the component, so that the user can input the component data of the component.
In particular, the components may include logical components and non-logical components. The logic components may represent a logical relationship between services, and the logical relationship may include parallel, serial, and judgment, and a connection relationship between the components may represent a serial logic between the components, so in this embodiment of the present invention, the logic components may include a parallel logic component and a judgment logic component, and each logic component generally appears in pairs to represent the beginning and the end of executing the logical relationship. For example, the parallel logic component may include parallel (FORK), parallel aggregation (FORK-JOIN), conditional (cancellation), and conditional aggregation (cancellation-JOIN), wherein parallel and parallel aggregations are a pair that match each other, parallel represents the beginning of parallel logic, and parallel aggregations represent the end of parallel logic; the condition and the condition aggregation are a pair matching each other, the condition indicating the start of the conditional branch logic, and the condition aggregation indicating the end of the conditional branch logic. The non-logical components may include atomic service components, data components, function components, API (Application Programming Interface) components. The atomic service component is used for representing a non-resolvable basic service unit which forms the application, and specifically can be an algorithm model service unit; the data component is used for simulating various data sources, can be connected with the data sources and executes corresponding code statements according to the configured component parameters; the function component represents a function hosting computing service based on event driving, can be specifically realized by an open source framework (OpenFaaS), and realizes data processing of corresponding services by configuring a Python (computer programming language) script; the API component may represent an API service provided by a third party.
It should be noted that the logic component may further include a start component and an end component for indicating the start and end of the service orchestration.
In the embodiment of the invention, the non-logic component can provide services to the outside in the form of HTTP, so that parameters required by HTTP requests are configured for the components in the component data configuration, thus not only ensuring the consistency of the data structures of the components, but also being convenient to adapt to the bottom data structure of the layout engine.
Specifically, in this embodiment of the present invention, an HTTP data structure template of a component may be preset, and component data that needs to be configured in the component data is displayed in a graphical interface, for example, the component data may include a group name, an API interface, interface information (such as an HTTP path, a port, and a request manner), a requested header, a query, a body, output information, policy information for timeout or retry, and the like.
In the embodiment of the invention, after the client obtains the graphic data, the graphic data can be sent to the server, and then the server generates the flow definition file of service arrangement based on the graphic data.
An embodiment of the present invention provides a method for processing service orchestration data, where the method is executable by a system for processing service orchestration data, and as shown in fig. 2, the method includes:
s201: and responding to the generation instruction of the service arrangement, acquiring the graph data corresponding to the generation instruction to identify a plurality of components in the graph data and the connection sequence among the components.
The generation instruction of the service arrangement can be input by a user or automatically triggered by a set trigger program. Specifically, the generation instruction may be sent to the server by the client after being input by the client, or may be triggered by the server through a trigger program, for example, after the client receives a publishing operation of a user on service arrangement, the generation instruction may be sent to the server, and after the server receives the publishing operation, the generation instruction is triggered. When the server stores the graphic data of each service arrangement, the mapping relationship between the graphic data and the service arrangement identifier can be established, so that the generated instruction in the step can comprise the service arrangement identifier, and the server can acquire the service arrangement identifier in the generated instruction and further acquire the graphic data corresponding to the service arrangement based on the mapping relationship. The graphic data comprises a plurality of components arranged by services and the connection relation among the components, so that the connection sequence among the components and the components in the graphic data can be identified after the graphic data is obtained.
It should be noted that, in the embodiment of the present invention, the graphic data is pre-stored, and specifically, may be generated by a client. So before this step is performed, it is also possible to: responding to a graph generation instruction of service arrangement, and displaying an initialized graph interface; receiving a first input instruction, and acquiring a connection relation between components in the first input instruction; receiving a second input instruction, and acquiring component parameters corresponding to each component in the second instruction; and generating service layout graph data based on the connection relation between the components in the first input instruction and the component parameters in the second input instruction.
The graphical generation instruction of the service arrangement can be input by a user, and the graphical interface can be displayed after being initialized, so that the user can design the service arrangement graph through the graphical interface. The first input instruction is used for indicating the connection relation between the components included in the graphic data, and after the client of the processing system receives the first input instruction, the connection relation between the components in the first input instruction can be displayed in the image design interface, so that a user can adjust the graphic conveniently. The user can further input a second input instruction, the second input instruction is used for configuring component data for the component, and after the first input instruction and the second input instruction are received, the graphical data of the service arrangement can be generated.
It should be noted that, in the embodiment of the present invention, each of the first input instruction and the second input instruction may include a plurality of instructions. The graphical data used for inputting service arrangement through the graphical interface can be stored in a database through storage, namely persistence, and the stored graphical data can be called a historical record of the graphical data. When a subsequent user needs to view or update the stored historical graphic data, the corresponding historical graphic data can be inquired from the historical records of the graphic data based on the graphic identification.
In some embodiments, the user may further update the historical graphic data, so that after responding to the graphic generation instruction arranged by the service, the user may further obtain a graphic identifier in the graphic generation instruction, where the graphic identifier may be a preset identifier uniquely identifying the graphic data, and query may be performed from a historical record of the graphic data based on the graphic identifier to query the historical graphic data corresponding to the graphic identifier, and display the historical graphic data in the graphical interface.
S202: and reading a starting component in the plurality of components, and inquiring the first component connected by the starting component according to the connection sequence.
Wherein the start component indicates the start of the service orchestration, so in the embodiment of the present invention, the processing is started from the start component of the graphics data. The connection relationship between the components is directional, which generally represents the flow direction of data processing during service execution, so that in this step, the next component corresponding to the starting component can be queried based on the connection order, that is, the component is determined as the first component.
S203: and querying a second component matched with the first component from the plurality of components, determining the components with the connection sequence between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters.
The logical components represent logical relationships among the components, do not represent specific services, and since the logical components usually appear in pairs, a second component matched with a first component can be queried from the components included in the graphic data, specifically, a first component matched with the first component after the first component is searched based on a connection order is the second component, for example, if the first component is parallel, the second component is parallel aggregation. After the second component is queried, the components connected between the first component and the second component can be determined, and the components are the logical relations represented by the execution of the first component, so that the components with the connection sequence between the first component and the second component can be determined to obtain the corresponding component parameters, and the logical flow definition file corresponding to the first component is generated.
Specifically, the logic component usually corresponds to a plurality of branches, for example, the parallel component may include at least two parallel branches, and the determining component may include two conditional branches, so that the generating of the logic flow definition file in this step may be specifically executed as: determining a connecting component corresponding to the logic branch between the first component and the second component based on the logic branch corresponding to the first component to obtain component data of the connecting component so as to generate a definition file corresponding to the logic branch; and acquiring a corresponding logic assembly model based on the logic type of the first assembly so as to assemble the definition file and obtain a logic flow definition file.
Each component may generate a task definition for the component based on the component data, i.e., building the various types of parameters that are required for each component to perform an HTTP request. And then the task definitions of the components in each logic branch can generate definition files corresponding to the logic branches based on the combination of the connection relations, and then the definition files are assembled based on the logic types expressed by the first components to generate logic flow definition files. In the embodiment of the invention, the corresponding logic assembly model is configured for each logic type, so that the definition file of each logic branch can be assembled through the logic assembly model.
It should be noted that, for a judgment logic component, each branch of the judgment logic component usually corresponds to a judgment condition, so that for each branch of the judgment logic component, after component data of a connection component needs to be acquired, a condition expression of the judgment logic component corresponding to each judgment branch is determined first to obtain an instance (case) of each judgment branch, and then a corresponding definition file is generated based on the instance of each judgment branch.
It should be noted that the logical component represents a logical relationship between components, and does not represent a specific service, but for a non-logical component, it may generally represent a specific service, so before this step is performed, it may also be determined whether the first component is a logical component. In the case that the first component is a logic component, the processing procedure in this step can be directly executed; in the case that the first component is not a logical component, it indicates that it corresponds to a specific service, so the component parameters of the first component can be acquired to generate a corresponding data structure file. Specifically, a data structure template may be set to generate a data structure file through the data structure template. Specifically, in the embodiment of the present invention, each non-logic component may provide a service in the form of an HTTP request, so that the data structure template may specifically be an HTTP data structure template, and therefore, in this step, a preset HTTP data structure template may be called to obtain the component parameters of the first component, so as to fill the component parameters in the data structure template, and generate the corresponding data structure file. In this case, if the first component is not a logical component, the first component may be updated to the second component in order to perform the next process after the corresponding data structure file is generated.
When the first component is a logic component, the components between the first component and the second component are processed completely, so that the subsequent components after the second component can be further processed, and the next component connected with the second component can be inquired based on the connection sequence, namely, the next component is determined to be a target component; when the first component is not a logical component, after the first component is processed, the components after the first component are further processed, so that the next component connected with the first component can be queried based on the connection order, that is, the next component is determined to be the target component. In both cases, the target component is determined, i.e. the component to be processed next.
S204: and inquiring a third component connected with the second component from the plurality of components, updating the third component to be a new first component in response to the fact that the third component is not the ending component, and executing the operation of generating the logic flow definition file.
After the third component is obtained, it may be determined whether the third component is an end component. If the third component is the end component, it indicates that the processing of the component in the graphic data is completed, i.e. the operation of step S203 may not be performed on the third component; if the third component is not the end component, which indicates that the processing of the component in the graphics data is not completed, the third component may be updated to be the new first component to execute the processing flow in step S203.
S205: and in response to the third component being the ending component or executing to the ending component, calling a preset file generation model to generate a target flow definition file of the service arrangement based on the generated logic flow definition file.
In step S204, after the third data is determined to be the end component, the processing of the components in the graphic data is completed, that is, each logic flow definition file is obtained, so that in this step, the file generation model may be called to generate the flow definition file for service arrangement.
In some embodiments, in the case that the plurality of components include a logic component and a non-logic component, a logic flow definition file corresponding to the logic component and a data structure file corresponding to the non-logic component may be generated, so that in this step, the file generation model may be invoked to generate a flow definition file for service orchestration based on the generated logic flow definition file and data structure file.
Specifically, because each parallel logic relationship and logic relationship judging component in the graphic data generates a corresponding logic flow definition file as a whole, and a component without the parallel logic relationship and the logic relationship judging component generates a corresponding data structure file, the generated data structure file and the logic flow definition file are in a serial logic relationship, so that the serial execution sequence of the data structure file and the logic flow definition file can be determined based on the connection sequence in the step; the data structure file and the logic flow definition file are assembled in serial execution order to generate a service orchestration flow definition file.
In the embodiment of the invention, the process definition file of the service arrangement can be automatically generated based on the graphic data of the service arrangement, so that professional developers are not required to encode the service arrangement, the time for constructing the service arrangement process is greatly simplified, and the efficiency for constructing the service arrangement process is improved. In addition, in the embodiment of the invention, when the service arrangement is updated, the graphic data can be updated, and then the updated process definition file is generated based on the updated graphic data, and developers do not need to encode the service arrangement again, so that the time for updating the service arrangement process is simplified, and the efficiency for updating the service arrangement process is improved.
The following describes, in conjunction with the embodiment shown in fig. 3, a method for processing service orchestration data according to an embodiment of the present invention, where as shown in fig. 3, the method includes:
s301: and displaying the initialized graphical interface in response to the graphical generation instruction of the service layout.
S302: receiving a first input instruction, and acquiring a connection relation between components in the first input instruction; and receiving a second input instruction, and acquiring component parameters corresponding to each component in the second instruction.
S303: and generating service layout graphic data based on the connection relation between the components in the first input instruction and the component parameters in the second input instruction.
S304: and responding to the generation instruction of the service arrangement, acquiring the graph data corresponding to the generation instruction to identify a plurality of components in the graph data and the connection sequence among the components.
S305: and reading a starting component in the components, and querying a first component connected by the starting component according to the connection sequence.
S306: judging whether the first component is a logic component, if so, executing step S307; if not, go to step S308.
S307: and querying a second component matched with the first component from the components to determine the components with the connection sequence between the first component and the second component, so as to obtain corresponding component parameters and generate a corresponding logic flow definition file.
S308: acquiring the component parameters of the first component, generating a corresponding data structure file, and updating the first component into the second component.
S309: querying a third component connected with the second component from the plurality of components, judging whether the third component is an ending component, and if so, executing the step S310; if not, the third component is updated to be the new first component, and step S306 is executed.
S310: and calling a preset file generation model to generate a process definition file of service arrangement based on the data structure file and the logic process definition file.
It should be noted that the data processing principle in the embodiment of the present invention is the same as the corresponding data principle in the embodiment shown in fig. 2, and is not described herein again.
In the embodiment of the invention, the flow definition file of the service arrangement can be automatically generated based on the graphic data of the service arrangement, so that professional developers are not required to encode the service arrangement, the time for constructing the service arrangement flow is greatly simplified, and the efficiency for constructing the service arrangement flow is improved. In addition, in the embodiment of the invention, when the service arrangement is updated, the graphic data can be updated, and then the updated process definition file is generated based on the updated graphic data, and developers do not need to encode the service arrangement again, so that the time for updating the service arrangement process is simplified, and the efficiency for updating the service arrangement process is improved.
In order to solve the problems in the prior art, an embodiment of the present invention provides a processing apparatus 400 for service orchestration data, as shown in fig. 4, where the apparatus 400 includes:
an obtaining unit 401, configured to, in response to a generation instruction of service orchestration, obtain graphics data corresponding to the generation instruction to identify multiple components in the graphics data and a connection order between the components;
a querying unit 402, configured to read a starting component in the multiple components, and query a first component connected by the starting component according to the connection order;
a processing unit 403, configured to query a second component matching the first component from the multiple components, determine a component having a connection order between the first component and the second component to obtain a corresponding component parameter, and generate a logic flow definition file based on the component parameter;
the processing unit 403 is further configured to query a third component connected to the second component from the multiple components, update the third component to a new first component in response to the third component not being an end component, and execute the above operation of generating a logic flow definition file;
a generating unit 404, configured to, in response to that the third component is an end component or an execution-to-end component, invoke a preset file generation model to generate a target flow definition file of the service orchestration based on the generated logic flow definition file.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 2, and the description thereof is omitted.
In an embodiment, the processing unit 403 is specifically configured to:
in response to the first component being a logical component, querying the plurality of components for a second component that matches the first component;
responding to the fact that the first component is not a logic component, obtaining component parameters of the first component, generating a corresponding data structure file, and updating the first component to be a second component;
the generating unit 404 is specifically configured to:
and generating a target process definition file of the service arrangement based on the generated logic process definition file and the data structure file.
In another embodiment, the processing unit 403 is specifically configured to:
and calling a preset HTTP data structure template to obtain the component parameters of the first component, filling the component parameters into the data structure template, and generating a corresponding data structure file.
In yet another embodiment, the apparatus 400 further comprises:
the display unit is used for responding to the graph generation instruction of the service arrangement and displaying the initialized graph interface;
the obtaining unit 401 is further configured to receive a first input instruction, and obtain a connection relationship between components in the first input instruction;
the obtaining unit 401 is further configured to receive a second input instruction, and obtain component parameters corresponding to components in the second instruction;
the generating unit 404 is further configured to generate the service layout graph data based on the connection relationship between the components in the first input instruction and the component parameters in the second input instruction.
In another embodiment, the display unit is specifically configured to:
and acquiring a graph identifier in the graph generation instruction, and inquiring historical graph data corresponding to the graph identifier from a historical record of the graph data so as to display the historical graph data in a graphical interface.
In another embodiment, the processing unit 403 is specifically configured to:
determining a connecting component which is located between the first component and the second component in a connecting sequence and corresponds to the logical branch based on the logical branch corresponding to the first component, so as to obtain component data of the connecting component, and generate a definition file corresponding to the logical branch;
and acquiring a corresponding logic assembly model based on the logic type of the first assembly so as to assemble the definition file to obtain a logic flow definition file.
In yet another embodiment, the first component is a judgment logic component;
the processing unit 403 is specifically configured to:
acquiring component data of the connecting component to determine a conditional expression of each judgment branch corresponding to the judgment logic component, and generating an instance of each judgment branch;
and generating a corresponding definition file based on the example of each judgment branch.
In another embodiment, the generating unit 404 is specifically configured to:
determining a serial execution sequence of the data structure file and the logic flow definition file based on the connection sequence;
and assembling the data structure file and the logic flow definition file based on the serial execution sequence to generate the flow definition file of the service arrangement.
It should be understood that the embodiment of the present invention is implemented in the same manner as the embodiment shown in fig. 2 or fig. 3, and is not repeated herein.
In the embodiment of the invention, the process definition file of the service arrangement can be automatically generated based on the graphic data of the service arrangement, so that professional developers are not required to encode the service arrangement, the time for constructing the service arrangement process is greatly simplified, and the efficiency for constructing the service arrangement process is improved. In addition, in the embodiment of the invention, when the service arrangement is updated, the graphic data can be updated, and then the updated process definition file is generated based on the updated graphic data, and developers do not need to encode the service arrangement again, so that the time for updating the service arrangement process is simplified, and the efficiency for updating the service arrangement process is improved.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic device of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the method for processing service orchestration data according to the embodiments of the present invention.
Fig. 5 illustrates an exemplary system architecture 500 of a processing method of service orchestration data or a processing apparatus of service orchestration data to which an embodiment of the invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. Various client applications may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be, but are not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, and the server may analyze and process data such as a received product information query request, and feed back a processing result (for example, product information — just an example) to the terminal device.
It should be noted that the method for processing the service layout data provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the processing device for the service layout data is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that the computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a query unit, a processing unit, and a generation unit. Where the names of these units do not in some cases constitute a limitation of the unit itself, for example, the acquisition unit may also be described as a "unit of the graphic data acquisition function".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method for processing service orchestration data provided by the present invention.
As another aspect, the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the method for processing service orchestration data according to the embodiments of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for processing service orchestration data, comprising:
responding to a generation instruction of service arrangement, acquiring graph data corresponding to the generation instruction so as to identify a plurality of components in the graph data and a connection sequence between the components;
reading a starting component in the plurality of components, and inquiring a first component connected by the starting component according to the connection sequence;
querying a second component matched with the first component from the plurality of components, determining the components with connection sequence between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters;
inquiring a third component connected with the second component from the plurality of components, updating the third component to be a new first component in response to the third component not being an end component, and executing the operation of generating the logic flow definition file;
and responding to the third component as an end component or an execution-to-end component, and calling a preset file generation model to generate a target flow definition file of the service arrangement based on the generated logic flow definition file.
2. The method of claim 1, wherein querying a second component from the plurality of components that matches the first component comprises:
in response to the first component being a logical component, querying the plurality of components for a second component that matches the first component;
responding to the fact that the first assembly is not a logic assembly, acquiring assembly parameters of the first assembly, generating a corresponding data structure file, and updating the first assembly to be a second assembly;
generating, by the server, a target process definition file of the service orchestration based on the generated logic process definition file, including:
and generating a target process definition file of the service arrangement based on the generated logic process definition file and the data structure file.
3. The method of claim 2, wherein obtaining component parameters of the first component and generating a corresponding data structure file comprises:
and calling a preset HTTP data structure template to obtain the component parameters of the first component, filling the component parameters in the data structure template, and generating a corresponding data structure file.
4. The method of claim 1, prior to the generating instructions in response to the service orchestration, further comprising:
responding to a graph generation instruction of the service arrangement, and displaying an initialized graph interface;
receiving a first input instruction, and acquiring a connection relation between components in the first input instruction;
receiving a second input instruction, and acquiring component parameters corresponding to each component in the second instruction;
and generating the service layout graph data based on the connection relation between the components in the first input instruction and the component parameters in the second input instruction.
5. The method of claim 4, wherein displaying the initialized graphical interface comprises:
and acquiring a graph identifier in the graph generation instruction, and inquiring historical graph data corresponding to the graph identifier from a historical record of the graph data so as to display the historical graph data in a graphical interface.
6. The method of claim 1, wherein determining the components with connection order between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters comprises:
determining a connecting component which is located between the first component and the second component in a connecting sequence and corresponds to the logical branch based on the logical branch corresponding to the first component, so as to obtain component data of the connecting component, and generate a definition file corresponding to the logical branch;
and acquiring a corresponding logic assembly model based on the logic type of the first assembly so as to assemble the definition file to obtain a logic flow definition file.
7. The method of claim 6, wherein the first component is a decision logic component;
acquiring the component data of the connecting component to generate a definition file corresponding to the logical branch, including:
acquiring component data of the connecting component to determine a conditional expression of each judgment branch corresponding to the judgment logic component, and generating an instance of each judgment branch;
and generating a corresponding definition file based on the example of each judgment branch.
8. A processing apparatus for service orchestration data, comprising:
the acquisition unit is used for responding to a generation instruction of service arrangement, acquiring the graph data corresponding to the generation instruction so as to identify a plurality of components in the graph data and a connection sequence between the components;
the query unit is used for reading a starting component in the plurality of components and querying a first component connected with the starting component according to the connection sequence;
the processing unit is used for inquiring a second component matched with the first component from the plurality of components, determining the components with the connection sequence between the first component and the second component to obtain corresponding component parameters, and generating a logic flow definition file based on the component parameters;
the processing unit is further configured to query a third component connected to the second component from the multiple components, update the third component to a new first component in response to the third component not being an end component, and execute the operation of generating the logic flow definition file;
and the generating unit is used for responding to the condition that the third component is an ending component or an execution-to-ending component, calling a preset file generating model, and generating the target process definition file of the service arrangement based on the generated logic process definition file.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202210380675.8A 2022-04-12 2022-04-12 Service arrangement data processing method and device, electronic equipment and storage medium Pending CN114675820A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210380675.8A CN114675820A (en) 2022-04-12 2022-04-12 Service arrangement data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210380675.8A CN114675820A (en) 2022-04-12 2022-04-12 Service arrangement data processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114675820A true CN114675820A (en) 2022-06-28

Family

ID=82078937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210380675.8A Pending CN114675820A (en) 2022-04-12 2022-04-12 Service arrangement data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114675820A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774573A (en) * 2023-02-10 2023-03-10 美云智数科技有限公司 Application integration method and device, electronic equipment and storage medium
CN116107549A (en) * 2023-04-13 2023-05-12 成都新希望金融信息有限公司 Logic arrangement and change service logic processing method, system and storage medium
CN116132513A (en) * 2023-02-24 2023-05-16 重庆长安汽车股份有限公司 Method, device, equipment and storage medium for updating parameters of service arrangement

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115774573A (en) * 2023-02-10 2023-03-10 美云智数科技有限公司 Application integration method and device, electronic equipment and storage medium
CN116132513A (en) * 2023-02-24 2023-05-16 重庆长安汽车股份有限公司 Method, device, equipment and storage medium for updating parameters of service arrangement
CN116132513B (en) * 2023-02-24 2024-04-19 重庆长安汽车股份有限公司 Method, device, equipment and storage medium for updating parameters of service arrangement
CN116107549A (en) * 2023-04-13 2023-05-12 成都新希望金融信息有限公司 Logic arrangement and change service logic processing method, system and storage medium
CN116107549B (en) * 2023-04-13 2023-06-23 成都新希望金融信息有限公司 Logic arrangement and change service logic processing method, system and storage medium

Similar Documents

Publication Publication Date Title
CN114675820A (en) Service arrangement data processing method and device, electronic equipment and storage medium
US10860398B2 (en) Adapting legacy endpoints to modern APIs
CN108846753B (en) Method and apparatus for processing data
CN110808855B (en) Internet technology architecture, management method and device, electronic equipment and medium
US11366704B2 (en) Configurable analytics for microservices performance analysis
CN108733527B (en) System, method and apparatus for testing server functionality
CN115509522A (en) Interface arranging method and system for low-code scene and electronic equipment
CN111125503B (en) Method and apparatus for generating information
CN112699111B (en) Report generation method and device, electronic equipment and computer readable medium
CN111787041B (en) Method and device for processing data
CN109462491B (en) System, method and apparatus for testing server functionality
CN115858905A (en) Data processing method and device, electronic equipment and storage medium
CN112052152A (en) Simulation test method and device
CN114625458A (en) Page data processing method and device, electronic equipment and storage medium
CN111124523A (en) Method and apparatus for initializing applications
CN113312900A (en) Data verification method and device
CN112596729A (en) Target application interface generation method and device, readable medium and electronic equipment
CN111078230A (en) Code generation method and device
CN111414566A (en) Method and device for pushing information
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN116126317A (en) Service code, service state flow chart generation method and device
CN118331970A (en) Icon data processing method and device, electronic equipment and storage medium
CN114356397A (en) Data processing method, device and equipment based on service grid and storage medium
CN113626027A (en) Application code processing method and device, electronic equipment and storage medium
CN117149633A (en) Script processing method, script processing device, electronic equipment and storage medium

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