Cross-platform instruction set intercommunication method based on finite-state machine
By adopting a cross-platform instruction set interoperability method based on finite state machine in a multi-cloud environment, the management instructions between cloud platforms are automatically parsed and generated, and the problem of incompatibility of bare metal management instruction interfaces is solved, efficient and flexible resource management is achieved and cost reduction is reduced.
Patent Information
- Application Number
- CN202510073257.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-17
AI Technical Summary
The bare metal management instruction interfaces between cloud platforms in multi-cloud environments are incompatible, resulting in high system integration complexity and cost, and the inability to achieve efficient and low-cost cross-platform management.
Using a cross-platform instruction set interoperability method based on finite state machine (FSM), management instructions between different cloud platforms are automatically parsed, mapped and generated through instruction parsers, instruction mappers and instruction generators.
Simplifies the management of bare metal resources in multi-cloud environments, improves resource management efficiency and flexibility, reduces development and maintenance costs, and supports the expansion of more cloud platforms and instructions.
Smart Images

Figure CN119987941A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of cloud computing, and in particular relates to a cross-platform instruction set intercommunication method based on a finite state machine. Background Art
[0002] In recent years, with the rapid development of cloud computing, Bare Metal as a Service (BMaaS) has emerged as an emerging cloud computing model that combines the high performance of bare metal with the flexibility of cloud computing, aiming to provide users with the ability to configure and expand physical resources on demand. This model has been widely used in many fields, but different cloud platforms such as OpenStack, AWS, Azure, and GCP have significant differences in interfaces and functions for bare metal management. For example, AWS can provide efficient bare metal instances, OpenStack allows users to customize configurations, and GCP is more inclined to provide powerful network optimization. However, they lack compatibility and unified management methods.
[0003] At present, although the advantages of various platforms can be integrated in a multi-cloud environment, the interface differences and operational incompatibility between cloud platforms in bare metal resource management have greatly increased the complexity and cost of system integration. Cloud platform instructions usually exist in the form of strings, which often lack a unified structure, making cross-platform resource management more difficult.
[0004] Existing technologies usually use abstract layers or third-party cloud management platforms to uniformly manage resources on different platforms, but these methods generally have problems such as poor scalability, insufficient flexibility, high usage costs, and inability to ensure automatic mapping and interoperability of cross-platform instructions, thus failing to meet the needs of efficient and low-cost cross-platform management. Summary of the invention
[0005] In order to solve the above technical problems, the present invention proposes a cross-platform instruction set intercommunication method based on finite state machine (FSM), which aims to automatically parse, map and generate management instructions between different cloud platforms, thereby simplifying the management operations of bare metal resources in a multi-cloud environment and improving resource management efficiency and flexibility.
[0006] In order to achieve the above object, the present invention is achieved through the following technical solutions:
[0007] The present invention is a cross-platform instruction set intercommunication method based on a finite state machine. The cross-platform instruction set intercommunication method is implemented by a cross-platform instruction set intercommunication system. The cross-platform instruction set intercommunication system includes: a user interface layer and a business logic layer. The user interface layer includes a cloud platform instruction input interface for receiving instructions input by a user and displaying platform feedback information to the user. The business logic layer includes an instruction parser, an instruction mapper and an instruction generator. The business logic layer is responsible for parsing and mapping the instructions input by the user and generating the final target cloud platform instructions. Specifically, the cross-platform instruction set intercommunication method specifically includes the following steps:
[0008] Step 1: Receive instructions input by the user: Receive cloud platform instructions input by the user through the user interface layer, and forward the cloud platform instructions to the business logic layer;
[0009] Step 2: The instruction parser of the business logic layer gradually parses the received cloud platform instructions through a finite state machine (FSM) to parse out the instruction elements, namely, the platform identifier, resource type, operation type, and parameter options in the input instruction;
[0010] Step 3: After the instruction parsing in step 2 is completed, the instruction mapper of the business logic layer maps the instruction elements parsed in step 2 to the instruction template of the target cloud platform through a predefined mapping function;
[0011] Step 4: When the target cloud platform's instruction template requires additional parameters and the user does not provide them, the cross-platform instruction set intercommunication system prompts to complete the necessary parameters through default values or user interface prompts to avoid instruction execution failure;
[0012] Step 5: The instruction generator replaces the specific parameters provided by the user into the placeholders in the target platform instruction template through string interpolation technology to generate the final executable target cloud platform instruction.
[0013] A further improvement of the present invention is that in step 1, the cloud platform instructions input by the user include a cloud platform identifier, a resource type, an operation type and related parameter information, wherein: cloud platform identifier: indicates that the instruction is sent to the cloud platform; resource type: indicates the type of resource the user wishes to operate; operation type: indicates the operation the user wishes to perform on the resource. The cloud platform instructions are manually input through the interface and passed to the business logic layer through the interface for further processing.
[0014] A further improvement of the present invention is that in step 2, the parsing process is specifically as follows: the cloud platform instructions of the user interface layer are divided into the cloud platform identifier, resource type, operation type and related parameter names and specific parameter values, and the division method is to use the five-tuple idea in the finite state machine (FSM) model to divide the instruction parsing process into five core states, wherein the five-tuple in the finite state machine (FSM) model is a five-tuple (Q, Σ, δ, q0, F), Q represents a state set, representing a set of all possible states of the system, Σ is a set of all legal input symbols, δ is a state transfer function, and defines that the cross-platform instruction set intercommunication system transfers the state according to the current state, i.e., the first Q and the input symbol set Σ:
[0015] δ:Q×Σ→Q
[0016] Among them: × is the Cartesian product, → is the mapping relationship.
[0017] A further improvement of the present invention is that in step 2, the instruction parser of the business logic layer gradually parses the instruction input by the user through a finite state machine, and the specific parsing step includes the following steps:
[0018] Step 2.1, when receiving the platform identifier, the cross-platform instruction set intercommunication system transfers from the initial state INIT to the PLATFORM cloud platform identifier state under the action of the state transfer function δ(INIT, platform)=PLATFORM, and at the same time parses the platform (platform is a general term for all possible cloud platform identifiers of PLATFORM, and the actual process will be replaced by a specific cloud platform identifier) as PLATFORM;
[0019] Step 2.2, when receiving the resource type, the cross-platform instruction set intercommunication system transfers from the PLATFORM cloud platform identification state to the RESOURCE resource type state under the action of the state transfer function δ(PLATFORM, resource) = RESOURCE, and at the same time parses resource (resource is a general term for all possible resource types of RESOURCE, and the actual process will be replaced by a specific resource type) as RESOURCE;
[0020] Step 2.3, when receiving the operation type, the cross-platform instruction set intercommunication system transfers from the RESOURCE resource type state to the ACTION operation type state under the action of the state transfer function δ(RESOURCE, action) = ACTION, and parses action (action is a general term for all possible operation types of ACTION, and the actual process will be replaced by the specific operation type) as ACTION;
[0021] Step 2.4, when receiving the parameter options, the cross-platform instruction set intercommunication system will transfer from the ACTION operation type state to the OPTIONS parameter option state under the action of the state transfer function δ(ACTION, options) = OPTIONS, and at the same time, options and its specific parameter values (options is a general reference to all possible parameter options of OPTIONS, and the actual process will be replaced by specific parameter options) are parsed as OPTIONS in the form of key-value pairs;
[0022] Step 2.5, when the cross-platform instruction set intercommunication system enters the OPTIONS state, the cross-platform instruction set intercommunication system will continue to parse parameter options, each parameter option will not cause further state transfer, and the cross-platform instruction set intercommunication system will remain in the OPTIONS state until all parameter options, namely platform identification, resource type, operation type and parameter option parsing is completed;
[0023] Step 2.6: When all instructions are parsed, the cross-platform instruction set intercommunication system will transfer from the OPTIONS state to the ACCEPT state, indicating that the parsing process has ended.
[0024] A further improvement of the present invention is that in step 3, the mapping function between the cloud platform identifier, resource type, operation type and parameter options is:
[0025] M(PLATFORM,RESOURCE,ACTION,OPTIONS)→CommandTemplate
[0026] Among them, PLATFORM represents the cloud platform identifier, RESOURCE represents the resource type, ACTION represents the operation type, OPTIONS represents the parameter options, and CommandTemplate represents the instruction template of the corresponding platform.
[0027] A further improvement of the present invention is that in step 5, the instruction generator uses string interpolation technology according to
[0028] Command=CommandTemplate.replace({options},value)
[0029] Substitute user-supplied specific parameters into the placeholders in the target platform instruction template.
[0030] The beneficial effects of the present invention are as follows: the present invention uses the finite state machine (FSM) model in discrete mathematics to provide a new idea for the current instruction set intercommunication between cross-cloud platforms, and verifies the effectiveness of this method by realizing instruction intercommunication for bare metal management between Openstack, AWS, Azure and GCP.
[0031] The present invention does not need to rely on a third-party cloud management platform; it simplifies the developer's management of different instructions in a multi-cloud environment, reduces complexity and possible errors; it has low development and maintenance costs; and it can expand more cloud platforms and instructions by modifying and adding the content of the mapping rule library, and is scalable.
[0032] The present invention solves the problem of incompatibility of bare metal management instruction interfaces of various cloud platforms in a multi-cloud environment, improves resource management efficiency, greatly reduces manual operations by parsing, mapping and automatically generating target instructions, and improves the efficiency and accuracy of intercommunication of instruction sets across cloud platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Schematic diagram of the method of the present invention.
[0034] Figure 2 It is the state transition diagram of the present invention. DETAILED DESCRIPTION
[0035] The following will disclose the embodiments of the present invention with drawings. For the purpose of clear description, many practical details will be described together in the following description. However, it should be understood that these practical details should not be used to limit the present invention. That is to say, in some embodiments of the present invention, these practical details are not necessary.
[0036] The states in the finite state machine (FSM) model are defined as follows: INIT: initial state, waiting to receive instructions input by the user. PLATFORM: Identify the cloud platform identifier, such as OpenStack, AWS, GCP, etc. RESOURCE: Identify resource types, such as virtual machines, storage volumes, network interfaces, etc. ACTION: Identify the operations performed by the user, such as create, delete, modify, query, etc. OPTIONS: Parse the options and parameters in the instruction, such as instance ID, image ID, network ID, etc. ACCEPT: Termination of reception state, indicating the final reception state of the system in the finite state machine (FSM) parsing link, that is, whether the system successfully completes the instruction parsing.
[0037] like Figure 1As shown, the present invention is a cross-platform instruction set intercommunication method based on a finite state machine. The cross-platform instruction set intercommunication method is implemented by a cross-platform instruction set intercommunication system. The cross-platform instruction set intercommunication system includes: a user interface layer and a business logic layer. The user interface layer includes a cloud platform instruction input interface for receiving instructions input by a user and displaying platform feedback information to the user. The business logic layer includes an instruction parser, an instruction mapper and an instruction generator. The business logic layer is responsible for parsing and mapping the instructions input by the user and generating the final target cloud platform instructions.
[0038] The cross-platform instruction set intercommunication method specifically comprises the following steps:
[0039] Step 1, receiving the instructions input by the user: receiving the cloud platform instructions input by the user through the user interface layer, and forwarding the cloud platform instructions to the business logic layer. The cloud platform instructions input by the user include the cloud platform identifier, resource type, operation type and related parameter information, among which: cloud platform identifier: indicates that the instruction belongs to the cloud platform; resource type: indicates the resource type that the user wants to operate; operation type: indicates the operation that the user wants to perform on the resource. The cloud platform instructions are manually input through the interface and passed to the business logic layer through the interface for further processing.
[0040] like Figure 1 As shown, a specific GCP instruction to create a server is used to explain:
[0041] gcloud compute instances create ab--image f02ad6e4-15f8-4917-86bf-859d7fd8a83a
[0042] --image-project ubuntu-os-cloud--machine-type HighPerformance--subnetdefault
[0043] The directive consists of the following parts:
[0044] Platform identifier (gcloud): indicates that the command is sent to the GCP cloud platform.
[0045] Resource type (compute instances): indicates that the resource type that the user wants to operate is "compute instance".
[0046] Operation type (create): indicates that the operation that the user wants to perform on the resource is a "create" operation.
[0047] Parameter options:
[0048] --image f02ad6e4-15f8-4917-86bf-859d7fd8a83a specifies the image ID as f02ad6e4-15f8-4917-86bf-859d7fd8a83a.
[0049] --image-project ubuntu-os-cloud: Image project, indicating that the image belongs to the ubuntu-os-cloud project.
[0050] --machine-type HighPerformance specifies the machine type as HighPerformance.
[0051] --subnet 341a3445-fb1d-4e15-809d-ba71f562ac27: Select the subnet to connect to. Here, 341a3445-fb1d-4e15-809d-ba71f562ac27 is used.
[0052] ab: Specifies the name of the newly created server as ab.
[0053] Step 2: The instruction parser of the business logic layer gradually parses the received cloud platform instructions through the finite state machine (FSM) to parse out the instruction elements, namely the platform identifier, resource type, operation type and parameter options in the input instruction. The parsing process is as follows: the cloud platform instructions of the user interface layer are divided into cloud platform identifier, resource type, operation type and related parameter names and specific parameter values. The division method is to use the five-tuple idea in the finite state machine (FSM) model to divide the instruction parsing process into five core states, where the five-tuple in the finite state machine (FSM) model is the five-tuple (Q, Σ, δ, q0, F), where:
[0054] Q represents the state set, which represents the set of all possible states of the system. In the finite state machine, the behavior of the system is manifested as switching or migration between these states. In the model of this method, the Q state set includes the INIT initial state, the PLATFORM cloud platform identification state, the RESOURCE resource type state, the ACTION operation type state, the OPTIONS parameter option state, and the ACCEPT termination reception state.
[0055] Σ is the set of all legal input symbols, which are divided into four types. The platform identifier PLATFORM includes openstack, aws, gcloud, and azure, representing the cloud platform type to which the instruction belongs; the resource type RESOURCE includes the target resource types of the instruction operation such as baremetal, server, instance, and vm; the operation type ACTION includes the specific operations performed on the resources such as create, delete, and manage; the parameter option OPTIONS includes the specific parameters required by the instruction such as --flavor, --image, and --network.
[0056] δ is the state transfer function, which is the core part of the finite state machine. It defines the state transfer of the cross-platform instruction set intercommunication system according to the current state, i.e., the first Q, and the input symbol set Σ:
[0057] δ:Q×Σ→Q
[0058] Among them: × is the Cartesian product, → is the mapping relationship.
[0059] The meaning of this expression is: the state transfer function maps the combination of the current state, i.e., an element in the Q set, and the input symbol, i.e., an element in the Σ set, to the next state, i.e., another element in the Q set.
[0060] In a specific embodiment:
[0061] Q={INIT、PLATFORM、RESOURCE、ACTION、OPTIONS、ACCEPT}
[0062] Σ={"aws","azure","gcloud","openstack","create","computeinstances","server"……}
[0063] δ:Q×Σ→Q defines all state transitions.
[0064] When you enter gcloud compute instances create ab --image
[0065] f02ad6e4-15f8-4917-86bf-859d7fd8a83a--image-project ubuntu-os-cloud--machine-type HighPerformance--subnet default
[0066] Instructions in the INIT initial state are analyzed step by step through the state transition function:
[0067] 1.δ(INIT,"gcloud")=PLATFORM
[0068] When receiving a platform identifier such as gcloud, the system moves from the initial state INIT to the LATFORM state.
[0069] 2.δ(PLATFORM,"compute instances")=RESOURCE
[0070] When a resource type such as compute instances is received, the system moves from the PLATFORM state to the RESOURCE state.
[0071] 3.δ(RESOURCE,"create")=ACTION
[0072] When an operation type such as create is received, the system moves from the RESOURCE state to the ACTION state.
[0073] 4.δ(ACTION,"--image")=OPTIONS
[0074] When receiving parameter options such as --image, --machine-type, etc., the system moves from the ACTION state to the OPTIONS state.
[0075] 5. OPTIONS status is maintained
[0076] When the system enters the OPTIONS state, the system will continue to parse parameter options such as the input in the format of --key=value. Each parameter option will not cause further state transition. The system will remain in the OPTIONS state until all parameter options are parsed.
[0077] 6. When all the instructions are parsed, the system will move from the OPTIONS state to the ACCEPT state.
[0078] q0 is the initial state of the finite state machine (FSM). In the model of this method, q0 represents the initial state INIT when the instruction parsing process of the system has not yet started. The role of q0 in this model is:
[0079] 1. As the starting point of the system, each time a new instruction is parsed, it starts from this state to ensure that the instruction parsing has a fixed starting point.
[0080] 2. State reset: reset the state machine before processing a new instruction to prevent the state of the previous instruction parsing from affecting the current parsing, so that each instruction parsing complies with the parsing process of this method.
[0081] 3. As the starting point of the transfer, this method stipulates that the first state transfer must start from q0. Ensure that the instruction parsing follows the correct order.
[0082] F represents the set of terminated receiving states, which indicates the final receiving state of the system in the finite state machine (FSM) parsing link, that is, whether the system has successfully completed the instruction parsing. The function of F is to determine whether the instruction parsing is completed, and it is also the end point verification of the state transfer. This method defines the set of terminated accepting states accept_states. If the current_state is in accept_states, the state has reached the final receiving state and the instruction parsing is completed. At this time, the state is transferred to the ACCEPT terminated accepting state, indicating that the finite state machine model has completed the parsing of the instruction.
[0083] The following uses a specific embodiment to illustrate the specific process of instruction parsing based on a finite state machine (FSM):
[0084] When the instruction
[0085] gcloud compute instances create ab--image f02ad6e4-15f8-4917-86bf-859d7fd8a83a--image-project ubuntu-os-cloud--machine-type HighPerformance--subnet default
[0086] When entering the finite state machine (FSM) instruction parsing process from the user interface layer to the business logic layer, the initial state q0 of the instruction will become the INIT initial state, and the instruction in the INIT initial state will pass the state transfer function
[0087] δ:Q×Σ→Q
[0088] Perform a step-by-step analysis:
[0089] 1.δ(INIT,"gcloud")=PLATFORM
[0090] When a platform identifier such as gcloud is received, the system moves from the initial state INIT to the PLATFORM state.
[0091] 2.δ(PLATFORM,"compute instances")=RESOURCE
[0092] When a resource type such as compute instances is received, the system moves from the PLATFORM state to the RESOURCE state.
[0093] 3.δ(RESOURCE,"create")=ACTION
[0094] When an operation type such as create is received, the system moves from the RESOURCE state to the ACTION state.
[0095] 4.δ(ACTION,"--image")=OPTIONS
[0096] When receiving parameter options such as --image, --machine-type, etc., the system moves from the ACTION state to the OPTIONS state.
[0097] 5. OPTIONS status is maintained
[0098] δ(OPTIONS,"--image-project")=OPTIONS
[0099] δ(OPTIONS,"--machine-type")=OPTIONS
[0100] δ(OPTIONS,"--subnet")=OPTIONS
[0101] When the system enters the OPTIONS state, the system will continue to parse parameter options such as the input in the format of --key=value. Each parameter option will not cause further state transition. The system will remain in the OPTIONS state until all parameter options are parsed.
[0102] 6. When all the instructions are parsed, the system will move from OPTIONS to ACCEPT state.
[0103] During the instruction parsing process of the finite state machine (FSM), the system gradually completes the parsing of the instruction through the state transfer function. When it reaches the terminal acceptance state ACCEPT, the platform identifier, resource type, operation type and related parameters are extracted and placed in a parsed_command class.
[0104] The parsed_command class before parsing:
[0105] parsed_command = {
[0106] "platform":None,#Store the parsed platform identifier
[0107] "resource":None,#Store the parsed resource type
[0108] "action":None,#Store the parsed operation type
[0109] "options":{}#Store the parsed parameter set
[0110] }
[0111] This class contains a dictionary that is gradually filled during the parsing process. When the state machine reaches the accepting state, this dictionary contains the complete parsing result. The options are stored in the form of key-value pairs.
[0112] The complete parsed_command class after successful parsing:
[0113] parsed_command = {
[0114] "platform":gcloud,#Store the parsed platform identifier
[0115] "resource":compute instances,#Store parsed resource types
[0116] "action": create, #Store the parsed operation type
[0117] "options":{
[0118] "image":"f02ad6e4-15f8-4917-86bf-859d7fd8a83a"
[0119] "image-project":"ubuntu-os-cloud"
[0120] "machine-type":"HighPerformance"
[0121] "subnet":"default"}#Store the parsed parameter set
[0122] }
[0123] Step 3: The instruction mapper maps the parsed instruction elements to the equivalent instruction template of the target cloud platform through a mapping function. The mapper maps the GCP instructions to the instruction templates of the target platform such as AWS and OpenStack through a mapping rule library pre-stored in the system. The mapping rule library stores instruction templates of different cloud platforms, allowing the system to automatically select the appropriate template. The mapping function
[0124] M(PLATFORM,RESOURCE,ACTION,OPTIONS)→CommandTemplate
[0125] Responsible for mapping the parsed cloud platform identifier, resource type, operation type, and parameter options into the instruction template of the specific platform. For example, if the instruction before parsing is
[0126] gcloud compute instances create ab--image f02ad6e4-15f8-4917-86bf-859d7fd8a83a
[0127] --image-project ubuntu-os-cloud--machine-type HighPerformance--subnetdefault
[0128] The mapper maps it to the Openstack instruction template
[0129] openstack server create--image{IMAGE}--flavor{FLAVOR}--network{NETWORK}--key-name{KEY_NAME}
[0130] Among them, --image f02ad6e4-15f8-4917-86bf-859d7fd8a83a of gcloud corresponds to --image{IMAGE} of openstack, --machine-type HighPerformance corresponds to --flavor{FLAVOR}, --subnet default corresponds to --network{NETWORK}, and --key-name{KEY_NAME}, as a parameter missing in the mapping process, will be filled in with the default value.
[0131] The parameter part in the instruction mapper generated template is temporarily replaced by placeholders. The specific parameter values will be replaced by string interpolation technology in the instruction generator.
[0132] The mapping function can map instruction templates for different cloud platforms based on resources and operations. The mapping rule base can be regularly updated to support new cloud platforms and operation instructions, thereby ensuring the long-term scalability of the system. By mapping resources and operations, the system can automatically adapt to the differences in instruction interfaces between different cloud platforms and improve the efficiency and accuracy of cross-platform operations.
[0133] Step 4: When mapping between different cloud platforms, if the parameters of the target cloud platform are incomplete and additional parameters are required, or if the necessary parameters of the target cloud platform are missing, you need to complete the parameters.
[0134] For example, the parameter key-name is missing in step 3 above.
[0135] When parameters are missing, the processing steps for completing the parameters are as follows:
[0136] Step 41: During the mapping phase, the system detects the parameters input by the user and checks whether there are any missing parameters by comparing them with the instruction template of the target cloud platform.
[0137] Step 42: If the system detects that the user does not provide the required parameters of the target cloud platform, the system will try to use the predefined default values. For example, if the user does not specify key-name, the system can automatically select the default value my-keypair.
[0138] Step 43: If the missing parameters cannot be replaced with default values, the system will prompt the user to complete the missing parameters through the user interface. The system will list the missing parameters and provide options for filling them in.
[0139] Step 44: After completing the parameters, the system will regenerate the instructions, replace the template parameters through string interpolation technology, and perform legality checks and dynamic verification to ensure the accuracy of the generated instructions.
[0140] Step 5: The instruction generator replaces the specific parameters provided by the user into the placeholders in the target platform instruction template through string interpolation technology to generate the final executable target cloud platform instruction.
[0141] The string interpolation process of the instruction generator includes the legitimacy check and dynamic verification of the parameters. When the system generates instructions, it checks whether the parameters provided by the user are consistent with the requirements of the target cloud platform. If missing or non-compliant parameters are detected, the system will prompt the user to supplement or modify them. In addition, the generated instructions can be executed by simulation or sandbox testing to ensure that they are executed correctly on the target platform.
[0142] The instruction generator is responsible for replacing the specific parameters entered by the user with the placeholders in the target cloud platform instruction template. String interpolation technology is used to replace placeholders in the template, such as {IMAGE}, {FLAVOR}, etc., with the actual parameter values provided by the user. For example, the user provides --image="f02ad6e4-15f8-4917-86bf-859d7fd8a83a", --flavor="HighPerformance", --network="deflaut" and --key-name="my-keypair". Through string interpolation technology, the generated instruction is:
[0143] openstack server create --image f02ad6e4-15f8-4917-86bf-859d7fd8a83a --flavor HighPerformance --network default --key-name my-keypair
[0144] The final generated instructions are complete instructions that can be directly executed on the target platform.
[0145] In summary, the present invention formalizes the cross-platform instruction parsing and generation process in a multi-cloud environment, and solves the technical problem of incompatible bare metal management instruction interfaces of different cloud platforms. First, in order to solve the complexity caused by the differences in bare metal management instruction interfaces in a multi-cloud environment, a cross-platform instruction set intercommunication method based on a finite state machine (FSM) is designed, which can gradually parse and identify the instruction structure input by the user; secondly, an instruction mapper is proposed, which converts the parsed instruction elements into equivalent instruction templates of the target cloud platform through a mapping function to ensure the correctness and compatibility of the instruction conversion; then, the final executable instruction is generated using string interpolation technology, which dynamically adapts to different parameters input by the user, improves the flexibility and automation of instruction generation, and realizes the integrated management of instruction operations in a multi-cloud environment.
[0146] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A cross-platform instruction set intercommunication method based on a finite state machine, characterized by: The cross-platform instruction set intercommunication method is implemented by a cross-platform instruction set intercommunication system, which includes: a user interface layer and a business logic layer, wherein the user interface layer includes a cloud platform instruction input interface for receiving instructions input by a user and displaying platform feedback information to the user, and the business logic layer includes an instruction parser, an instruction mapper and an instruction generator, and the business logic layer is responsible for parsing and mapping the instructions input by the user and generating the final target cloud platform instructions; specifically, the cross-platform instruction set intercommunication method includes the following steps: Step 1: Receive instructions input by the user: Receive cloud platform instructions input by the user through the user interface layer, and forward the cloud platform instructions to the business logic layer; Step 2: The instruction parser of the business logic layer gradually parses the received cloud platform instructions through a finite state machine (FSM) to parse out the instruction elements, namely, the cloud platform identifier, resource type, operation type, and parameter options in the input instruction; Step 3: After the instruction parsing in step 2 is completed, the instruction mapper of the business logic layer maps the instruction elements parsed in step 2 to the instruction template of the target cloud platform through a predefined mapping function; Step 4: When the target cloud platform's instruction template requires additional parameters and the user does not provide them, the cross-platform instruction set intercommunication system prompts to complete the necessary parameters through default values or user interface prompts to avoid instruction execution failure; Step 5: The instruction generator replaces the specific parameters provided by the user into the placeholders in the target platform instruction template through string interpolation technology to generate the final executable target cloud platform instruction.
2. A method for intercommunication of cross-platform instruction sets based on finite state machines according to claim 1, characterized in that: In step 1, the cloud platform instructions input by the user include the cloud platform identifier, resource type, operation type and related parameter information, among which: cloud platform identifier: indicates that this instruction belongs to the cloud platform; resource type: indicates the type of resource the user wants to operate; operation type: indicates the operation the user wants to perform on the resource. The cloud platform instructions are manually entered through the interface and passed to the business logic layer through the interface for further processing.
3. The method for cross-platform instruction set intercommunication based on finite state machine according to claim 1, characterized in that: In step 2, the parsing process is specifically as follows: the cloud platform instructions of the user interface layer are divided into cloud platform identification, resource type, operation type and related parameter names and specific parameter values. The division method is to use the five-tuple idea in the finite state machine (FSM) model to divide the instruction parsing process into five core states, where the five-tuple in the finite state machine (FSM) model is the five-tuple (Q, Σ, δ, q0, F), Q represents the state set, representing the set of all possible states of the system, Σ is the set of all legal input symbols, δ is the state transfer function, and defines the cross-platform instruction set intercommunication system to transfer the state according to the current state, i.e., the first Q and the input symbol set Σ: δ:Q×Σ→Q Among them: × is the Cartesian product, → is the mapping relationship.
4. The method for intercommunication of cross-platform instruction sets based on finite state machines according to claim 3, characterized in that: In step 2, the instruction parser of the business logic layer gradually parses the instructions input by the user through a finite state machine. The specific parsing steps include the following steps: Step 2.1, when receiving the platform identifier, the cross-platform instruction set intercommunication system transfers from the initial state INIT to the PLATFORM cloud platform identifier state under the action of the state transfer function δ(INIT, platform)=PLATFORM, and parses the platform as PLATFORM; Step 2.2, when receiving the resource type, the cross-platform instruction set intercommunication system transfers from the PLATFORM cloud platform identification state to the RESOURCE resource type state under the action of the state transfer function δ(PLATFORM, resource) = RESOURCE, and parses resource as RESOURCE; Step 2.3, when receiving the operation type, the cross-platform instruction set intercommunication system transfers from the RESOURCE resource type state to the ACTION operation type state under the action of the state transfer function δ(RESOURCE, action) = ACTION, and parses the action as ACTION; Step 2.4, when receiving the parameter options, the cross-platform instruction set intercommunication system will transfer from the ACTION operation type state to the OPTIONS parameter option state under the action of the state transfer function δ(ACTION, options) = OPTIONS, and at the same time parse out the options and their specific parameter values as OPTIONS in the form of key-value pairs; Step 2.5, when the cross-platform instruction set intercommunication system enters the OPTIONS state, the cross-platform instruction set intercommunication system will continue to parse parameter options, each parameter option will not cause further state transfer, and the cross-platform instruction set intercommunication system will remain in the OPTIONS state until all parameter options, namely platform identification, resource type, operation type and parameter option parsing is completed; Step 2.6: When all instructions are parsed, the cross-platform instruction set intercommunication system will transfer from the OPTIONS state to the ACCEPT state, indicating that the parsing process has ended.
5. The method for intercommunication of cross-platform instruction sets based on finite state machines according to claim 1, characterized in that: In step 3, the mapping function between cloud platform identifier, resource type, operation type and parameter options is: M(PLATFORM,RESOURCE,ACTION,OPTIONS)→CommandTemplate Among them, PLATFORM represents the cloud platform identifier, RESOURCE represents the resource type, ACTION represents the operation type, OPTIONS represents the parameter options, and CommandTemplate represents the instruction template of the corresponding platform.
6. The method for cross-platform instruction set intercommunication based on finite state machine according to claim 1, characterized in that: In step 5, the instruction generator uses string interpolation technology to follow Command=CommandTemplate.replace({options},value) Substitute user-supplied specific parameters into the placeholders in the target platform instruction template.
Citation Information
Patent Citations
Cross-platform data processing method and system and cross-platform data sharing system
CN106844063A
Cross-cloud platform hosting device and method
CN110740069A
Cross-platform and multi-language ORM service framework solution
CN116382939A
Data management and control method based on multi-cloud fusion and multi-cloud fusion management platform
CN116566844A
Instruction execution method for realizing cross-platform unified data by using grammar analysis
CN117764057A