Scene resource import and export method and system based on network target range

By using asynchronous processing and weight factor calculation methods in the network shooting range, the problem of data loss and platform lag during scene resource migration is solved, automatic import and export of multi-version platforms is realized, and the user experience is optimized.

CN118760504APending Publication Date: 2024-10-11SAINING WANGAN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410897358.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When migrating scene resources in the network shooting range, there are problems such as data loss, version differences, import and export failures, and platform lags, which affect the user experience.

Method used

Adopt a scene resource export and import method based on the network shooting range, optimize computing node selection and task allocation through asynchronous processing, standardization of topological metadata, weight factor calculation and dynamic adjustment, realize automated import and export, and select appropriate computing nodes based on load information Perform resource upload and download.

Benefits of technology

It reduces manual intervention, realizes differentiated import and export of multi-version platforms, reduces platform lags, optimizes user experience, and improves the convenience of resource migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760504A_ABST
    Figure CN118760504A_ABST
Patent Text Reader

Abstract

The invention discloses a scene resource import and export method and system based on a network target range, the export and import of a plurality of scene resources are supported, when an export request is received, topology metadata of a scene and mirror image information in the topology metadata are obtained, whether a current mirror image is exported at a computing node or not is inquired, and if the mirror image is exported and does not expire, the mirror image is not exported. If yes, directly updating and computing node mirror image expiration time, obtaining a mirror image export position, and uploading the mirror image export position to a storage server; in the export process, load information of each computing node is obtained, weight factors of the computing nodes are combined, weight scores are calculated, the computing node with the highest weight score larger than a platform weight threshold value is selected as an export node, and an export task is issued; wherein the weight factor is dynamically adjusted according to the execution condition of the export task; and after the uploading of the mirror image in the scene is completed, the topology metadata of the scene is uploaded to the storage server. According to the invention, a user can conveniently migrate scene resources on different platforms, and the user experience is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of shooting range applications, and in particular to a scene resource import and export method and system based on a network shooting range. Background Art

[0002] In the middle of the network range, scenarios are often needed to train participants. Training scenarios can simulate real network environments, including hardware, software, network structure, and attack methods. This helps participants learn and practice in a safe environment and improve their ability to deal with threats in a real network environment. By practicing in training scenarios, participants can improve their network security skills, including penetration testing, vulnerability exploitation, and defense strategies. This helps to improve the technical level of the entire team, so as to better deal with actual network threats. Training scenarios can help researchers better understand new network threats and study effective response methods. A good training scenario production requires a lot of time and effort to complete. Distributing scenario resources to other platforms can allow more people to train and help improve the technical level of the entire team or university.

[0003] like Figure 1 In the network target range, it is often necessary to migrate multiple scene resources to other platforms. The resource volume of each scene is large and requires many mirror resources. Manual database operations are time-consuming and labor-intensive, and data loss is easy. There will also be differences in the versions imported into the target platform, and there will be import failures. The import and export of platform scene resources will cause the platform to freeze, affecting the user experience. Summary of the invention

[0004] Purpose of the invention: In view of the deficiencies in the prior art, the purpose of the present invention is to provide a method and system for exporting and importing scene resources based on a network target range, which can facilitate users to migrate scene resources on different platforms and optimize user experience.

[0005] Technical solution: To achieve the above-mentioned invention object, the present invention adopts the following technical solution:

[0006] A method for exporting scene resources based on a network range includes the following steps:

[0007] Receive at least one network range scene export request, put the scene code requested to be exported into a queue for asynchronous processing;

[0008] Take out one scene information from the queue in turn and obtain the topological metadata of the scene;

[0009] Obtain the image information in the topology metadata of the export scenario in turn, and check whether the current image has been exported on the computing node. If the image has been exported and has not expired, directly update the image expiration time of the computing node, obtain the image export location, and upload it to the storage server;

[0010] Obtain the load information of each computing node, calculate the weight score in combination with the weight factor of the computing node, select the computing node with the highest weight score and greater than the platform weight threshold as the export node, issue the export task, and the computing node uploads the exported image resources to the specified directory of the storage server; the weight factor is dynamically adjusted according to the execution of the export task;

[0011] Upload the scene's topology metadata to the specified directory on the storage server.

[0012] Preferably, the topology metadata includes scene name, network information, node information, and node connection information, and the node information includes mirror information used by the node.

[0013] As a preference, existing fields cannot be deleted after the topology metadata format is determined; when the metadata cannot meet the needs of higher-version functions, the value range of the original fields cannot be modified, the meaning of the original fields cannot be modified, and new fields must be defined to carry the new functions.

[0014] Preferably, the weight score = (CPU availability*CPU weight+memory availability*memory weight+disk availability*disk weight+network bandwidth availability*network weight)*node weight factor; wherein the disk weight is higher than other weights.

[0015] Preferably, the initial value of the weight factor is set according to the performance of the computing node, and the stronger the performance, the larger the weight factor; the weight factor is dynamically adjusted according to the execution of the export task: when the computing node exports an error, the weight factor of the computing node is reduced, and the export task is not sent to the computing node within a preset time; when the number of consecutive export failures is greater than a set threshold, the weight factor of the computing node is set to 0; when the computing node exports successfully, the weight factor of the computing node is increased to increase the probability of the computing node being selected.

[0016] Preferably, the platform weight threshold = number of online users / (number of computing nodes*number of node users)*platform weight factor, where the number of node users is the number of users theoretically supported by a single node.

[0017] A method for importing scene resources based on a network range includes the following steps:

[0018] Receive an import request for a network range scene, download topology metadata from a storage server, parse the topology metadata, and obtain topology node information, node connection information, and a mirror resource list of each node; wherein the topology metadata and the mirror resource are obtained according to a scene resource export method based on a network range;

[0019] Obtain the load information of each computing node, calculate the weight score based on the weight factor of the computing node, select the computing node with the highest weight score that is greater than the platform weight threshold as the import node, issue the import task, and the computing node downloads the image resource from the storage server and loads it into the platform.

[0020] A scene resource export system based on a network range, comprising: a dispatch center, a mirror module and a storage module;

[0021] The scheduling center is used to receive an export request for at least one network range scene, put the scene code requested for export into a queue for asynchronous processing; take out a scene information from the queue in turn, and obtain the topological metadata of the scene; obtain the image information in the topological metadata of the exported scene in turn, query whether the current image has been exported from the computing node, and if the image has been exported and has not expired, notify the corresponding computing node to upload directly; obtain the load information of each computing node, combine the weight factor of the computing node, calculate the weight score, select the computing node with the highest weight score and greater than the platform weight threshold as the export node, and issue the export task; the weight factor is dynamically adjusted according to the execution of the export task; and is used to upload the topological metadata of the scene to the specified directory of the storage module;

[0022] The mirror module is located in each computing node and is used to directly update the mirror expiration time and upload the mirror to the storage module when receiving the direct upload instruction from the scheduling center; and export the mirror resource and upload it to the specified directory of the storage module when receiving the export task instruction from the scheduling center.

[0023] A scene resource import system based on a network range, comprising: a dispatch center, a mirror module and a storage module;

[0024] The scheduling center is used to receive an import request for a network range scene, download topology metadata from a storage module, parse the topology metadata, obtain topology node information, node connection information, and a list of mirror resources for each node; wherein the topology metadata and mirror resources are obtained according to a scene resource export method based on a network range; and obtain the load information of each computing node, calculate the weight score in combination with the weight factor of the computing node, select the computing node with the highest weight score and greater than the platform weight threshold as the import node, and issue the import task;

[0025] The mirror module is located in each computing node and is used to receive the import task instruction from the scheduling center, download the mirror resource from the storage module, and load it into the platform.

[0026] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of the method for exporting scene resources based on a network range, or the steps of the method for importing scene resources based on a network range.

[0027] Beneficial effects: Compared with the prior art, the present invention has the following advantages: 1. By defining standard topology metadata, the present invention performs parsing according to the standard metadata during the import and export process, thereby realizing automated import and export operations and reducing manual intervention; and based on the management of metadata, differentiated import of multi-version platforms can be realized. 2. The present invention determines the computing node for executing tasks based on actual load information, reduces platform freezes when exporting resources, and optimizes user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is a schematic diagram of the scenario resource migration of the network range platform.

[0029] Figure 2 The figure is a schematic diagram of the scene resource export process according to an embodiment of the present invention.

[0030] Figure 3 This is an example diagram of system modules according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.

[0032] In order to improve the convenience of resource migration, the present invention provides a scene resource import and export method and system based on a network range. Specifically, an embodiment of the present invention discloses a scene resource export method based on a network range, first receiving an export request of at least one network range scene, placing the scene code requested to be exported into a queue for asynchronous processing; then taking out a scene information from the queue in turn, obtaining the topological metadata of the scene; then obtaining the image information in the topological metadata of the exported scene in turn, querying whether the current image has been exported in the computing node, if the image has been exported and has not expired, directly updating the computing node image expiration time, and obtaining the image export location, and uploading it to the storage server; if it has not been exported or has expired, obtaining the load information of each computing node, combining the weight factor of the computing node (dynamically adjusted according to the execution of the export task), calculating the weight score, selecting the computing node with the highest weight score and greater than the platform weight threshold as the export node, issuing the export task, and the computing node uploading the exported image resource to the storage server specified directory; finally uploading the scene topological metadata to the storage server specified directory.

[0033] Correspondingly, an embodiment of the present invention discloses a scene resource import method based on a network target range, which first receives an import request for a network target range scene, downloads topology metadata from a storage server, parses the topology metadata, obtains topology node information, node connection information, and a list of image resources for each node; then obtains load information for each computing node, calculates a weight score based on the weight factor of the computing node, selects a computing node with the highest weight score that is greater than the platform weight threshold as the import node, issues an import task, and the computing node downloads the image resource from the storage server and loads it into the platform.

[0034] The following describes in detail the scene resource exporting and importing method provided by the embodiment of the present invention in conjunction with specific scenarios.

[0035] The specific steps for exporting scene resources are as follows:

[0036] Step 1. The user selects multiple scene IDs to be exported on the front page. After receiving the request, the backend determines whether the current user has the export permission.

[0037] Step 2. The background puts the scene ID list into a queue for asynchronous processing.

[0038] Step 3. Take out a scene ID from the queue each time for export; the export is divided into two parts: topology resources and image resources.

[0039] Since the original data format or field of each system is inconsistent, it needs to be parsed according to standard metadata during the import and export process. The topology module defines the standard metadata format of the topology. Standard metadata can ensure the integrity of the topology structure in a scene. The new functions and features added in the subsequent new version are added on the basis of standard metadata, which will not affect the normal functions of the old version of the topology. The topology metadata format can be recorded in file formats such as yml and json. The following uses the yml format:

[0040]

[0041]

[0042] nodes indicates all node information used in the topology. Each node contains attribute information such as identifier and name. The net field indicates the connection relationship between the current node and other nodes. The image field in the node indicates the image name used by the current node.

[0043] Metadata management strategy: 1. Once the metadata format is determined, the existing fields cannot be deleted; 2. When the metadata cannot meet the functions of the higher version, the value range of the original field cannot be modified, and the meaning of the original field cannot be modified. New fields must be defined to carry the unsatisfied functions; 3. The new field definition must have clear naming, field description information, whether it is required, and other basic elements. Examples of high and low versions are as follows:

[0044] The metadata format of the lower version V1 is as follows:

[0045] -id:server-02#Required node 2id (fixed content is server-02)

[0046] name:target#Required (node ​​name, name length between 4-40)

[0047] image:KW001-WordPress#Required (virtual machine name, corresponding to servers.yml)

[0048] net:

[0049] -id:network-02#Required, network id corresponds to network

[0050] The metadata format fields of the higher version V2 are as follows:

[0051] -id:server-02#Required node 2id (fixed content is server-02)

[0052] name:target#Required (node ​​name, name length between 4-40)

[0053] image:KW001-WordPress#Required (virtual machine name, corresponding to servers.yml)

[0054] description: description#Optional (node ​​description, length between 4-200)

[0055] net:

[0056] -id:network-02#Required, network id corresponds to network

[0057] A new attribute 'description' is introduced in the high version V2 to describe the additional information of the node. When importing metadata of the low version 1, the 'description' field is not included. In the new version program, the missing field is filled with the default value and the import can be performed; when importing metadata of the high version 2, the 'description' field is included. The new program parses and imports normally; when importing metadata of the low version 1, the 'description' field is not included. The old version program parses and imports; when importing metadata of the high version 2, the 'description' field is included. In the old version program, the newly added

[0058] The 'description' field will not be recognized and can be imported normally.

[0059] Step 5. The topology module collects the list of mirror nodes used in the scenario and reports it to the dispatch center.

[0060] Step 6. The scheduling center will query whether the current image has been exported to the computing node. If the image has been exported and the time has not expired, the computing node image expiration time will be directly updated and the image export location will be obtained. If the computing node retains the exported image for a long time, it will take up a lot of storage and need to be deleted after expiration.

[0061] Step 7. Each computing node reports the current load to the dispatch center. The dispatch center filters out the computing nodes that can export the image task according to the load performance of each computing node. Each computing node has a different model and size. A different initial weight factor is set for each computing node. The stronger the performance, the larger the weight factor. The dispatch center can also dynamically adjust the initial weight factor according to the export results.

[0062] In this step, each computing node reports the CPU utilization, memory utilization, and disk utilization indicators to the scheduling center. The scheduling center calculates based on the reported data and the initial weight factor of each computing node. If the disk bottleneck is large in the export of image resources, the disk weight is set higher. The sum of the disk weight, CPU weight, memory weight, and network weight is 1. For example, the sum of the weights of CPU weight 0.2 + memory weight 0.2 + disk weight 0.4 + network weight 0.2 is 1; node weight score = (CPU availability * CPU weight + memory availability * memory weight + disk availability * disk weight + network bandwidth availability * network weight) * node initial weight factor; the higher the node weight score, the more resources the node can use. Example: The node initial weight factor is set to 1, and the node weight score =

[0063] (0.7*0.2+0.8*0.2+0.6*0.4+0.5*0.2)*1.

[0064] The scheduling center sorts all computing nodes according to their weight scores, selects the node with the highest weight score as the optimal export node, and sends the export task to the optimal node.

[0065] In addition, since there will be user peaks and off-peaks during the use of the platform, in order to ensure that the export process does not affect the normal use of the system platform, this embodiment also sets a platform weight threshold, platform weight threshold = number of online users / (number of computing nodes * number of node users) * platform weight factor, where the number of node users is the number of users theoretically supported by a single node. Example: The platform weight factor is set to 1.1, and the platform weight threshold = 200 / (20*20)*1.1. The higher the platform weight threshold, the more it means that the platform is at its peak; it is necessary to reduce the export tasks of the computing nodes and leave resources for users; when the computing node weight score is less than the platform weight threshold, the scheduling center is not allowed to issue tasks to the computing node.

[0066] The dispatch center counts the weight score of each computing node to see if it is greater than the platform weight threshold. If the weight score of computing node A is greater than the platform weight threshold, the control node will send the export task to computing node A for execution. If the weight score of computing node B is less than the platform weight threshold, the export task will not be sent. If the weight scores of computing node A and computing node B are both greater than the platform weight threshold, the export task will be sent in sequence from the computing node with the highest score.

[0067] Step 8. The computing node reports the task progress to the scheduling center in real time. When a computing node exports an error, the initial weight of the computing node can be gradually reduced. The scheduling center does not issue any operations to the computing node within a certain period of time (which can be 1 hour). When there are three consecutive export failures, it is defined as permanent damage and the computing node weight is set to 0, and it will no longer be exported.

[0068] For computing nodes that successfully export tasks, the weight is increased by 10% for each success, such as node weight score * (1+10%), and the maximum weight increase does not exceed 30%, such as node weight score * (1+30%), to increase the probability of the computing node being selected.

[0069] Step 9. The computing node uploads each exported image resource to the specified directory of the storage server and reports the upload result to the scheduling center. After the scheduling center waits for the image export task in the current scenario to be completed, it uploads the topology metadata to the specified directory of the storage server.

[0070] Step 10. After the task is completed, the download address is returned to the user for unified downloading.

[0071] The specific steps for importing scene resources are as follows:

[0072] Step 1. The user selects the scene resource to be imported, and supports differentiated import on multiple versions of the platform. For example, when a high-version scene resource is imported into a low-version platform, the topology metadata is downloaded from the specified storage server. The low-version platform only parses the fields identified in the topology metadata. The topology module completes the loading of nodes and the drawing of connections between nodes based on the standard metadata fields to ensure the availability of the imported low-version.

[0073] Step 2. After the topology resource is parsed, obtain the node image resource list corresponding to the topology.

[0074] Step 3. Similar to the export logic, the scheduling center filters out the computing nodes that meet the requirements and sends the import tasks in sequence.

[0075] Step 4. The computing node downloads the image resource from the storage server and loads it into the platform, thereby implementing the import and export of scene resources in the cross-version platform.

[0076] Based on the same inventive concept, an embodiment of the present invention discloses a scene resource export system based on a network range, comprising: a scheduling center, a mirror module and a storage module; the scheduling center is used to receive an export request for at least one network range scene, put the scene code requested to be exported into a queue, and perform asynchronous processing; take out a scene information from the queue in turn, and obtain the topological metadata of the scene; obtain the mirror information in the topological metadata of the exported scene in turn, query whether the current image has been exported from the computing node, and if the image has been exported and has not expired, notify the corresponding computing node to directly upload it; obtain the load information of each computing node, combine the weight factor of the computing node, calculate the weight score, select the computing node with the highest weight score and greater than the platform weight threshold as the export node, and issue the export task; the weight factor is dynamically adjusted according to the execution status of the export task; and is used to upload the topological metadata of the scene to the specified directory of the storage module; the mirror module is located in each computing node, and is used to directly update the image expiration time and upload the image to the storage module when receiving the direct upload instruction of the scheduling center; and export the image resource and upload it to the specified directory of the storage module when receiving the export task instruction of the scheduling center.

[0077] Based on the same inventive concept, an embodiment of the present invention discloses a scene resource import system based on a network target range, including: a scheduling center, a mirror module and a storage module; the scheduling center is used to receive an import request for a network target range scene, download topology metadata from the storage module, parse the topology metadata, obtain topology node information, node connection information and a mirror resource list of each node; wherein the topology metadata and the mirror resource are obtained according to the scene resource export method based on a network target range; and the load information of each computing node is obtained, combined with the weight factor of the computing node, the weight score is calculated, and the computing node with the highest weight score and greater than the platform weight threshold is selected as the import node, and the import task is issued; the mirror module is located in each computing node, and is used to receive the import task instruction of the scheduling center, download the mirror resource from the storage module, and load it into the platform.

[0078] A computer program product disclosed in an embodiment of the present invention includes a computer program / instruction. When the computer program / instruction is executed by a processor, the steps of the method for exporting scene resources based on a network target range or the steps of the method for importing scene resources based on a network target range are implemented.

Claims

1. A scene resource export method based on a network range, It is characterized in that The steps include: Receive at least one network range scene export request, put the scene code requested to be exported into a queue for asynchronous processing; Take out one scene information from the queue in turn and obtain the topological metadata of the scene; Obtain the image information in the topology metadata of the export scenario in turn, and check whether the current image has been exported on the computing node. If the image has been exported and has not expired, directly update the image expiration time of the computing node, obtain the image export location, and upload it to the storage server; Obtain the load information of each computing node, calculate the weight score based on the weight factor of the computing node, select the computing node with the highest weight score and greater than the platform weight threshold as the export node, issue the export task, and the computing node uploads the exported image resources to the specified directory of the storage server; The weight factor is dynamically adjusted according to the execution status of the export task; Upload the scene's topology metadata to the specified directory on the storage server.

2. According to claim 1, a method for exporting scene resources based on a network range, It is characterized in that The topology metadata includes scene name, network information, node information, and node connection information. The node information includes mirror information used by the node.

3. According to the method for exporting scene resources based on a network range as described in claim 1, It is characterized in that Once the topology metadata format is determined, existing fields cannot be deleted. When the metadata cannot meet the needs of higher-version functions, the value range of the original fields cannot be modified, and the meaning of the original fields cannot be modified. New fields must be defined to carry the new functions.

4. According to claim 1, a method for exporting scene resources based on a network range, It is characterized in that The weight score = (CPU availability * CPU weight + memory availability * memory weight + disk availability * disk weight + network bandwidth availability * network weight) * node weight factor; The disk weight is higher than other weights.

5. According to claim 1, a method for exporting scene resources based on a network range, It is characterized in that The initial value of the weight factor is set according to the performance of the computing node, and the stronger the performance, the larger the weight factor; The weight factor is dynamically adjusted according to the execution of the export task: when a computing node exports an error, the weight factor of the computing node is reduced, and the export task is not issued to the computing node within a preset time; when the number of consecutive export failures is greater than a set threshold, the weight factor of the computing node is set to 0; When a computing node is successfully exported, the weight factor of the computing node is increased to increase the probability of the computing node being selected.

6. According to claim 1, a method for exporting scene resources based on a network range, It is characterized in that Platform weight threshold = number of online users / (number of computing nodes*number of node users)*platform weight factor, where the number of node users is the number of users theoretically supported by a single node.

7. A method for importing scene resources based on a network range. It is characterized in that The steps include: Receive an import request for a network range scene, download topology metadata from a storage server, parse the topology metadata, and obtain topology node information, node connection information, and a mirror resource list of each node; wherein the topology metadata and the mirror resource are obtained according to a scene resource export method based on a network range according to any one of claims 1 to 6; Obtain the load information of each computing node, calculate the weight score based on the weight factor of the computing node, select the computing node with the highest weight score that is greater than the platform weight threshold as the import node, issue the import task, and the computing node downloads the image resource from the storage server and loads it into the platform.

8. A scene resource export system based on a network shooting range, It is characterized in that include: Dispatching center, mirror module and storage module; The scheduling center is used to receive an export request for at least one network range scene, put the scene code requested to be exported into a queue, and perform asynchronous processing; Take out one scene information from the queue in turn and obtain the topological metadata of the scene; Obtain the image information in the topology metadata of the export scenario in turn, and check whether the current image has been exported on the computing node. If the image has been exported and has not expired, notify the corresponding computing node to upload it directly; Obtain the load information of each computing node, calculate the weight score based on the weight factor of the computing node, select the computing node with the highest weight score that is greater than the platform weight threshold as the export node, and issue the export task; The weight factor is dynamically adjusted according to the execution status of the export task; And used to upload the topological metadata of the scene to the specified directory of the storage module; The mirror module is located in each computing node and is used to directly update the mirror expiration time and upload the mirror to the storage module when receiving the direct upload instruction from the scheduling center; And when receiving the export task instruction from the dispatch center, the image resource is exported and uploaded to the specified directory of the storage module.

9. A scene resource import system based on a network shooting range, It is characterized in that include: Dispatching center, mirror module and storage module; The scheduling center is used to receive an import request for a network range scene, download topology metadata from a storage module, parse the topology metadata, and obtain topology node information, node connection information, and a mirror resource list of each node; wherein the topology metadata and the mirror resource are obtained according to a scene resource export method based on a network range according to any one of claims 1 to 6; And obtain the load information of each computing node, combine the weight factor of the computing node, calculate the weight score, select the computing node with the highest weight score and greater than the platform weight threshold as the import node, and issue the import task; The mirror module is located in each computing node and is used to receive the import task instruction from the scheduling center, download the mirror resource from the storage module, and load it into the platform.

10. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by the processor, the steps of the scene resource export method based on the network shooting range are implemented according to any one of claims 1 to 6, or the steps of the scene resource import method based on the network shooting range according to claim 7.