Method, device, electronic device and storage medium for constructing operation system
By checking the integrity, validity and dependency of resource parameters, generating resource templates and creating resource stacks, it solves the problem of users being difficult to determine the correctness of resource parameters and improves system construction efficiency.
Patent Information
- Application Number
- CN202010329359.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-04-23
AI Technical Summary
When calling the template creation system, it is difficult for users to determine the correctness of resource parameters, resulting in resource creation failure and low system construction efficiency.
Obtain the list of available resource parameters through associated queries, receive target parameters and custom parameters input by the user, use integrity, validity and dependency verification algorithms for verification, generate resource templates and create resource stacks, and serialize if creation fails. The context is stored and users can resume work from a break point.
It reduces the possibility of users entering invalid parameters, improves the success rate of resource creation, and improves system construction efficiency.
Smart Images

Figure CN111679893B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for constructing an operating system. Background Art
[0002] At present, with the development of computer technology, it is possible to directly call a specified template to create the resources required by a system and complete the construction of the system. However, in practice, it is found that when calling a template, the user needs to input resource parameters, and the user cannot determine whether the input resource parameters are correct. If the input resource parameters are incorrect, the resource creation will fail. The user may need to adjust the input resource parameters multiple times before successfully creating resources and building a system. The system construction efficiency is not high.
[0003] Therefore, how to improve the system construction efficiency is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above, it is necessary to provide a method, device, electronic device and storage medium for constructing an operating system, which can improve the construction efficiency of the system.
[0005] A first aspect of the present invention provides a method for constructing an operating system, the method comprising:
[0006] Obtain a list of available resource parameters through associated queries;
[0007] receiving a target parameter selected by a user from the list of available resource parameters and a custom parameter input by the user;
[0008] Using a verification algorithm to verify the target parameter and the custom parameter to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm, and a dependency verification algorithm;
[0009] If the verification result indicates that the target parameters and the custom parameters are correct, generating a resource template according to the target parameters and the custom parameters;
[0010] Creating a resource stack according to the resource template;
[0011] According to the resource stack, a running system is constructed.
[0012] In a possible implementation, the using a verification algorithm to verify the target parameter and the custom parameter to obtain a verification result includes:
[0013] Use an integrity check algorithm to determine whether the target parameters and the custom parameters are complete;
[0014] If the multiple custom parameters are complete, use a validity verification algorithm to determine whether the target parameters and the custom parameters are valid;
[0015] If the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and judging whether the dependency of the custom parameters is correct according to the dependency verification algorithm;
[0016] If the dependency relationship of the target parameter is correct and the dependency relationship of the custom parameter is correct, a verification result indicating that the custom parameter is correct is generated.
[0017] In a possible implementation, the using an integrity check algorithm to determine whether the target parameter and the custom parameter are complete includes:
[0018] Determine a first resource definition block corresponding to the target parameter, and determine a second resource definition block corresponding to the custom parameter;
[0019] According to the first resource definition block, determining whether there is a first missing parameter in the target parameter, and according to the second resource definition block, determining whether there is a second missing parameter in the custom parameter, wherein the first missing parameter has no corresponding parameter definition in the first resource definition block, and the second missing parameter has no corresponding parameter definition in the second resource definition block;
[0020] If there is a first missing parameter in the target parameter, or a second missing parameter in the custom parameter, determining that the target parameter or the custom parameter is incomplete; or
[0021] If the first missing parameter does not exist in the target parameter and the second missing parameter does not exist in the custom parameter, it is determined that the target parameter and the custom parameter are complete.
[0022] In a possible implementation manner, the determining whether the target parameter and the custom parameter are valid includes:
[0023] Obtaining a first preset format requirement corresponding to the target parameter and obtaining a second preset format requirement corresponding to the custom parameter;
[0024] Determining whether the format of the target parameter meets the first preset format requirement, and determining whether the format of the custom parameter meets the second preset format requirement;
[0025] If the format of the target parameter meets the first preset format requirement, and the format of the custom parameter meets the second preset format requirement, determining that the target parameter and the custom parameter are valid;
[0026] If the format of the target parameter does not meet the first preset format requirement, or the format of the custom parameter does not meet the second preset format requirement, it is determined that the target parameter or the custom parameter is valid.
[0027] In a possible implementation, creating a resource stack according to the resource template includes:
[0028] Create an empty stack;
[0029] Determine dependent resource parameters having a dependency relationship and determine non-dependent resource parameters having no dependency relationship from all resource parameters indicated by the resource template;
[0030] In the empty stack, non-dependent resources are created in parallel through multiple threads according to the non-dependent resource parameters, and dependent resources are created serially according to the dependent resource parameters to obtain a resource stack, wherein the resource stack includes multiple resources and the resource stack is stored in the blockchain.
[0031] In a possible implementation, the method further includes:
[0032] If the resource stack fails to be created, the current context environment is obtained;
[0033] Serialize the current context environment to obtain serialized data;
[0034] The serialized data is stored in a database.
[0035] In a possible implementation, after storing the serialized data in a database, the method further includes:
[0036] Receiving a breakpoint-resume instruction input by a user, and acquiring the serialized data from the database;
[0037] Deserialize the serialized data to obtain the current context environment;
[0038] Continue to create the resource stack according to the current context environment.
[0039] A second aspect of the present invention provides an operating system construction device, the device comprising:
[0040] The acquisition module is used to obtain a list of available resource parameters through associated queries;
[0041] A receiving module, used for receiving a target parameter selected by a user from the available resource parameter list and a custom parameter input by the user;
[0042] A verification module, used to verify the target parameters and the custom parameters using a verification algorithm to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm, and a dependency verification algorithm;
[0043] A generating module, configured to generate a resource template according to the target parameters and the custom parameters if the verification result indicates that the target parameters and the custom parameters are correct;
[0044] A creation module, used to create a resource stack according to the resource template;
[0045] The construction module is used to construct a running system according to the resource stack.
[0046] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the operating system construction method when executing a computer program stored in the memory.
[0047] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the operating system construction method when executed by a processor.
[0048] According to the above technical solution, in the present invention, the latest list of available resource parameters can be obtained through associated query for user selection, which can reduce the user's input of invalid resource parameters. At the same time, before creating a group of resources (resource stack), the resource parameters are verified to feedback the cause of the error to the user, avoiding the user from entering invalid resource parameters again, improving the success rate of resource creation, and thus improving the system construction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of a preferred embodiment of a method for constructing an operating system disclosed by the present invention.
[0050] Figure 2 It is a functional module diagram of a preferred embodiment of an operating system construction device disclosed in the present invention.
[0051] Figure 3 It is a schematic diagram of the structure of an electronic device of a preferred embodiment of the method for building a running system according to the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0054] The operating system construction method of the embodiment of the present invention is applied in an electronic device, and can also be applied in a hardware environment consisting of an electronic device and a server connected to the electronic device via a network, and is executed by the server and the electronic device together. The network includes but is not limited to: a wide area network, a metropolitan area network or a local area network.
[0055] Among them, a server can refer to a computer system that can provide services to other devices (such as electronic devices) in the network. If a personal computer can provide File Transfer Protocol (FTP) services to the outside world, it can also be called a server. In a narrow sense, a server refers specifically to certain high-performance computers that can provide services to the outside world through the network. Compared with ordinary personal computers, it has higher requirements in terms of stability, security, and performance. Therefore, it is different from ordinary personal computers in terms of hardware such as CPU, chipset, memory, disk system, network, etc.
[0056] The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc. The electronic device may also include network devices and / or user devices. Among them, the network device includes but is not limited to a single network device, a server group composed of multiple network devices, or a cloud composed of a large number of hosts or network devices based on cloud computing (Cloud Computing), wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets. The user device includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, tablet computer, smart phone, personal digital assistant PDA, etc.
[0057] See also Figure 1 , Figure 1 The flowchart of a preferred embodiment of a method for constructing an operating system disclosed in the present invention is shown in FIG. 1 . The order of the steps in the flowchart can be changed and some steps can be omitted according to different requirements. The execution subject of the method for constructing an operating system can be an electronic device.
[0058] S11. Obtain a list of available resource parameters through associated query.
[0059] The associated query may be to query all resources, obtain available resources, and query various parameters associated with these available resources.
[0060] The available resource parameter list is the resource parameters of currently idle resources.
[0061] S12: Receive the target parameter selected by the user from the available resource parameter list and the custom parameter input by the user.
[0062] In the embodiment of the present invention, all parameters in the available resource parameter list may be output (displayed), and the user may select and input the parameters he / she wants according to all parameters in the available resource parameter list.
[0063] S13. Use a verification algorithm to verify the target parameter and the custom parameter to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm, and a dependency verification algorithm.
[0064] The verification result is used to indicate whether the target parameters and the custom parameters are correct and the cause of the error.
[0065] In the embodiment of the present invention, the type, value range, length, etc. of the target parameter and the custom parameter can be verified. For example, if the subnet mask length range is limited to 22 to 26, the longest attribute value (MaxValue) of the subnet mask and the shortest attribute value (MinValue) of the subnet mask can be set to directly determine whether the length of the subnet mask parameter meets the specification. A verification result is generated.
[0066] Specifically, the use of a verification algorithm to verify the target parameter and the custom parameter to obtain a verification result includes:
[0067] Use an integrity check algorithm to determine whether the target parameters and the custom parameters are complete;
[0068] If the multiple custom parameters are complete, use a validity verification algorithm to determine whether the target parameters and the custom parameters are valid;
[0069] If the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and judging whether the dependency of the custom parameters is correct according to the dependency verification algorithm;
[0070] If the dependency relationship of the target parameter is correct and the dependency relationship of the custom parameter is correct, a verification result indicating that the custom parameter is correct is generated.
[0071] In this optional implementation, a resource can have multiple parameters, and it is necessary to ensure that the parameters of various resources meet the specifications and are complete. There may be dependencies between different resources, and it is necessary to determine whether the dependencies entered by the user are correct. It can be confirmed whether the dependent resources exist. If they exist, the dependencies are determined to be correct. If the dependent resources cannot be found, the dependencies are determined to be incorrect. For example, a network resource (Network) depends on a network segment resource (vpc). The output identification parameter (uuid) created by the network segment resource can be used as an input parameter to pass to the network resource as a network segment identifier (vpcId) and saved as a certain attribute parameter. Characters (such as: Ref:A) can be used to indicate the dependency resource A output parameter uuid; characters (such as: Ref:Fn::GetAtt":["A","vpcId"]) can be used to indicate that the output parameter vpcId of resource A is assigned to the target parameter.
[0072] Specifically, the use of an integrity check algorithm to determine whether the target parameter and the custom parameter are complete includes:
[0073] Determine a first resource definition block corresponding to the target parameter, and determine a second resource definition block corresponding to the custom parameter;
[0074] According to the first resource definition block, determining whether there is a first missing parameter in the target parameter, and according to the second resource definition block, determining whether there is a second missing parameter in the custom parameter, wherein the first missing parameter has no corresponding parameter definition in the first resource definition block, and the second missing parameter has no corresponding parameter definition in the second resource definition block;
[0075] If there is a first missing parameter in the target parameter, or a second missing parameter in the custom parameter, determining that the target parameter or the custom parameter is incomplete; or
[0076] If the first missing parameter does not exist in the target parameter and the second missing parameter does not exist in the custom parameter, it is determined that the target parameter and the custom parameter are complete.
[0077] Among them, a resource block can be a complete parameter definition of a certain type of resources.
[0078] In this optional implementation, the parameters of a certain type of resource input by the user may be checked one by one to ensure that the parameters input by the user are complete. Optionally, if a certain parameter is missing, a prompt message may be generated and output.
[0079] Specifically, the determining whether the target parameter and the custom parameter are valid includes:
[0080] Obtaining a first preset format requirement corresponding to the target parameter and obtaining a second preset format requirement corresponding to the custom parameter;
[0081] Determining whether the format of the target parameter meets the first preset format requirement, and determining whether the format of the custom parameter meets the second preset format requirement;
[0082] If the format of the target parameter meets the first preset format requirement, and the format of the custom parameter meets the second preset format requirement, determining that the target parameter and the custom parameter are valid;
[0083] If the format of the target parameter does not meet the first preset format requirement, or the format of the custom parameter does not meet the second preset format requirement, it is determined that the target parameter or the custom parameter is valid.
[0084] In this optional implementation, each parameter can be format checked to determine whether the parameter meets the format requirements, such as detecting whether there are illegal characters, whether it exceeds the value range, etc. For example, the length range of creating a subnet mask is 26-29. If the value entered by the user is not an integer or is not within the target range, a prompt message can be output. In addition, if the creation parameter vpcId of the network resource is used, it can rely on the newly created network segment resources or the historically created network segment resources. If the historically created network segment resource parameter vpcId is used, the format is such as vpcId: "Vpc-hssd7sds", where Vpc-hssd7sds is the identification parameter uuid of the network segment resource. At this time, it is necessary to verify whether the uuid is real and valid, otherwise it will cause the resource creation to fail.
[0085] S14. If the verification result indicates that the target parameters and the custom parameters are correct, generate a resource template according to the target parameters and the custom parameters.
[0086] The resource template may include the template parameters and resource definition blocks of all resources corresponding to the custom parameters, that is, including parameter definitions of these resources.
[0087] S15. Create a resource stack according to the resource template.
[0088] The resource stack is a unit used to manage operations such as creation and deletion of a group of resources, and is itself a group of resources, namely, composed of multiple created resources.
[0089] Among them, the resource template can be regarded as a resource configuration, and the parameters (configuration) of various resources are recorded according to the resource template. The resource stack is a data structure, and resources are created in the resource stack. According to the resource template, there can be an empty stack without content. Then, resources are continuously created in this empty stack to form a complete resource stack.
[0090] Specifically, creating a resource stack according to the resource template includes:
[0091] Create an empty stack;
[0092] Determine dependent resource parameters having a dependency relationship and determine non-dependent resource parameters having no dependency relationship from all resource parameters indicated by the resource template;
[0093] In the empty stack, non-dependent resources are created in parallel through multiple threads according to the non-dependent resource parameters, and dependent resources are created serially according to the dependent resource parameters to obtain a resource stack, wherein the resource stack includes multiple resources and the resource stack is stored in the blockchain.
[0094] It should be emphasized that in order to further ensure the privacy and security of the above resource stack, the above resource stack can also be stored in a node of a blockchain.
[0095] In this optional implementation, a resource must be created after the resources it depends on are created, otherwise the creation will fail. Therefore, for resources that do not depend on other resources, they can be created simultaneously (in parallel) in a multi-threaded manner. For resources that depend on other resources, the dependent resources must be created first (in serial).
[0096] As an optional implementation, the method further includes:
[0097] If the resource stack fails to be created, the current context environment is obtained;
[0098] Serialize the current context environment to obtain serialized data;
[0099] The serialized data is stored in a database.
[0100] In this optional implementation, during the resource creation process, if a resource fails to be created, the current context environment is saved and serialized in the database.
[0101] As an optional implementation, after storing the serialized data in a database, the method further includes:
[0102] Receiving a breakpoint-resume instruction input by a user, and acquiring the serialized data from the database;
[0103] Deserialize the serialized data to obtain the current context environment;
[0104] Continue to create the resource stack according to the current context environment.
[0105] In this optional implementation, when the user resumes the work from a breakpoint, the work is executed after deserialization. The resources in the resource stack are atomic nodes. When the resource orchestration engine completes the creation of the current node, the result is displayed to the user in real time, so that the current creation progress of the system can be viewed intuitively.
[0106] S16: construct an operating system according to the resource stack.
[0107] The operating system is composed of various resources and provides an operating environment for various programs.
[0108] In an embodiment of the present invention, according to each resource in the resource stack, the corresponding system construction program is called to build and operate the system. If the resources in the resource stack include a 2-core 4G cloud CPU, 8G cloud memory, and 100G cloud space, a cloud system with a 2-core 4G CPU, 8G memory, and 100G capacity can be built.
[0109] exist Figure 1 In the described method flow, in the present invention, the latest list of available resource parameters can be obtained through associated query for user selection, which can reduce the user's input of invalid resource parameters. At the same time, before creating a group of resources (resource stack), the resource parameters are checked to feed back the cause of the error to the user, avoiding the user from entering invalid resource parameters again, improving the success rate of resource creation, and thus improving the system construction efficiency.
[0110] See also Figure 2 , Figure 2 It is a functional module diagram of a preferred embodiment of an operating system construction device disclosed in the present invention.
[0111] In some embodiments, the operating system construction device is run in an electronic device. The operating system construction device may include a plurality of functional modules composed of program code segments. The program code of each program segment may be stored in a memory and executed by at least one processor to execute Figure 1 Part or all of the steps in the described method for building an operating system.
[0112] In this embodiment, the operating system construction device can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 201, a receiving module 202, a verification module 203, a generation module 204, a creation module 205 and a construction module 206. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.
[0113] The acquisition module 201 is used to acquire a list of available resource parameters through an associated query.
[0114] The associated query may be to query all resources, obtain available resources, and query various parameters associated with these available resources.
[0115] The available resource parameter list is the resource parameters of currently idle resources.
[0116] The receiving module 202 is used to receive the target parameter selected by the user from the available resource parameter list and the custom parameter input by the user.
[0117] In the embodiment of the present invention, all parameters in the available resource parameter list may be output (displayed), and the user may select and input the parameters he / she wants according to all parameters in the available resource parameter list.
[0118] The verification module 203 is used to use a verification algorithm to verify the target parameters and the custom parameters to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm and a dependency verification algorithm.
[0119] The verification result is used to indicate whether the target parameters and the custom parameters are correct and the cause of the error.
[0120] In the embodiment of the present invention, the type, value range, length, etc. of the target parameter and the custom parameter can be verified. For example, if the subnet mask length range is limited to 22 to 26, the longest attribute value (MaxValue) of the subnet mask and the shortest attribute value (MinValue) of the subnet mask can be set to directly determine whether the length of the subnet mask parameter meets the specification. A verification result is generated.
[0121] The generating module 204 is configured to generate a resource template according to the target parameters and the custom parameters if the verification result indicates that the target parameters and the custom parameters are correct.
[0122] The resource template may include the template parameters and resource definition blocks of all resources corresponding to the custom parameters, that is, including parameter definitions of these resources.
[0123] The creation module 205 is used to create a resource stack according to the resource template.
[0124] The resource stack is a unit used to manage operations such as creation and deletion of a group of resources, and is itself a group of resources, namely, composed of multiple created resources.
[0125] Among them, the resource template can be regarded as a resource configuration, and the parameters (configuration) of various resources are recorded according to the resource template. The resource stack is a data structure, and resources are created in the resource stack. According to the resource template, there can be an empty stack without content. Then, resources are continuously created in this empty stack to form a complete resource stack.
[0126] The construction module 206 is used to construct an operating system according to the resource stack.
[0127] The operating system is composed of various resources and provides an operating environment for various programs.
[0128] In an embodiment of the present invention, according to each resource in the resource stack, the corresponding system construction program is called to build and operate the system. If the resources in the resource stack include a 2-core 4G cloud CPU, 8G cloud memory, and 100G cloud space, a cloud system with a 2-core 4G CPU, 8G memory, and 100G capacity can be built.
[0129] As an optional implementation, the verification module 203 uses a verification algorithm to verify the target parameter and the custom parameter, and the verification result is obtained in the following manner:
[0130] Use an integrity check algorithm to determine whether the target parameters and the custom parameters are complete;
[0131] If the multiple custom parameters are complete, use a validity verification algorithm to determine whether the target parameters and the custom parameters are valid;
[0132] If the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and judging whether the dependency of the custom parameters is correct according to the dependency verification algorithm;
[0133] If the dependency relationship of the target parameter is correct and the dependency relationship of the custom parameter is correct, a verification result indicating that the custom parameter is correct is generated.
[0134] In this optional implementation, a resource can have multiple parameters, and it is necessary to ensure that the parameters of various resources meet the specifications and are complete. There may be dependencies between different resources, and it is necessary to determine whether the dependencies entered by the user are correct. It can be confirmed whether the dependent resources exist. If they exist, the dependencies are determined to be correct. If the dependent resources cannot be found, the dependencies are determined to be incorrect. For example, a network resource (Network) depends on a network segment resource (vpc). The output identification parameter (uuid) created by the network segment resource can be used as an input parameter to pass to the network resource as a network segment identifier (vpcId) and saved as a certain attribute parameter. Characters (such as: Ref:A) can be used to indicate the dependency resource A output parameter uuid; characters (such as: Ref:Fn::GetAtt":["A","vpcId"]) can be used to indicate that the output parameter vpcId of resource A is assigned to the target parameter.
[0135] As an optional implementation, the verification module 203 uses an integrity verification algorithm to determine whether the target parameter and the custom parameter are complete in the following manner:
[0136] Determine a first resource definition block corresponding to the target parameter, and determine a second resource definition block corresponding to the custom parameter;
[0137] According to the first resource definition block, determining whether there is a first missing parameter in the target parameter, and according to the second resource definition block, determining whether there is a second missing parameter in the custom parameter, wherein the first missing parameter has no corresponding parameter definition in the first resource definition block, and the second missing parameter has no corresponding parameter definition in the second resource definition block;
[0138] If there is a first missing parameter in the target parameter, or a second missing parameter in the custom parameter, determining that the target parameter or the custom parameter is incomplete; or
[0139] If the first missing parameter does not exist in the target parameter and the second missing parameter does not exist in the custom parameter, it is determined that the target parameter and the custom parameter are complete.
[0140] Among them, a resource block can be a complete parameter definition of a certain type of resources.
[0141] In this optional implementation, the parameters of a certain type of resource input by the user may be checked one by one to ensure that the parameters input by the user are complete. Optionally, if a certain parameter is missing, a prompt message may be generated and output.
[0142] As an optional implementation, the verification module 203 determines whether the target parameter and the custom parameter are valid in the following manner:
[0143] Obtaining a first preset format requirement corresponding to the target parameter and obtaining a second preset format requirement corresponding to the custom parameter;
[0144] Determining whether the format of the target parameter meets the first preset format requirement, and determining whether the format of the custom parameter meets the second preset format requirement;
[0145] If the format of the target parameter meets the first preset format requirement, and the format of the custom parameter meets the second preset format requirement, determining that the target parameter and the custom parameter are valid;
[0146] If the format of the target parameter does not meet the first preset format requirement, or the format of the custom parameter does not meet the second preset format requirement, it is determined that the target parameter or the custom parameter is valid.
[0147] In this optional implementation, each parameter can be format checked to determine whether the parameter meets the format requirements, such as detecting whether there are illegal characters, whether it exceeds the value range, etc. For example, the length range of creating a subnet mask is 26-29. If the value entered by the user is not an integer or is not within the target range, a prompt message can be output. In addition, if the creation parameter vpcId of the network resource is used, it can rely on the newly created network segment resources or the historically created network segment resources. If the historically created network segment resource parameter vpcId is used, the format is such as vpcId: "Vpc-hssd7sds", where Vpc-hssd7sds is the identification parameter uuid of the network segment resource. At this time, it is necessary to verify whether the uuid is real and valid, otherwise it will cause the resource creation to fail.
[0148] As an optional implementation manner, creating a resource stack according to the resource template includes:
[0149] The creation module 205 is also used to create an empty stack;
[0150] The operating system construction device may further include:
[0151] A determination module, used to determine dependent resource parameters having a dependency relationship and determine non-dependent resource parameters having no dependency relationship from all resource parameters indicated by the resource template;
[0152] The creation module 205 is also used to create non-dependent resources in parallel through multi-threading in the empty stack according to the non-dependent resource parameters, and to create dependent resources serially according to the dependent resource parameters to obtain a resource stack, wherein the resource stack includes multiple resources and the resource stack is stored in the blockchain.
[0153] In this optional implementation, a resource must be created after the resources it depends on are created, otherwise the creation will fail. Therefore, for resources that do not depend on other resources, they can be created simultaneously (in parallel) in a multi-threaded manner. For resources that depend on other resources, the dependent resources must be created first (in serial).
[0154] As an optional implementation, the acquisition module 201 is further configured to acquire the current context environment if the resource stack creation fails;
[0155] The operating system construction device may further include:
[0156] A serialization module, used for serializing the current context environment to obtain serialized data;
[0157] The storage module is used to store the serialized data in a database.
[0158] In this optional implementation, during the resource creation process, if a resource fails to be created, the current context environment is saved and serialized in the database.
[0159] As an optional implementation, the receiving module 202 is further configured to receive a breakpoint resume instruction input by a user after the storage module stores the serialized data in a database, and obtain the serialized data from the database;
[0160] The operating system construction device may further include:
[0161] A deserialization module, used for deserializing the serialized data to obtain the current context environment;
[0162] The creation module 205 is further configured to continue creating the resource stack according to the current context environment.
[0163] In this optional implementation, when the user resumes the work from a breakpoint, the work is executed after deserialization. The resources in the resource stack are atomic nodes. When the resource orchestration engine completes the creation of the current node, the result is displayed to the user in real time, so that the current creation progress of the system can be viewed intuitively.
[0164] exist Figure 2In the described operating system construction device, the latest list of available resource parameters can be obtained through associated queries for users to choose from, which can reduce the number of users entering invalid resource parameters. At the same time, before creating a group of resources (resource stack), the resource parameters are checked to feedback the cause of the error to the user, avoiding the user from entering invalid resource parameters again, thereby improving the success rate of resource creation and improving the system construction efficiency.
[0165] like Figure 3 As shown, Figure 3 The electronic device 3 includes a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and executable on the at least one processor 32, and at least one communication bus 34.
[0166] Those skilled in the art will understand that Figure 3 The schematic diagram shown is merely an example of the electronic device 3 and does not constitute a limitation on the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 3 may also include input and output devices, network access devices, etc.
[0167] The electronic device 3 also includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touch pad or voice control device, such as a personal computer, tablet computer, smart phone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc. The network where the electronic device 3 is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0168] The at least one processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, discrete hardware components, etc. The processor 32 may be a microprocessor or any conventional processor, etc. The processor 32 is the control center of the electronic device 3, and uses various interfaces and lines to connect various parts of the entire electronic device 3.
[0169] The memory 31 can be used to store the computer program 33 and / or modules / units. The processor 32 implements various functions of the electronic device 3 by running or executing the computer program and / or modules / units stored in the memory 31 and calling the data stored in the memory 31. The memory 31 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 3 (such as audio data, etc.), etc. In addition, the memory 31 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, etc.
[0170] Combination Figure 1 , the memory 31 in the electronic device 3 stores a plurality of instructions to implement a method for building an operating system, and the processor 32 can execute the plurality of instructions to implement:
[0171] Obtain a list of available resource parameters through associated queries;
[0172] receiving a target parameter selected by a user from the list of available resource parameters and a custom parameter input by the user;
[0173] Using a verification algorithm to verify the target parameter and the custom parameter to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm, and a dependency verification algorithm;
[0174] If the verification result indicates that the target parameters and the custom parameters are correct, generating a resource template according to the target parameters and the custom parameters;
[0175] Creating a resource stack according to the resource template;
[0176] According to the resource stack, a running system is constructed.
[0177] Specifically, the specific implementation method of the processor 32 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0178] exist Figure 3 In the described electronic device 3, the latest list of available resource parameters can be obtained through associated queries for users to choose from, which can reduce the number of invalid resource parameters input by users. At the same time, before creating a group of resources (resource stack), the resource parameters are checked to feedback the cause of the error to the user, avoiding the user from entering invalid resource parameters again, thereby improving the success rate of resource creation and improving the system construction efficiency.
[0179] If the module / unit integrated in the electronic device 3 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program code can be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
[0180] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0181] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0183] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0184] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any accompanying figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim may also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, and do not indicate any particular order.
[0185] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for constructing an operating system, characterized in that: The operating system construction method includes: Obtain a list of available resource parameters through associated queries; receiving a target parameter selected by a user from the list of available resource parameters and a custom parameter input by the user; Use a verification algorithm to verify the target parameters and the custom parameters to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm and a dependency verification algorithm, and the use of the verification algorithm to verify the target parameters and the custom parameters to obtain a verification result includes: using the integrity verification algorithm to determine whether the target parameters and the custom parameters are complete; if multiple custom parameters are complete, using the validity verification algorithm to determine whether the target parameters and the custom parameters are valid; if the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and whether the dependency of the custom parameters is correct according to the dependency verification algorithm; if the dependency of the target parameters is correct and the dependency of the custom parameters is correct, generating a verification result indicating that the custom parameters are correct; wherein, the use of the integrity verification algorithm to verify the target parameters and the custom parameters to obtain a verification result includes: using the integrity verification algorithm to determine whether the target parameters and the custom parameters are complete; if multiple custom parameters are complete, using the validity verification algorithm to determine whether the target parameters and the custom parameters are valid; if the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and whether the dependency of the custom parameters is correct according to the dependency verification algorithm; if the dependency of the target parameters is correct and the dependency of the custom parameters is correct, generating a verification result indicating that the custom parameters are correct; The algorithm for determining whether the target parameter and the custom parameter are complete includes: determining a first resource definition block corresponding to the target parameter, and determining a second resource definition block corresponding to the custom parameter; determining whether a first missing parameter exists in the target parameter based on the first resource definition block, and determining whether a second missing parameter exists in the custom parameter based on the second resource definition block, wherein the first missing parameter does not have a corresponding parameter definition in the first resource definition block, and the second missing parameter does not have a corresponding parameter definition in the second resource definition block; if the first missing parameter exists in the target parameter, or the second missing parameter exists in the custom parameter, determining that the target parameter or the custom parameter is incomplete; or if the first missing parameter does not exist in the target parameter, and the second missing parameter does not exist in the custom parameter, determining that the target parameter and the custom parameter are complete; If the verification result indicates that the target parameters and the custom parameters are correct, generating a resource template according to the target parameters and the custom parameters; Creating a resource stack according to the resource template includes: creating an empty stack; determining dependent resource parameters with dependencies and determining non-dependent resource parameters without dependencies from all resource parameters indicated by the resource template; creating non-dependent resources in parallel using multiple threads in the empty stack according to the non-dependent resource parameters, and creating dependent resources serially according to the dependent resource parameters, to obtain a resource stack, wherein the resource stack includes multiple resources and is stored in a blockchain; Build an operating system based on the resource stack; The operating system construction method further includes: If the resource stack fails to be created, obtain the current context; Serialize the current context environment to obtain serialized data; The serialized data is stored in a database.
2. The operating system construction method according to claim 1, characterized in that: Determining whether the target parameter and the custom parameter are valid includes: Obtaining a first preset format requirement corresponding to the target parameter and obtaining a second preset format requirement corresponding to the custom parameter; Determining whether the format of the target parameter complies with the first preset format requirement, and determining whether the format of the custom parameter complies with the second preset format requirement; If the format of the target parameter meets the first preset format requirement, and the format of the custom parameter meets the second preset format requirement, determining that the target parameter and the custom parameter are valid; If the format of the target parameter does not meet the first preset format requirement, or the format of the custom parameter does not meet the second preset format requirement, it is determined that the target parameter or the custom parameter is valid.
3. The operating system construction method according to claim 1, characterized in that: After storing the serialized data in a database, the operating system construction method further includes: receiving a breakpoint resume instruction input by a user, and obtaining the serialized data from the database; Deserialize the serialized data to obtain the current context; Continue creating the resource stack according to the current context.
4. An operating system construction device, characterized in that: The operating system construction device includes: The acquisition module is used to obtain a list of available resource parameters through associated queries; A receiving module, configured to receive target parameters selected by a user from the available resource parameter list and custom parameters input by the user; A verification module is used to use a verification algorithm to verify the target parameters and the custom parameters to obtain a verification result, wherein the verification algorithm includes an integrity verification algorithm, a validity verification algorithm and a dependency verification algorithm, and the use of the verification algorithm to verify the target parameters and the custom parameters to obtain a verification result includes: using the integrity verification algorithm to determine whether the target parameters and the custom parameters are complete; if multiple custom parameters are complete, using the validity verification algorithm to determine whether the target parameters and the custom parameters are valid; if the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and whether the dependency of the custom parameters is correct according to the dependency verification algorithm; if the dependency of the target parameters is correct and the dependency of the custom parameters is correct, generating a verification result indicating that the custom parameters are correct; wherein, using the complete verification algorithm to verify the target parameters and the custom parameters to obtain a verification result includes: using the integrity verification algorithm to determine whether the target parameters and the custom parameters are complete; if multiple custom parameters are complete, using the validity verification algorithm to determine whether the target parameters and the custom parameters are valid; if the multiple custom parameters are valid, judging whether the dependency of the target parameters is correct and whether the dependency of the custom parameters is correct according to the dependency verification algorithm; if the dependency of the target parameters is correct and the dependency of the custom parameters is correct, generating a verification result indicating that the custom parameters are correct; The integrity check algorithm for determining whether the target parameter and the custom parameter are complete includes: determining a first resource definition block corresponding to the target parameter, and determining a second resource definition block corresponding to the custom parameter; determining whether a first missing parameter exists in the target parameter based on the first resource definition block, and determining whether a second missing parameter exists in the custom parameter based on the second resource definition block, wherein the first missing parameter does not have a corresponding parameter definition in the first resource definition block, and the second missing parameter does not have a corresponding parameter definition in the second resource definition block; if the first missing parameter exists in the target parameter, or the second missing parameter exists in the custom parameter, determining that the target parameter or the custom parameter is incomplete; or if the first missing parameter does not exist in the target parameter, and the second missing parameter does not exist in the custom parameter, determining that the target parameter and the custom parameter are complete; a generating module, configured to generate a resource template according to the target parameters and the custom parameters if the verification result indicates that the target parameters and the custom parameters are correct; A creation module, configured to create a resource stack based on the resource template, comprising: creating an empty stack; determining dependent resource parameters with dependencies and determining non-dependent resource parameters without dependencies from all resource parameters indicated by the resource template; creating non-dependent resources in parallel using multiple threads in the empty stack based on the non-dependent resource parameters, and serially creating dependent resources based on the dependent resource parameters to obtain a resource stack, wherein the resource stack includes multiple resources and is stored in a blockchain; A construction module, configured to construct an operating system based on the resource stack; The operating system construction device also includes: The acquisition module is further configured to acquire the current context if the resource stack creation fails; A serialization module, used to serialize the current context environment to obtain serialized data; A storage module is used to store the serialized data in a database.
5. An electronic device, characterized in that: The electronic device includes a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the operating system construction method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the operating system construction method according to any one of claims 1 to 3 is implemented.
