Streaming processing-based function and service fusion scheduling method and device
By decompiling and service-oriented processing of function packages, combined with streaming processing, the integrated scheduling of functions and general services is realized, solving the problem that functions cannot directly provide capabilities and improving the convenience of calling and the flexibility of scheduling.
Patent Information
- Application Number
- CN202411102334.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-12
AI Technical Summary
In existing technologies, functions cannot directly provide capabilities to the outside world and must be manually encapsulated into services. There is a lack of joint scheduling methods for functions and general services, as well as a lack of real-time debugging and testing mechanisms.
By decompiling the function package, extracting function metadata, forming a function tree, and performing service-oriented processing on the target function, combined with streaming processing for scheduling, the fusion scheduling of function services and general services is achieved.
This approach enables direct service-oriented functionality, simplifies the encapsulation process, enhances the convenience of invocation and the flexibility of service integration and scheduling, and solves the problem that functions cannot directly provide capabilities.
Smart Images

Figure CN118972455A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for scheduling function and service fusion based on streaming processing. Background Art
[0002] At present, in software industry applications, the provision of system services is often protocol-oriented, such as HTTP, HTTPS, SOCKET, DUBBO, TARS, etc. This protocol is very suitable for interaction between Client and Server, and has various advantages such as short transmission time and high security. However, its disadvantages are also very obvious. Among them, the high development difficulty and the need to parse the transmitted data make many occasions unsuitable for protocol-based software interaction.
[0003] At the same time, in most scenarios, methods within a service also need to provide capabilities to the outside. However, since the methods are JVM-level or native-level oriented, there is no better way to directly provide capabilities to the outside. Instead, the methods still have to be manually encapsulated into services and then provided to the outside in the form of services.
[0004] The existing software function services and fusion methods have the following main defects: 1) The method based on direct back-end configuration is prone to errors in function metadata, which leads to a high threshold and poor application effect; 2) In the software development process, functions are basically regarded as internal execution and are rarely used to directly provide services to the outside world. When services are needed, they are also provided through various protocols; 3) In the current software implementation process, there is basically no method for jointly scheduling general services and functional services, and there is even less scenario for directly using the combined services formed; 4) There is currently no application that directly schedules general services and functional services through streaming processing. Generally, the method is to package functions into services and then schedule services; 5) There is currently no application that assembles general services and functional services into an overall service and performs real-time scheduling, real-time inspection, debugging and testing.
[0005] With regard to the problem in the above-mentioned related technologies that, because the functions are JVM-level or native-level oriented, the functions cannot directly provide capabilities to the outside, but still need to be manually encapsulated into services and then provided to the outside in the form of services, no effective solution has been proposed yet. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for fusion scheduling of functions and services based on streaming processing, so as to at least solve the technical problem in the related technology that because the functions are oriented to the JVM level or the native level, the functions cannot directly provide capabilities to the outside, but still need to be manually encapsulated into services and then provide capabilities to the outside in the form of services.
[0007] According to one aspect of an embodiment of the present invention, a method for fusion scheduling of functions and services based on streaming processing is provided, comprising: decompiling a function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe feature information of the functions; processing the multiple functions in a tree structure based on the function metadata to obtain a function tree; responding to a selection operation of selecting the function in the function tree to determine that the function selected by the selection operation is a target function; performing service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; receiving a service call flow of the function service and a general service, wherein the general service is a service designed according to a communication protocol, and the service call flow is a call flow obtained by combining the function service and the general service by configuring the target object at the front end; responding to a service scheduling request to schedule the function service and the general service according to the service calling flow based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request scheduling of a service, and the service includes at least one of the following: the function service and the general service.
[0008] Optionally, before decompiling the function package to obtain function metadata of each function in the function package, the streaming-based function and service fusion scheduling method also includes: responding to an upload operation to receive the function package uploaded by the target object by executing the upload operation.
[0009] Optionally, the function package is decompiled to obtain function metadata of each function in the function package, including: decompiling the function package to obtain source code of class files in the function package; traversing the source code to obtain multiple functions in the source code; removing interference information in the function, wherein the interference information includes at least: code comments, non-functional code; and performing feature extraction on the function after removing the interference information to obtain the function metadata.
[0010] Optionally, after processing the function metadata in a tree structure to obtain a function tree, the streaming-based function and service fusion scheduling method further includes: transmitting the function tree to the front end so that the front end displays the function tree.
[0011] Optionally, the target function is service-oriented to obtain a function service, including: determining that the function metadata of the target function is the target function metadata; generating a service interface definition based on the target function metadata, wherein the service interface definition is used to describe the calling method of the function service; and encapsulating the target function and the service interface definition to obtain the function service.
[0012] Optionally, after encapsulating the target function and the service interface definition to obtain the function service, the streaming-based function and service fusion scheduling method further includes: registering the function service to add the function service to a service catalog.
[0013] Optionally, responding to a service scheduling request, scheduling the function service and the general service according to the service calling process based on the service scheduling request to obtain a scheduling result, including: parsing the service calling process through a streaming engine to obtain a scheduling order for the function service and the general service; scheduling the function service and the general service according to the scheduling order based on the service scheduling request to obtain a scheduling result.
[0014] Optionally, in response to a service scheduling request, the function service and the general service are scheduled according to the service calling process based on the service scheduling request to obtain a scheduling result, and the function and service fusion scheduling method based on streaming processing also includes: transmitting the scheduling result to the front end so that the front end displays the scheduling result.
[0015] According to another aspect of an embodiment of the present invention, a function and service fusion scheduling device based on streaming processing is also provided, including: a first acquisition unit, used to decompile a function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe the characteristic information of the function; a second acquisition unit, used to process the multiple functions in a tree structure based on the function metadata to obtain a function tree; a first response unit, used to respond to a selection operation of selecting the function in the function tree to determine that the function selected by the selection operation is a target function; a third acquisition unit, used to service the target function to obtain a function. A number of services, wherein the function service is a service obtained by encapsulating the function; a receiving unit, used to receive the service calling process of the function service and the general service, wherein the general service is a service designed according to the communication protocol, and the service calling process is a calling process obtained by combining the function service and the general service by configuring the target object at the front end; a second responding unit, used to respond to a service scheduling request, so as to schedule the function service and the general service according to the service calling process based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request the scheduling of the service, and the service includes at least one of the following: the function service, the general service.
[0016] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a third response unit, which is used to respond to the upload operation before decompiling the function package to obtain the function metadata of each function in the function package, so as to receive the function package uploaded by the target object by executing the upload operation.
[0017] Optionally, the first acquisition unit includes: a first acquisition module, used to decompile the function package to obtain the source code of the class file in the function package; a second acquisition module, used to traverse the source code to obtain the multiple functions in the source code; a removal module, used to remove interference information in the function, wherein the interference information includes at least: code comments, non-functional code; a third acquisition module, used to extract features of the function after removing the interference information, to obtain the function metadata.
[0018] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a transmission unit, which is used to process the function metadata in the form of a tree structure to obtain a function tree, and then transmit the function tree to the front end so that the front end displays the function tree.
[0019] Optionally, the third acquisition unit includes: a determination module, used to determine that the function metadata of the target function is the target function metadata; a generation module, used to generate a service interface definition based on the target function metadata, wherein the service interface definition is used to describe the calling method of the function service; a fourth acquisition module, used to encapsulate the target function and the service interface definition to obtain the function service.
[0020] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a registration module, which is used to register the function service after encapsulating the target function and the service interface definition to obtain the function service, so as to add the function service to the service directory.
[0021] Optionally, the second response unit includes: a fifth acquisition module, used to parse the service call process through a streaming engine to obtain a scheduling order of the function service and the general service; a sixth acquisition module, used to schedule the function service and the general service according to the scheduling order based on the service scheduling request to obtain a scheduling result.
[0022] Optionally, the function and service fusion scheduling device based on streaming processing also includes: in response to a service scheduling request, scheduling the function service and the general service according to the service calling process based on the service scheduling request, and after obtaining the scheduling result, transmitting the scheduling result to the front end so that the front end displays the scheduling result.
[0023] According to another aspect of an embodiment of the present invention, a function and service fusion scheduling system based on streaming processing is also provided, and the function and service fusion scheduling system based on streaming processing uses any of the above-mentioned function and service fusion scheduling methods based on streaming processing.
[0024] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored program, wherein the program executes any one of the above-mentioned streaming-based function and service fusion scheduling methods.
[0025] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program executes any one of the above-mentioned streaming-based function and service fusion scheduling methods when running.
[0026] According to another aspect of an embodiment of the present invention, a computer program product is provided, including computer instructions, which, when executed by a processor, execute any one of the above-mentioned streaming-based function and service fusion scheduling methods.
[0027] In an embodiment of the present invention, a function package is decompiled to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe the characteristic information of the function; based on the function metadata, the multiple functions are processed in the form of a tree structure to obtain a function tree; a selection operation for selecting a function in the function tree is responded to to determine that the function selected by the selection operation is a target function; the target function is service-oriented to obtain a function service, wherein the function service is a service obtained by encapsulating the function; a service call process of the function service and the general service is received, wherein the general service is a service designed according to a communication protocol, and the service call process is a call process obtained by combining the function service and the general service by configuring the target object at the front end; a service scheduling request is responded to to schedule the function service and the general service according to the service calling process based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request scheduling of the service, and the service includes at least one of the following: function service, general service. Through the above technical scheme, the function in the function tree selected by the user is service-oriented, so that the function is automatically encapsulated as a function service so that it can be called directly, and through the streaming engine scheduling, the call between the general service and the functional service is converted into a streaming scheduling, thereby achieving the technical effect of enabling the function to directly provide capabilities to the outside in the form of a service, simplifying the tediousness of service-oriented functions, improving the convenience of calling functions, and improving the flexibility of integrated scheduling of general services and functional services, thereby solving the technical problem in the related technology that the function is oriented to the JVM level or the native level, resulting in the inability to directly provide capabilities to the outside, but still needs to be manually encapsulated into a service and then provide capabilities to the outside in the form of a service. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0029] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for fusion scheduling of functions and services based on streaming processing according to an embodiment of the present invention;
[0030] Figure 2 is a flow chart of a method for fusion scheduling of functions and services based on streaming processing according to an embodiment of the present invention;
[0031] Figure 3 is a schematic diagram of managing function packages according to an embodiment of the present invention;
[0032] Figure 4is a schematic diagram of a generating function tree according to an embodiment of the present invention;
[0033] Figure 5 is a schematic diagram of servitizing a function according to an embodiment of the present invention;
[0034] Figure 6 is a schematic diagram of combining a function service with a general service according to an embodiment of the present invention;
[0035] Figure 7 is a schematic diagram of scheduling services through a streaming engine according to an embodiment of the present invention;
[0036] Figure 8 is a flowchart of an optional streaming-based function and service fusion scheduling method according to an embodiment of the present invention;
[0037] Fig. 9 is a schematic diagram of a function and service fusion scheduling device based on streaming processing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] As introduced in the background technology, in the related art, since the functions are oriented to the JVM level or the native level, the functions cannot directly provide capabilities to the outside, but still need to be manually encapsulated into services and then provide capabilities to the outside in the form of services. In view of the above defects, a method and device for fusion scheduling of functions and services based on streaming processing are provided in an embodiment of the present invention.
[0041] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0042] The method embodiments provided in the embodiments of the present invention can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for fusion scheduling of functions and services based on streaming processing according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0043] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the function and service fusion scheduling method based on streaming processing in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific network example may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] According to an embodiment of the present invention, a method embodiment of a function and service fusion scheduling method based on streaming processing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0045] Figure 2 is a flow chart of a method for fusion scheduling of functions and services based on streaming processing according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:
[0046] Step S202, decompile the function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe feature information of the function.
[0047] Optionally, the above function metadata may include but is not limited to: function name, parameter list (including parameter name and parameter type), function return type, etc.
[0048] In this embodiment, the traversal decompilation and analysis of the function package can be completed by a function dynamic decompilation and analysis program to obtain function metadata of multiple functions in the function package.
[0049] According to the above embodiment of the present invention, before the above step S202, that is, before decompiling the function package to obtain the function metadata of each function in the function package, the function and service fusion scheduling method based on streaming processing also includes: responding to the upload operation to receive the function package uploaded by the target object by executing the upload operation.
[0050] In this embodiment, the function package is uploaded by the R&D personnel at the front end and then transmitted to the back end for processing.
[0051] According to the above embodiment of the present invention, in the above step S202, the function package is decompiled to obtain function metadata of each function in the function package, including: decompiling the function package to obtain the source code of the class file in the function package; traversing the source code to obtain multiple functions in the source code; removing interference information in the function, wherein the interference information includes at least: code comments, non-functional code; and performing feature extraction on the function after removing the interference information to obtain function metadata.
[0052] Specifically, the traversal decompilation and analysis of the function package is completed through the function dynamic decompilation and analysis program, which specifically includes the following contents: 1) Identify the uploaded function package and manage it; 2) Decompile the function package and traverse all the functions therein; 3) Obtain function metadata based on the function, including function name, parameter name, function return type, etc.
[0053] Combine the following Figure 3 Provide detailed description of the management of function packages. Figure 3 is a schematic diagram of managing a function package according to an embodiment of the present invention, such as Figure 3 As shown, when managing function packages, the three elements of the function packages are mainly managed, which are the basis and data source for servitizing functions. Specifically, the overall management of multiple function packages and the combined management of functions in the packages can be completed through the function combiner: ① Unify the management of multiple function packages into lists and identifiable objects, etc.; ② Perform version management, overload identification, rewrite identification, etc. on multiple functions in multiple function packages; ③ Represent multiple functions in different structures.
[0054] Step S204: Process the multiple functions in a tree structure based on the function metadata to obtain a function tree.
[0055] In this embodiment, functions may be organized in a tree structure based on function metadata to form a function tree.
[0056] It should be noted that what is formed on the back end is actually a tree-shaped function structure, and the function tree is visualized by the front end.
[0057] According to the above embodiment of the present invention, after the above step S204, that is, after the function metadata is processed in the form of a tree structure to obtain a function tree, the function and service fusion scheduling method based on streaming processing also includes: transmitting the function tree to the front end so that the front end displays the function tree.
[0058] Combine the following Figure 4 The above embodiments of the present invention are described in detail. Figure 4 is a schematic diagram of a generating function tree according to an embodiment of the present invention, such as Figure 4 As shown in the figure, the tree function can be used to generate a graph to directly visualize the rule-based decompilation results of the backend in a tree structure on the front end to show them to R&D personnel.
[0059] Step S206, responding to a selection operation on a function in the function tree to determine that the function selected by the selection operation is a target function.
[0060] In this embodiment, the developer can click on the function he wants to call in the function tree displayed on the front end. After the developer clicks, the back end can respond to the selection operation of the front end to determine that the function selected by the developer is the target function.
[0061] Step S208, performing service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function.
[0062] In this embodiment, after determining the target function, the target function can be service-oriented to encapsulate the function as a service, and the obtained function service is essentially no different from a general service.
[0063] Specifically, the functions can be serviced through a tree recognition mechanism: 1) the front end performs package management to obtain the functions that need to be serviced; 2) directly operates on the tree structure to select the functions to be serviced.
[0064] In an optional embodiment of the present invention, a function running container can also be started, and the function to be executed can be virtualized into a package and started and maintained: ① The function running container is implemented based on the JVM and SpringIOC ideas; ② The function is started in the running container; ③ The state change of the function in the running container is maintained. When the function has a request change, the running container recognizes the request, restarts the corresponding function package and continues tracking.
[0065] According to the above embodiment of the present invention, in the above step S208, the target function is service-oriented to obtain a function service, including: determining the function metadata of the target function as the target function metadata; generating a service interface definition based on the target function metadata, wherein the service interface definition is used to describe the calling method of the function service; and encapsulating the target function and the service interface definition to obtain a function service.
[0066] Combine the following Figure 5 The above embodiments of the present invention are described in detail. Figure 5 is a schematic diagram of servitizing a function according to an embodiment of the present invention; Figure 5 As shown, a code generation tool can be used to automatically generate service interface definitions and encapsulation codes based on the function metadata of the target function, and then the service mesh technology can be used to handle service registration and discovery, and the CI / CD process can be used to automate testing and service deployment.
[0067] Generating the definition of the service interface specifically refers to defining the calling specifications of the service based on the metadata of the function using the selected protocol standard. The service interface definition here is the description of the calling method exposed to the outside when the function is converted into a service, which usually involves the following aspects: 1) Protocol selection: Select a protocol suitable for the service characteristics, such as RESTful API or gRPC; 2) Interface description: Define the calling method of the service using the selected protocol. For example, in RESTful API, this may involve defining the HTTP request method (GET, POST, PUT, DELETE, etc.), URL path, request and response data format, etc.; 3) Parameter mapping: Determine how to map the function parameters to the network request and how to extract the function return value from the network response; 4) Service encapsulation: Encapsulate the function into a service class, which contains the following: ① Request processing method: used to process incoming network requests, parse request data, and call the original function; ② Response generation method: used to encapsulate the function return value into a network response and send it to the client.
[0068] According to the above embodiment of the present invention, after encapsulating the target function and the service interface definition to obtain the function service, the function and service fusion scheduling method based on streaming processing also includes: registering the function service to add the function service to the service directory.
[0069] Specifically, registering a function service means registering the function service with the service discovery and registration center to add the function service to the service directory for easy discovery and calling. This usually involves: 1) Service registration information: including the service name, version, list of provided interfaces, network location, etc.; 2) Service discovery mechanism: the client uses this information to discover the service and determine how to communicate with it.
[0070] Step S210, receiving the service calling process of the function service and the general service, wherein the general service is a service designed according to the communication protocol, and the service calling process is a calling process obtained by combining the function service and the general service by configuring the target object at the front end.
[0071] Optionally, the above-mentioned general services may include but are not limited to: Hypertext Transfer Protocol (HTTP), distributed service framework (DUBBO), remote service framework (TARS), etc.
[0072] Combine the following Figure 6 The above embodiments of the present invention are described in detail. Figure 6 is a schematic diagram of combining a function service with a general service according to an embodiment of the present invention; Figure 6As shown in the figure, after the function is serviced, the function service can be visualized in the form of a block on the front end. R&D personnel can combine the function service and the general service by dragging and dropping to determine the service call process. After the front-end operation is completed, the R&D personnel will transfer the call process to the back end. It should be noted that Figure 6 In the figure, those marked with J in the upper right corner are function services, and those marked with H and D are general services.
[0073] Through the front-end service combination, general services and functional services are assembled and integrated, scheduled and used, including the following: 1) There are many ways to combine services, which can be combined based on flowcharts or snap-on structures; 2) When combining services, both functional services and general services perform parameter normalization, and the parameter headers, parameter bodies of general services and the formal parameters of functional services are standardized; 3) General services are integrated into the entire call link through protocol calls. After being service-oriented, functional services provide the ability to call external services, and their calling method is similar to that of general services. Therefore, the integration and scheduling of the two services can be directly run and completed; 4) During the integrated scheduling process, the external performance of the entire process is consistent, but the internal processing logic is an independent processing logic.
[0074] The technical solutions provided by the above steps are equivalent to building a framework that can directly call functions and integrate function services and general services for scheduling. Next, the framework can be used to output scheduling results when users have corresponding service scheduling requirements.
[0075] Step S212, respond to the service scheduling request, schedule the function service and the general service according to the service calling process based on the service scheduling request, and obtain the scheduling result, wherein the service scheduling request is used to request the scheduling of the service, and the service includes at least one of the following: function service, general service.
[0076] In this embodiment, when the front end initiates a service scheduling request, the back end will respond to the request, and schedule function services and general services in sequence according to the service call process, and transmit the scheduling results to the front end for output.
[0077] According to the above embodiment of the present invention, in the above step S212, a service scheduling request is responded to, so as to schedule function services and general services according to the service calling process based on the service scheduling request to obtain a scheduling result, including: parsing the service calling process through a streaming engine to obtain a scheduling order of function services and general services; scheduling function services and general services according to the scheduling order based on the service scheduling request to obtain a scheduling result.
[0078] Combine the following Figure 7The above embodiments of the present invention are described in detail. Figure 7 is a schematic diagram of scheduling services through a streaming engine according to an embodiment of the present invention; Figure 7 As shown, the streaming engine can be used to perform streaming processing according to the order or structure of the previous step, and the streaming engine will execute according to the combination rules, and return the execution results and time consumption data in real time.
[0079] According to the above embodiment of the present invention, after the above step S212, in response to the service scheduling request, the function service and the general service are scheduled according to the service calling process based on the service scheduling request, and after obtaining the scheduling result, the function and service fusion scheduling method based on streaming processing also includes: transmitting the scheduling result to the front end so that the front end displays the scheduling result.
[0080] Specifically, the result (ie, the scheduling result) returned by the streaming engine in real time may be transmitted to the front end so that the front end displays the result.
[0081] From the above, it can be seen that through the technical solution provided by the above embodiment of the present invention, the function package can be decompiled to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe the characteristic information of the function; based on the function metadata, the multiple functions are processed in the form of a tree structure to obtain a function tree; respond to a selection operation on a function in the function tree to determine that the function selected by the selection operation is the target function; perform service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; receive the service call process of the function service and the general service, wherein the general service is a service designed according to the communication protocol, and the service call process is the target object at the front end through configuration to connect the function service with a certain service. a calling process obtained by combining general services; responding to a service scheduling request, scheduling the function service and the general service according to the service calling process based on the service scheduling request, and obtaining a scheduling result, wherein the service scheduling request is used to request scheduling of the service, and the service includes at least one of the following: function service, general service, so as to achieve the purpose of servitizing the functions in the function tree selected by the user, so as to automatically encapsulate the functions as function services so that they can be directly called, and through the streaming engine scheduling, the call between the general service and the functional service is turned into streaming scheduling, so as to achieve the technical effect of enabling the function to directly provide capabilities to the outside in the form of service, simplifying the tediousness of servitizing the function, improving the convenience of calling the function, and improving the flexibility of integrated scheduling of general services and functional services.
[0082] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem in the related technology that the functions are oriented to the JVM level or the native level, resulting in the inability of the functions to directly provide capabilities to the outside, but still need to be manually encapsulated into services and then provide capabilities to the outside in the form of services.
[0083] Combine the following Figure 8 Another optional embodiment of the present invention is described. Figure 8 It is a flowchart of an optional streaming-based function and service fusion scheduling method according to an embodiment of the present invention.
[0084] In the above embodiment of the present invention, the front-end and back-end programs are implemented by VUE and JAVA language, and the programs include a front-end service assembler, a back-end streaming engine program, a function dynamic decompiler, a function running container program and a function dynamic assembler, etc., wherein the front-end service assembler combines functional services and general services in a variety of combinations, thereby completing a visual combination of the two services; the function dynamic decompiler scans the functions and function elements in each class in the function package through a regularized and standardized decompilation and parsing program; the function running container program provides a function running environment for function streaming processing; the function dynamic assembler completes the direct calling logic when calling functions across packages, etc.
[0085] like Figure 8 As shown, the function and service fusion scheduling method based on streaming processing specifically includes the following contents: a. The front-end and back-end implement the function package management function, which is mainly the management of the three elements of the function package; b. The back-end implements the decompilation function, including the traversal of the package, the identification of functions and function elements, and the removal of interference elements; c. The function elements of the composite specification are obtained, including the name, return type, parameters and other data; d. According to the structure of the package, a function generation tree with the function as the target is generated; e. In the front-end operation interface, the R&D personnel can choose to service the specified function; f. In the front-end operation interface, the R&D personnel can General services and functional services are combined by configuration or dragging and dropping. The combined services complete the integrated display and operation for front-end operators; g. The front-end initiates the service streaming execution command; h. The overall service is executed according to the existing execution rules. General services call the execution methods of general services, and functional services call the function execution methods. The regular execution method completes the classification and integration of general services and functional services; i. The streaming execution engine returns the execution result of the combined service; j. Before the streaming engine executes, it is necessary to synchronize the startup and maintenance of the function execution container to keep it normal.
[0086] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0088] According to an embodiment of the present invention, there is also provided a streaming-based function and service fusion scheduling device for implementing the streaming-based function and service fusion scheduling method. Fig. 9 is a schematic diagram of a function and service fusion scheduling device based on streaming processing according to an embodiment of the present invention, such as Fig. 9 As shown, the device includes: a first acquisition unit 901, a second acquisition unit 903, a first response unit 905, a third acquisition unit 907, a receiving unit 909, and a second response unit 911. The function and service fusion scheduling device based on streaming processing is described in detail below.
[0089] The first acquisition unit 901 is used to decompile the function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe feature information of the function.
[0090] The second acquisition unit 903 is used to process the multiple functions in a tree structure based on the function metadata to obtain a function tree.
[0091] The first response unit 905 is used to respond to a selection operation of selecting a function in the function tree to determine that the function selected by the selection operation is a target function.
[0092] The third acquisition unit 907 is used to perform service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function.
[0093] The receiving unit 909 is used to receive the service calling process of the function service and the general service, wherein the general service is a service designed according to the communication protocol, and the service calling process is a calling process obtained by combining the function service and the general service by configuring the target object at the front end.
[0094] The second response unit 911 is used to respond to the service scheduling request to schedule the function service and the general service according to the service calling process based on the service scheduling request to obtain the scheduling result, wherein the service scheduling request is used to request the scheduling of the service, and the service includes at least one of the following: function service, general service.
[0095] It should be noted here that the above-mentioned first acquisition unit 901, second acquisition unit 903, first response unit 905, third acquisition unit 907, receiving unit 909, and second response unit 911 correspond to steps S202 to S212 in the above-mentioned embodiments, and the six units and the corresponding steps have the same instances and application scenarios implemented, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0096] As can be seen from the above, in the scheme recorded in the above-mentioned embodiment of the present invention, the first acquisition unit can be used to decompile the function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe the characteristic information of the function; then the second acquisition unit is used to process the multiple functions in the form of a tree structure based on the function metadata to obtain a function tree; then the first response unit is used to respond to the selection operation of selecting the function in the function tree to determine that the function selected by the selection operation is the target function; then the third acquisition unit is used to service the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; and then the receiving unit is used to receive the service calling process of the function service and the general service, wherein the general service is a service designed according to the communication protocol, and the service calling process is the target object in the front. The end obtains a calling process by combining the function service and the general service in a configuration manner; finally, the second response unit is used to respond to the service scheduling request, so as to schedule the function service and the general service according to the service calling process based on the service scheduling request, and obtain the scheduling result, wherein the service scheduling request is used to request the scheduling of the service, and the service includes at least one of the following: function service, general service, so as to achieve the purpose of servicing the functions in the function tree selected by the user, so as to automatically encapsulate the functions as function services so that they can be called directly, and through the streaming engine scheduling, the call between the general service and the functional service is converted into streaming scheduling, so as to achieve the technical effect of enabling the function to directly provide capabilities to the outside in the form of service, simplifying the tediousness of servicing the function, improving the convenience of calling the function, and improving the flexibility of the integrated scheduling of the general service and the functional service.
[0097] Therefore, the technical solution provided by the above-mentioned embodiment of the present invention solves the technical problem in the related technology that the functions are oriented to the JVM level or the native level, resulting in the inability of the functions to directly provide capabilities to the outside, but still need to be manually encapsulated into services and then provide capabilities to the outside in the form of services.
[0098] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a third response unit, which is used to respond to the upload operation before decompiling the function package to obtain the function metadata of each function in the function package, so as to receive the function package uploaded by the target object by executing the upload operation.
[0099] Optionally, the first acquisition unit includes: a first acquisition module, used to decompile the function package to obtain the source code of the class file in the function package; a second acquisition module, used to traverse the source code to obtain multiple functions in the source code; a removal module, used to remove interference information in the function, wherein the interference information includes at least: code comments, non-functional code; a third acquisition module, used to extract features of the function after removing the interference information, to obtain function metadata.
[0100] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a transmission unit, which is used to process the function metadata in the form of a tree structure to obtain a function tree, and then transmit the function tree to the front end so that the front end displays the function tree.
[0101] Optionally, the third acquisition unit includes: a determination module, used to determine that the function metadata of the target function is the target function metadata; a generation module, used to generate a service interface definition based on the target function metadata, wherein the service interface definition is used to describe the calling method of the function service; and a fourth acquisition module, used to encapsulate the target function and the service interface definition to obtain the function service.
[0102] Optionally, the function and service fusion scheduling device based on streaming processing also includes: a registration module, which is used to register the function service after encapsulating the target function and the service interface definition to obtain the function service, so as to add the function service to the service catalog.
[0103] Optionally, the second response unit includes: a fifth acquisition module, used to parse the service call process through the streaming engine to obtain the scheduling order of function services and general services; a sixth acquisition module, used to schedule function services and general services according to the scheduling order based on the service scheduling request to obtain the scheduling result.
[0104] Optionally, the function and service fusion scheduling device based on streaming processing also includes: in response to a service scheduling request, scheduling function services and general services according to the service calling process based on the service scheduling request, and after obtaining the scheduling result, transmitting the scheduling result to the front end so that the front end displays the scheduling result.
[0105] According to another aspect of an embodiment of the present invention, a function and service fusion scheduling system based on streaming processing is also provided. The function and service fusion scheduling system based on streaming processing uses any of the above-mentioned function and service fusion scheduling methods based on streaming processing.
[0106] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein the program executes any one of the above-mentioned streaming-based function and service fusion scheduling methods.
[0107] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the communication devices in a communication device group.
[0108] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: decompiling a function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe the characteristic information of the function; processing the multiple functions in a tree structure based on the function metadata to obtain a function tree; responding to a selection operation for selecting a function in the function tree to determine that the function selected by the selection operation is a target function; performing service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; receiving a service call process of a function service and a general service, wherein the general service is a service designed according to a communication protocol, and the service call process is a call process obtained by combining the function service and the general service by configuring the target object at the front end; responding to a service scheduling request to schedule the function service and the general service according to the service call process based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request scheduling of a service, and the service includes at least one of the following: a function service and a general service.
[0109] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: responding to an upload operation to receive a function package uploaded by the target object by executing the upload operation.
[0110] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: decompiling the function package to obtain the source code of the class files in the function package; traversing the source code to obtain multiple functions in the source code; removing interference information in the function, wherein the interference information includes at least: code comments, non-functional code; and performing feature extraction on the function after removing the interference information to obtain function metadata.
[0111] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: transmitting the function tree to the front end so that the front end displays the function tree.
[0112] Optionally, in this embodiment, a computer-readable storage medium is configured to store program code for executing the following steps: determining function metadata of a target function as target function metadata; generating a service interface definition based on the target function metadata, wherein the service interface definition is used to describe a calling method of the function service; and encapsulating the target function and the service interface definition to obtain a function service.
[0113] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for performing the following steps: registering the function service to add the function service to the service catalog.
[0114] Optionally, in this embodiment, the computer-readable storage medium is configured to store program code for executing the following steps: parsing the service call process through a streaming engine to obtain a scheduling order for function services and general services; scheduling function services and general services in the scheduling order based on the service scheduling request to obtain a scheduling result.
[0115] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: transmitting the scheduling result to the front end so that the front end displays the scheduling result.
[0116] According to another aspect of an embodiment of the present invention, a processor is further provided, and the processor is used to run a program, wherein when the program is running, any one of the above-mentioned streaming-based function and service fusion scheduling methods is executed.
[0117] According to another aspect of an embodiment of the present invention, a computer program product is provided, including computer instructions, which, when executed by a processor, execute any one of the above-mentioned streaming-based function and service fusion scheduling methods.
[0118] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0119] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0124] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for fusion scheduling of functions and services based on streaming processing. It is characterized in that include: Decompiling the function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe feature information of the function; Processing the plurality of functions in a tree structure based on the function metadata to obtain a function tree; In response to a selection operation of selecting the function in the function tree, determining the function selected by the selection operation as a target function; Performing service-oriented processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; Receive the service calling process of the function service and the general service, wherein the general service is a service designed according to a communication protocol, and the service calling process is a calling process obtained by combining the function service and the general service by configuring the target object at the front end; Respond to a service scheduling request to schedule the function service and the general service according to the service calling process based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request scheduling of a service, and the service includes at least one of the following: the function service, the general service.
2. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that Before decompiling the function package to obtain function metadata of each function in the function package, the following steps are also included: In response to an upload operation, the function package uploaded by the target object by executing the upload operation is received.
3. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that Decompile the function package to obtain function metadata of each function in the function package, including: Decompiling the function package to obtain source code of the class files in the function package; Traversing the source code to obtain a plurality of the functions in the source code; Removing interference information in the function, wherein the interference information at least includes: code comments and non-functional code; Feature extraction is performed on the function after the interference information is removed to obtain the function metadata.
4. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that After the function metadata is processed in a tree structure to obtain a function tree, the method further includes: The function tree is transmitted to the front end so that the front end displays the function tree.
5. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that The target function is subjected to service-oriented processing to obtain a function service, including: Determining the function metadata of the target function as target function metadata; Generate a service interface definition according to the target function metadata, wherein the service interface definition is used to describe a calling method of the function service; The target function and the service interface definition are encapsulated to obtain the function service.
6. The method for fusion scheduling of functions and services based on streaming processing according to claim 5, It is characterized in that After encapsulating the target function and the service interface definition to obtain the function service, the method further includes: Register the function service to add the function service to the service directory.
7. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that Responding to the service scheduling request, scheduling the function service and the general service according to the service calling process based on the service scheduling request, and obtaining a scheduling result, including: The service call process is parsed by a streaming engine to obtain a scheduling order of the function service and the general service; The function service and the general service are scheduled according to the scheduling order based on the service scheduling request to obtain a scheduling result.
8. The method for fusion scheduling of functions and services based on streaming processing according to claim 1, It is characterized in that In response to the service scheduling request, the function service and the general service are scheduled according to the service calling process based on the service scheduling request, and after obtaining the scheduling result, the method further includes: The scheduling result is transmitted to the front end so that the front end displays the scheduling result.
9. A function and service fusion scheduling device based on streaming processing, It is characterized in that include: A first acquisition unit is used to decompile the function package to obtain function metadata of multiple functions in the function package, wherein the function package is a collection of multiple functions, and the function metadata is used to describe feature information of the function; A second acquisition unit, configured to process the plurality of functions in a tree structure based on the function metadata to obtain a function tree; A first response unit, used for responding to a selection operation of selecting the function in the function tree, so as to determine that the function selected by the selection operation is a target function; A third acquisition unit is used to perform service processing on the target function to obtain a function service, wherein the function service is a service obtained by encapsulating the function; A receiving unit, used to receive a service calling process of the function service and the general service, wherein the general service is a service designed according to a communication protocol, and the service calling process is a calling process obtained by combining the function service and the general service by configuring the target object at the front end; The second response unit is used to respond to the service scheduling request to schedule the function service and the general service according to the service calling process based on the service scheduling request to obtain a scheduling result, wherein the service scheduling request is used to request scheduling of the service, and the service includes at least one of the following: the function service, the general service.
10. A computer program product comprising computer instructions, It is characterized in that When the computer instructions are executed by the processor, the function and service fusion scheduling method based on streaming processing is performed.
Citation Information
Patent Citations
Service request processing method, device and equipment of different protocols and storage medium
CN109445968A
Inter-process communication method and device, computer device and readable storage medium
CN109933443A
Multi-source data service REST API interface construction method and device
CN116048991A
Web service packaging and publishing method and device for monitoring and early warning model
CN117806657A
Smart Interactive and Autonomous Robotic Property Maintenance Apparatus, System, and Method
US20180035606A1
