CN109788032B - Method and device for acquiring mirror image file, computer equipment and storage medium - Google Patents

Method and device for acquiring mirror image file, computer equipment and storage medium Download PDF

Info

Publication number
CN109788032B
CN109788032B CN201811544384.8A CN201811544384A CN109788032B CN 109788032 B CN109788032 B CN 109788032B CN 201811544384 A CN201811544384 A CN 201811544384A CN 109788032 B CN109788032 B CN 109788032B
Authority
CN
China
Prior art keywords
node
image file
basic
service
block chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811544384.8A
Other languages
Chinese (zh)
Other versions
CN109788032A (en
Inventor
张伟
褚镇飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201811544384.8A priority Critical patent/CN109788032B/en
Publication of CN109788032A publication Critical patent/CN109788032A/en
Priority to PCT/CN2019/122360 priority patent/WO2020125389A1/en
Application granted granted Critical
Publication of CN109788032B publication Critical patent/CN109788032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords

Abstract

The application relates to a method and a device for acquiring an image file, computer equipment and a storage medium. The method comprises the following steps: acquiring network segment information of the block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node; sending basic parameters of the block chain nodes to an operation server through an access port, wherein the basic parameters are used for indicating the operation server to generate a configuration file according to the basic parameters, and the operation server pre-stores basic mirror image files of the service nodes; pulling a configuration file and a service node basic image file from an operation service machine by using a preset automatic deployment script; and generating a target image file according to the configuration file and the service node basic image file. The method is based on the mobile terminal mirror image technology, realizes automatic deployment of the service node mirror image files of the block chain nodes, effectively reduces the workload of deployment, and greatly reduces the error probability of manually pulling the mirror image files.

Description

Method and device for acquiring mirror image file, computer equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for acquiring an image file, a computer device, and a storage medium.
Background
In the deployment process of the block chain, because the number of the component modules of the block chain is large, the organization and the operation are tedious, and particularly when the distributed cross-network segment deployment is involved. For safety performance consideration, when the mechanism members participating in the block chain set the block chain nodes, the self-established network is often shielded externally, and at this time, each network segment, even each block chain node, needs to prepare a service node image file in advance. When the number of the blockchain nodes is large and the blockchain nodes are in different network segments, the workload of deploying the service node image files to the blockchain nodes one by one is huge, the deployment efficiency is low, and errors are easy to occur.
Disclosure of Invention
Based on this, it is necessary to provide a method and an apparatus for acquiring an image file, a computer device, and a storage medium for solving the technical problems of huge workload, low deployment efficiency, and high possibility of errors in deploying a service node image file to a block link point.
A method for acquiring an image file comprises the following steps:
acquiring network segment information of a block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending the basic parameters of the block chain nodes to an operation service machine through the access port, wherein the basic parameters are used for indicating the operation service machine to generate a configuration file according to the basic parameters, and the operation service machine prestores basic mirror image files of service nodes;
pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, the automation deployment script comprises a boot image file instruction;
after the step of generating the target image file according to the configuration file and the service node basic image file, the method further comprises the following steps:
executing the image file starting instruction to start and execute a target image file to obtain target image service;
and adding the target mirror image service into a block chain node.
In one embodiment, before the step of generating the target image file according to the configuration file and the service node base image file, the method further includes:
analyzing the configuration file to obtain node configuration parameters in the configuration file;
comparing the node configuration parameters with the basic parameters;
and if the node configuration parameters are consistent with the basic parameters, executing the step of generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, the step of sending the basic parameters of the blockchain node to the operation server through the access port includes:
carrying out Hash processing on the basic parameters to obtain a first Hash value;
encrypting the first hash value by using a private key of the block chain node to obtain signature data;
sending the signature data and the basic parameters to the service operation machine, wherein the service operation machine is used for decrypting the signature data by using a public key of the block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameter to obtain a second Hash value; and when the first hash value and the second hash value are consistent, generating a configuration file according to the basic parameter.
A method for acquiring an image file comprises the following steps:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of the block chain node according to the network segment information;
acquiring basic parameters of the block chain nodes through the access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
In one embodiment, the service node base image files include a sequencing node base image file, a peer node base image file and a transaction server base image file;
after the step of generating the configuration file according to the basic parameters, the method further comprises the following steps:
acquiring an identity of the block chain node, and determining a node type corresponding to the block chain node according to the identity, wherein the node type comprises a sequencing node, a peer node and a transaction server node;
and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
An apparatus for obtaining an image file, the apparatus comprising:
the network segment information sending module is used for acquiring network segment information of the block link node and sending the network segment information to the operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block link node;
a basic parameter sending module, configured to send a basic parameter of the block chain node to an operation server through the access port, where the basic parameter is used to instruct the operation server to generate a configuration file according to the basic parameter, and a basic image file of a service node is pre-stored in the operation server;
the file pulling module is used for pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and the mirror image file generation module is used for generating a target mirror image file according to the configuration file and the service node basic mirror image file.
An apparatus for obtaining an image file, the apparatus comprising:
the network segment information acquisition module is used for acquiring a service node basic mirror image file and receiving network segment information of a block link node;
an access port determining module, configured to determine an access port of the block link node according to the network segment information;
a configuration file obtaining module, configured to obtain a basic parameter of the block chain node through the access port, and generate a configuration file according to the basic parameter;
the configuration file is used for pulling the corresponding configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring network segment information of a block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending the basic parameters of the block chain nodes to an operation service machine through the access port, wherein the basic parameters are used for indicating the operation service machine to generate a configuration file according to the basic parameters, and the operation service machine prestores basic mirror image files of service nodes;
pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring network segment information of a block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending the basic parameters of the block chain nodes to an operation service machine through the access port, wherein the basic parameters are used for indicating the operation service machine to generate a configuration file according to the basic parameters, and the operation service machine prestores basic mirror image files of service nodes;
pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of the block chain node according to the network segment information;
acquiring basic parameters of the block chain nodes through the access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of the block chain node according to the network segment information;
acquiring basic parameters of the block chain nodes through the access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
According to the method, the device, the computer equipment and the storage medium for acquiring the mirror image file, the access port of the operation server is determined according to the network segment of the block chain node, the configuration file and the basic mirror image file corresponding to the block chain node are pulled from the operation server through the access port, so that the target mirror image file is generated according to the configuration file and the basic mirror image file, the automatic deployment of the mirror image file of the service node is realized, the error probability of manually pulling the mirror image file is greatly reduced, the workload of deployment is effectively reduced due to the fact that only the basic mirror image file needs to be prepared, and the deployment efficiency of the mirror image file of the service node is improved.
Drawings
FIG. 1 is a diagram illustrating an application scenario of a method for obtaining an image file according to an embodiment;
FIG. 2 is a flowchart illustrating a method for obtaining an image file according to an embodiment;
FIG. 3 is a flowchart illustrating a method for obtaining an image file according to another embodiment;
FIG. 4 is a flowchart illustrating a method for obtaining an image file according to another embodiment;
FIG. 5 is a block diagram showing an exemplary configuration of an apparatus for acquiring an image file;
FIG. 6 is a block diagram showing the structure of an apparatus for acquiring an image file according to another embodiment;
FIG. 7 is a block diagram showing the structure of an apparatus for acquiring an image file according to still another embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for acquiring the image file can be applied to the application environment shown in fig. 1. The operation server 102 communicates with the block link point 104 through a network, a service node basic image file is prepared locally in advance in one operation server 102, a network port which can be accessed by the block link point 104 is opened on the operation server, in the process of deploying the service node image file of the block link node 104, the block link node 104 sends basic parameters to the operation server 102 through the network port corresponding to the network segment where the block link point is located, and the operation server 102 generates a configuration file corresponding to the block link point 104 according to the basic parameters; the blockchain node 104 executes the automation deployment script, and pulls the service node base image file and the configuration file from the operation service machine 102, so as to generate a service node image file corresponding to the service node base image file. The operation server 102 and the blockchain node 104 may be implemented by separate servers or a server cluster composed of a plurality of servers.
In an embodiment, as shown in fig. 2, a method for acquiring an image file is provided, which is described by taking the method as an example for being applied to a blockchain node in fig. 1, and includes the following steps:
step S210: and acquiring network segment information of the block chain node, and sending the network segment information to the operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node.
In the step, the operation server opens a network port which can access the operation server for different network segments in advance; and the block link point sends the network segment information of the block link point to the operation server machine, so that the operation server machine determines the access port of the block link point to the operation server machine.
Step S220: and sending the basic parameters of the block chain nodes to the operation server through the access port, wherein the basic parameters are used for indicating the operation server to generate a configuration file according to the basic parameters, and the basic image file of the service nodes is prestored in the operation server.
In this embodiment, the basic parameters include a service address of a server where the block link point is located, an exposed port and information thereof, and peer levels of the block link nodes; after an access port for accessing the operation server is determined, the block link node sends the basic parameters of the block link node to the operation server, and after the operation server obtains the basic parameters, the configuration file generation tool is executed to generate configuration related configuration files.
Step S230: and pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script.
In this embodiment, the automatic deployment script is uploaded to the block chain node in advance, after the block chain node sends the basic parameters to the operation server, the block chain node executes the automatic deployment script, and pulls the service node basic image file and the configuration file generated by the operation server from the operation server.
Step S240: and generating a target image file according to the configuration file and the service node basic image file.
According to the method for acquiring the mirror image file, the access port of the operation server is determined according to the network segment of the block chain node, the configuration file and the basic mirror image file corresponding to the block chain node are pulled from the operation server through the access port, so that the target mirror image file is generated according to the configuration file and the basic mirror image file, the automatic deployment of the mirror image file of the service node is realized, the error probability of manually pulling the mirror image file is greatly reduced, the deployment and maintenance cost is effectively reduced due to the fact that only the basic mirror image file needs to be prepared, the deployment efficiency of the mirror image file of the service node is improved, in the deployment process of the mirror image file of the service node, the mechanism network corresponding to each block chain node is still shielded outwards, and the safety of the network is effectively guaranteed.
In one embodiment, the automated deployment script includes a start image file instruction; after the step of generating the target image file according to the configuration file and the service node basic image file, the method further comprises the following steps: executing the image file starting instruction to start and execute the target image file to obtain target image service; and adding the target mirror image service into the block chain node.
In this embodiment, the automatic deployment script further includes an image file starting instruction, the block link points execute the automatic deployment script, the service node basic image file and the configuration file are generated into a target image file, and then a program in the target image file is started to be executed, so as to obtain image services corresponding to the block link points, and implement the service node image service deployment, so that the mechanism network corresponding to each block link point keeps external shielding, and the security of the network is effectively ensured.
In an embodiment, before the step of generating the target image file according to the configuration file and the service node base image file, the method further includes: analyzing the configuration file to obtain node configuration parameters in the configuration file; comparing the node configuration parameters with the basic parameters; and if the node configuration parameters are consistent with the basic parameters, executing a step of generating a target image file according to the configuration file and the service node basic image file.
In this embodiment, after the block chain node pulls the corresponding configuration file and the service node basic image file from the service operator, the configuration file is analyzed to obtain the node configuration parameters in the configuration file; and comparing and verifying the node configuration parameters with the basic parameters of the node configuration parameters, and if the verification is passed, generating a target image file according to the configuration file and the basic image file of the service node. The accuracy of the configuration file is ensured by verifying the correctness of various parameters in the configuration file, so that the accuracy of the generation of the mirror image file of the service node is improved, and the deployment error monitoring of the mirror image file is realized.
In one embodiment, the step of sending the basic parameters of the blockchain node to the operation server through the access port comprises: carrying out Hash processing on the basic parameters to obtain a first Hash value; encrypting the first hash value by using a private key of the block chain node to obtain signature data; the method comprises the steps that signature data and basic parameters are sent to a service operator, wherein the service operator is used for decrypting the signature data by using a public key of a block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameters to obtain a second Hash value; and when the first hash value is consistent with the second hash value, generating a configuration file according to the basic parameters.
In this embodiment, before the block link node sends the basic parameter of the node to the service manipulator, the block link node performs hash processing on the basic parameter to obtain a first hash value, and encrypts the obtained first hash value by using a private key of the block link node to obtain signature data; and the block link node sends the basic parameters to the service operation machine and simultaneously sends the signature data to the service operation machine.
After receiving the signature data and the basic parameters, the service manipulator decrypts the signature data by using a public key of the block chain node to obtain a first hash value; meanwhile, the service operating machine performs Hash processing on the basic parameters to obtain a second Hash value, verification of the basic parameters is achieved by comparing whether the first Hash value is consistent with the second Hash value, transmission errors in the transmission process of the basic parameters of the block link points are avoided, the accuracy of generating the configuration file is improved, and the error rate of generating the target image file is reduced.
In an embodiment, as shown in fig. 3, a method for obtaining an image file is provided, which is described by taking the method as an example of being applied to the service operation machine in fig. 1, and includes the following steps: a method for acquiring an image file comprises the following steps:
step S310: and acquiring a basic mirror image file of the service node, and receiving network segment information of the block link node.
Step S320: and determining an access port of the block chain node according to the network segment information.
Step S330: acquiring basic parameters of a block chain node through an access port, and generating a configuration file according to the basic parameters; the configuration file is used for pulling the configuration file and the service node basic image file at the block link point by using a preset automatic deployment script, and then generating a target image file by combining the service node basic image file.
In the embodiment, the service operator uploads the basic image file of the service node locally in advance, and receives the network segment information sent by the blockchain node, the network port accessed by the blockchain node is determined according to the network segment information, so that the basic parameters sent by the blockchain node are received from the determined network port, the basic parameters are generated into the configuration file by using the configuration file generation tool, the blockchain node executes the prestored automatic deployment script to pull the basic image file of the service node and the configuration file from the operation server, and then generates the target image file according to the image file of the service node and the configuration file, thereby realizing the automatic deployment of the image file of the service node, greatly reducing the error probability of manually pulling the image file, effectively reducing the deployment and maintenance cost and improving the deployment efficiency of the image file of the service node due to only needing to prepare the basic image file, in the process of deploying the service node image file, the mechanism network corresponding to each block link point is still shielded externally, and the safety of the network is effectively guaranteed.
In one embodiment, the service operator may open access ports for all network segments in advance, and when the block link points transmit network segment information, the corresponding access ports may be determined quickly.
In one embodiment, the service node base image files include a sequencing node base image file, a peer node base image file, and a transaction server base image file; the step of determining the service node basic image file from the service node basic image file comprises the following steps: acquiring an identity of a block chain node, and determining a node type corresponding to the block chain node according to the identity, wherein the node type comprises a sequencing node, a peer node and a transaction server node; and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
In this embodiment, the node types of the blockchain node include a sequencing node, a peer node, and a transaction server node; correspondingly, the service node basic image files comprise various basic image files such as a sequencing node basic image file, a peer node basic image file, a transaction server basic image file and the like;
specifically, the service operator acquires an identity of a blockchain node, and matches the identity with identity data in a local database; when the identity identification is successfully matched with the identity data, determining the node type corresponding to the identity data as the node type of the block chain link point; and the service operating machine determines the service node basic image file of the corresponding type to the node type as the service node basic image file, so that the service node basic image file is pulled by the block link point.
In one embodiment, as shown in fig. 4, a method for obtaining an image file is provided, which is described by taking an example of the method applied to the service manipulator and the block link point interaction in fig. 1, and includes the following steps:
step S410: the method comprises the steps that a block chain node obtains network segment information of the block chain node and sends the network segment information to an operation server;
step S420: operating a server to obtain a basic mirror image file of a service node and receiving network segment information of a block link node;
step S430: the operation server determines an access port of the block chain node according to the network segment information;
step S440: the block chain node sends the basic parameters of the block chain node to the operation server through the access port;
step S450: the operation server acquires basic parameters of the block chain nodes through the access port and generates a configuration file according to the basic parameters;
step S460: the block link points pull configuration files and service node basic mirror images from the operation service machine by using a preset automatic deployment script;
step S470: and generating a target image file according to the configuration file and the service node basic image file.
In the method for acquiring the mirror image file, the service operation machine uploads the basic mirror image file of the service node locally in advance, the network segment information sent by the block chain node is received, the network port accessed by the block chain node is determined according to the network segment information, so that the basic parameters sent by the block chain node are received from the determined network port, the configuration file is generated by the basic parameters through the configuration file generation tool, the basic mirror image file of the service node and the configuration file are pulled from the operation service machine by the block chain node executing the pre-stored automatic deployment script, and then the target mirror image file is generated according to the mirror image file of the service node and the configuration file, so that the mirror image file of the service node is automatically deployed, the error probability of manually pulling the mirror image file is greatly reduced, and the deployment efficiency of the mirror image file of the service node is improved.
It should be understood that, although the steps in the flowcharts of fig. 2 to 4 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided an apparatus for acquiring an image file, including: a network segment information obtaining module 510, a basic parameter sending module 520, a file pulling module 530 and an image file generating module 540, wherein:
a network segment information sending module 510, configured to obtain network segment information of the node of the block link, and send the network segment information to the operation server, where the network segment information is used to instruct the operation server to determine an access port of the node of the block link;
a basic parameter sending module 520, configured to send a basic parameter of the blockchain node to the operation server through the access port, where the basic parameter is used to instruct the operation server to generate a configuration file according to the basic parameter, and the basic image file of the service node is pre-stored in the operation server;
the file pulling module 530 is configured to pull the configuration file and the service node basic image file from the operation service machine by using a preset automation deployment script;
and the image file generating module 540 is configured to generate a target image file according to the configuration file and the service node base image file.
In one embodiment, the automated deployment script includes a start image file instruction; the image file generation module 540 is configured to execute an image file starting instruction to start and execute a target image file, so as to obtain a target image service; and adding the target mirror image service into the block chain node.
In one embodiment, the image file generating module 540 is configured to analyze the configuration file to obtain a node configuration parameter in the configuration file; comparing the node configuration parameters with the basic parameters; and if the node configuration parameters are consistent with the basic parameters, executing a step of generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, the basic parameter sending module 520 is configured to perform hash processing on the basic parameter to obtain a first hash value; encrypting the first hash value by using a private key of the block chain node to obtain signature data; the method comprises the steps that signature data and basic parameters are sent to a service operator, wherein the service operator is used for decrypting the signature data by using a public key of a block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameters to obtain a second Hash value; and when the first hash value is consistent with the second hash value, generating a configuration file according to the basic parameters.
In one embodiment, as shown in fig. 6, there is provided an apparatus for acquiring an image file, including: a network segment information obtaining module 610, an access port determining module 620 and a configuration file obtaining module 630, wherein:
a network segment information obtaining module 610, configured to obtain a service node basic image file, and receive network segment information of a block link node;
an access port determining module 620, configured to determine an access port of a block link node according to the network segment information;
a configuration file obtaining module 630, configured to obtain a basic parameter of the blockchain node through the access port, and generate a configuration file according to the basic parameter;
the configuration file is used for pulling the configuration file and the service node basic image file at the block link point by using a preset automatic deployment script, and then generating a target image file by combining the service node basic image file.
In an embodiment, as shown in fig. 7, an apparatus for obtaining an image file is provided, where the apparatus for obtaining an image file further includes a basic image file determining module 640, and the service node basic image file includes a sequencing node basic image file, a peer node basic image file, and a transaction server basic image file; the basic image file determining module 640 is configured to obtain an identity of a block chain node, and determine a node type corresponding to the block chain node according to the identity, where the node type includes a sequencing node, a peer node, and a transaction server node; and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
For specific limitations of the image file obtaining device, reference may be made to the above limitations on the image file obtaining method, which are not described herein again. All or part of each module in the image file acquisition device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing basic parameters, basic mirror image files of the service nodes and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for obtaining an image file.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring network segment information of the block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending basic parameters of the block chain nodes to an operation server through an access port, wherein the basic parameters are used for indicating the operation server to generate a configuration file according to the basic parameters, and the operation server pre-stores basic mirror image files of the service nodes;
pulling a configuration file and a service node basic image file from an operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, the automated deployment script includes a start image file instruction; the processor, when executing the computer program, further performs the steps of: executing the image file starting instruction to start and execute the target image file to obtain target image service; and adding the target mirror image service into the block chain node.
In one embodiment, the processor, when executing the computer program, further performs the steps of: analyzing the configuration file to obtain node configuration parameters in the configuration file; comparing the node configuration parameters with the basic parameters; and if the node configuration parameters are consistent with the basic parameters, executing a step of generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, when the processor executes the computer program to implement the step of sending the basic parameters of the blockchain node to the operation server through the access port, the following steps are specifically implemented: carrying out Hash processing on the basic parameters to obtain a first Hash value; encrypting the first hash value by using a private key of the block chain node to obtain signature data; the method comprises the steps that signature data and basic parameters are sent to a service operator, wherein the service operator is used for decrypting the signature data by using a public key of a block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameters to obtain a second Hash value; and when the first hash value is consistent with the second hash value, generating a configuration file according to the basic parameters.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of a block chain node according to network segment information;
acquiring basic parameters of a block chain node through an access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file at the block link point by using a preset automatic deployment script, and then generating a target image file by combining the service node basic image file.
In one embodiment, the service node base image files include a sequencing node base image file, a peer node base image file, and a transaction server base image file; the processor, when executing the computer program, further performs the steps of: acquiring an identity of a block chain node, and determining a node type corresponding to the block chain node according to the identity, wherein the node type comprises a sequencing node, a peer node and a transaction server node; and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring network segment information of the block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending basic parameters of the block chain nodes to an operation server through an access port, wherein the basic parameters are used for indicating the operation server to generate a configuration file according to the basic parameters, and the operation server pre-stores basic mirror image files of the service nodes;
pulling a configuration file and a service node basic image file from an operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, the automated deployment script includes a start image file instruction; the computer program when executed by the processor further realizes the steps of: executing the image file starting instruction to start and execute the target image file to obtain target image service; and adding the target mirror image service into the block chain node.
In one embodiment, the computer program when executed by the processor further performs the steps of: analyzing the configuration file to obtain node configuration parameters in the configuration file; comparing the node configuration parameters with the basic parameters; and if the node configuration parameters are consistent with the basic parameters, executing a step of generating a target image file according to the configuration file and the service node basic image file.
In one embodiment, when the computer program is executed by the processor to implement the step of sending the basic parameters of the blockchain node to the operation server through the access port, the following steps are specifically implemented: carrying out Hash processing on the basic parameters to obtain a first Hash value; encrypting the first hash value by using a private key of the block chain node to obtain signature data; the method comprises the steps that signature data and basic parameters are sent to a service operator, wherein the service operator is used for decrypting the signature data by using a public key of a block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameters to obtain a second Hash value; and when the first hash value is consistent with the second hash value, generating a configuration file according to the basic parameters.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of a block chain node according to network segment information;
acquiring basic parameters of a block chain node through an access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file at the block link point by using a preset automatic deployment script, and then generating a target image file by combining the service node basic image file.
In one embodiment, the service node base image files include a sequencing node base image file, a peer node base image file, and a transaction server base image file; the computer program when executed by the processor further realizes the steps of: acquiring an identity of a block chain node, and determining a node type corresponding to the block chain node according to the identity, wherein the node type comprises a sequencing node, a peer node and a transaction server node; and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for acquiring an image file comprises the following steps:
acquiring network segment information of a block chain node, and sending the network segment information to an operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block chain node;
sending the basic parameters of the block chain nodes to an operation service machine through the access port, wherein the basic parameters are used for indicating the operation service machine to generate a configuration file according to the basic parameters, and the operation service machine prestores basic mirror image files of service nodes;
pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and generating a target image file according to the configuration file and the service node basic image file.
2. The method of claim 1, wherein the automation deployment script comprises a boot image instruction;
after the step of generating the target image file according to the configuration file and the service node basic image file, the method further comprises the following steps:
executing the image file starting instruction to start and execute a target image file to obtain target image service;
and adding the target mirror image service into a block chain node.
3. The method of claim 1, wherein the step of generating the target image file according to the configuration file and the service node base image file is preceded by the step of:
analyzing the configuration file to obtain node configuration parameters in the configuration file;
comparing the node configuration parameters with the basic parameters;
and if the node configuration parameters are consistent with the basic parameters, executing the step of generating a target image file according to the configuration file and the service node basic image file.
4. The method of claim 1, wherein the step of sending the basic parameters of the blockchain node to the operating server through the access port comprises:
carrying out Hash processing on the basic parameters to obtain a first Hash value;
encrypting the first hash value by using a private key of the block chain node to obtain signature data;
sending the signature data and the basic parameters to the operation server, wherein the operation server is used for decrypting the signature data by using a public key of the block chain node after receiving the signature data and the basic parameters to obtain a first hash value; carrying out Hash processing on the basic parameter to obtain a second Hash value; and when the first hash value and the second hash value are consistent, generating a configuration file according to the basic parameter.
5. A method for acquiring an image file comprises the following steps:
acquiring a basic mirror image file of a service node, and receiving network segment information of a block chain node;
determining an access port of the block chain node according to the network segment information;
acquiring basic parameters of the block chain nodes through the access port, and generating a configuration file according to the basic parameters;
the configuration file is used for pulling the configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
6. The method of claim 5, wherein the service node base image files comprise a sequencing node base image file, a peer node base image file, and a transaction server base image file;
after the step of generating the configuration file according to the basic parameters, the method further comprises the following steps:
acquiring an identity of the block chain node, and determining a node type corresponding to the block chain node according to the identity, wherein the node type comprises a sequencing node, a peer node and a transaction server node;
and determining the service node basic image file of the type corresponding to the node type as the pulled service node basic image file.
7. An apparatus for obtaining an image file, the apparatus comprising:
the network segment information sending module is used for acquiring network segment information of the block link node and sending the network segment information to the operation server, wherein the network segment information is used for indicating the operation server to determine an access port of the block link node;
a basic parameter sending module, configured to send a basic parameter of the block chain node to an operation server through the access port, where the basic parameter is used to instruct the operation server to generate a configuration file according to the basic parameter, and a basic image file of a service node is pre-stored in the operation server;
the file pulling module is used for pulling the configuration file and the service node basic image file from the operation service machine by using a preset automatic deployment script;
and the mirror image file generation module is used for generating a target mirror image file according to the configuration file and the service node basic mirror image file.
8. An apparatus for obtaining an image file, the apparatus comprising:
the network segment information acquisition module is used for acquiring a service node basic mirror image file and receiving network segment information of a block link node;
an access port determining module, configured to determine an access port of the block link node according to the network segment information;
a configuration file obtaining module, configured to obtain a basic parameter of the block chain node through the access port, and generate a configuration file according to the basic parameter;
the configuration file is used for pulling the corresponding configuration file and the service node basic image file by using a preset automatic deployment script at the block link point, and then generating a target image file by combining the service node basic image file.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any of claims 1 to 4 or 5 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4 or 5 to 6.
CN201811544384.8A 2018-12-17 2018-12-17 Method and device for acquiring mirror image file, computer equipment and storage medium Active CN109788032B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811544384.8A CN109788032B (en) 2018-12-17 2018-12-17 Method and device for acquiring mirror image file, computer equipment and storage medium
PCT/CN2019/122360 WO2020125389A1 (en) 2018-12-17 2019-12-02 Image file acquisition method, apparatus, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811544384.8A CN109788032B (en) 2018-12-17 2018-12-17 Method and device for acquiring mirror image file, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109788032A CN109788032A (en) 2019-05-21
CN109788032B true CN109788032B (en) 2021-12-14

Family

ID=66498043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811544384.8A Active CN109788032B (en) 2018-12-17 2018-12-17 Method and device for acquiring mirror image file, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109788032B (en)
WO (1) WO2020125389A1 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109788032B (en) * 2018-12-17 2021-12-14 深圳壹账通智能科技有限公司 Method and device for acquiring mirror image file, computer equipment and storage medium
CN112181474B (en) * 2019-07-04 2022-05-20 北京新唐思创教育科技有限公司 Block chain service processing method, electronic device and computer storage medium
CN110647439B (en) * 2019-08-15 2023-02-03 深圳壹账通智能科技有限公司 Method and device for confirming block chain system deployment, computer equipment and storage medium
CN110572287B (en) * 2019-09-05 2022-03-18 腾讯科技(深圳)有限公司 Data disaster tolerance method and device, computer equipment and storage medium
CN110673992B (en) * 2019-09-16 2022-06-03 苏州浪潮智能科技有限公司 Multi-mirror image fusion self-starting method and system
CN110855791B (en) * 2019-11-18 2021-07-27 腾讯科技(深圳)有限公司 Block link point deployment method and related equipment
CN111787116B (en) * 2020-07-07 2021-08-20 上海道客网络科技有限公司 System and method for trusted authentication of container mirror image based on block chain technology
CN111541788B (en) 2020-07-08 2020-10-16 支付宝(杭州)信息技术有限公司 Hash updating method and device of block chain all-in-one machine
CN113971289A (en) 2020-07-08 2022-01-25 支付宝(杭州)信息技术有限公司 Trusted starting method and device of block chain all-in-one machine
CN112637365B (en) * 2021-01-06 2023-01-31 Oppo广东移动通信有限公司 Terminal resource issuing and acquiring method and device and electronic equipment
CN113282065B (en) * 2021-05-18 2023-01-31 西安热工研究院有限公司 Clustering extreme value real-time calculation method based on graph configuration
CN113434254B (en) * 2021-06-30 2023-03-07 深圳平安智汇企业信息管理有限公司 Client deployment method, client deployment apparatus, computer device, and storage medium
CN113516065B (en) * 2021-07-03 2022-08-05 北京中建建筑科学研究院有限公司 Data weight measuring and calculating method and device based on block chain, server and storage medium
CN113641373A (en) * 2021-08-30 2021-11-12 北京京东乾石科技有限公司 Mirror image deployment method, device and storage medium

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136014B (en) * 2011-12-02 2016-07-13 北京市电力公司 The method and system of installing DB
US9053236B1 (en) * 2013-12-23 2015-06-09 Emc Corporation Automated directory services test setup utility
CN104503965B (en) * 2014-10-16 2017-08-29 杭州斯凯网络科技有限公司 The elastomeric High Availabitities of PostgreSQL and implementation of load balancing
US11360945B2 (en) * 2015-12-11 2022-06-14 Umbra Technologies Ltd. System and method for information slingshot over a network tapestry and granularity of a tick
CN106101242B (en) * 2016-06-24 2019-08-06 深圳前海微众银行股份有限公司 The construction method and device of block chain cloud service platform
WO2018119638A1 (en) * 2016-12-27 2018-07-05 深圳前海达闼云端智能科技有限公司 Method, device, and electronic apparatus for recording application program configuration information
CN109002354B (en) * 2017-06-07 2022-05-03 中国科学院信息工程研究所 OpenStack-based computing resource capacity elastic expansion method and system
CN107911421B (en) * 2017-10-30 2020-05-15 上海点融信息科技有限责任公司 Method, apparatus, and computer storage medium for configuring cross-network communications in a blockchain
CN108170590B (en) * 2017-12-12 2021-08-24 北京大学深圳研究生院 Test system and method of block chain system
CN107888625A (en) * 2017-12-25 2018-04-06 杭州迪普科技股份有限公司 Packet filtering log aggregation method and device
CN108366105B (en) * 2018-01-30 2019-12-10 百度在线网络技术(北京)有限公司 Cross-block-chain data access method, device, system and computer readable medium
CN108964982B (en) * 2018-06-13 2021-07-09 众安信息技术服务有限公司 Method, apparatus and storage medium for enabling deployment of multiple nodes of a blockchain
CN108965468B (en) * 2018-08-16 2021-04-30 北京京东尚科信息技术有限公司 Block chain network service platform, chain code installation method thereof and storage medium
CN109788032B (en) * 2018-12-17 2021-12-14 深圳壹账通智能科技有限公司 Method and device for acquiring mirror image file, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109788032A (en) 2019-05-21
WO2020125389A1 (en) 2020-06-25

Similar Documents

Publication Publication Date Title
CN109788032B (en) Method and device for acquiring mirror image file, computer equipment and storage medium
CN109743390B (en) Task scheduling method and device, computer equipment and storage medium
CN108400978B (en) Vulnerability detection method and device, computer equipment and storage medium
CN111104273A (en) Batch task-based automatic distribution testing method and device and computer equipment
WO2020233092A1 (en) Smart contract calling method and apparatus, device, and storage medium
CN109726134B (en) Interface test method and system
CN112491659B (en) Flow playback test method and device, computer equipment and storage medium
CN109391618B (en) Method and system for establishing communication link
CN111107073A (en) Application automatic login method and device, computer equipment and storage medium
CN110555769A (en) Block chain transaction data processing method and device, computer equipment and storage medium
CN112261083B (en) Remote control method, system and virtual machine server
CN110704312A (en) Pressure testing method and device, computer equipment and storage medium
CN110995683A (en) Hardware information acquisition method and device based on Web page and computer equipment
CN110597541A (en) Interface updating processing method, device, equipment and storage medium based on block chain
CN111258591A (en) Program deployment task execution method and device, computer equipment and storage medium
CN109831521B (en) Cache instance management method and device, computer equipment and storage medium
CN113709126A (en) Network protocol security fuzzy test method, device, equipment and storage medium
CN110225511B (en) Method, device and system for acquiring IMEI number of terminal and computer equipment
CN111782447A (en) Batch test updating method and device based on SSH service and computer equipment
CN112838930A (en) Block chain transaction execution method and device, electronic equipment and storage medium
CN111580927A (en) Communication method and container communication system
CN110837373A (en) Continuous integration and continuous delivery method, device, computer equipment and storage medium
CN113742681B (en) Account management method and device, computer equipment and storage medium
CN108667919B (en) Data processing method, data processing device, computer equipment and storage medium
CN110727509A (en) Task scheduling method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant