Method and device for regulating virtual production facility in game

CN122828367APending Publication Date: 2026-09-29GUANGZHOU YIWAN NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610944433.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-09-29

AI Technical Summary

Technical Problem

这种逐个调整的方式需要玩家反复执行大量重复性操作

Benefits of technology

[0060]1.通过自动追溯生产异常的级联影响并协同生成包含位置调整和人力重分配的优化方案,玩家仅需对图形用户界面中显示的优化方案执行单次确认操作,即可完成对多个虚拟设施空间布局和运输链路人力配置的协同调控,显著减少了调控操作环节,降低了玩家的认知负担和操作频次。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122828367A_ABST
    Figure CN122828367A_ABST
Patent Text Reader

Abstract

The application discloses a method and device for regulating a virtual production facility in a game, and is applied to a terminal device. The method comprises the following steps: in response to a triggering operation on an optimization identifier in a graphical user interface, obtaining to-be-optimized information associated with the optimization identifier; based on an optimization type and a first optimization object in the to-be-optimized information, generating an optimization scheme, wherein the optimization scheme comprises position adjustment information of a virtual facility to be optimized and manpower redistribution information of a transportation link; in response to a confirmation execution instruction on the optimization scheme, executing the optimization scheme, and displaying a position adjustment path of the virtual facility and / or a manpower adjustment state of the transportation link in a player's perspective. By automatically tracing abnormal cascade effects and cooperatively generating an optimization scheme, the player can simplify repeated manual investigation and adjustment into a single confirmation operation to complete regulation, thereby reducing operation links and improving regulation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer game technology, and more specifically, to a method, apparatus, electronic device, and storage medium for controlling virtual production facilities in a game. Background Technology

[0002] In simulation management games, players need to build and manage numerous production facilities, which form a multi-layered production network through raw material supply and product processing. To maintain the stable operation of the production network, players need to continuously monitor various aspects of information, such as the raw material inventory levels of each facility, the capacity matching of each transportation link, and the supply and demand of the final product.

[0003] Currently, if players want to know the operating status of the production network, they usually need to trigger the status viewing interface of each virtual facility one by one, and check the raw material inventory balance, processing progress and real-time demand of downstream facilities through multiple click operations. Only by combining all the information they have viewed can they pinpoint which link has a supply and demand imbalance or inventory shortage problem, resulting in a lengthy human-computer interaction path and numerous operation steps.

[0004] When an anomaly occurs in a production link (such as a shortage of a certain intermediate product), the game system only provides a warning after obvious anomalies such as complete depletion of inventory or complete production halt occur. Before this, it does not proactively inform players of potential risks. Upon receiving such a warning, because the system provides no information about the scope of the anomaly's impact, players must manually investigate each upstream supply facility and downstream processing facility involved to determine which facilities will be shut down and the extent of the impact. If the anomaly involves multiple levels of the production chain, players must also traverse the chain step by step to fully grasp the cascading effects. This piecemeal adjustment method requires players to repeatedly perform a large number of repetitive operations. Summary of the Invention

[0005] In order to overcome the shortcomings of the prior art, this application provides a method, device, electronic device and storage medium for controlling virtual production facilities in games, the purpose of which is to reduce the amount of manual investigation and control operations for players in handling production network anomalies and improve human-computer interaction efficiency.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] Firstly, a method for controlling virtual production facilities in a game, applied to terminal devices, includes:

[0008] In response to a trigger operation on an optimization identifier in the graphical user interface, obtain the optimization information associated with the optimization identifier;

[0009] Based on the optimization type and the first optimization object in the information to be optimized, an optimization scheme is generated; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link;

[0010] In response to the confirmation and execution command of the optimization scheme, the optimization scheme is executed, and the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link are displayed from the player's perspective.

[0011] Optionally, the optimization type includes raw material shortage, logistics bottleneck, supply and demand imbalance, or global optimization; the generation of optimization schemes includes:

[0012] Based on the optimization type, a first constraint condition corresponding to the optimization type is determined; the first constraint condition includes at least one of the following: the expected depletion time of the optimized raw materials is greater than a first safety threshold, the human resource efficiency factor of the transportation link is less than a second safety threshold, and the supply-demand ratio of residents' necessities is within a preset safety range.

[0013] Based on the first optimization object, the second optimization object is determined by linking and tracing through a preset production relationship map;

[0014] Under the first constraint, the spatial coordinates of the virtual facilities involved in the second optimization object and the allocation of manpower for the transportation links are collaboratively optimized to obtain the optimization scheme.

[0015] Optionally, the step of collaboratively optimizing the spatial coordinates and manpower allocation of the virtual facilities and transportation links involved in the second optimization object to obtain the optimization scheme includes:

[0016] Obtain the current spatial coordinates of the virtual facilities involved in the second optimization object, and the current manpower allocation of the transportation link involved in the second optimization object;

[0017] With the goal of minimizing global transportation costs, the target spatial coordinates and target manpower allocation are determined based on the current spatial coordinates, the current manpower allocation, and the first constraint.

[0018] The location adjustment information is generated based on the target spatial coordinates, and the manpower reallocation information is generated based on the target manpower allocation, so as to form the optimization scheme.

[0019] Optionally, the objective of minimizing global transportation costs includes:

[0020] The preset second constraint is used as a restriction, which, together with the first constraint, constrains the solution process to obtain the target spatial coordinates and the target manpower allocation; the second constraint includes: the spatial coordinates of each virtual facility are within the buildable area and do not overlap with each other, and the total number of virtual manpower units allocated to each transportation link does not exceed the total number of available virtual manpower units.

[0021] Optionally, the global transportation cost is calculated in the following way:

[0022] For each transport link, the sub-link cost is calculated based on the link factor of that transport link; the link factor includes the transport volume of the transport link, the distance between upstream and downstream virtual facilities, the manpower efficiency factor, and the adjacency gain factor; the adjacency gain factor takes a preset value less than 1 when the upstream and downstream virtual facilities are in adjacent grids, and otherwise takes 1;

[0023] The global transportation cost is calculated based on the sub-link costs of each transportation link.

[0024] Optionally, the preset production relationship map is constructed in the following way:

[0025] Establish multiple nodes, each node representing an item;

[0026] Establish directed edges between nodes, pointing from raw material nodes to product nodes, to represent the transformation relationship from raw materials to products;

[0027] Configure edge attributes for each directed edge, including: the type of virtual facility required, the raw material consumption per production run, the product output per production run, and the basic production time, to obtain the production relationship graph.

[0028] Optionally, the step of determining the second optimization object based on the first optimization object through a preset production relationship map includes:

[0029] When the optimization type is raw material shortage or logistics bottleneck, in the production relationship graph, starting from the first node corresponding to the first optimization object, the downstream nodes are traversed along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the downstream nodes are determined as the second optimization object.

[0030] When the optimization type is supply and demand imbalance, in the production relationship graph, starting from the first node corresponding to the first optimization object, the upstream nodes are traversed in reverse along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the upstream nodes are determined as the second optimization object.

[0031] Optionally, the step of obtaining the optimization information associated with the optimization identifier in response to a trigger operation on the graphical user interface includes at least one of the following:

[0032] In response to a trigger operation on the global optimization control in the graphical user interface, global optimization information is obtained;

[0033] In response to the detection that a preset anomaly detection condition has been met, the optimization identifier is displayed on the corresponding virtual facility and / or transportation link in the graphical user interface; in response to the triggering operation of the optimization identifier, the optimization information associated with the optimization identifier is obtained;

[0034] The preset anomaly detection conditions include: the estimated depletion time of raw materials in the virtual facility is lower than a first preset threshold, the human resource efficiency factor of the transportation link is higher than a second preset threshold, or the supply-demand ratio of residents' demand goods exceeds a preset range.

[0035] Optionally, obtaining the optimization information associated with the optimization identifier includes:

[0036] Acquire real-time status data for each virtual facility, including raw material inventory, raw material consumption rate, actual and demand capacity of transportation links, and supply and demand of consumer goods.

[0037] Based on the real-time status data, calculate the estimated depletion time of raw materials, the human resource efficiency factor of the transportation chain, and the supply-demand ratio of consumer goods.

[0038] Based on the calculation results, the optimization type and the corresponding first optimization object are determined to obtain the information to be optimized.

[0039] Optionally, it also includes:

[0040] In response to the generation of the optimization scheme, the optimization scheme is displayed in the graphical user interface; wherein, for the adjustment of the position of virtual facilities, a semi-transparent outline is displayed at the target position in the game world view, and a displacement arrow from the current position to the target position is drawn; for the redistribution of manpower in the transportation link, the transportation link that needs to be increased or decreased in manpower, as well as the corresponding increase or decrease in manpower indicators, are highlighted in the transportation task management interface.

[0041] Optionally, the method further includes:

[0042] In response to the modification operation of the optimization scheme, the location adjustment information and / or the manpower reallocation information are adjusted according to the modification operation, and the displayed optimization scheme is updated in real time;

[0043] In response to the confirmation and execution command for the modified optimization scheme, the modified optimization scheme is executed.

[0044] Optionally, executing the optimization scheme includes:

[0045] After receiving the confirmation execution instruction, determine whether the current game resources meet the requirements for executing the optimization scheme;

[0046] If satisfied, the required game resources are deducted, the corresponding virtual facilities are moved according to the location adjustment information, and the manpower allocation of the corresponding transportation link is adjusted according to the manpower redistribution information.

[0047] If the conditions are not met, a resource shortage warning will be displayed and the current layout and manpower will remain unchanged.

[0048] The game resources include building materials for mobile virtual facilities.

[0049] Optionally, the method further includes:

[0050] In response to the save operation of the optimized scheme, the optimized scheme is stored as a historical layout scheme;

[0051] In response to the loading operation of the historical layout scheme, verify whether the current game state meets the execution conditions of the historical layout scheme;

[0052] If the conditions are met, the historical layout scheme is displayed in the graphical user interface, and the system waits for the player to confirm and execute it.

[0053] Secondly, a control device for a virtual production facility in a game includes:

[0054] The trigger response module is used to respond to the trigger operation of the optimization identifier in the graphical user interface and obtain the optimization information associated with the optimization identifier;

[0055] The scheme generation module is used to generate an optimization scheme based on the optimization type and the first optimization object in the information to be optimized; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link;

[0056] The execution module is used to execute the optimization scheme in response to the confirmation execution command of the optimization scheme, and to display the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link from the player's perspective.

[0057] Thirdly, an electronic device includes a processor and a memory, the memory storing program instructions that, when executed by the processor, implement the above-described method.

[0058] Fourthly, a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the above-described method.

[0059] Due to the application of the above technical solution, the present invention has the following advantages compared with the prior art:

[0060] 1. By automatically tracing the cascading effects of production anomalies and collaboratively generating optimization solutions that include location adjustments and manpower reallocation, players only need to perform a single confirmation operation on the optimization solution displayed in the graphical user interface to complete the collaborative control of the spatial layout of multiple virtual facilities and the manpower configuration of transportation links. This significantly reduces the number of control operation steps and lowers the cognitive burden and operation frequency of players.

[0061] 2. By directly displaying optimization icons on the corresponding virtual facilities and / or transportation links in the graphical user interface, players can intuitively identify facilities or links with anomalies and their locations without having to actively traverse each facility. After triggering an operation, the system automatically obtains the information to be optimized and generates an optimization plan, improving the intuitiveness and convenience of anomaly location.

[0062] 3. By presenting the optimized plan in a visual format, such as semi-transparent outlines, displacement arrows, highlighted links, and indicators for increasing or decreasing the number of players, players can preview the adjustment effects and make modifications before confirming the execution, thus improving the intuitiveness and certainty of the control operation.

[0063] 4. By establishing a preset production relationship map and tracing upstream or downstream connections based on optimization type, the system automatically expands virtual facilities and / or transportation links directly affected by anomalies into a second optimization object containing related upstream and downstream objects for collaborative optimization. This allows the system to handle the layout and manpower allocation issues of multiple related facilities in a single optimization, improving the comprehensiveness and accuracy of anomaly handling.

[0064] 5. By setting up a global optimization control, players can trigger a global optimization of all current virtual facilities and transportation links with one click, without having to trigger and adjust each anomaly individually, further simplifying the operation path of global production network optimization.

[0065] To make the above and other objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0067] Figure 1 This is a flowchart illustrating the virtual production facility control method in the embodiments of this application;

[0068] Figure 2 This is a schematic diagram of the process for generating the optimization scheme in the embodiments of this application;

[0069] Figure 3 This is a schematic diagram of the control device in an embodiment of this application;

[0070] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application.

[0071] Figure descriptions: 10. Trigger response module; 20. Scheme generation module; 30. Execution module. Detailed Implementation

[0072] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0073] In the description of this application, the terms "first," "second," etc., are used only for descriptive purposes and to distinguish similar objects; there is no order between them, nor should they be construed as indicating or implying relative importance. Furthermore, unless otherwise stated, "multiple" means two or more.

[0074] The method of this application can be applied to various simulation management games. It is understood that the method of this application embodiment can run on various terminal devices. As an example, the terminal device can be an electronic device with a graphical user interface, such as a smartphone, tablet, personal computer, or game console. For ease of explanation, the following description will be combined with a maritime simulation management game and will use a smartphone as an exemplary operating environment, but this does not constitute a limitation on the scope of application of this application.

[0075] In this exemplary scenario, the game includes various virtual facilities such as a material factory, a garment workshop, and a seafood kitchen. A virtual facility refers to a functional unit within the virtual scene, controlled by the game program, capable of processing upstream materials into downstream materials according to a production formula. For example, the material factory can use the basic material "waste cloth" to produce the intermediate material "fabric," and the garment workshop can use the intermediate material "fabric" to produce the final product "clothes." Each virtual facility has its own independent local inventory for storing the raw materials and finished products required for production. Raw materials and finished products are distinguished by item type tags. This can be implemented by each facility having a unified warehouse and using data identification to differentiate between raw materials and finished products, or by each facility having separate raw material and finished product warehouses; this application does not impose any limitations on this. Each virtual facility occupies a defined grid cell in the game scene displayed in the graphical user interface, its position represented by spatial coordinates (x, y). The game features deployable virtual residents, each with individual attributes such as load capacity and speed. These virtual residents are virtual human units that can be assigned to perform transportation tasks between factories. The transportation task is as follows: the virtual human unit takes out the items marked as products from the local inventory of the upstream virtual facility, transports them to the downstream virtual facility along the grid path in the game scene, and stores them in the local inventory of the downstream virtual facility marked as raw materials.

[0076] Example 1: Control method for virtual production facilities in games

[0077] See Figure 1 As shown, this embodiment provides a method for controlling virtual production facilities in a game, applied to a terminal device. The graphical user interface of the terminal device displays multiple virtual facilities. The method includes the following steps:

[0078] Step S110: In response to a trigger operation on an optimization identifier in the graphical user interface, obtain the optimization information associated with the optimization identifier.

[0079] It should be noted that the optimization indicator refers to the visual element in the graphical user interface used to prompt players that an optimization process can be triggered. Its specific form can be a button, icon, exclamation mark, flashing mark, highlighted border, etc.

[0080] The information to be optimized is acquired by the system after receiving a player's trigger action on an optimization identifier. It is used to generate subsequent optimization plans and includes two parts: optimization type and first optimization object. The optimization type indicates the category of the problem being optimized, and the first optimization object represents the set of identifiers for virtual facilities and / or transportation links directly affected by the problem. An identifier is a unique identifier used to identify a corresponding virtual facility or transportation link in the system, such as the name or number of the virtual facility (e.g., "Materials Factory A"), the number of the transportation link, or a combination of upstream and downstream virtual facility identifiers (e.g., "Materials Factory A → Cloth Transportation Link to Garment Workshop B"). A transportation link is a logical connection established between two virtual facilities for transporting specific items; it is directional, pointing from the upstream virtual facility to the downstream virtual facility.

[0081] In one exemplary embodiment, the above-mentioned optimization identifier is triggered via the following two paths:

[0082] Path 1: In response to a trigger operation on the global optimization control in the graphical user interface, obtain global information to be optimized. The global optimization control can be a button, menu item, or other interactive interface element in the graphical user interface that the player can actively click. In this path, the optimization type of the information to be optimized is "global optimization," and the first optimization object is the set of identifiers for all virtual facilities and all transportation links currently owned by the player.

[0083] Path 2: In response to the detection that a preset anomaly detection condition has been met, the optimization identifier is displayed on the corresponding virtual facility and / or transportation link in the graphical user interface; in response to the triggering operation of the optimization identifier, the optimization information associated with the optimization identifier is obtained.

[0084] The preset anomaly detection conditions include: the estimated depletion time of raw materials in the virtual facility is lower than a first preset threshold, the human resource efficiency factor of the transportation link is higher than a second preset threshold, or the supply-demand ratio of residents' demand goods exceeds a preset range.

[0085] Specific examples are as follows:

[0086] For cases where the estimated depletion time of raw materials is less than a first preset threshold: Taking a first preset threshold of 900 seconds as an example, if a virtual facility (such as material plant A) currently has 48 units of a certain raw material (such as waste cloth) in stock, and the consumption rate of this raw material is 0.1 units / second, then the estimated depletion time is 48 ÷ 0.1 = 480 seconds. 480 seconds < 900 seconds, which meets the anomaly detection condition, indicating that the virtual facility faces a raw material shortage risk.

[0087] For situations where the manpower efficiency factor of a transportation link exceeds the second preset threshold: Taking a second preset threshold of 1.4 as an example, if the required transport capacity of a certain transportation link (such as the fabric transportation link from material factory A to garment workshop B) is 0.044 units / second, and the actual transport capacity (calculated based on the load, speed attributes, and transport distance of the allocated virtual manpower units) is 0.025 units / second, then the manpower efficiency factor is 0.044 ÷ 0.025 ≈ 1.76. 1.76 > 1.4, which meets the anomaly detection condition, indicating that there is a logistics bottleneck in this transportation link.

[0088] For situations where the supply-demand ratio of a consumer good exceeds a preset range: Taking a preset range of [0.8, 2.0] as an example, if the current total production capacity (the sum of the output rates of all virtual facilities producing this item) of a consumer good (such as clothing) is 0.022 units / second, and the total consumption rate of this item by residents is 0.05 units / second, then the supply-demand ratio is 0.022 ÷ 0.05 = 0.44. 0.44 < 0.8, exceeding the lower limit of the preset range, indicating a supply shortage of this item. Conversely, if the supply-demand ratio of an item is 2.5, exceeding the upper limit of the preset range of 2.0, then there is a supply surplus of this item.

[0089] The above thresholds are all preset game balance parameters of the system, and game designers can adjust them according to the actual game rhythm and balance requirements.

[0090] In one optional implementation, the optimization marker is an exclamation mark. In the game scene of the graphical user interface, the estimated depletion time of raw material "waste cloth" in material factory A is 480 seconds, which is less than the system's preset time of 900 seconds. Therefore, the system displays an exclamation mark-shaped optimization marker above material factory A. The manpower efficiency factor of the cloth transportation link from material factory A to clothing workshop B is 1.76, which is higher than the second preset threshold of 1.4. The system also displays an optimization marker above clothing workshop B. After the player clicks on any optimization marker, the system obtains the corresponding optimization information.

[0091] In an exemplary embodiment, obtaining the information to be optimized associated with the optimization identifier specifically includes: obtaining real-time status data of each virtual facility, the real-time status data including raw material inventory, raw material consumption rate, actual and demanded transport capacity of the transportation link, and supply and demand of residential goods; calculating the expected depletion time of raw materials, the human resource efficiency factor of the transportation link, and the supply-demand ratio of residential goods based on the real-time status data; and determining the optimization type and the corresponding first optimization object based on the calculation results to obtain the information to be optimized.

[0092] The following example illustrates the process of obtaining the information to be optimized associated with the optimization identifier:

[0093] The real-time status data is collected by the system from various virtual facilities and transportation links at a fixed frequency (e.g., every 5 seconds). Specifically:

[0094] Raw material inventory refers to the current quantity of a certain item marked as raw material in the local inventory of a virtual facility. For example, material plant A has 48 units of waste cloth in stock. Raw material consumption rate refers to the quantity of raw material consumed by the virtual facility per unit of time. It is calculated based on the virtual facility's current production plan, the raw material consumption per production run (read from the edge attributes of the production relationship graph), and the time taken per production run. For example, if material plant A's current production plan is "cloth × 5", and the production graph edge attributes record a single production run consuming 3 waste cloths and taking 30 seconds, then the virtual facility's waste cloth consumption rate is 3 ÷ 30 = 0.1 units / second.

[0095] The actual transport capacity of a transport link refers to the actual number of goods that the transport link can transport per unit time. It is calculated based on the load-bearing and speed attributes of the assigned virtual human units, as well as the distance between upstream and downstream virtual facilities. Specifically, the calculation method is as follows: Assume a virtual resident's load is L units, speed is V units / second, and the distance between upstream and downstream virtual facilities is D grids. Then, the resident's round-trip distance is 2 × D grids, the round-trip time is (2 × D) ÷ V seconds, and the transport volume is L units. Therefore, the actual transport capacity = L ÷ ((2 × D) ÷ V) = L × V ÷ (2 × D) units / second. For example, if a virtual resident's load is 8 units, speed is 2.0 units / second, and transport distance is 13 grids, then the resident's actual transport capacity = 8 × 2.0 ÷ (2 × 13) = 16 ÷ 26 ≈ 0.62 units / second. Demand capacity refers to the rate at which downstream virtual facilities need to transport raw materials from upstream to maintain the current production plan. It is determined based on the raw material consumption rate of downstream virtual facilities. For example, if garment workshop B consumes fabric at a rate of 0.044 units / second, then its required transport capacity is 0.044 units / second. The labor efficiency factor is the ratio of required transport capacity to actual transport capacity, i.e., 0.044 ÷ 0.62 ≈ 0.07. In this example, the labor efficiency factor is much less than 1, indicating sufficient transport capacity and no logistical bottleneck.

[0096] To further illustrate the detection scenario of logistics bottlenecks, in another example scenario, if the transportation link is assigned only to a virtual resident with a small load and slow speed (e.g., a load of 3 units and a speed of 1.0 unit / second), and the transportation distance is 13 grids, then the actual transport capacity = 3 × 1.0 ÷ (2 × 13) = 3 ÷ 26 ≈ 0.115 units / second. If the required transport capacity is 0.044 units / second, then the manpower efficiency factor = 0.044 ÷ 0.115 ≈ 0.38, which is still less than 1. To construct a logistics bottleneck scenario, the required transport capacity can be set to 0.05 units / second, and the actual transport capacity to 0.025 units / second. Then the manpower efficiency factor = 0.05 ÷ 0.025 = 2.0, which is higher than the second preset threshold of 1.4, triggering a logistics bottleneck anomaly.

[0097] The supply of a good demanded by residents refers to the total output rate of all virtual facilities currently producing that good. For example, if only clothing workshop B is currently producing clothes, its output rate is 1 ÷ 45 ≈ 0.022 units / second (producing 1 piece of clothing per batch, taking 45 seconds). The demand refers to the total quantity of that good consumed by all residents per unit of time. For example, if 3 virtual residents each consume 1 piece of clothing every 60 seconds, the demand is 3 ÷ 60 = 0.05 units / second. The supply-demand ratio is the ratio of supply to demand, i.e., 0.022 ÷ 0.05 = 0.44.

[0098] After calculating the above indicators, the system determines the optimization type and the first optimization object based on the calculation results. Specifically, the system compares the calculated indicators with the corresponding preset thresholds: if the expected depletion time of a certain raw material is lower than the first preset threshold, the optimization type is determined to be "raw material shortage", and the virtual facilities consuming the raw material and the transportation links related to the raw material are determined to be the first optimization object; if the human efficiency factor of a certain transportation link is higher than the second preset threshold, the optimization type is determined to be "logistics bottleneck", and the transportation link and its upstream and downstream virtual facilities are determined to be the first optimization object; if the supply-demand ratio of a certain consumer demand item exceeds the preset range (below the lower limit or above the upper limit), the optimization type is determined to be "supply-demand imbalance", and the virtual facilities producing the item and the related transportation links are determined to be the first optimization object. If multiple anomalies are detected simultaneously, the system can select the anomaly type with the highest priority according to the preset priority (e.g., raw material shortage takes precedence over logistics bottleneck, and logistics bottleneck takes precedence over supply and demand imbalance), and use the anomaly corresponding to that type as the main trigger condition to determine the first constraint condition; if multiple anomalies have upstream and downstream relationships in the correlation tracing of the production relationship map, the system can include the virtual facilities and / or transportation links corresponding to multiple anomalies into the second optimization object, thereby solving multiple correlation problems in one optimization.

[0099] Step S120: Based on the optimization type and the first optimization object in the information to be optimized, generate an optimization scheme; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link.

[0100] It should be noted that the location adjustment information refers to the data description of changes in the spatial coordinates of virtual facilities in the optimization plan, including the identifier of the virtual facility to be moved, its current spatial coordinates, and the target spatial coordinates. The manpower reallocation information refers to the data description of changes in manpower allocation along transportation links in the optimization plan, including the identifier of the transportation link to be adjusted, the current number of personnel allocated, the target number of personnel allocated, and any increases or decreases in personnel. After the player confirms the execution, the above adjustment information is translated into actual facility movement and manpower reallocation actions.

[0101] The system takes the information to be optimized as input and generates a set of optimization schemes that include location adjustment information and manpower reallocation information. These schemes aim to solve or mitigate the problems indicated by the information to be optimized by collaboratively adjusting the spatial layout of virtual facilities and the manpower allocation of transportation links.

[0102] In one exemplary embodiment, see Figure 2 As shown, the process of generating the optimization scheme includes the following steps:

[0103] Step S121: Determine the first constraint condition corresponding to the optimization type according to the optimization type.

[0104] The first constraint includes at least one of the following: the expected depletion time of the optimized raw materials is greater than the first safety threshold, the human resource efficiency factor of the transportation link is less than the second safety threshold, and the supply-demand ratio of residents' necessities is within a preset safety range.

[0105] Specifically, when the optimization type is "raw material shortage", the first constraint is that the expected depletion time of the raw material after optimization must be greater than the first safety threshold (e.g., the system preset is 1800 seconds); when the optimization type is "logistics bottleneck", the first constraint is that the manpower efficiency factor of the abnormal transportation link after optimization must be less than the second safety threshold (e.g., the system preset is 1.0); when the optimization type is "supply and demand imbalance", the first constraint is that the supply-demand ratio of the residents' demand goods after optimization must be within the preset safety range (e.g., [0.8, 2.0]); when the optimization type is "global optimization", the first constraint includes: the supply-demand ratio of each residents' demand goods is within the preset safety range (e.g., [0.8, 2.0]), to ensure that the global optimization scheme pursues the minimization of transportation costs while meeting the basic needs of residents.

[0106] Step S122: Based on the first optimization object, perform correlation and tracing through a preset production relationship map to determine the second optimization object.

[0107] The second optimization object refers to the set of identifiers of virtual facilities and / or transportation links that need to be adjusted in spatial coordinates and / or manpower allocation after being identified through association tracing. It includes the first optimization object and can be extended to the upstream or downstream related objects of the first optimization object.

[0108] The production relationship graph refers to a directed acyclic graph (DAG) with items as nodes and the transformation relationships between items as directed edges, used to describe the material flow relationships in the entire production network. The preset production relationship graph is constructed as follows: multiple nodes are established, each node representing an item; directed edges are established between nodes, pointing from raw material nodes to product nodes, representing the transformation relationship from raw materials to products; edge attributes are configured for each directed edge, including: the type of virtual facility required, the raw material consumption per production run, the product output per production run, and the basic production time, thus obtaining the production relationship graph.

[0109] Specifically, node A represents "waste cloth," a basic raw material with no upstream nodes; node B represents "cloth," an intermediate product with both upstream and downstream components; node C represents "clothes," a final product with no downstream nodes and is included in the residents' demand list. Edge B1 points from node A to node B, with the following attributes: {Required virtual facility type: Material factory, Raw material consumption: 3 waste cloth, Product output: 1 piece of cloth, Basic time consumption: 30 seconds}. Edge B2 points from node B to node C, with the following attributes: {Required virtual facility type: Clothing workshop, Raw material consumption: 2 pieces of cloth, Product output: 1 piece of clothing, Basic time consumption: 45 seconds}. It should be noted that the residents' demand list is used to mark which items will be directly consumed by residents. This list can include both final products (such as clothes) and some intermediate products (such as cloth), configured by the game designers according to the game settings. For ease of explanation, this embodiment uses "clothing" as a representative of residents' necessities for exemplary calculation, but the technical solution of this application is also applicable to situations where intermediate products such as cloth are included in the list of residents' necessities.

[0110] The specific method of correlation and traceability depends on the optimization type: when the optimization type is a raw material shortage or logistics bottleneck, in the production relationship graph, starting from the first node corresponding to the first optimization object, downstream nodes are traversed along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the downstream nodes are determined as the second optimization object; when the optimization type is a supply and demand imbalance, in the production relationship graph, starting from the first node corresponding to the first optimization object, upstream nodes are traversed in reverse along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the upstream nodes are determined as the second optimization object.

[0111] Example Explanation: If the first optimization target is "material plant A", this facility corresponds to edge B1 (processing waste fabric into cloth) in the production relationship graph, and its product node is node B. Therefore, node B is taken as the first node. The system traverses downstream along directed edge B2 to reach node C. The downstream virtual facility corresponding to node C is garment workshop B. Therefore, garment workshop B and its associated transportation link (material plant A → garment workshop B) are determined as the second optimization target.

[0112] Step S123: Under the first constraint, the spatial coordinates of the virtual facilities involved in the second optimization object and the manpower allocation of the transportation links are collaboratively optimized to obtain the optimization scheme.

[0113] Specifically, this includes: obtaining the current spatial coordinates of the virtual facilities involved in the second optimization object, and the current manpower allocation of the transportation link involved in the second optimization object; with the goal of minimizing global transportation costs, determining the target spatial coordinates and target manpower allocation based on the current spatial coordinates, the current manpower allocation, and the first constraint; generating the location adjustment information based on the target spatial coordinates, and generating the manpower reallocation information based on the target manpower allocation, to form the optimization scheme.

[0114] The global transportation cost is calculated as follows: for each transportation link, the sub-link cost is calculated based on the link factor of that transportation link; based on the sub-link costs of each transportation link, the global transportation cost is calculated. The link factor includes the transportation volume of the transportation link, the distance between upstream and downstream virtual facilities, the manpower efficiency factor, and the adjacency gain factor.

[0115] In one exemplary embodiment, the cost of a sub-link of a single transport link is calculated using the following formula:

[0116] Sub-link cost = Transportation volume × Distance × Human resource efficiency factor × Adjacency gain factor;

[0117] The transportation volume is directly read from the raw material consumption data in the directed edge attribute corresponding to the transportation link in the production relationship graph. For example, if the link transports "cloth" to a clothing workshop to produce "clothes", and the graph edge attribute records "consumption: 2 pieces of cloth", then the transportation volume is 2. The distance is the Manhattan distance between upstream and downstream virtual facilities. Let the coordinates of the upstream facility be (x1, y1) and the coordinates of the downstream facility be (x2, y2), then the distance = |x1-x2| + |y1-y2|. The manpower efficiency factor is determined by the ratio of the demand capacity to the actual capacity of the transportation link. The demand capacity is calculated based on factors such as the raw material consumption rate and transportation volume of the downstream virtual facility, while the actual capacity is calculated based on the load and speed attributes of the allocated virtual manpower units. A manpower efficiency factor greater than 1 indicates insufficient capacity, and less than 1 indicates excess capacity. The adjacency gain factor takes a preset value less than 1 (e.g., 0.5) when the upstream and downstream virtual facilities are in adjacent grids (Manhattan distance is 1), otherwise it takes 1. This factor naturally makes the system tend to concentrate the layout of supporting factory buildings during the optimization process.

[0118] In some alternative embodiments, the value of the adjacent gain factor is not limited to 0.5, and can be set to other positive numbers less than 1, such as 0.3, 0.6, and 0.8, depending on the game design requirements. In some alternative embodiments, the adjacent gain not only applies to adjacent grids, but can also extend to a range where the distance is less than or equal to a preset threshold (such as 2 or 3 grids), and the value of the gain factor gradually decreases as the distance increases.

[0119] The objective of minimizing global transportation costs specifically includes: using a preset second constraint as a limitation, which, together with the first constraint, constrains the solution process to obtain the target spatial coordinates and the target manpower allocation. The second constraint is a general hard constraint, including: the spatial coordinates of each virtual facility are within the buildable area and do not overlap, and the total number of virtual manpower units allocated to each transportation link does not exceed the total number of available virtual manpower units.

[0120] The system collaboratively solves the problem by alternately adjusting spatial coordinates and manpower allocation within the solution space. Heuristic search algorithms, such as hill climbing, simulated annealing, or genetic algorithms, can be used. Each attempt must pass both the first and second constraints; solutions that do not meet these constraints are discarded. During the search, spatial exploration (moving virtual facility locations) and manpower exploration (increasing or decreasing the number of personnel allocated to links) alternate until the global transportation cost no longer decreases significantly or the preset number of iterations is reached. The current optimal solution is then output as the target spatial coordinates and target manpower allocation.

[0121] Step S130: In response to the confirmation and execution command of the optimization scheme, execute the optimization scheme and display the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link from the player's perspective.

[0122] In this step, the system presents the generated optimization plan to the player, awaiting the player's final decision. Only after the player issues a confirmation command will the system actually execute the adjustments in the plan.

[0123] In an optional implementation, for adjusting the position of a virtual facility: in the game scene displayed in the graphical user interface, a semi-transparent outline of the virtual facility is displayed at the target location, and a displacement arrow from the current location to the target location is drawn. The semi-transparent outline allows the player to preview the layout effect after movement, and the displacement arrow intuitively indicates the direction and path of movement. Simultaneously, the game resources consumed to perform the movement can be displayed in the sidebar of the interface.

[0124] For manpower reallocation in transportation links: The transportation task management interface highlights the transportation links that require manpower adjustments, along with the corresponding increase / decrease in manpower. It also displays the estimated manpower efficiency factor for the adjusted link, allowing players to evaluate the optimization effect. Furthermore, a summary of the optimization effect prediction can be displayed on the interface.

[0125] In an exemplary embodiment, the method further includes: in response to a modification operation on the optimization scheme, adjusting the location adjustment information and / or the manpower reallocation information according to the modification operation, and updating the displayed optimization scheme in real time; and in response to a confirmation execution command for the modified optimization scheme, executing the modified optimization scheme. For example, the system suggests assigning a first virtual resident and a second virtual resident to a certain transportation link, but the player wants to use only the first virtual resident and have a third virtual resident undertake the task instead. The player drags the second virtual resident out of the assignment bar and drags the third virtual resident into the assignment bar in the transportation task management interface. The system updates the manpower reallocation information in real time according to the modification operation, and updates the assigned personnel information and the recalculated optimization effect estimate in the displayed interface in real time. After the player is satisfied with the modification, they confirm the execution of the modified optimization scheme.

[0126] The execution of the optimization scheme specifically includes: after receiving the confirmation execution instruction, determining whether the current game resources meet the requirements for executing the optimization scheme, wherein the game resources include building materials for moving virtual facilities. If the requirements are met, the required game resources are deducted, the corresponding virtual facilities are moved according to the position adjustment information, and the manpower allocation of the corresponding transportation link is adjusted according to the manpower redistribution information; if the requirements are not met, a resource shortage prompt is displayed and the current layout and manpower remain unchanged.

[0127] In an optional embodiment, the method further includes a historical layout scheme management function: in response to the save operation of the optimized scheme, the optimized scheme is stored as a historical layout scheme, which includes information such as the spatial coordinates of all virtual facilities in the scheme, the manpower allocation of all transportation links, and the resource list required to execute the scheme. In response to the loading operation of the historical layout scheme, it is verified whether the current game state meets the execution conditions of the historical layout scheme. The execution conditions include whether all virtual facilities involved in the scheme have been built and are in a movable state, and whether the total number of currently available virtual manpower units meets the requirements of the scheme. If the conditions are met, the historical layout scheme is displayed in the graphical user interface and the player is asked to confirm the execution; if the conditions are not met, the unmet conditions are highlighted and the player is asked whether to partially execute or abandon the scheme.

[0128] To better understand the overall technical solution of this invention, a complete game scene example is used below for comprehensive explanation.

[0129] The game scene displayed by the graphical user interface is a gridded sea area, with each grid cell being 1×1. The player has constructed the following virtual facilities: Material Factory A (ID: Factory_001), spatial coordinates (15,22), local inventory contains 48 / 100 units of scrap cloth marked as raw material and 12 / 50 units of cloth marked as finished product, current production plan: Cloth × 5 (consuming 0.1 units of scrap cloth / second); Clothing Workshop B (ID: Factory_002), spatial coordinates (28,22), local inventory contains 8 / 50 units of cloth marked as raw material and 3 / 30 units of clothing marked as finished product, current production plan: Clothing × 2 (consuming approximately 0.044 units of cloth / second).

[0130] There are 5 available virtual manpower units, which are designated as follows for easy identification: Virtual Resident 1 (load 10, speed 2.0), Virtual Resident 2 (load 8, speed 2.5), Virtual Resident 3 (load 12, speed 1.5), Virtual Resident 4 (load 8, speed 2.0), and Virtual Resident 5 (load 10, speed 1.8). Current manpower allocation: Virtual Resident 4 (1 person) has been allocated to the fabric transportation link from Material Factory A to Garment Workshop B; the remaining residents are idle.

[0131] The system collects real-time status data for each virtual facility every 5 seconds. Calculations show: the estimated time for waste fabric to be exhausted in Material Plant A is 48 ÷ 0.1 = 480 seconds; the first preset threshold (attention threshold) is 900 seconds, 480 seconds < 900 seconds, so the preset anomaly detection condition is met. The required transport capacity for the fabric transportation link is 0.044 units / second, and the actual transport capacity (fourth virtual resident: load 8, speed 2.0, distance 13 grids) is 8 × 2.0 ÷ (2 × 13) = 16 ÷ 26 ≈ 0.62 units / second. The manpower efficiency factor is 0.044 ÷ 0.62 ≈ 0.07, which is lower than the second preset threshold of 1.4, so the logistics bottleneck anomaly is not triggered. The system displays an exclamation mark optimization indicator above Material Plant A.

[0132] The player clicks on the optimization icon above Material Factory A. The system obtains real-time status data and calculates that the optimization type is "raw material shortage". The first optimization targets are "Material Factory A" (first virtual facility) and "Material Factory A → Cloth Transportation Link to Garment Workshop B" (first transportation link).

[0133] The system defines the first constraint: the estimated depletion time of the optimized waste fabric must be greater than 1800 seconds. The system uses a production relationship graph for correlation and traceability: starting from the waste fabric node, following directed edge B1 to the fabric node, and then along B2 to the clothing node. The second optimization target includes: garment workshop B and its associated fabric transportation chain.

[0134] The system employs collaborative optimization to minimize global transportation costs. Under the constraints of the first and second constraints, it alternately explores adjustments to spatial coordinates and manpower allocation. During the solution process, the sub-link cost is calculated as: transportation volume × distance × manpower efficiency factor × adjacent gain factor. The current sub-link cost for the fabric transportation link is: 2 × 13 × 0.07 × 1.0 = 1.82. The system tentatively moves garment workshop B from (28,22) to (16,22), making it adjacent to material factory A. The Manhattan distance changes from 13 squares to 1 square, and the adjacency gain factor changes from 1.0 to 0.5. Simultaneously, two virtual residents (fourth and fifth) are assigned to this link. The total actual transport capacity is 8 × 2.0 ÷ (2 × 1) + 10 × 1.8 ÷ (2 × 1) = 8.0 + 9.0 = 17.0 units / second. The manpower efficiency factor is 0.044 ÷ 17.0 ≈ 0.0026. The cost of the new sub-link is 2 × 1 × 0.0026 × 0.5 = 0.0026. After multiple iterations, the system outputs the target solution: garment workshop B moves from (28,22) to (16,22), and the fabric transport link is assigned two virtual residents (fourth and fifth).

[0135] In the game scene displayed on the graphical user interface, the system shows a semi-transparent outline of Clothing Workshop B at (16,22), draws a dashed arrow from (28,22) to (16,22), and displays "Estimated Building Materials Consumption ×50" in the sidebar. The cloth transport link and a "+1" indicator are highlighted in the transport task management interface. After reviewing the information, the player deems the manpower allocation optimized and replaces the fifth virtual resident with the third virtual resident. The system updates the display in real time and recalculates the estimated effect.

[0136] The player clicks to confirm execution. The system determines that the current building material holdings (120 units) meet the required 50 units, deducts 50 units of building materials, and Clothing Workshop B moves from (28,22) along the grid to (16,22). The third and fourth virtual residents are assigned to the cloth transport link. From the player's perspective, the movement path and manpower adjustment status of Clothing Workshop B are clearly displayed.

[0137] Players can save the current layout as a "Materials Factory - Garment Workshop Compact Scheme". When new areas are unlocked or new factories are built later, this scheme can be loaded with one click, and the system will automatically verify the conditions and provide confirmation for the player to execute.

[0138] Through the above methods, production network management in the game no longer relies on players passively receiving isolated warnings and repeatedly performing manual trial and error. Instead, it leverages multi-dimensional real-time status awareness, cascades and traces data through a knowledge graph, and jointly solves for the optimal factory layout and manpower allocation scheme with the goal of minimizing global transportation costs. The scheme is not executed directly until confirmed by the player; instead, it is presented on the graphical user interface as a semi-transparent outline, displacement arrows, and highlighted links, allowing the player to verify it before deciding whether to execute. This achieves a fundamental shift from layout locking, missing logistics, isolated warnings, and no optimization options to adjustable layout, linked logistics, warning traceability, and intelligent optimization. While enhancing the depth of strategy, it also empowers players with complete awareness and control over the automated control process.

[0139] Example 2: Control System for Virtual Production Facilities in Games

[0140] This embodiment also provides a control system for virtual production facilities in a game. The system can execute all or part of the steps in Embodiment 1 above and is applied to terminal devices. See [link to documentation]. Figure 3 As shown, the system includes the following modules:

[0141] The trigger response module 10 is configured to, in response to a trigger operation on an optimization identifier in the graphical user interface, obtain optimization information associated with the optimization identifier. Specifically, the trigger response module is configured to perform at least one of the following operations: in response to a trigger operation on a global optimization control in the graphical user interface, obtain global optimization information; in response to detecting that a preset anomaly detection condition is met, display the optimization identifier on the corresponding virtual facility and / or transportation link in the graphical user interface, and in response to a trigger operation on the optimization identifier, obtain optimization information associated with the optimization identifier.

[0142] The scheme generation module 20 is used to generate an optimization scheme based on the optimization type and the first optimization object in the information to be optimized; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link. The scheme generation module is further used to: determine the corresponding first constraint condition according to the optimization type; determine the second optimization object by association and tracing through a preset production relationship map according to the first optimization object; under the first constraint condition, perform collaborative optimization on the spatial coordinates of the virtual facilities involved in the second optimization object and the manpower allocation of the transportation link to obtain the target spatial coordinates and target manpower allocation with the goal of minimizing the global transportation cost, and generate the location adjustment information and manpower reallocation information accordingly.

[0143] The execution module 30 is used to execute the optimization scheme in response to a confirmation execution command, and to display the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link from the player's perspective. After receiving the confirmation execution command, the execution module first determines whether the current game resources meet the execution requirements. If they do, resources are deducted and adjustments are performed; if not, a resource shortage prompt is displayed and the current status is maintained.

[0144] In an optional embodiment, the system further includes a display module for displaying the optimization scheme in the graphical user interface in response to the generation of the optimization scheme, including displaying a semi-transparent outline and drawing a displacement arrow at the target position in the game scene displayed in the graphical user interface, and highlighting the transportation links that require additional or reduced manpower and the corresponding additional or reduced manpower indicators in the transportation task management interface.

[0145] In an optional embodiment, the system further includes a storage module for storing the optimized scheme as a historical layout scheme in response to a save operation, and for verifying execution conditions in response to a load operation.

[0146] It should be understood that the functional division between the above modules is merely exemplary. In other embodiments of this application, the functions of the above modules can be split, merged, or reorganized according to specific engineering implementation requirements, and this application does not impose any restrictions on this. Furthermore, the collaborative working relationship between the above modules can be referred to the execution order and data flow relationship between the steps described in the foregoing method embodiments, and will not be repeated here.

[0147] Example 3: Electronic device and computer-readable storage medium

[0148] This application also provides an electronic device, see [link to relevant documentation] Figure 4 As shown, the electronic device includes a processor and a memory. The memory stores a computer program, which, when executed by the processor, implements the steps of the control method for virtual production facilities in the game described in Embodiment 1 above.

[0149] Specifically, the electronic device includes, but is not limited to, at least one of the following device forms: server, terminal device, embedded device, dedicated gaming device, etc. The specific implementation forms of the processor include, but are not limited to: central processing unit, graphics processing unit, application-specific integrated circuit, field-programmable gate array, etc., and the number of processors may be one or more. The specific implementation forms of the memory include, but are not limited to: volatile memory, non-volatile memory, magnetic memory, optical memory, and any combination of the above types of memory.

[0150] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps of the game virtual production facility control method described in Embodiment 1. Specific implementations of the computer-readable storage medium include, but are not limited to, magnetic storage media, optical storage media, and semiconductor storage media. It should be understood that the computer-readable storage medium described in this application does not include non-permanent, transient computer-readable signals.

[0151] This application uses specific embodiments to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for controlling virtual production facilities in a game, characterized in that, Applied to terminal devices, including: In response to a trigger operation on an optimization identifier in the graphical user interface, obtain the optimization information associated with the optimization identifier; Based on the optimization type and the first optimization object in the information to be optimized, an optimization scheme is generated; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link; In response to the confirmation and execution command of the optimization scheme, the optimization scheme is executed, and the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link are displayed from the player's perspective.

2. The method according to claim 1, characterized in that, The optimization types include raw material shortages, logistics bottlenecks, supply and demand imbalances, or global optimization; the generated optimization schemes include: Based on the optimization type, a first constraint condition corresponding to the optimization type is determined; the first constraint condition includes at least one of the following: the expected depletion time of the optimized raw materials is greater than a first safety threshold, the human resource efficiency factor of the transportation link is less than a second safety threshold, and the supply-demand ratio of residents' necessities is within a preset safety range. Based on the first optimization object, the second optimization object is determined by linking and tracing through a preset production relationship map; Under the first constraint, the spatial coordinates of the virtual facilities involved in the second optimization object and the allocation of manpower for the transportation links are collaboratively optimized to obtain the optimization scheme.

3. The method according to claim 2, characterized in that, The coordinated optimization of the spatial coordinates of the virtual facilities and the allocation of manpower for the transportation links involved in the second optimization object, to obtain the optimization scheme, includes: Obtain the current spatial coordinates of the virtual facilities involved in the second optimization object, and the current manpower allocation of the transportation link involved in the second optimization object; With the goal of minimizing global transportation costs, the target spatial coordinates and target manpower allocation are determined based on the current spatial coordinates, the current manpower allocation, and the first constraint. The location adjustment information is generated based on the target spatial coordinates, and the manpower reallocation information is generated based on the target manpower allocation, so as to form the optimization scheme.

4. The method according to claim 3, characterized in that, The objective of minimizing global transportation costs includes: The preset second constraint is used as a restriction, which, together with the first constraint, constrains the solution process to obtain the target spatial coordinates and the target manpower allocation; the second constraint includes: the spatial coordinates of each virtual facility are within the buildable area and do not overlap with each other, and the total number of virtual manpower units allocated to each transportation link does not exceed the total number of available virtual manpower units.

5. The method according to claim 3, characterized in that, The overall transportation cost is calculated in the following way: For each transport link, the sub-link cost is calculated based on the link factor of that transport link; the link factor includes the transport volume of the transport link, the distance between upstream and downstream virtual facilities, the manpower efficiency factor, and the adjacency gain factor; the adjacency gain factor takes a preset value less than 1 when the upstream and downstream virtual facilities are in adjacent grids, and otherwise takes 1; The global transportation cost is calculated based on the sub-link costs of each transportation link.

6. The method according to claim 2, characterized in that, The preset production relationship map is constructed in the following way: Establish multiple nodes, each node representing an item; Establish directed edges between nodes, pointing from raw material nodes to product nodes, to represent the transformation relationship from raw materials to products; Configure edge attributes for each directed edge, including: the type of virtual facility required, the raw material consumption per production run, the product output per production run, and the basic production time, to obtain the production relationship graph.

7. The method according to claim 6, characterized in that, The step of determining the second optimization object based on the first optimization object through a preset production relationship map includes: When the optimization type is raw material shortage or logistics bottleneck, in the production relationship graph, starting from the first node corresponding to the first optimization object, the downstream nodes are traversed along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the downstream nodes are determined as the second optimization object. When the optimization type is supply and demand imbalance, in the production relationship graph, starting from the first node corresponding to the first optimization object, the upstream nodes are traversed in reverse along the directed edge direction, and the virtual facilities and / or transportation links corresponding to the upstream nodes are determined as the second optimization object.

8. The method according to claim 1, characterized in that, The step of obtaining optimization information associated with the optimization identifier in response to a trigger operation on the graphical user interface includes at least one of the following: In response to a trigger operation on the global optimization control in the graphical user interface, global optimization information is obtained; In response to the detection that a preset anomaly detection condition has been met, the optimization identifier is displayed on the corresponding virtual facility and / or transportation link in the graphical user interface; In response to a trigger operation on the optimization identifier, obtain the optimization information associated with the optimization identifier; The preset anomaly detection conditions include: the estimated depletion time of raw materials in the virtual facility is lower than a first preset threshold, the human resource efficiency factor of the transportation link is higher than a second preset threshold, or the supply-demand ratio of residents' demand goods exceeds a preset range.

9. The method according to claim 1, characterized in that, The step of obtaining the optimization information associated with the optimization identifier includes: Acquire real-time status data for each virtual facility, including raw material inventory, raw material consumption rate, actual and demand capacity of transportation links, and supply and demand of consumer goods. Based on the real-time status data, calculate the estimated depletion time of raw materials, the human resource efficiency factor of the transportation chain, and the supply-demand ratio of consumer goods. Based on the calculation results, the optimization type and the corresponding first optimization object are determined to obtain the information to be optimized.

10. The method according to claim 1, characterized in that, Also includes: In response to the generation of the optimization scheme, the optimization scheme is displayed in the graphical user interface; wherein, for the adjustment of the position of virtual facilities, a semi-transparent outline is displayed at the target position in the game world view, and a displacement arrow from the current position to the target position is drawn; for the redistribution of manpower in the transportation link, the transportation link that needs to be increased or decreased in manpower, as well as the corresponding increase or decrease in manpower indicators, are highlighted in the transportation task management interface.

11. The method according to claim 10, characterized in that, The method further includes: In response to the modification operation of the optimization scheme, the location adjustment information and / or the manpower reallocation information are adjusted according to the modification operation, and the displayed optimization scheme is updated in real time; In response to the confirmation and execution command for the modified optimization scheme, the modified optimization scheme is executed.

12. The method according to claim 1, characterized in that, The execution of the optimization scheme includes: After receiving the confirmation execution instruction, determine whether the current game resources meet the requirements for executing the optimization scheme; If satisfied, the required game resources are deducted, the corresponding virtual facilities are moved according to the location adjustment information, and the manpower allocation of the corresponding transportation link is adjusted according to the manpower redistribution information. If the conditions are not met, a resource shortage warning will be displayed and the current layout and manpower will remain unchanged. The game resources include building materials for mobile virtual facilities.

13. The method according to claim 1, characterized in that, The method further includes: In response to the save operation of the optimized scheme, the optimized scheme is stored as a historical layout scheme; In response to the loading operation of the historical layout scheme, verify whether the current game state meets the execution conditions of the historical layout scheme; If the conditions are met, the historical layout scheme is displayed in the graphical user interface, and the system waits for the player to confirm and execute it.

14. A control device for a virtual production facility in a game, characterized in that, include: The trigger response module is used to respond to the trigger operation of the optimization identifier in the graphical user interface and obtain the optimization information associated with the optimization identifier; The scheme generation module is used to generate an optimization scheme based on the optimization type and the first optimization object in the information to be optimized; the first optimization object includes the first virtual facility targeted by the information to be optimized and the first transportation link between the first virtual facilities; the optimization scheme includes the location adjustment information of the virtual facility to be optimized and the manpower reallocation information of the transportation link; The execution module is used to execute the optimization scheme in response to the confirmation execution command of the optimization scheme, and to display the location adjustment path of the virtual facility and / or the manpower adjustment status of the transportation link from the player's perspective.

15. An electronic device, characterized in that, It includes a processor and a memory, the memory storing program instructions that, when executed by the processor, implement the method as described in any one of claims 1 to 13.

16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 13.