A method, apparatus, storage medium, and electronic device for acquiring a task environment.
By switching the target node by calculating the cost value through the plugin, the node machine environment can be quickly restored, which solves the problems of large data volume and high time cost in the existing technology and improves the execution efficiency of rendering tasks.
Patent Information
- Application Number
- CN202211091040.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-09-07
AI Technical Summary
Existing technologies require the complete copying of the user's local machine environment to the node machine before executing cloud node rendering tasks, resulting in large data volumes, high storage pressure, and high time costs, thus reducing the execution efficiency of rendering tasks.
By obtaining the list of plugins for the task to be rendered and the plugin information of candidate nodes, the switching cost is calculated, the target node is selected, and the plugin version is adjusted, thus achieving rapid restoration of the node machine environment.
It effectively reduces the amount of data to be processed and stored, lowers time costs, and improves the execution efficiency of rendering tasks.
Smart Images

Figure CN115586930B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of rendering, in particular to a method and device for obtaining a task environment, a storage medium and an electronic device. BACKGROUND
[0002] Generally, before performing a rendering task of a cloud node, a node machine with the same environment as a local machine of a user needs to be prepared.
[0003] At present, in order to make the node machine have the same environment as the local machine of the user, all necessary product information related to the rendering task in the local machine of the user, such as software and plug-ins, is generally copied to the node machine, so as to restore the environment of the node machine to the local machine environment of the user. However, since the data volume of the product information related to the rendering task is large, the storage pressure is also large, and a long time is required, the time cost is high, and thus the execution efficiency of the rendering task is reduced.
[0004] Therefore, how to provide an efficient technical solution for performing a rendering task becomes a technical problem to be solved. SUMMARY
[0005] Some embodiments of the present application aim to provide a method and device for obtaining a task environment, a storage medium and an electronic device. The technical solution of the embodiments of the present application can realize fast restoration of the environment of a node machine, so that the task environment of the node machine is the same as the local environment of the user, effectively reduces the data volume of processing and storage, reduces the time cost, and thus improves the execution efficiency of the rendering task.
[0006] In a first aspect, some embodiments of the present application provide a method for obtaining a task environment, comprising: obtaining a plug-in list for performing a to-be-rendered task, and obtaining plug-in information of each candidate node in a plurality of candidate nodes for performing the to-be-rendered task; obtaining a switching generation value of each candidate node when switching the plug-in information of each candidate node to all plug-ins in the plug-in list; selecting a target node for performing the to-be-rendered task from the plurality of candidate nodes according to the plug-in list and the switching generation value of each candidate node, and obtaining a target task environment corresponding to the target node.
[0007] Some embodiments of the present application obtain a target task environment through the plug-in list of a to-be-rendered task and the switching generation value of each candidate node plug-in information, which can realize fast restoration of the environment of a node machine (that is, a node), so that the task environment of the node machine is the same as the local environment of the user, effectively reduces the data volume of processing and storage, reduces the time cost, and thus improves the execution efficiency of the rendering task.
[0008] In some embodiments, before the obtaining the switching cost values of the candidate node plug-in information when the candidate node plug-in information is switched to all plug-ins in the plug-in list, the method further comprises: obtaining a plug-in switching cost table, wherein the plug-in switching cost table comprises switching cost values of each plug-in in the plurality of plug-ins when switching between any two versions; and the obtaining the switching cost values of the candidate node plug-in information when the candidate node plug-in information is switched to all plug-ins in the plug-in list comprises: obtaining each plug-in version in the candidate node plug-in information; obtaining each target plug-in version in the plug-in list, wherein one plug-in version corresponds to one target plug-in version; determining the switching cost values of the plug-in versions when switched to the target plug-in versions from the plug-in switching cost table; and adding the switching cost values to obtain the switching cost values.
[0009] Some embodiments of the present application can obtain the switching cost values of each plug-in version in the candidate node plug-in information when switched to the plug-ins in the plug-in list through the plug-in switching cost table, and can accurately calculate the switching cost values consumed by the candidate nodes when switching versions, thereby effectively reducing the amount of data to be processed and stored.
[0010] In some embodiments, the selecting a target node from the plurality of candidate nodes to perform the to-be-rendered task according to the plug-in list and the switching cost values, and obtaining a target task environment corresponding to the target node comprises: obtaining the target node according to the size of the switching cost values; adjusting original plug-in information in the target node according to the plug-in list to obtain an adjustment result; and obtaining the target task environment of the target node when the adjustment result is that all plug-ins in the original plug-in information are replaced by all plug-ins in the plug-in list.
[0011] Some embodiments of the present application can obtain the target node according to the size of the switching cost values, and then adjust the plug-ins in the target node to all plug-ins in the plug-in list, thereby quickly and accurately obtaining the target task environment same as the local environment of the user.
[0012] In some embodiments, the obtaining the target node according to the size of the switching cost values comprises: selecting a candidate node corresponding to the minimum value in the switching cost values as the target node; or selecting a preset number of candidate node switching cost values from the switching cost values; determining performance parameters of the candidate nodes, and determining the target node from the preset number of candidate node switching cost values according to the performance parameters.
[0013] Some embodiments of the present application can directly obtain the target node according to the size of the switching cost values, or can comprehensively analyze the switching cost values and the performance parameters to obtain the target node, which is flexible and accurate.
[0014] In some embodiments, the method further comprises: in a case where the adjustment result is that the original plug-in information is replaced by the state of all plug-ins being abnormal, executing a rollback instruction, and sending information of a task environment acquisition failure or a failure of the to-be-rendered task to a control end.
[0015] Some embodiments of the present application can execute a rollback instruction and report failure information in a case where an exception occurs during adjustment, so as to realize real-time monitoring of a target node.
[0016] In some embodiments, before the target task environment of the target node is acquired, the method further comprises: assigning the to-be-rendered task to the target node; and after the target node executing the to-be-rendered task is selected from the plurality of candidate nodes and the target task environment corresponding to the target node is acquired, the method further comprises: executing the to-be-rendered task based on the target task environment.
[0017] Some embodiments of the present application execute the to-be-rendered task based on the target task environment of the target node, which improves the efficiency of acquiring the target task environment, and further improves the efficiency of executing the to-be-rendered task, and reduces the task delivery cycle.
[0018] In a second aspect, some embodiments of the present application provide a device for acquiring a task environment, comprising: an acquisition module configured to acquire a plug-in list for executing a to-be-rendered task, and acquire plug-in information of each candidate node in a plurality of candidate nodes for executing the to-be-rendered task; a switching module configured to acquire a switching value of each candidate node when the plug-in information of each candidate node is switched to all plug-ins in the plug-in list; and a selection module configured to select a target node for executing the to-be-rendered task from the plurality of candidate nodes according to the plug-in list and the switching value of each candidate node, and acquire a target task environment corresponding to the target node.
[0019] In a third aspect, some embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, wherein the program is executable by a processor to implement the method according to any of the embodiments of the first aspect.
[0020] In a fourth aspect, some embodiments of the present application provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any of the embodiments of the first aspect when executing the program.
[0021] In a fifth aspect, some embodiments of the present application provide a computer program product, which comprises a computer program, wherein the computer program, when executed by a processor, can implement the method according to any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings needed to be used in some embodiments of the present application will be briefly introduced as follows. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0023] Figure 1 A system diagram for obtaining a task environment provided by some embodiments of the present application;
[0024] Figure 2 One of the method flowcharts for obtaining a task environment provided by some embodiments of the present application;
[0025] Figure 3 An apparatus composition block diagram for obtaining a task environment provided by some embodiments of the present application;
[0026] Figure 4 An electronic device schematic diagram provided by some embodiments of the present application. DETAILED DESCRIPTION
[0027] The technical solutions of some embodiments of the present application will be described in detail below with reference to the drawings in some embodiments of the present application.
[0028] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used for distinguishing description, and cannot be understood as indicating or implying relative importance.
[0029] In the related art, before performing a process of rendering a user task in the cloud, a node machine (also referred to as a node) needs to be prepared, which is the same as the user's local machine environment. The node machine environment needs to include the same version of rendering software and various rendering plug-ins as the user's local machine environment. The traditional technology for ensuring the same environment is to start up using different images according to the user's local machine environment, and copy the rendering software and various rendering plug-ins used by the user's local machine to the node machine, so as to restore the node machine to the user's local machine environment. As can be seen from the above related art, because the memory occupation of the rendering software and various rendering plug-ins is large, the data volume of copying all the software and plug-ins is large, the storage pressure is also large, and in the case of small single rendering volume, the total loss ratio is high, and the time cost is also high.
[0030] Therefore, some embodiments of the present application provide a method for obtaining a task environment. The method calculates the switching generation value of each candidate node plug-in information when all plug-ins in the plug-in list required by the to-be-rendered task are switched, and then obtains the target task environment according to the switching generation value and the plug-in list. Some embodiments of the present application can realize fast restoration of the environment of the node machine, so that the task environment of the node machine is the same as the user's local environment, effectively reducing the data volume of processing and storage, reducing the time cost, and thereby improving the execution efficiency of the rendering task.
[0031] As shown in FIG. 1, Figure 1 Some embodiments of the present application provide a system for obtaining a task environment. The system includes a rendering server 100, a user local machine end 110, a candidate node 120, a candidate node 130, and a candidate node 140. The rendering server 100 can obtain the plug-in list in the user local machine environment of the user local machine end 110 where the to-be-rendered task is located, and obtain the plug-in information of each candidate node in the candidate node 120, the candidate node 130, and the candidate node 140. Then, the switching generation value of each candidate node can be obtained by calculation. Finally, the target node is selected based on the switching generation value, and then the original plug-in in the target node is replaced with the plug-in in the plug-in list, and thus the target task environment can be obtained.
[0032] In some embodiments of the present application, the user local machine end 110 can be a server or a terminal device. The candidate node 120, the candidate node 130, and the candidate node 140 can be a local server or a cloud server. The number of candidate nodes is not unique in actual application (for example, the number of candidate nodes can be 8, 10, or 100, etc.), and the present application is not limited thereto.
[0033] The accompanying drawings are used to illustrate some embodiments of the present application. Figure 2 The following describes an implementation process of obtaining a task environment performed by the rendering server 100 according to some embodiments of the present application.
[0034] The following describes an implementation process of obtaining a task environment performed by the rendering server 100 according to some embodiments of the present application. Figure 2 Figure 2 The following describes an implementation process of obtaining a task environment performed by the rendering server 100 according to some embodiments of the present application.
[0035] S210, obtaining a list of plugins for executing a to-be-rendered task, and obtaining plugin information of each candidate node in a plurality of candidate nodes for executing the to-be-rendered task.
[0036] It should be noted that software is an application program that can be executed independently in a system, and a plugin is an application program that can be executed on the basis of a specified system and software. The plugin in some embodiments of the present application can include software and a plugin related to the software.
[0037] For example, in some embodiments of the present application, some target plugins required by the to-be-rendered task exist in the user local machine end 110, and the target plugins are sorted into a corresponding plugin list. The plugin list includes a version number of each target plugin and a memory size of the target plugin. Plugins related to the to-be-rendered task in the plurality of candidate nodes are sorted to obtain plugin information of each candidate node, and the plugin information of each candidate node includes a version of each plugin and a size of each plugin.
[0038] S220, obtaining a switching generation value of each candidate node when the plugin information of each candidate node is switched to all plugins in the plugin list.
[0039] For example, in some embodiments of the present application, a specific process of one plugin switching is as follows: for a plugin A, compared with a 1.5 version, a 2.0.1 version of the plugin A increases 50 files, denoted as a set S_ADD, and reduces 20 files, denoted as a set S_DEL. Now it is required to switch the plugin A from the version 1.5 to the version 2.0.1 on a node machine, all files in S_DEL need to be deleted, and all files in S_ADD need to be copied from a public storage to the node machine, and this process is called one plugin switching for the plugin A. Therefore, the switching generation value of each candidate node can be obtained by the plugin information of each candidate node and the plugin list. The switching generation value of each node represents a memory size of each node occupied when the plugin is switched, or represents a number of files that need to be added or deleted when the plugin is switched, and the present application is not limited thereto.
[0040] To improve the efficiency of obtaining the switching cost value, in some embodiments of the present application, before S220, the method for obtaining the task environment further comprises: obtaining a plug-in switching cost table, wherein the plug-in switching cost table comprises switching cost values of each plug-in in the plurality of plug-ins between any two versions.
[0041] For example, in some embodiments of the present application, the switching cost values between different versions of the plurality of plug-ins are pre-calculated. For example, for a plug-in A, compared with the 1.5 version, the 2.0.1 version of the plug-in A increases 50 files with a total of 300 MB and reduces 20 files with a total of 50 MB. Considering that the time for copying a file is much longer than the time for deleting a file, the switching cost value for switching the plug-in A from the 1.5 version to the 2.0.1 version is defined as 300, and the switching cost value for switching the plug-in A from the 2.0.1 version to the 1.5 version is defined as 50. In particular, the switching cost value of the same plug-in between the 2.0.1 version and the 1.5 version is 0, which can also be understood as not needing to make any changes to the same plug-in, and thus the switching cost value is 0. The switching cost values between all versions of the plurality of plug-ins are pre-calculated in the above manner, and a two-dimensional plug-in switching cost table can be obtained for each plug-in. The plug-in switching cost tables of each plug-in are integrated to obtain a plug-in switching cost table containing the plurality of plug-ins.
[0042] In some embodiments of the present application, S220 can comprise: obtaining each plug-in version in the plug-in information of each candidate node; obtaining each target plug-in version in the plug-in list, wherein one plug-in version corresponds to one target plug-in version; determining each switching cost value for switching the plug-in version to the target plug-in version from the plug-in switching cost table; and adding the switching cost values to obtain the switching cost value.
[0043] For example, in some embodiments of the present application, each switching cost value is found from the plug-in switching cost table by using each plug-in version in each candidate node and each target plug-in version in the plug-in list, and then the switching cost values are added to obtain the switching cost value. For example, a candidate node contains 5 plug-in versions, and the plug-in list includes 5 target plug-in versions. The 5 switching cost values required for replacing each of the 5 plug-in versions with the 5 target plug-in versions are found from the plug-in switching cost table, and the 5 switching cost values are added to obtain the switching cost value for adjusting the environment of the candidate node to the local machine environment of the user.
[0044] For example, as an example of the present application, when there are multiple candidate nodes available for distribution (i.e., executable for the to-be-rendered task), the total switching cost (i.e., the switching cost of each plug-in) of all plug-ins is calculated for each node. First, a plug-in list of all plug-ins required for the to-be-rendered task is listed, and then compared with the existing plug-in version and the plug-in version to be adjusted of each node, and then the plug-in switching cost table is searched to obtain the switching cost (i.e., the cost value of each plug-in) of each plug-in in each node, and the total sum of the accumulative total is calculated as the total switching cost.
[0045] S230, according to the plug-in list and the switching cost value of each plug-in, selects a target node for executing the to-be-rendered task from the multiple candidate nodes, and obtains a target task environment corresponding to the target node.
[0046] For example, in some embodiments of the present application, the target node can be obtained through the switching cost value, and the target task environment can be obtained by adjusting the original plug-in information of the target node to all plug-ins in the plug-in list.
[0047] In some embodiments of the present application, S230 can include: obtaining the target node according to the size of the switching cost value of each plug-in; adjusting the original plug-in information in the target node according to the plug-in list to obtain an adjustment result; and obtaining the target task environment of the target node in the case that the adjustment result is that all original plug-in information is replaced by all plug-ins in the plug-in list.
[0048] For example, in some embodiments of the present application, after the target node is determined by the size of the switching cost value, the original plug-in version in the original plug-in information in the target node is adjusted to the target plug-in version in the plug-in list. If all original plug-in versions are successfully adjusted, the target task environment can be obtained. At this time, the target task environment is the same as the user local machine environment of the user local machine 110. For example, there are 5 plug-ins in the original plug-in information, 4 of which have different original plug-in versions from the target plug-in version in the plug-in list, and at this time, the 4 original plug-ins need to be adjusted to the target plug-in, and the remaining one does not need to be adjusted.
[0049] In order to save time and space, in some embodiments of the present application, S230 can include: taking the candidate node corresponding to the minimum value in the switching cost value as the target node.
[0050] For example, in some embodiments of the present application, the candidate node corresponding to the minimum value of the switching cost value of each plug-in can be taken as the target node. For example, the switching cost values of the plug-ins of 5 candidate nodes are 100, 200, 50, 10 and 60 respectively, and the candidate node with the switching cost value of 10 is taken as the target node.
[0051] In some embodiments of the present application, S230 can include selecting a preset number of candidate node switching generation values from the switching generation values, and determining the target node from the preset number of candidate node switching generation values according to the performance parameters of the candidate nodes.
[0052] For example, in some embodiments of the present application, the target node can also be determined by selecting a smaller number of candidate nodes from the switching generation values, and then confirming the target node according to the performance parameters (such as CPU occupancy, memory space, and other performance parameters) of the candidate nodes. For example, the switching generation values of the plug-ins of the above-mentioned five candidate nodes are sorted, and three smaller candidate nodes are selected, and then the target node is determined according to the performance parameters of the three candidate nodes. It should be understood that when selecting a preset number of candidate node switching generation values, candidate nodes corresponding to switching generation values smaller than the set generation threshold can also be selected, and the target node can be selected therefrom. The present application is not limited to the above-mentioned embodiments.
[0053] For example, as a specific example of the present application, a list of all plug-in versions required by the to-be-rendered task and a list of versions of the original plug-ins on the target node can be listed. The plug-ins on the target node are replaced in a predefined order, and for each plug-in whose original plug-in version and to-be-rendered task version are different, the switching of the single plug-in is performed according to the above-mentioned embodiments.
[0054] In some embodiments of the present application, the method for obtaining a task environment further includes: in the case where the adjustment result is that the replacement of the original plug-in information to the all plug-ins is abnormal, executing a rollback instruction, and sending information of a failure to obtain a task environment or a failure to execute the to-be-rendered task to a control end.
[0055] For example, in some embodiments of the present application, the original plug-in of the target node needs to be monitored during the version adjustment of the original plug-in of the target node. If there is a problem of deleting a file, copying a file, or setting an environment variable, a rollback instruction needs to be executed to rollback the environment of the node, and a main control server (as a specific example of a control end) is reported to prompt that the to-be-rendered task fails this time.
[0056] In some embodiments of the present application, before obtaining the target task environment of the target node, the method for obtaining a task environment further includes: assigning the to-be-rendered task to the target node. After S230, the method for obtaining a task environment further includes: executing the to-be-rendered task based on the target task environment.
[0057] For example, in some embodiments of the present application, the to-be-rendered task is assigned to a corresponding target node, and then the to-be-rendered task is executed based on the target task environment after the target node completes the task environment adjustment. The efficiency of selecting a target node can be improved by some embodiments of the present application, thereby improving the efficiency of executing the to-be-rendered task.
[0058] Reference is made to Figure 3 , Figure 3 A block diagram of an apparatus for obtaining a task environment according to some embodiments of the present application is shown. It should be understood that the apparatus for obtaining a task environment corresponds to the above-mentioned method embodiments, and can perform each step involved in the above-mentioned method embodiments. The specific functions of the apparatus for obtaining a task environment can be referred to the description above, and the detailed description is appropriately omitted here to avoid repetition.
[0059] Figure 3 The apparatus for obtaining a task environment includes at least one software function module that can be stored in the form of software or firmware in the memory or solidified in the apparatus for obtaining a task environment. The apparatus for obtaining a task environment includes: an obtaining module 310 configured to obtain a plug-in list for executing a to-be-rendered task, and obtain plug-in information of each candidate node in a plurality of candidate nodes for executing the to-be-rendered task; a switching module 320 configured to obtain a switching cost value of each candidate node when each candidate node plug-in information is switched to all plug-ins in the plug-in list; a selection module 330 configured to select a target node for executing the to-be-rendered task from the plurality of candidate nodes according to the plug-in list and the switching cost value of each candidate node, and obtain a target task environment corresponding to the target node.
[0060] In some embodiments of the present application, before the switching module 320, the apparatus for obtaining a task environment further includes a cost table obtaining module (not shown in the figure) configured to obtain a plug-in switching cost table, wherein the plug-in switching cost table includes a switching cost value of each plug-in in a plurality of plug-ins between any two versions. The switching module 320 is configured to obtain each plug-in version in the candidate node plug-in information; obtain each target plug-in version in the plug-in list, wherein one plug-in version corresponds to one target plug-in version; determine each switching cost value of each plug-in version switched to each target plug-in version from the plug-in switching cost table; and add the switching cost values to obtain the switching cost value of each candidate node.
[0061] In some embodiments of the present application, the selection module 330 is configured to obtain the target node according to the size of the switching cost value of each candidate node; adjust the original plug-in information in the target node according to the plug-in list to obtain an adjustment result; and obtain the target task environment of the target node in the case that the adjustment result is that all the original plug-in information is replaced by all plug-ins in the plug-in list.
[0062] In some embodiments of the present application, the selection module 330 is configured to select the candidate node corresponding to the minimum value of the switching generation values as the target node; or select a preset number of candidate node switching generation values from the switching generation values; confirm the performance parameters of the candidate nodes, and determine the target node from the preset number of candidate node switching generation values according to the performance parameters.
[0063] In some embodiments of the present application, the selection module 330 is configured to execute a rollback instruction and send information of a task environment acquisition failure or a to-be-rendered task execution failure to the control end in a case where the adjustment result is that the original plug-in information is replaced by the state of all plug-ins is abnormal.
[0064] In some embodiments of the present application, before the selection module 330, the device for acquiring a task environment further includes an allocation module (not shown in the figure) configured to allocate the to-be-rendered task to the target node. After the selection module 330, an execution module (not shown in the figure) is further included, which is configured to execute the to-be-rendered task based on the target task environment.
[0065] Some embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the operations of the method corresponding to any of the above embodiments.
[0066] Some embodiments of the present application also provide a computer program product, which includes a computer program, wherein the computer program is executed by a processor to implement the operations of the method corresponding to any of the above embodiments.
[0067] As shown in FIG. 4, Figure 4 Some embodiments of the present application provide an electronic device 400, which includes a memory 410, a processor 420, and a computer program stored in the memory 410 and executable on the processor 420, wherein the processor 420 reads the program from the memory 410 through a bus 430 and executes the program to implement the method of any of the above embodiments.
[0068] The processor 420 can process digital signals and can include various computing structures. For example, a complex instruction set computer structure, a reduced instruction set computer structure, or a structure implementing a combination of multiple instruction sets. In some examples, the processor 420 can be a microprocessor.
[0069] The memory 410 can be used to store instructions executed by the processor 420 or data related to the instructions execution process. The instructions and / or data can include code for implementing some or all of the functions of one or more modules described in the embodiments of the present application. The processor 420 of the embodiments of the present disclosure can be configured to execute the instructions in the memory 410 to implement the methods shown in the above. The memory 410 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory well known to those skilled in the art.
[0070] The above only describes the embodiments of the present application and is not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0071] The above only describes the embodiments of the present application and is not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0072] It should be noted that, in the present document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
Claims
1. A method of acquiring a task environment, characterized by, The method comprises the following steps: obtaining a list of plug-ins for executing a to-be-rendered task, and obtaining plug-in information of each candidate node in a plurality of candidate nodes for executing the to-be-rendered task; obtaining a switching generation value of each candidate node when the plug-in information of each candidate node is switched to all plug-ins in the list of plug-ins; the switching generation value represents a memory size of each candidate node occupied when the plug-ins are switched, or a number of files that need to be added or deleted when the plug-ins are switched; the obtaining of the switching generation value of each candidate node when the plug-in information of each candidate node is switched to all plug-ins in the list of plug-ins comprises: obtaining each plug-in version in the plug-in information of each candidate node; obtaining each target plug-in version in the list of plug-ins, wherein one plug-in version corresponds to one target plug-in version; determining a generation value of each plug-in version switched to each target plug-in version from the plug-in switching generation table; and adding the generation values to obtain the switching generation value of each candidate node; selecting a target node for executing the to-be-rendered task from the plurality of candidate nodes according to the list of plug-ins and the switching generation value, and obtaining a target task environment corresponding to the target node.
2. The method of claim 1, wherein, Before the obtaining of the switching generation value of each candidate node when the plug-in information of each candidate node is switched to all plug-ins in the list of plug-ins, the method further comprises: obtaining a plug-in switching generation table, wherein the plug-in switching generation table comprises a generation value of each plug-in in a plurality of plug-ins when the plug-in is switched between any two versions.
3. The method according to any one of claims 1 to 2, wherein, The selecting of the target node for executing the to-be-rendered task from the plurality of candidate nodes and the obtaining of the target task environment corresponding to the target node comprise: obtaining the target node according to the size of the switching generation value; adjusting original plug-in information in the target node according to the list of plug-ins to obtain an adjustment result; in a case where the adjustment result is that all original plug-in information is replaced by all plug-ins in the list of plug-ins, obtaining the target task environment of the target node.
4. The method of claim 3, wherein, The obtaining of the target node according to the size of the switching generation value comprises: taking a candidate node corresponding to a minimum value in the switching generation value as the target node; or selecting a preset number of candidate node switching generation values from the switching generation values; confirming performance parameters of each candidate node, and determining the target node from the preset number of candidate node switching generation values according to the performance parameters. The method further comprises:
5. The method of claim 4, wherein, in a case where the state in which the original plug-in information is replaced by all plug-ins is abnormal, executing a rollback instruction, and sending information of a task environment acquisition failure or a to-be-rendered task execution failure to a control end. Before the obtaining of the target task environment of the target node, the method further comprises:
6. The method of claim 5, wherein, allocating the to-be-rendered task to the target node; After the selecting of the target node for executing the to-be-rendered task from the plurality of candidate nodes and the obtaining of the target task environment corresponding to the target node, the method further comprises: executing the to-be-rendered task based on the target task environment. 7. An apparatus for acquiring a task environment, characterized by comprising: The device is used to execute the method in claim 1, comprising: an acquisition module configured to acquire a plug-in list for executing a task to be rendered, and acquire plug-in information of each candidate node in a plurality of candidate nodes for executing the task to be rendered; a switching module configured to acquire a switching generation value of each candidate node when the plug-in information of each candidate node is switched to all plug-ins in the plug-in list; a selection module configured to select a target node for executing the task to be rendered from the plurality of candidate nodes according to the plug-in list and the switching generation value of each candidate node, and acquire a target task environment corresponding to the target node.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is run by a processor to execute the method in any one of claims 1-6.
9. A computer program product, characterised in that, The computer program product comprises a computer program, wherein the computer program is run by a processor to execute the method in any one of claims 1-6.
10. An electronic device, comprising: The device comprises a memory, a processor, and a computer program stored in the memory and run on the processor, wherein the computer program is run by the processor to execute the method in any one of claims 1-6.
Citation Information
Patent Citations
Network function realization method and device
CN105681437A
A server scheduling method and device, electronic equipment and a storage medium
CN113961326A