A cross-platform instruction set interworking method based on finite state machine

By using a cross-platform instruction set interoperability method based on finite state machines, instructions from different cloud platforms are parsed, mapped, and generated, solving the problem of interface incompatibility in bare metal management and achieving efficient and low-cost cross-platform resource management.

CN119987941BActive Publication Date: 2025-11-21NANJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510073257.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-11-21
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

Bare metal management on different cloud platforms suffers from interface differences and operational incompatibility, resulting in high complexity and cost of resource management in multi-cloud environments, as well as a lack of automatic mapping and interoperability of cross-platform commands.

Method used

A cross-platform instruction set interoperability method based on finite state machines (FSM) is adopted to achieve cross-platform instruction set interoperability through the user interface layer and the business logic layer. This includes instruction parsing, mapping, and generation. The finite state machine is used to parse the user input instructions, and mapping functions and string interpolation techniques are used to generate the target cloud platform instructions.

Benefits of technology

It simplifies resource management operations in multi-cloud environments, improves management efficiency and flexibility, reduces development and maintenance costs, and achieves efficient and accurate interoperability of cross-platform instruction sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119987941B_ABST
    Figure CN119987941B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of cloud computing, and discloses a cross-platform instruction set intercommunication method based on a finite state machine, which is realized through a cross-platform instruction set intercommunication system, and the system comprises a user interface layer and a business logic layer, wherein the user interface layer comprises a cloud platform instruction input interface, the business logic layer comprises an instruction parser, an instruction mapper and an instruction generator, and the business logic layer receives user input instructions and forwards the same to the business logic layer, and the business logic layer parses, maps and generates final target cloud platform instructions of the user input instructions. The application significantly improves the cross-platform resource management capability in a multi-cloud environment, greatly improves the management efficiency, reduces errors caused by instruction incompatibility and the cost required for management, and has high expansibility.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of cloud computing, and specifically relates to a cross-platform instruction set interworking method based on a finite state machine. BACKGROUND

[0002] In recent years, with the rapid development of cloud computing, Bare Metal as a Service (BMaaS) as a new emerging cloud computing mode combines the high performance of bare metal and the flexibility of cloud computing, aiming to provide users with the ability to configure and expand physical resources on demand. This mode has been widely applied in multiple 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, there is a lack of compatibility and unified management between them.

[0003] Currently, although the advantages of each platform can be integrated in a multi-cloud environment, the interface differences and operation incompatibility between cloud platforms greatly increase the complexity and cost of system integration in bare metal resource management. Cloud platform instructions usually exist in the form of strings, and these string instructions often lack a unified structure, making cross-platform resource management more difficult.

[0004] Existing technologies usually use an abstraction layer or a third-party cloud management platform to uniformly manage resources of different platforms, but these methods generally have poor scalability, insufficient flexibility, high usage cost, and cannot guarantee automatic mapping and interworking of cross-platform instructions, thus failing to meet the efficient and low-cost cross-platform management needs. SUMMARY

[0005] To solve the above technical problems, the present application proposes a cross-platform instruction set interworking method based on a finite state machine (FSM), aiming to automatically parse, map and generate management instructions between different cloud platforms, thereby simplifying the management operation of bare metal resources in a multi-cloud environment and improving resource management efficiency and flexibility.

[0006] To achieve the above purpose, the present application is implemented through the following technical solutions:

[0007] The application is a cross-platform instruction set interworking method based on a finite state machine, which is realized by a cross-platform instruction set interworking system, the cross-platform instruction set interworking system comprising: a user interface layer and a business logic layer, the user interface layer comprising a cloud platform instruction input interface, for receiving user input instructions, and showing platform feedback information to the user, the business logic layer comprising an instruction parser, an instruction mapper and an instruction generator, the business logic layer being responsible for parsing, mapping and generating the final target cloud platform instructions of the user input instructions; specifically, the cross-platform instruction set interworking method specifically comprises the following steps:

[0008] Step 1: receiving user input instructions: receiving user input cloud platform instructions through the user interface layer, and forwarding 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), and parses out instruction elements, i.e. platform identification, resource type, operation type and parameter options in the input instructions;

[0010] Step 3: after the instruction parsing of step 2 is completed, the instruction mapper of the business logic layer maps the instruction elements parsed out in step 2 to the instruction template of the target cloud platform through a predefined mapping function;

[0011] Step 4: when the instruction template of the target cloud platform requires additional parameters and the user does not provide them, the cross-platform instruction set interworking system completes 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 instructions.

[0013] Further improvement of the application is that in step 1, the user input cloud platform instructions comprise cloud platform identification, resource type, operation type and related parameter information, wherein: the cloud platform identification indicates that the instruction is sent to the cloud platform; the resource type indicates the resource type that the user wants to operate; the operation type indicates the operation that the user wants to perform on the resource, the cloud platform instructions are input manually through the interface and are transmitted to the business logic layer for further processing.

[0014] Further improvement of the present application is that in the step 2, the parsing process is specifically that the cloud platform instruction of the user interface layer is divided into the identification of the cloud platform, the resource type, the operation type and the related parameter name and the specific parameter value, the division mode is that the parsing process of the instruction is divided into five core states by using the five tuple thought in the finite state machine (FSM) model, wherein the five tuple in the finite state machine (FSM) model is five tuple (Q, Sigma, delta, q0, F), Q represents a state set, represents the set of all possible states of the system, Sigma is a set of all legal input symbols, delta is a state transition function, defines the state transition of the cross-platform instruction set interworking system according to the current state, that is, the first Q and the input symbol set Sigma:

[0015] delta: Q x Sigma -> Q

[0016] Wherein: x is the Cartesian product, and -> is a mapping relationship.

[0017] Further improvement of the present application is that in the step 2, the instruction parser of the business logic layer gradually parses the instruction input by the user through the finite state machine, and the specific parsing steps include the following steps:

[0018] Step 2.1, when the platform identification is received, the cross-platform instruction set interworking system is transferred from the initial state INIT to the PLATFORM cloud platform identification state under the action of the state transition function delta (INIT, platform) = PLATFORM, and platform (platform is a general term of all possible cloud platform identifications of PLATFORM, and the actual process will be replaced by a specific cloud platform identification) is analyzed as PLATFORM;

[0019] Step 2.2, when the resource type is received, the cross-platform instruction set interworking system is transferred from the PLATFORM cloud platform identification state to the RESOURCE resource type state under the action of the state transition function delta (PLATFORM, resource) = RESOURCE, and resource (resource is a general term of all possible resource types of RESOURCE, and the actual process will be replaced by a specific resource type) is analyzed as RESOURCE;

[0020] Step 2.3, when the operation type is received, the cross-platform instruction set interworking system is transferred from the RESOURCE resource type state to the ACTION operation type state under the action of the state transition function delta (RESOURCE, action) = ACTION, and action (action is a general term of all possible operation types of ACTION, and the actual process will be replaced by a specific operation type) is analyzed as ACTION;

[0021] Step 2.4. When the parameter option is received, the cross-platform instruction set interworking system is transferred from the ACTION operation type state to the OPTIONS parameter option state under the action of the state transition function δ(ACTION, options) = OPTIONS, and the options and 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 out in the form of key-value pairs as OPTIONS;

[0022] Step 2.5. When the cross-platform instruction set interworking system enters the OPTIONS state, the cross-platform instruction set interworking system will continue to parse the parameter options, and each parameter option will not cause further state transition. The cross-platform instruction set interworking system will remain in the OPTIONS state until all parameter options, i.e., platform identification, resource type, operation type and parameter option, are parsed.

[0023] Step 2.6. When all instructions are parsed, the cross-platform instruction set interworking system is transferred from the OPTIONS state to the ACCEPT state, indicating that the parsing process has ended.

[0024] Further improvement of the application is that in step 3, the mapping function between the cloud platform identification, resource type, operation type and parameter option is:

[0025] M(PLATFORM, RESOURCE, ACTION, OPTIONS)→CommandTemplate

[0026] Wherein, PLATFORM represents the cloud platform identification, RESOURCE represents the resource type, ACTION represents the operation type, OPTIONS represents the parameter option, and CommandTemplate represents the instruction template of the corresponding platform.

[0027] Further improvement of the application is that in step 5, the instruction generator replaces the specific parameters provided by the user into the placeholder in the target platform instruction template by using the string interpolation technology.

[0028] Command = CommandTemplate.replace({options}, value)

[0029] The specific parameters provided by the user are replaced into the placeholder in the target platform instruction template.

[0030] The beneficial effects of the present application are: the present application uses the finite state machine (FSM) model in discrete mathematics to provide a new idea for the current instruction set interworking between cross cloud platforms, and verifies the effectiveness of the method by realizing the instruction interworking for bare metal management between Openstack, AWS, Azure and GCP.

[0031] The present application does not need to rely on the cloud management platform of the third party; simplifies the management of different instructions of the developer for the multi-cloud environment, reduces the complexity and possible errors; the development and maintenance cost is small; through the modification and addition of the mapping rule library content, more cloud platforms and instructions can be expanded, and the scalability is good.

[0032] The present application solves the problem of incompatible bare metal management instruction interfaces of each cloud platform in the multi-cloud environment, improves the resource management efficiency, and greatly reduces the manual operation through parsing, mapping and automatic generation of target instructions, improves the efficiency and accuracy of cross cloud platform instruction set interworking. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 The present application is a schematic diagram of the method.

[0034] Figure 2 The present application is a state transition diagram. DETAILED DESCRIPTION

[0035] The embodiments of the present application will be disclosed below with reference to the drawings, and many practical details will be described in the following description. However, it should be understood that these practical details should not be used to limit the present application. That is, in some embodiments of the present application, these practical details are unnecessary.

[0036] The state definition in the finite state machine (FSM) model is: INIT: initial state, waiting to receive user input instructions. PLATFORM: identify the cloud platform identifier, such as OpenStack, AWS, GCP, etc. RESOURCE: identify the resource type, such as virtual machine, storage volume, network interface, etc. ACTION: identify the operation performed by the user, such as creation, deletion, modification, query, etc. OPTIONS: parse the options and parameters in the instruction, such as instance ID, image ID, network ID, etc. ACCEPT: the final receiving state of the system in the finite state machine (FSM) analysis link, indicating whether the system successfully completes the instruction analysis.

[0037] As Figure 1As shown, the present application is a cross-platform instruction set interworking method based on a finite state machine, which is implemented through a cross-platform instruction set interworking system. The cross-platform instruction set interworking system includes a user interface layer and a business logic layer. The user interface layer includes a cloud platform instruction input interface for receiving user input instructions and showing 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, mapping, and generating the final target cloud platform instructions from user input instructions.

[0038] The cross-platform instruction set interworking method specifically includes the following steps:

[0039] Step 1, receiving user input instructions: through the user interface layer, receiving user input cloud platform instructions, and forwarding the cloud platform instructions to the business logic layer. User input cloud platform instructions include cloud platform identification, resource type, operation type, and related parameter information, wherein: cloud platform identification: 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, cloud platform instructions are manually input through the interface and transmitted to the business logic layer for further processing.

[0040] As Figure 1 shown, a specific GCP server creation instruction 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 instruction includes the following parts:

[0044] Platform identification (gcloud): indicates that the instruction 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 instances".

[0046] Operation type (create): indicates that the operation that the user wants to perform on the resource is "create" operation.

[0047] Parameter options:

[0048] --image f02ad6e4-15f8-4917-86bf-859d7fd8a83a specifies the ID of the image 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 connected subnet, which is 341a3445-fb1d-4e15-809d-ba71f562ac27 here.

[0052] ab: specifies the name of the newly created server as ab.

[0053] Step 2, the instruction parser of the business logic layer parses the received cloud platform instruction step by step through the finite state machine (FSM), and parses out the instruction elements, that is, the platform identification, resource type, operation type and parameter options in the input instruction. The parsing process is: the cloud platform instruction of the user interface layer is divided into cloud platform identification, resource type, operation type and related parameter name and specific parameter value, and the division method is to divide the instruction parsing process into five core states by using the five-tuple idea in the finite state machine (FSM) model, wherein the five-tuple in the finite state machine (FSM) model is five-tuple (Q, Σ, δ, q0, F), wherein:

[0054] Q represents the state set, representing the set of all possible states of the system, and in the finite state machine, the behavior of the system is represented as switching or migration between these states. In the model of this method, the Q state set contains 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 receiving state.

[0055] Σ is the set of all legal input symbols, which is divided into four types. The platform identifier PLATFORM contains openstack, aws, gcloud, azure, representing the type of cloud platform to which the instruction belongs; the resource type RESOURCE contains baremetal, server, instance, vm, etc. The target resource type of the instruction operation; the operation type ACTION contains create, delete, manage, etc. The specific operation performed on the resource; the parameter option OPTIONS contains --flavor, --image, --network, etc. The specific parameters required by the instruction.

[0056] δ is the state transition function, which is the core part of the finite state machine, and defines the state transition of the cross-platform instruction set interworking system according to the current state, i.e. the first Q and the input symbol set Σ:

[0057] δ: Q x Σ→ Q

[0058] Where: x is the Cartesian product, and → is the mapping relationship.

[0059] The meaning of this expression is: the state transition function maps the combination of an element in the current state Q set and an element in the input symbol Σ set to another element in the next state 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 x Σ→ Q defines all state transitions.

[0064] When the input gcloud compute instances create ab--image

[0065] f02ad6e4-15f8-4917-86bf-859d7fd8a83a--image-project ubuntu-os-cloud--machine-type HighPerformance--subnet default this instruction,

[0066] The command in INIT state will be parsed step by step by the state transition function:

[0067] 1. δ(INIT, "gcloud") = PLATFORM

[0068] When the platform identifier such as gcloud is received, the system transitions from the INIT state to the PLATFORM state.

[0069] 2. δ(PLATFORM, "compute instances") = RESOURCE

[0070] When the resource type such as compute instances is received, the system transitions from the PLATFORM state to the RESOURCE state.

[0071] 3. δ(RESOURCE, "create") = ACTION

[0072] When the operation type such as create is received, the system transitions from the RESOURCE state to the ACTION state.

[0073] 4. δ(ACTION, "--image") = OPTIONS

[0074] When the parameter option such as --image, --machine-type, etc. is received, the system transitions from the ACTION state to the OPTIONS state.

[0075] 5. The OPTIONS state remains

[0076] When the system enters the OPTIONS state, the system will continue to parse the parameter options such as --key=value format input. 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 command parsing is completed, the system will transition 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 state INIT initial state when the system's command parsing process has not started. The role of q0 in this model:

[0079] 1. As the starting point of the system, every time a new command is parsed, it starts from this state, ensuring that the command parsing has a fixed starting point.

[0080] 2. State reset, reset the state machine before processing new instructions, avoid the state of the last instruction analysis affecting the current analysis, make each instruction analysis conform to the analysis process of this method.

[0081] 3. As the starting point of transfer, this method stipulates that the first state transfer must start from q0. Ensure that the instruction analysis follows the correct order.

[0082] F represents the final receiving state set, which represents the final receiving state of the system in the finite state machine (FSM) analysis of this link, that is, whether the system successfully completes the instruction analysis. The role of F is to determine whether the instruction analysis is completed, and it is also the end point verification of state transfer. This method defines the set of final receiving states accept_states, if the current state current_state is in accept_states, the state reaches the final receiving state, and the instruction analysis is completed. At this time, the state is transferred to the ACCEPT terminal acceptance state, indicating that the finite state machine model has completed the analysis of the instruction.

[0083] The following uses a specific example to illustrate the specific process of instruction analysis based on 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 the finite state machine (FSM) instruction analysis process enters the business logic layer from the user interface layer, the initial state q0 of the instruction will become INIT, and the instruction in the INIT state will be transferred to the state transition function

[0087] δ:Q×Σ→Q

[0088] Step-by-step analysis:

[0089] 1.δ(INIT, "gcloud") = PLATFORM

[0090] When receiving platform identification such as gcloud, the system transfers 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 transitions 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 transitions from the RESOURCE state to the ACTION state.

[0095] 4. δ(ACTION, "--image") = OPTIONS

[0096] When a parameter option such as --image, --machine-type, etc. is received, the system transitions from the ACTION state to the OPTIONS state.

[0097] 5. The OPTIONS state holds

[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 --key=value formatted inputs. Each parameter option does not cause further state transitions. The system will remain in the OPTIONS state until all parameter options are parsed.

[0102] 6. When all instructions are parsed, the system transitions from the OPTIONS state to the ACCEPT state.

[0103] During the instruction parsing process of the finite state machine (FSM), the system gradually completes the parsing of the instructions through the state transition function. When the terminal acceptance state ACCEPT is reached, the platform identifier, resource type, operation type, and related parameters are extracted and placed in a parsed_command class.

[0104] parsed_command class before parsing:

[0105] parsed_command = {

[0106] "platform": None, # stores the parsed platform identifier

[0107] "resource": None, # stores the parsed resource type

[0108] "action": None, # stores the parsed action type

[0109] "options": {} # stores the parsed options dictionary

[0110] }

[0111] This dictionary is filled in during the parsing process. When the state machine reaches the accept state, this dictionary contains the complete parsed result. The options are stored as key-value pairs.

[0112] The complete parsed_command class after a successful parse:

[0113] parsed_command = {

[0114] "platform": gcloud, # stores the parsed platform identifier

[0115] "resource": compute instances, # stores the parsed resource type

[0116] "action": create, # stores the parsed action type

[0117] "options": {

[0118] "image": "f02ad6e4-15f8-4917-86bf-859d7fd8a83a"

[0119] "image-project": "ubuntu-os-cloud"

[0120] "machine-type": "HighPerformance"

[0121] "subnet": "default"} # stores the parsed options dictionary

[0122] }

[0123] Step 3, the instruction mapper maps the parsed instruction elements into the equivalent instruction template of the target cloud platform through a mapping function. The working mode is that the mapper maps the instructions of GCP to the instruction templates of the target platforms such as AWS and OpenStack through a mapping rule library pre-stored in the system. The mapping rule library stores the instruction templates of different cloud platforms, allowing the system to automatically select the appropriate template. While the mapping function

[0124] M(PLATFORM, RESOURCE, ACTION, OPTIONS)→CommandTemplate

[0125] is 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--subnet default

[0128] the mapper maps it to the instruction template of Openstack

[0129] openstack server create--image{IMAGE}--flavor{FLAVOR}--network{NETWORK}--key-name{KEY_NAME}

[0130] wherein the --image f02ad6e4-15f8-4917-86bf-859d7fd8a83a of gcloud corresponds to the --image{IMAGE} of openstack, --machine-type HighPerformance corresponds to --flavor{FLAVOR}, --subnet default corresponds to --network{NETWORK}, and --key-name{KEY_NAME} is a parameter missing in the mapping process, which will be filled in the default value.

[0131] The parameter part in the instruction template generated by the instruction mapper uses placeholders to temporarily replace, and the specific parameter values will be replaced by the instruction generator using string interpolation technology.

[0132] The mapping function can map different cloud platform instruction templates according to resources and operations. The mapping rule library can support new cloud platforms and operation instructions through regular updates, thereby ensuring the long-term scalability of the system. Through the mapping of resources and operations, the system can automatically adapt to the differences in instruction interfaces between different cloud platforms, improving 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 not complete, additional parameters are needed. Or if the necessary parameters of the target cloud platform are missing, the parameters need to be completed

[0134] For example: In the above step 3, the parameter key-name is missing.

[0135] In the case of missing parameters, the processing steps for completing the parameters are as follows:

[0136] Step 41, the system will detect the parameters input by the user during the mapping stage, and check against the instruction template of the target cloud platform to check if there are missing parameters.

[0137] Step 42, if the system detects that the user has not provided the necessary parameters of the target cloud platform, the system will try to use the predefined default value. For example, if the user does not specify the key-name, the system can automatically select the default value my-keypair.

[0138] Step 43, if the default value cannot replace the missing parameter, the system will prompt the user to complete the missing parameter through the user interface. The system will list the missing parameters and provide options for filling in.

[0139] Step 44, after completing the parameters, the system will regenerate the instruction and replace the template parameters through string interpolation technology, and perform legality check and dynamic verification to ensure the accuracy of the generated instruction.

[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, generating the final executable target cloud platform instruction.

[0141] The string interpolation process of the instruction generator includes legality check and dynamic verification of parameters. When generating instructions, the system will check whether the parameters provided by the user meet 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. In addition, the generated instruction can be simulated or tested in a sandbox to ensure its correct execution on the target platform.

[0142] The instruction generator is responsible for replacing the specific parameters input by the user into the placeholders in the target cloud platform instruction template. String interpolation technology is used to replace placeholders such as {IMAGE}, {FLAVOR}, etc. in the template with 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 instruction is a complete instruction that can be directly executed on the target platform.

[0145] In summary, the present application formalizes the cross-platform instruction parsing and generation process in a multi-cloud environment, solving 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 interworking method based on finite state machine (FSM) is designed, which can gradually parse and recognize 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, ensuring the correctness and compatibility of instruction conversion; then, string interpolation technology is used to generate the final executable instruction, dynamically adapting to different parameters input by the user, improving the flexibility and automation of instruction generation, and realizing integrated management of instruction operation in a multi-cloud environment.

[0146] The above only describes the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the scope of the claims of the present application.

Claims

1. A method for cross-platform instruction set interworking based on finite state machines, the method comprising: The cross-platform instruction set interworking method is implemented through a cross-platform instruction set interworking system, and the cross-platform instruction set interworking system comprises a user interface layer and a business logic layer, the user interface layer comprises a cloud platform instruction input interface, which is used for receiving user input instructions and showing platform feedback information to the user, and the business logic layer comprises an instruction parser, an instruction mapper and an instruction generator, and the business logic layer is responsible for parsing, mapping and generating final target cloud platform instructions of the user input instructions; specifically, the cross-platform instruction set interworking method specifically comprises the following steps: ​ Step 1, receiving user input instructions: receiving cloud platform instructions input by a user through a user interface layer, and forwarding the cloud platform instructions to the business logic layer; Step 2, the instruction parser of the business logic layer parses the received cloud platform instructions step by step through a finite state machine (FSM), and parses out instruction elements, i.e. cloud platform identifiers, resource types, operation types and parameter options in the input instructions; Step 3, after the instruction parsing in step 2 is completed, the instruction mapper of the business logic layer maps the instruction elements parsed out in step 2 to an instruction template of a target cloud platform through a pre-defined mapping function; Step 4, when the instruction template of the target cloud platform requires additional parameters and the user does not provide them, the cross-platform instruction set interworking system completes 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 a string interpolation technology to generate the final executable target cloud platform instructions.

2. The method of claim 1, wherein: In step 1, the cloud platform instructions input by the user include cloud platform identifiers, resource types, operation types and related parameter information, wherein: the cloud platform identifier indicates that the instruction belongs to the cloud platform; the resource type indicates the resource type that the user wants to operate; the operation type indicates the operation that the user wants to perform on the resource, and the cloud platform instruction is manually input through an interface and is transmitted to the business logic layer for further processing.

3. The method of claim 1, wherein: In step 2, the parsing process is specifically: the cloud platform instructions of the user interface layer are divided into cloud platform identifiers, resource types, operation types and related parameter names and specific parameter values, and the division method is to divide the instruction parsing process into five core states by using the five-tuple idea in the finite state machine (FSM) model, wherein the five-tuple in the finite state machine (FSM) model is 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 transition function, which defines the state transition of the cross-platform instruction set interworking system according to the current state, i.e. the first Q and the input symbol set Σ: δ:Q×Σ→Q Wherein: × is a Cartesian product, and → is a mapping relationship.

4. The method of claim 3, wherein: In step 2, the instruction parser of the business logic layer parses the user input instructions step by step through the finite state machine, and the specific parsing steps include the following steps: Step 2.1, when receiving the platform identifier, the cross-platform instruction set interworking system is transferred from the initial state INIT to the PLATFORM cloud platform identifier state under the action of the state transition function δ(INIT, platform) = PLATFORM, and platform is parsed as PLATFORM; Step 2.2, when receiving the resource type, the cross-platform instruction set interworking system is transferred from the PLATFORM cloud platform identifier state to the RESOURCE resource type state under the action of the state transition function δ(PLATFORM, resource) = RESOURCE, and resource is parsed as RESOURCE; Step 2.3, when receiving the operation type, the cross-platform instruction set interworking system is transferred from the RESOURCE resource type state to the ACTION operation type state under the action of the state transition function δ(RESOURCE, action) = ACTION, and action is parsed as ACTION; Step 2.4, when receiving the parameter option, the cross-platform instruction set interworking system is transferred from the ACTION operation type state to the OPTIONS parameter option state under the action of the state transition function δ(ACTION, options) = OPTIONS, and options and its specific parameter values are parsed as OPTIONS in the form of key-value pairs; Step 2.5, when the cross-platform instruction set interworking system enters the OPTIONS state, the cross-platform instruction set interworking system will continue to parse the parameter options, and each parameter option will not cause further state transition. The cross-platform instruction set interworking system will remain in the OPTIONS state until all parameter options, i.e. platform identifier, resource type, operation type and parameter option, are parsed; Step 2.6, when all instructions are parsed, the cross-platform instruction set interworking system will be transferred from the OPTIONS state to the ACCEPT state, indicating that the parsing process has ended.

5. The method of claim 1, wherein: In step 3, the mapping function between the cloud platform identifier, the resource type, the operation type and the parameter option is: M(PLATFORM, RESOURCE, ACTION, OPTIONS)→CommandTemplate Where, PLATFORM represents the cloud platform identifier, RESOURCE represents the resource type, ACTION represents the operation type, OPTIONS represents the parameter option, and CommandTemplate represents the instruction template of the corresponding platform.

6. The method of claim 1, wherein: In step 5, the instruction generator replaces the specific parameters provided by the user into the placeholders in the target platform instruction template by string interpolation technology according to Command = CommandTemplate.replace({options}, value). ​

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