Cloud network resource agile allocation method and system based on program flow and medium
Through the cloud network resource agile allocation method based on program flow, the business resource allocation rules are converted into program flow and atomic methods are bound to solve the flexibility and maintainability problems in the resource allocation process in the existing technology, efficient resource allocation and business flow management are realized, and software development and maintenance efficiency is improved.
Patent Information
- Application Number
- CN202510526413.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-07-18
AI Technical Summary
In the resource allocation process, the existing technology has problems such as offline design, large data-ready workload, high R&D customization, long joint debugging test cycle, and inflexible abnormal process handling, resulting in frequent iteration of code development and business tests, increasing time costs and reducing business implementation efficiency.
The cloud network resource agile allocation method based on program flow is adopted, and the business resource allocation rules are converted into program flow through the program flow configuration page. The program flow design page is used to bind atomic methods and determine the routing relationship. Relying on the program flow engine to perform resource allocation, realizing flexible resource configuration and business flow management.
It improves the flexibility and maintainability of resource allocation, reduces duplicate design and development work, improves R&D and operational efficiency, and supports agile iteration and rapid information technology support.
Smart Images

Figure CN120342869A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of software development, and particularly to a method, system and medium for agile allocation of cloud network resources based on program flow. Background Art
[0002] When a new service is launched or the service is changed, the resource system is required to provide the ability of resource allocation. Currently, the related capabilities of resource allocation are faced with the current situation or problems such as mainly offline demand design, large workload of data readiness, high degree of R & D customization, long joint debugging and testing cycle, and inflexible handling of abnormal processes.
[0003] To provide the resource allocation ability, developers need to go through the following steps: requirement analysis, understanding the network, understanding the model, code development, business testing, and function online. The language used in "code development" can be JAVA, can be stored procedures, can be scripts, etc. In short, they all belong to the hard code mode.
[0004] Although code development accounts for about 30% of the workload of the entire software engineering, code development and business testing often need to be iterated. And each iteration may generate time costs for software engineering such as compilation, testing, and release. This time cost will be transferred to the time cost of code development, and ultimately drag down the overall timeliness of business implementation.
[0005] There is also the operation problem. The previous code contains a lot of business logic resource configuration codes that have been implemented. When there are demand changes, it is time-consuming and laborious to understand the idea of the original code only by scattered comments. Developers tend to directly block the previous code and rewrite a set of codes that conform to their own logical habits. Or, without blocking the previous code, directly add a new set of codes at the back to overwrite the previous results, which has less risk. It seems that the problem is solved, but at the same time, hidden dangers are also buried. With the iteration of version three, version four, version five... the bloated code volume makes the readability of the code worse and worse. Everyone has the idea of making fewer changes and adding more. The code file gets bigger and bigger. Maybe there are thousands of lines of code, and only the first and last few lines are useful. The operation and maintenance of the code face huge difficulties. Summary of the Invention
[0006] To solve the above technical problems, the purpose of the present invention is to provide a method, system and medium for agile allocation of cloud network resources based on program flow, which can improve the flexibility and maintainability of resource allocation.
[0007] To achieve the above purpose, one aspect of the embodiments of the present application proposes a method for agile allocation of cloud network resources based on program flow, including the following steps:
[0008] In response to the list configuration instruction, display the program flow configuration page, convert the program code corresponding to the business resource allocation rule into multiple program flows, and each of the program flows includes multiple program flow steps;
[0009] In response to the program flow configuration instruction, display the program flow design page, which includes a link icon area and a canvas area, and the link icon area includes various standardized components;
[0010] Configure the standardized components in the link icon area in the canvas area, bind the corresponding atomic methods to each program flow step in the program flow, and determine the routing relationship between each program flow step;
[0011] Through the program flow engine, instantiate and execute the atomic methods according to the routing relationship to achieve cloud network resource allocation.
[0012] In some embodiments, the step of, in response to the list configuration instruction, displaying the program flow configuration page and converting the program code corresponding to the business resource allocation rule into multiple program flows specifically includes:
[0013] In response to the list configuration instruction, perform an extended description on the program code corresponding to the business resource allocation rule to obtain multiple program flows and the program flow variables corresponding to each program flow;
[0014] Configure the program flow list according to each program flow, and configure the variable list according to the program flow variables corresponding to each program flow.
[0015] In some embodiments, the step of configuring the standardized components in the link icon area in the canvas area and binding the corresponding atomic methods to each program flow step in the program flow specifically includes:
[0016] In response to the first configuration instruction for the first standardized component in the link icon area, establish a start step in the canvas area;
[0017] In response to the second configuration instruction for the second standardized component in the link icon area, establish the program flow step in the canvas area;
[0018] In response to the third configuration instruction for the third standardized component in the link icon area, establish an end step in the canvas area;
[0019] In response to the fourth configuration instruction for the program flow step in the canvas area, display the link configuration page and configure the link parameters corresponding to the program flow step;
[0020] In response to the fifth configuration instruction, display the method configuration page, bind the link parameters corresponding to the program flow steps to the atomic method, and configure the output and input parameters of the atomic method.
[0021] In some embodiments, the determining the routing relationship between each of the program flow steps specifically includes:
[0022] In response to the sixth configuration instruction, use routing to connect each of the program flow steps in the canvas area;
[0023] In response to the seventh configuration instruction for the routing in the canvas area, display the routing configuration page and configure the routing conditions corresponding to the routing;
[0024] Among them, the types of the routing include single routing, branch routing, and loop routing.
[0025] In some embodiments, the cloud network resource agile allocation method further includes the step of configuring the program flow engine. The configuring the program flow engine specifically includes:
[0026] Construct a variable pool, which is used to store the process data generated when executing the atomic method;
[0027] Obtain a framework program, which is used to execute the program flow;
[0028] Configure the program flow engine according to the framework program, the atomic method, the variable pool, and the routing relationship.
[0029] In some embodiments, the realizing cloud network resource allocation by instantiating and executing the atomic method according to the routing relationship through the program flow engine specifically includes:
[0030] Load the program flow and determine the start step and end step of the program flow;
[0031] According to the routing relationship, determine the next program flow step corresponding to the start step, and use the next program flow step as the current step;
[0032] Query the atomic method corresponding to the current step;
[0033] According to the program flow variables corresponding to the current step, take out the input parameters corresponding to the atomic method from the variable pool;
[0034] Create a variable set, instantiate and execute the atomic method;
[0035] After the atomic method is executed, put the output parameters corresponding to the atomic method into the variable set, and incorporate the variable set into the variable pool;
[0036] Determine the next program flow step corresponding to the current step according to the routing relationship, and return the next program flow step as the current step until the next program flow step is the termination step.
[0037] In some embodiments, the determining the next program flow step corresponding to the current step according to the routing relationship specifically includes:
[0038] Parse the routing conditions between the current step and each program flow step;
[0039] When the parsing result of the routing condition is true, or when the routing condition does not exist, determine the program flow step corresponding to the routing condition as the next program flow step.
[0040] To achieve the above object, another aspect of the embodiments of the present application proposes a cloud network resource agile allocation system based on a program flow, including:
[0041] A first module, configured to display a program flow configuration page in response to a list configuration instruction, and convert the program code corresponding to the service resource allocation rule into multiple program flows, each of the program flows including multiple program flow steps;
[0042] A second module, configured to display a program flow design page in response to a program flow configuration instruction, the program flow design page including a link icon area and a canvas area, and the link icon area including a variety of standardized components;
[0043] A third module, configured to configure the standardized components in the link icon area in the canvas area, bind corresponding atomic methods to each program flow step in the program flow, and determine the routing relationship between each program flow step;
[0044] A fourth module, configured to instantiate and execute the atomic methods through a program flow engine according to the routing relationship to implement cloud network resource allocation.
[0045] To achieve the above object, another aspect of the embodiments of the present application proposes an electronic device, the electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory, and when the program is executed by the processor, it implements the cloud network resource agile allocation method based on a program flow as described above.
[0046] To achieve the above object, another aspect of the embodiments of the present application provides a storage medium. The storage medium is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for agile allocation of cloud network resources based on program flow as described above.
[0047] The beneficial effects of the present invention are as follows: For the method, system and medium for agile allocation of cloud network resources based on program flow of the present invention, through the program flow configuration page, the program code corresponding to the service resource allocation rule is converted into a program flow. Through the program flow design page, atomic methods are bound to each program flow step in the program flow, and the routing relationship between each program flow step is determined. Furthermore, relying on the program flow engine, the program flow steps are connected in series according to the execution order of the business logic and executed in sequence. Through the visual program flow configuration page and program flow design page, combined with low-code or even zero-code, flexible design and logical assembly of resource allocation can be completed, which can reduce repetitive design and development work, facilitate agile iterative research and development, quickly provide an information technology support solution for resource configuration and business flow configuration, improve research and development and operation efficiency, and can break the traditional development mode of completing business logic by stacking code, and improve the development and maintenance efficiency of resource allocation software. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following introduces the drawings required to be used in the embodiments of the present invention. It should be understood that the drawings introduced below are only for conveniently and clearly expressing some embodiments of the technical solutions in the present invention, and those skilled in the art can also obtain other drawings based on these drawings without creative efforts.
[0049] Figure 1 It is a schematic diagram of the implementation environment of the method for agile allocation of cloud network resources based on program flow provided by an embodiment of the present invention;
[0050] Figure 2 It is a flowchart of the steps of the method for agile allocation of cloud network resources based on program flow provided by an embodiment of the present invention;
[0051] Figure 3 It is a simple flowchart of cloud network service activation provided by an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of the program flow configuration page provided by an embodiment of the present invention;
[0053] Figure 5 It is a schematic diagram of the program flow variable definition provided by an embodiment of the present invention;
[0054] Figure 6 Schematic diagram of the layout of the program flow design page provided by an embodiment of the present invention;
[0055] Figure 7 Schematic diagram of the program flow design page provided by an embodiment of the present invention;
[0056] Figure 8 Schematic diagram of the link configuration page provided by an embodiment of the present invention;
[0057] Figure 9 Schematic diagram of the method configuration page provided by an embodiment of the present invention;
[0058] Figure 10 Schematic diagram of the routing configuration page provided by an embodiment of the present invention;
[0059] Figure 11(a) is a schematic diagram of a single routing provided by an embodiment of the present invention;
[0060] Figure 11(b) is a schematic diagram of a branch routing provided by an embodiment of the present invention;
[0061] Figure 11(c) is a schematic diagram of a loop routing provided by an embodiment of the present invention;
[0062] Figure 12 Schematic diagram of the program flow engine provided by an embodiment of the present invention;
[0063] Figure 13 Schematic diagram of the structure of the cloud network resource agile allocation system based on the program flow provided by an embodiment of the present invention;
[0064] Figure 14 Schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0065] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application detailed in the appended claims.
[0066] It can be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if", "when" as used herein may be interpreted as "when...", "while...", or "in response to determining".
[0067] The terms "at least one", "multiple", "each", "any one", etc. used in this application, at least one includes one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any one refers to any one of the multiple.
[0068] Before elaborating on the embodiments of this application in detail, some nouns and terms involved in the embodiments of this application are first explained, and the nouns and terms involved in the embodiments of this application are applicable to the following explanations.
[0069] Program flow: Refers to the control flow during the execution of a program, that is, the program executes different operations or statements in a certain order.
[0070] PSR: A concept related to the allocation of cloud network resources of a communication operator, Product / Service / Resource, a three-layer model of product / service / resource.
[0071] API: Application Programming Interface, an agreement for interaction between different components of a software system. It provides a set of predefined functions or classes that allow developers to call system functions to achieve data sharing and communication between programs.
[0072] When a new service is launched or the service is changed, the resource system needs to be able to provide the ability of resource allocation. The current resource allocation-related capabilities face the current situation or problems such as mainly offline demand design, large data readiness workload, high degree of R & D customization, long joint debugging and testing cycle, and inflexible abnormal process handling.
[0073] To provide the resource allocation ability, developers need to go through the following steps: requirement analysis, understanding the network, understanding the model, code development, business testing, and function online. The language used in "code development" can be JAVA, can be a stored procedure, can be a script, etc. In short, they all belong to the hard code mode.
[0074] Although code development accounts for about 30% of the workload of the entire software engineering project, code development and business testing often require iterations. Each iteration may incur time costs for software engineering such as compilation, testing, and release. This time cost will be transferred to the time cost of code development, and ultimately reduce the overall timeliness of business implementation.
[0075] There is also the operational problem. The previous code contains a lot of business logic resource configuration codes that have been implemented. When there are changes in requirements, it is time-consuming and laborious to understand the ideas of the original code by relying on sporadic comments. R&D personnel tend to directly block the previous code and rewrite a set of code that conforms to their own logical habits. Or, the previous code is not blocked, and a new set of code is directly added to the back to overwrite the previous results, which is less risky. This seems to solve the problem, but it also lays hidden dangers. With the iteration of version three, version four, version five..., the bloated amount of code makes the readability of the code worse and worse. Everyone holds the idea of less modification and appending. The code files are getting bigger and bigger, and there may be thousands of lines of code, and the useful ones are only the beginning and the last few lines. The operation and maintenance of the code faces huge problems.
[0076] To this end, an embodiment of the present invention proposes a method for agile allocation of cloud network resources based on program flow. Through the program flow configuration page, the program code corresponding to the business resource allocation rule is converted into a program flow. Through the program flow design page, the atomic method is bound to each program flow step in the program flow, and the routing relationship between each program flow step is determined, and then the program flow steps are connected in series according to the order of business logic execution by relying on the program flow engine, and executed in sequence. The present invention uses a visualized program flow configuration page and a program flow design page, combined with low code or even zero code to complete the flexible design and logic assembly of resource allocation, which can reduce repeated design and development work, facilitate agile iterative research and development, and quickly provide information technology support solutions for resource configuration and business flow configuration, improve research and development and operational efficiency, break the traditional development mode of completing business logic through code stacking, and improve the development and maintenance efficiency of resource allocation software. This agile resource allocation can be applied to scenarios such as dynamic scheduling of cloud computing resources, cross-resource pool collaboration of hybrid clouds, and real-time response of edge computing resources, but is not limited to this.
[0077] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a method for agile allocation of cloud network resources based on program flow provided by an embodiment of the present invention. Figure 1As shown, in this implementation environment, it includes a terminal 101 and a server 102. A software system for agile allocation of cloud network resources is installed on the terminal 101. This software system can perform program flow configuration and cloud network resource allocation. The program flow configuration page and the program flow design page of the software system are visual interfaces. Program flow configuration is performed on the program flow configuration page, and the configuration area is divided on the program flow design page. The divided areas include, but are not limited to, the link icon area and the canvas area. A variety of standardized components are included in the link icon area. The software system responds to a program flow configuration instruction, configures standardized components in the canvas area, completes the specific process design of the program flow, and then, through the program flow engine, realizes cloud network resource configuration according to the routing relationship of the standardized components after configuration. In this implementation environment, the terminal 101 can be any electronic product that can perform human-computer interaction in one or more ways such as a keyboard, touchpad, touch screen, remote control, voice interaction, or handwriting device. This electronic product can receive a user's program flow configuration instruction through its visual program flow design page and perform real-time visual display on the result of the program flow configuration instruction. Exemplarily, as Figure 1 shown, the terminal 101 can be a personal computer (PC), mobile phone, smart phone, personal digital assistant (PDA), wearable device, pocket PC (PPC), tablet computer, etc.
[0078] Referring to Figure 2 , Figure 2 is the step flowchart of the method for agile allocation of cloud network resources based on program flow provided by an embodiment of the present invention. An embodiment of the present invention proposes a method for agile allocation of cloud network resources based on program flow. This method includes steps S101 to S104:
[0079] S101. In response to a list configuration instruction, display a program flow configuration page, and convert the program code corresponding to the service resource allocation rule into multiple program flows. Each program flow includes multiple program flow steps;
[0080] Specifically, regarding cloud network service activation, as Figure 3 shown in the simple flowchart of cloud network service activation, a complete service activation process mainly includes links such as service acceptance, resource allocation, network management configuration, on-site construction, and filing and completion. The embodiment of the present invention is mainly an invention creation regarding the "resource allocation" link. For "resource allocation", the program code corresponding to the service resource allocation rule is converted into steps. The steps are bound to atomic methods and, relying on the program flow engine, are connected in sequence according to the execution order of the business logic and executed in turn.
[0081] In the embodiment of the present invention, through a visual program flow configuration page, the program code corresponding to the business resource allocation rule is converted into steps. It is transformed from the traditional hard-coded mode to "a lightweight self-developed program flow engine with the program flow as the core idea" to solve the problem of high operation and maintenance difficulty of the resource allocation code mentioned above, and to realize the resource allocation of the PON link in the access section from the PON network terminal device (ONU / A8-C) to the OLT, the allocation of terminal devices, the allocation of logical resource LOIDs, the allocation of end OBD terminals, the allocation of main and sub-optical paths, etc.
[0082] Further as an optional implementation manner, in response to the list configuration instruction, a program flow configuration page is displayed, and the step of converting the program code corresponding to the business resource allocation rule into multiple program flows can be further divided into the following steps S1011 and S1012:
[0083] S1011. In response to the list configuration instruction, the program code corresponding to the business resource allocation rule is extended and described to obtain multiple program flows and program flow variables corresponding to each program flow;
[0084] S1012. Configure the program flow list according to each program flow, and configure the variable list according to the program flow variables corresponding to each program flow.
[0085] In some optional embodiments, the program flow configuration page is used to perform operations such as adding, deleting, and modifying program flows according to the program code corresponding to the business resource allocation rule, and construct a program flow list and a variable list that can be conveniently queried and designed. The list configuration instruction is an operation performed by the user on the program flow in the program flow configuration page, and is an instruction triggered by the program flow configuration page capturing this operation. It can be understood that triggering the list configuration instruction includes but is not limited to clicking to create a new program flow, deleting an old program flow, modifying the program flow variables of the program flow, etc.
[0086] Exemplarily, as Figure 4 shown in the schematic diagram of the program flow configuration page, the program flow list is on the left and the variable list is on the right:
[0087] Program flow list: It can be queried by fuzzy matching through the program flow code or name, and shows the basic information of the program flow, including the identification number (ID), code, name, version number, and remarks information. Among them, the identification number (ID) refers to the unique primary key ID, the code refers to the program flow code, the name refers to the program flow name, and the version number refers to the version number of the program flow. Operations such as adding, deleting, and modifying the program flow can be performed on the program flow configuration page. Select a certain program flow and click service design to display the program flow design page for specific process design of the program flow.
[0088] Variable list: When the corresponding program flow is selected on the left, the program flow variables defined within the program flow will be displayed. You can query the name through coding, display the basic variable information (such as name, coding, and remarks), and can also perform operations such as adding, deleting, and modifying program flow variables. For example, Figure 5 As shown in the schematic diagram of the program flow variable definition, when performing the definition operation on the program flow variable, you can specify the variable coding and name, and can supplement remarks to explain the specific meaning, usage conditions, etc. of the variable.
[0089] S102. In response to the program flow configuration instruction, display the program flow design page. The program flow design page includes a link icon area and a canvas area. The link icon area includes a variety of standardized components;
[0090] Specifically, the program flow configuration instruction is an operation performed by the user on the program flow on the program flow configuration page, and is an instruction captured by the program flow configuration page and triggered. It can be understood that triggering the program flow configuration instruction includes, but is not limited to, selecting the corresponding program flow name, clicking on service design, and displaying the program flow design page. For example, Figure 6 As shown in the layout schematic diagram of the program flow design page, the program flow design page may include, but is not limited to, a link icon area 100 and a canvas area 200. The link icon area 100 is used to provide various types of standardized component tools, and the canvas area 200 is used to draw point elements (program flow steps) and line elements (routing relationships). All the program flow steps participating in the program flow fully reflect the business logic through the name and extended description, making it easier and faster for developers to understand the implementation process of the business logic and intuitively presenting the business logic.
[0091] Exemplarily, for example, Figure 7 As shown in the schematic diagram of the program flow design page provided by an embodiment of the present invention, it includes a link icon area 100, a canvas area 200, a canvas zoom toolbar area 300, a link coordinate display bar 400, a process information area 500, etc. Among them, the link icon area 100 includes a first standardized component, a second standardized component, a third standardized component, and a fourth standardized component; the canvas area 200 is used to draw the program design process of the program flow; the canvas zoom toolbar area 300 is used to provide basic operation functions, such as zooming in, zooming out, scrolling, etc.; the link coordinate display bar 400 is used to display the x-axis coordinate, y-axis coordinate, and offset of each link (program flow step); the process information area 500 is used to display the current process information of the program flow, including identification number, coding, name, version, and remarks information, etc.
[0092] S103. Configure the standardized components in the link icon area in the canvas area, bind the corresponding atomic methods to each program flow step in the program flow, and determine the routing relationship between each program flow step;
[0093] Specifically, configure the program flow steps through the program flow design page. Drag the standardized components in the link icon area to the canvas area to draw the program flow chart. Among them, the display name of the program flow steps can be configured, and the business actions or IT actions can be intuitively reflected through the display name. Bind the atomic methods to the program flow steps, and set the input and output parameters according to the requirements of the atomic methods. Define business rules on the program flow steps, and configure the routing relationship between each program flow step through line elements. Among them, the display name of the line elements can be configured, and the conditions for routing access can be intuitively reflected through the display name.
[0094] Further, as an optional implementation manner, the step of configuring the standardized components in the link icon area in the canvas area and binding the corresponding atomic methods to each program flow step in the program flow can be further divided into the following steps S1031 to S1035:
[0095] S1031. In response to the first configuration instruction for the first standardized component in the link icon area, establish a starting step in the canvas area.
[0096] In some optional embodiments, as Figure 7 shown, the first standardized component is used to establish the starting link (starting step) of the program flow in the canvas area. The first configuration instruction is an operation performed by the user on the first standardized component in the link icon area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the first configuration instruction include, but are not limited to, clicking the first standardized component, dragging the first standardized component to the canvas area, etc., to generate the starting step of the program flow.
[0097] S1032. In response to the second configuration instruction for the second standardized component in the link icon area, establish a program flow step in the canvas area.
[0098] In some optional embodiments, as Figure 7 shown, the second standardized component is used to establish a new link (program flow step). The second configuration instruction is an operation performed by the user on the second standardized component in the link icon area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the second configuration instruction include, but are not limited to, clicking the second standardized component, dragging the second standardized component to the canvas area, determining the position of the second standardized component in the canvas area, generating a new link (program flow step), editing the name of the second standardized component, etc.
[0099] S1033. In response to the third configuration instruction for the third standardized component in the link icon area, establish an ending step in the canvas area.
[0100] In some alternative embodiments, such as Figure 7 shown, the third standardization component is used to establish the termination link (termination step) of the program flow. The third configuration instruction is an operation performed by the user on the third standardization component in the link icon area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the third configuration instruction include, but are not limited to, clicking on the third standardization component, dragging the third standardization component to the canvas area, etc., to generate the termination step of the program flow.
[0101] Further, as Figure 7 shown, the link icon area may further include a fourth standardization component, and the fourth standardization component is used to provide a copy and paste function to quickly draw program flow steps with the same or similar business logics.
[0102] S1034. In response to a fourth configuration instruction for a program flow step in the canvas area, display a link configuration page and configure the link parameters corresponding to the program flow step;
[0103] In some alternative embodiments, the fourth configuration instruction is an operation performed by the user on each second standardization component in the canvas area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the fourth configuration instruction include, but are not limited to, clicking on the second standardization component in the canvas area, etc. Exemplarily, as Figure 7 shown, click on the link named "Query Pipeline" in the canvas area, and display the link configuration page corresponding to the "Query Pipeline" link as shown in Figure 8 shown, and configure link parameters such as function parameter encoding, program variable encoding, and remarks information on this page.
[0104] S1035. In response to a fifth configuration instruction, display a method configuration page, bind the link parameters corresponding to the program flow step to an atomic method, and configure the output and input parameters of the atomic method.
[0105] In some alternative embodiments, the fifth configuration instruction is an operation performed by the user to select an atomic method corresponding to a program flow step in the link configuration page, and is an instruction triggered by the link configuration page capturing this operation. It can be understood that the operations triggering the fifth configuration instruction include, but are not limited to, clicking on the method selection bar, clicking on the method query component, etc. Exemplarily, as Figure 8 shown, click on the method query component, and display the method configuration page as shown in Figure 9 shown, and select the corresponding atomic method on this page.
[0106] Further as an alternative implementation manner, the step of determining the routing relationship between each program flow step may specifically be further divided into the following steps S1036 and S1037:
[0107] S1036. In response to the sixth configuration instruction, connect each program flow step on the canvas area with a route;
[0108] Specifically, there is also a configuration of link routing in the process definition. Different links (program flow steps) can be connected through routes. For example, in the case of one link having multiple destinations, multiple routes can be set, and the routing conditions defined for each route are mutually exclusive, and the program determines which route to take.
[0109] In some optional embodiments, the sixth configuration instruction is an operation performed by the user to connect each standardized component in the canvas area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the sixth configuration instruction include, but are not limited to, using a line element (route) with or without an arrow to select one link (program flow step) and connect it to another link (program flow step), and editing the display name of the line element, etc.
[0110] S1037. In response to the seventh configuration instruction for the route in the canvas area, display a route configuration page and configure the route conditions corresponding to the route;
[0111] Among them, the types of routes include single route, branch route, and loop route.
[0112] In some optional embodiments, the seventh configuration instruction is an operation performed by the user on the line element (route) in the canvas area of the program flow design page, and is an instruction triggered by the program flow design page capturing this operation. It can be understood that the operations triggering the seventh configuration instruction include, but are not limited to, clicking on the line element. Exemplarily, as Figure 7 shown, click on the line element with the display name "having pipeline service", and the route configuration page as shown in Figure 10 is displayed. Configure the corresponding route conditions on this page. In the embodiments of the present invention, the types of routes include single route, branch route, and loop route. As shown in Fig. 11(a), it is a schematic diagram of a single route, as shown in Fig. 11(b), it is a schematic diagram of a branch route, and as shown in Fig. 11(c), it is a schematic diagram of a loop route.
[0113] S104. Through the program flow engine, instantiate and execute the atomic methods according to the routing relationship to realize cloud network resource allocation.
[0114] Specifically, based on the idea of process-oriented program development, the program flow engine splits a piece of independent and complete code into N methods, and then connects the methods using a process tool, and executes them sequentially from start to end. Among them, a method: is implemented by an atomic method, and an atomic method has both the attributes of IT and the characteristics of the business, and generally provides dedicated capabilities for specific and fixed events. The atomic method has already designed the formal parameters; Jump: After a method is executed, the next method is continued. When jumping, the jump condition must be met, or it can be an unconditional jump. Use an expression to describe the jump condition, and use SpEL (Spring Expression Language) for boolean operations to calculate whether the jump condition is met; Variable: Used for passing values between methods. Variables are uniformly managed by the framework.
[0115] Further as an optional implementation, the cloud network resource agile allocation method further includes the step of configuring the program flow engine. This step of configuring the program flow engine can be further divided into the following steps S401 to S403:
[0116] S401. Build a variable pool, which is used to store the process data generated when executing atomic methods;
[0117] S402. Obtain the framework program, which is used to execute the program flow;
[0118] S403. Configure the program flow engine according to the framework program, atomic methods, variable pool, and routing relationship.
[0119] Specifically, the design of the program flow engine is based on the concept of program flow in computer programming. The program flow engine mainly includes two parts, namely the framework program and the configuration data. Among them, the framework program is solidified, and it provides all the capabilities required to implement the program flow, including data transfer, execution order control, encapsulation management, exception tolerance, etc. The configuration data is variable, and the configuration data is defined according to different business requirements, mainly defining input data and process data.
[0120] It should be noted that in the embodiments of the present invention, the definition of the configuration data uses a visualization tool and is defined through a visual program flow configuration page and a program flow design page. After using the program flow engine, the "resource allocation" changes from fixed to variable and is dynamic. The engine can change the operation result at any time according to the adjustment of the configuration data, without any compilation and distribution, greatly saving the software engineering implementation cost.
[0121] As Figure 12 shown in the program flow engine description diagram, the program flow engine includes the following main components:
[0122] Inside the engine, multiple single-functional and general method classes are pre-set, called "atomic methods". The "atomic methods" are instantiated during use and come from the same base class.
[0123] Inside the engine, a MAP object is pre-set as the "variable pool". All process data under the current transaction is stored in the "variable pool" in the form of objects. When process data needs to be used, the corresponding data is retrieved from the "variable pool", and each piece of process data has its own unique name.
[0124] The main program inside the engine is mainly responsible for the sequential execution of "steps", and the transition between "steps" is called "routing". Routing can be unconditional. If there are execution conditions, the routing conditions are written in SpEL (Spring Expression Language), and SpEL is responsible for the boolean calculation of the routing conditions. Only when the routing condition is true or unconditional will the routing be selected.
[0125] Further as an optional implementation, through the program flow engine, the atomic methods are instantiated and executed according to the routing relationship to implement the step of cloud network resource allocation, which can be further divided into the following steps S1041 to S1047:
[0126] S1041. Load the program flow and determine the starting step and ending step of the program flow;
[0127] S1042. According to the routing relationship, determine the next program flow step corresponding to the starting step, and use the next program flow step as the current step;
[0128] S1043. Query the atomic method corresponding to the current step;
[0129] S1044. According to the program flow variables corresponding to the current step, retrieve the input parameters corresponding to the atomic method from the variable pool;
[0130] S1045. Create a variable set, instantiate and execute the atomic method;
[0131] S1046. After the atomic method is executed, put the output parameters corresponding to the atomic method into the variable set, and merge the variable set into the variable pool;
[0132] S1047. According to the routing relationship, determine the next program flow step corresponding to the current step, and return to use the next program flow step as the current step until the next program flow step is the ending step.
[0133] Further as an optional implementation, the step of determining the next program flow step corresponding to the current step according to the routing relationship can be further divided into the following steps S10471 and S10472:
[0134] S10471. Parse the routing conditions between the current step and each program flow step;
[0135] S10472. When the parsing result of the routing condition is true, or when the routing condition does not exist, determine the program flow step corresponding to the routing condition as the next program flow step.
[0136] Specifically, refer to Figure 12 , first load the program flow according to the service. The starting step of all program flows is fixed as the "start" step, and this start step only supports a single and unconditional routing configuration. Therefore, the engine will determine the next step as "Step 1". Then, the engine sets the current step to "Step 1" and queries the execution logic of the atomic method F2 bound to this "Step 1" through the configuration. Among them, the input parameter p1 in the atomic method F2 corresponds to the variable v1, the input parameter p2 corresponds to the variable v2, and the output parameter pn corresponds to the variable v3. At this time, the engine retrieves the current values of v1 and v2 from the variable pool, then creates a new variable set object, initializes p1 with the value of v1, p2 with the value of v2, and the output parameter pn remains unassigned. After completing the initialization of the variable set, the engine instantiates the F2 method and passes the prepared variable set as a parameter, and then calls the execution method of F2. During the execution of the F2 method, it will process the input parameters and assign the final result to the output parameter pn, and this value will be automatically updated to the variable set. After the execution is completed, the engine will merge all the changes in the variable set back into the variable pool. Since pn corresponds to v3, the value of v3 will be updated to the calculation result of F2. Next, the engine will query all the downstream routing configurations of "Step 1", take out two of the routing rules, and sort them according to the principle of routing condition priority, with the unconditional routing ranked last. Then, it will loop through and judge the SpEl expressions on these routes in turn. When encountering the first route whose expression evaluates to true, or when an unconditional route is checked, it will lock this route and terminate the loop judgment. Finally, the engine will obtain the next step pointed to by this route. If it is judged that this step is the termination step, it will immediately terminate the execution of the entire program flow and announce that the engine has finished running; otherwise, the engine will update the current step to the newly obtained step and start from setting the current step again, and continue to execute the subsequent processing flow, repeating this process until a termination step is encountered.
[0137] The above describes the method for agile allocation of cloud network resources based on program flow in the embodiments of the present invention. It can be recognized that compared with the existing cloud network resource allocation methods, the embodiments of the present invention have the following advantages:
[0138] 1. High flexibility and maintainability. The configurable program flow allows the behavior of the program to be adjusted by modifying the configuration process without modifying the source code. This method greatly improves the flexibility of the software, enabling it to more easily adapt to different requirements and scenarios. At the same time, modifying the configuration process is usually simpler and safer than modifying the source code, reducing potential problems caused by code errors and improving the maintainability of the software.
[0139] 2. Fast deployment and response. In a distributed system or microservices architecture, the dynamic adjustment of configuration information is crucial. Through the configurable program flow, rapid changes and deployment of configuration information can be achieved without recompiling and releasing the entire application, thus improving the response speed and efficiency of the system.
[0140] 3. Reduced customization cost. For software systems that require high customization, the configurable program flow provides a more economical and efficient solution. By adjusting the configuration file to meet specific requirements instead of writing independent code for each customization need, the customization cost and time are reduced.
[0141] 4. Facilitates team collaboration and standardization. In team collaboration, the configurable program flow helps to standardize the development, testing, and production environments. By defining unified configuration specifications and templates, it can ensure that team members follow the same standards and best practices during the development process. This helps to improve code quality and reduce communication costs in team collaboration.
[0142] Referring to Figure 13 , the embodiment of the present invention also provides a cloud network resource agile allocation system based on a program flow, including:
[0143] The first module is used to respond to the list configuration instruction, display the program flow configuration page, and convert the program code corresponding to the business resource allocation rule into multiple program flows, each program flow including multiple program flow steps;
[0144] The second module is used to respond to the program flow configuration instruction, display the program flow design page, and the program flow design page includes a link icon area and a canvas area, and the link icon area includes multiple standardized components;
[0145] The third module is used to configure the standardized components in the link icon area in the canvas area, bind the corresponding atomic methods to each program flow step in the program flow, and determine the routing relationship between each program flow step;
[0146] The fourth module is used to instantiate and execute the atomic methods according to the routing relationship through the program flow engine to achieve cloud network resource allocation.
[0147] The content in the above embodiments of the method for agile allocation of cloud network resources based on program flow is applicable to the embodiments of the system for agile allocation of cloud network resources based on program flow. The functions specifically implemented by the embodiments of the system for agile allocation of cloud network resources based on program flow are the same as those of the above embodiments of the method for agile allocation of cloud network resources based on program flow, and the beneficial effects achieved are also the same as those of the above embodiments of the method for agile allocation of cloud network resources based on program flow.
[0148] Embodiments of the present invention also provide an electronic device, which includes: a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. When the program is executed by the processor, it implements the above method for agile allocation of cloud network resources based on program flow. The electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.
[0149] As Figure 14 shown is a schematic hardware structure diagram of the electronic device provided by the embodiments of the present invention. Referring to Figure 14 , embodiments of the present invention provide an electronic device, including:
[0150] A processor 1001, which can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention;
[0151] A memory 1002, which can be implemented in forms such as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1002 and are called by the processor 1001 to execute the method for agile allocation of cloud network resources based on program flow in the embodiments of the present invention;
[0152] An input / output interface 1003, which is used to implement information input and output;
[0153] A communication interface 1004, which is used to implement the communication interaction between this device and other devices. It can communicate through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);
[0154] The bus 1005 transmits information between various components of the device (such as the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004).
[0155] Among them, the processor 1001, the memory 1002, the input / output interface 1003, and the communication interface 1004 achieve communication connections with each other inside the device through the bus 1005.
[0156] An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the above-mentioned agile allocation method of cloud network resources based on program flow.
[0157] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory can optionally include a memory remotely set relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise internal network, a local area network, a mobile communication network, and combinations thereof.
[0158] An embodiment of the present invention also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 2 the method shown.
[0159] In some alternative embodiments, the functions / operations mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two consecutive blocks shown can actually be executed substantially simultaneously, or the above-mentioned blocks can sometimes be executed in the reverse order. In addition, the embodiments presented and described in the flowchart of the present invention are provided by way of example for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical processes presented herein. Alternative embodiments are foreseeable, in which the order of various operations is changed and the sub-operations described as part of a larger operation are executed independently.
[0160] In addition, although the present invention has been described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the above-described functions and / or features may be integrated in a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It should also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. Rather, considering the attributes, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of such modules would be understood within the ordinary skills of an engineer. Thus, those skilled in the art can implement the present invention as set forth in the claims without undue experimentation. It should also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0161] If the above functions are implemented in the form of software function units and sold or used as independent products, they 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 a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0162] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a predefined sequence of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with such instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0163] More specific examples (nonexhaustive list) of computer-readable media include the following: an electrical connection (electronic device) having one or more wirings, a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable media can even be paper or other suitable media on which the above programs can be printed, because the above programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then storing them in a computer memory.
[0164] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), and the like.
[0165] In the above description of this specification, descriptions referring to the terms "one embodiment / example", "another embodiment / example", or "certain embodiments / examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0166] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the claims and their equivalents.
[0167] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included in the scope defined by the claims of this application.
Claims
1. An agile allocation method for cloud network resources based on program flow, characterized in that, Including the following steps: In response to a list configuration instruction, display a program flow configuration page, and convert the program code corresponding to the service resource allocation rule into multiple program flows, each of the program flows including multiple program flow steps; In response to a program flow configuration instruction, display a program flow design page, the program flow design page including a link icon area and a canvas area, the link icon area including multiple standardized components; Configure the standardized components in the link icon area in the canvas area, bind corresponding atomic methods to each of the program flow steps in the program flow, and determine the routing relationship between each of the program flow steps; Through a program flow engine, instantiate and execute the atomic methods according to the routing relationship to implement cloud network resource allocation.
2. The agile allocation method of cloud network resources based on program flow according to claim 1, characterized in that The step of, in response to a list configuration instruction, displaying a program flow configuration page and converting the program code corresponding to the service resource allocation rule into multiple program flows specifically includes: In response to the list configuration instruction, perform an extended description on the program code corresponding to the service resource allocation rule to obtain multiple program flows and program flow variables corresponding to each of the program flows; Configure a program flow list according to each of the program flows, and configure a variable list according to the program flow variables corresponding to each of the program flows.
3. The agile allocation method of cloud network resources based on program flow according to claim 1, wherein The step of configuring the standardized components in the link icon area in the canvas area and binding corresponding atomic methods to each of the program flow steps in the program flow specifically includes: In response to a first configuration instruction for a first standardized component in the link icon area, establish a start step in the canvas area; In response to a second configuration instruction for a second standardized component in the link icon area, establish the program flow step in the canvas area; In response to a third configuration instruction for a third standardized component in the link icon area, establish an end step in the canvas area; In response to a fourth configuration instruction for the program flow step in the canvas area, display a link configuration page and configure link parameters corresponding to the program flow step; In response to a fifth configuration instruction, display a method configuration page, bind the link parameters corresponding to the program flow step to the atomic method, and configure the output parameters and input parameters of the atomic method.
4. A method for agile allocation of cloud network resources based on program flow according to claim 1, characterized in that, The step of determining the routing relationship between each of the program flow steps specifically includes: In response to a sixth configuration instruction, connect each of the program flow steps with a route in the canvas area; In response to a seventh configuration instruction for the route in the canvas area, display a route configuration page and configure route conditions corresponding to the route; Wherein, the types of the route include a single route, a branch route, and a loop route.
5. A method for agile allocation of cloud network resources based on program flow according to claim 1, characterized in that The cloud network resource agile allocation method further includes a step of configuring the program flow engine, and the step of configuring the program flow engine specifically includes: Construct a variable pool, the variable pool being used to store process data generated when executing the atomic method; Obtain a framework program, the framework program being used to execute the program flow; Configure the program flow engine according to the framework program, the atomic method, the variable pool, and the routing relationship.
6. The agile allocation method of cloud network resources based on program flow according to claim 5, characterized in that Through the program flow engine, instantiate and execute the atomic method according to the routing relationship to achieve cloud network resource allocation, specifically including: Load the program flow and determine the starting step and ending step of the program flow; According to the routing relationship, determine the next program flow step corresponding to the starting step, and use the next program flow step as the current step; Query the atomic method corresponding to the current step; According to the program flow variables corresponding to the current step, retrieve the input parameters corresponding to the atomic method from the variable pool; Create a variable set, instantiate and execute the atomic method; After the atomic method is executed, put the output parameters corresponding to the atomic method into the variable set, and incorporate the variable set into the variable pool; According to the routing relationship, determine the next program flow step corresponding to the current step, and return to use the next program flow step as the current step until the next program flow step is the ending step.
7. A method for agile allocation of cloud network resources based on program flow according to claim 6, characterized in that The determining, according to the routing relationship, the next program flow step corresponding to the current step specifically includes: Parse the routing conditions between the current step and each program flow step; When the parsing result of the routing condition is true, or when the routing condition does not exist, determine the program flow step corresponding to the routing condition as the next program flow step.
8. A cloud network resource agile allocation system based on program flow, characterized in that, Including: A first module, configured to display a program flow configuration page in response to a list configuration instruction, convert the program code corresponding to the service resource allocation rule into multiple program flows, and each program flow includes multiple program flow steps; A second module, configured to display a program flow design page in response to a program flow configuration instruction, where the program flow design page includes a link icon area and a canvas area, and the link icon area includes multiple standardized components; A third module, configured to configure the standardized components in the link icon area in the canvas area, bind the corresponding atomic method to each program flow step in the program flow, and determine the routing relationship between each program flow step; A fourth module, configured to instantiate and execute the atomic method according to the routing relationship through the program flow engine to achieve cloud network resource allocation.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for realizing the connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the program flow-based cloud network resource agile allocation method according to any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium for computer-readable storage, characterized in that, The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the steps of the program flow-based cloud network resource agile allocation method according to any one of claims 1 to 7.