Model creation methods, apparatus, equipment and storage media
By intermittently pausing the model creation process in an IoT simulation scenario and utilizing real-time sleep intervals to handle non-creation tasks, the user interaction problem during batch model import is solved, achieving efficient model creation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NEUSOFT CORP
- Filing Date
- 2022-11-18
- Publication Date
- 2026-05-26
Smart Images

Figure CN115729685B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet of Things (IoT) technology, and in particular relates to a model creation method, apparatus, device, and storage medium. Background Technology
[0002] In the editing of IoT simulation scenarios, batch model creation tasks can be completed. This batch model creation task requires importing a large number of device models into the scene being edited at once. If the number of imported models is too large, or the models themselves are highly complex, the import process will take a long time.
[0003] However, since the code executed in the browser is single-threaded, it cannot accept user responses simultaneously during the model creation process. Therefore, users cannot perform other operations when importing models in batches. Summary of the Invention
[0004] This application aims to at least partially address one of the technical problems in the related art. To this end, one objective of this application is to provide a model creation method, apparatus, device, and storage medium.
[0005] To address the aforementioned technical problems, embodiments of this application provide the following technical solutions:
[0006] A model creation method, comprising:
[0007] Obtain the real-time running phase of the real-time model creation task, and determine the real-time sleep interval time that matches the real-time running phase based on the real-time running phase;
[0008] During the real-time operation phase, the real-time model creation task is paused once every real-time sleep interval.
[0009] After each pause of the real-time model creation task, the real-time non-creation tasks in the task list are queried. If the real-time non-creation model task exists, the real-time sleep time matching the real-time non-creation model task is obtained; wherein, the real-time non-creation model task is executed based on the real-time sleep time.
[0010] After waiting for the real-time sleep period, the real-time model creation task continues.
[0011] Optionally, obtaining the real-time running phase of the real-time model creation task, and determining a real-time sleep interval time matching the real-time running phase based on the real-time running phase, includes:
[0012] Obtain a set of reference sleep interval times; wherein, the set of reference sleep interval times includes multiple reference sleep interval times and historical running stages matched with each of the reference sleep interval times, and each of the historical running stages has a historical duration;
[0013] Obtain the real-time running time of the real-time model creation task, and determine the real-time running stage of the real-time model creation task based on the real-time running time and the historical duration.
[0014] Based on the real-time operation phase, the reference sleep interval time set is searched. If a historical operation phase that matches the real-time operation phase is found, the reference sleep interval time that matches the historical operation phase is determined as the real-time sleep interval time.
[0015] Optionally, obtaining the reference sleep interval time set includes:
[0016] Obtain the historical execution time of the historical model creation task, and determine the historical execution stage corresponding to the historical execution time;
[0017] Obtain the historical trigger frequency corresponding to each of the historical operation stages;
[0018] Based on the historical duration and the historical trigger frequency matching each historical operation phase, a reference sleep interval time matching each historical operation phase is determined;
[0019] The reference sleep interval set is obtained based on multiple reference sleep interval times and the historical running phases that match each historical sleep interval.
[0020] Optionally, during the real-time execution phase, the real-time model creation task is paused once every real-time sleep interval, including:
[0021] In the Hth real-time running phase, the Hth real-time running phase matches the Hth real-time sleep interval. After pausing the real-time model creation task for the Jth time, the real-time model creation task is paused for the J+1th time after the (J+1)th Hth real-time sleep interval; where H and J are both positive integers.
[0022] Optionally, if the real-time non-creating model task exists, obtaining the real-time sleep time matching the real-time non-creating model task includes:
[0023] Based on the real-time runtime, obtain the real-time reference stage;
[0024] Based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase;
[0025] Based on the historical trigger instruction type, obtain the real-time sleep time that matches the real-time non-creation model task.
[0026] Optionally, the step of obtaining the real-time reference stage based on the real-time runtime includes:
[0027] The real-time running time is determined as the real-time termination time of the real-time reference phase;
[0028] The real-time start time of the real-time reference phase is determined based on the preset reference duration and the real-time termination time.
[0029] The real-time reference phase is determined based on the real-time start time and the real-time end time.
[0030] Optionally, based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase, including:
[0031] Obtain historical operation data corresponding to the real-time reference stage; wherein, the historical operation data includes a historical editing parameter set, and the historical editing parameter set includes multiple historical editing parameters;
[0032] Based on multiple historical editing parameters, the type of historical trigger instruction that matches the real-time reference stage is determined.
[0033] Optionally, obtaining the real-time sleep time matching the real-time non-creation model task based on the historical trigger instruction type includes:
[0034] The reference trigger command type set is searched based on the historical trigger command type; wherein, the reference trigger command type set includes multiple reference trigger command types, and each reference trigger command type has a reference sleep time;
[0035] When a reference trigger instruction type that matches the historical trigger instruction type is found, the reference sleep time that matches the historical trigger instruction type is determined as the real-time sleep time.
[0036] Embodiments of this application also provide a model creation apparatus, comprising:
[0037] The acquisition module is used to acquire the real-time running phase of the real-time model creation task, and determine the real-time sleep interval time that matches the real-time running phase based on the real-time running phase.
[0038] The pause module is used to pause the real-time model creation task once every real-time sleep interval during the real-time operation phase.
[0039] The query module is used to query the real-time non-creation tasks in the task list after each pause of the real-time model creation task. If the real-time non-creation task exists, the real-time sleep time matching the real-time non-creation task is obtained; wherein, the real-time non-creation task is executed based on the real-time sleep time.
[0040] The sleep module is used to wait for the real-time sleep time before continuing the real-time model creation task.
[0041] Embodiments of this application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the method described above.
[0042] Embodiments of this application also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the method described above.
[0043] The embodiments of this application have the following technical effects:
[0044] The above-mentioned technical solution of this application can intermittently pause the model creation process during the batch model creation process. In each real-time running stage, the pause is based on the real-time sleep interval corresponding to that real-time running stage, and the pause duration corresponding to each real-time running stage is determined by the real-time sleep time corresponding to each real-time running stage. This ensures that the editing page has a good user interaction experience while completing the batch model creation task in the shortest possible time.
[0045] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating a model creation method provided in an embodiment of this application;
[0047] Figure 2 This is a schematic diagram of the structure of a model creation device provided in an embodiment of this application. Detailed Implementation
[0048] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0049] To facilitate understanding of the embodiments by those skilled in the art, some terms are explained below:
[0050] (1) JavaScript: is a lightweight, interpreted or just-in-time compiled programming language with function priority.
[0051] (2) web: World Wide Web.
[0052] like Figure 1 As shown, embodiments of this application provide a model creation method, including:
[0053] Step S11: Obtain the real-time running phase of the real-time model creation task, and determine the real-time sleep interval time that matches the real-time running phase based on the real-time running phase;
[0054] In an optional embodiment of this application, obtaining the real-time running phase of the real-time model creation task and determining a real-time sleep interval time matching the real-time running phase based on the real-time running phase includes:
[0055] Obtain a set of reference sleep interval times; wherein, the set of reference sleep interval times includes multiple reference sleep interval times and historical running stages matched with each of the reference sleep interval times, and each of the historical running stages has a historical duration;
[0056] Obtain the real-time running time of the real-time model creation task, and determine the real-time running stage of the real-time model creation task based on the real-time running time and the historical duration.
[0057] Based on the real-time operation phase, the reference sleep interval time set is searched. If a historical operation phase that matches the real-time operation phase is found, the reference sleep interval time that matches the historical operation phase is determined as the real-time sleep interval time.
[0058] The embodiments of this application can create models based on a system used to create models, such as a web-based 3D editor for IoT simulation scenarios, where the 3D editor obtains a corresponding set of reference sleep interval time based on historical running data.
[0059] Specifically, the reference sleep interval set includes multiple reference sleep intervals, and each reference sleep interval has a matching historical running phase;
[0060] Furthermore, the specific value of the historical duration can be determined according to actual needs.
[0061] Furthermore, since the system may not be able to respond to user trigger commands in a timely manner when creating batch models, in order to solve the above problem, the embodiments of this application divide the running time of each model creation task into multiple running stages, determine each real-time running stage corresponding to the real-time running time, and then determine the historical running stage that matches the real-time running stage, for example, the third running stage. Based on the third running stage, the reference sleep interval time set is searched, and the third reference sleep interval time that matches the third running stage is determined as the real-time sleep interval time. Then, based on the real-time sleep interval time, the user's trigger commands are responded to multiple times, so as to realize timely response to the user's real-time trigger commands while creating batch models, and realize support for user interaction while creating batch models.
[0062] In an optional embodiment of this application, obtaining the reference sleep interval time set includes:
[0063] Obtain the historical execution time of the historical model creation task, and determine the historical execution stage corresponding to the historical execution time;
[0064] Obtain the historical trigger frequency corresponding to each of the historical operation stages;
[0065] Based on the historical duration and the historical trigger frequency matching each historical operation phase, a reference sleep interval time matching each historical operation phase is determined;
[0066] The reference sleep interval set is obtained based on multiple reference sleep interval times and the historical running phases that match each historical sleep interval.
[0067] In an optional embodiment of this application, in order to broaden the scope of application, the historical trigger frequency is obtained based on the average value of a large amount of data; for example, the historical trigger frequency corresponding to the first historical operation stage is obtained based on the average value of the historical trigger frequencies corresponding to multiple first historical operation stages in the system's historical operation data.
[0068] In one optional embodiment of this application, the historical running time of the historical model creation task is obtained, and the historical running stage corresponding to the historical running time is determined. The specific value corresponding to the historical duration of each historical running stage can be preset; for example, one minute can be defined as a historical running stage (i.e., the historical duration is one minute), two minutes as a historical running stage (i.e., the historical duration is two minutes), or three minutes as a historical running stage (i.e., the historical duration is three minutes), etc.
[0069] The embodiments of this application are explained using a historical duration of one minute as an example. The timing starts from the start time of the historical model creation task. When the historical running time of the historical model creation task is p minutes, it indicates that the historical running stage of the historical model creation task is p; where p is a positive integer.
[0070] Obtain the historical trigger frequency corresponding to the p-th historical operation stage; where the historical trigger frequency is the frequency of generating trigger commands based on user operations, that is, the number of times the user performs operations within the p-th minute;
[0071] Based on the number of times the user performs an operation within the p-th minute, determine the p-th reference sleep interval time corresponding to the p-th historical running phase;
[0072] By repeating the above steps, multiple reference sleep intervals and the historical running stages corresponding to each reference sleep interval can be obtained, thereby obtaining a set of reference sleep intervals.
[0073] In an optional embodiment of this application, if the historical trigger frequency obtained within the p-th minute is w (a positive integer) times, then the p-th reference sleep interval time in the p-th historical running phase is (60 / w) s.
[0074] In an optional embodiment of this application, when the total historical runtime of a historical creation model task is N minutes;
[0075] When the historical duration is one minute, the historical creation model corresponds to N reference sleep intervals and N historical running stages, each of which needs to run for one minute; where N is a positive integer.
[0076] In one optional embodiment of this application, it is assumed that the historical operating data of the system is as follows:
[0077] In the first minute, the average number of user operations is 10, so the reference sleep interval for the first historical running phase is 6 seconds; that is, when the system is in the first historical running phase, the historical creation model task is paused once every 6 seconds during the first historical running phase.
[0078] In the second minute, the average number of user operations is 6, so the reference sleep interval for the second historical running phase is 10 seconds; that is, when the system is in the second historical running phase, the historical creation model task is paused once every 10 seconds during the second historical running phase.
[0079] In the third minute, the average number of user operations is 5, so the reference sleep interval for the third historical running phase is 12 seconds; that is, when the system is in the third historical running phase, the historical creation model task is paused once every 12 seconds during the third historical running phase.
[0080] In the fourth minute, the average number of user operations is 4, so the reference sleep interval for the third historical running phase is 15 seconds; that is, when the system is in the fourth historical running phase, the historical creation model task is paused once every 15 seconds during the fourth historical running phase.
[0081] In the fifth minute, the average number of user operations is 3, so the reference sleep interval for the fifth historical operation phase is 20 seconds; that is, when the system is in the fifth historical operation phase, the historical creation model task is paused once every 3 seconds during the fifth historical operation phase.
[0082] ...
[0083] Similarly, based on the above algorithm, the reference sleep time interval for each historical running stage during the batch historical model creation task can be obtained, thus obtaining the reference sleep interval time set.
[0084] Step S12: During the real-time operation phase, the real-time model creation task is paused once every real-time sleep interval.
[0085] In an optional embodiment of this application, during the real-time operation phase, the real-time model creation task is paused once every real-time sleep interval, including:
[0086] In the Hth real-time running phase, the Hth real-time running phase matches the Hth real-time sleep interval. After pausing the real-time model creation task for the Jth time, the real-time model creation task is paused for the J+1th time after the (J+1)th Hth real-time sleep interval; where H and J are both positive integers.
[0087] In an optional embodiment of this application, after determining the current real-time operation stage of the system, a reference sleep interval time set is searched based on the real-time operation stage. For example, if the current real-time operation stage is the Hth real-time operation stage, the reference sleep interval time set is searched based on the Hth real-time operation stage to obtain the Hth historical operation stage, and the Hth reference sleep interval time that matches the Hth historical operation stage is determined as the Hth real-time sleep interval time of the current system.
[0088] During the Hth real-time running phase, the system performs a pause operation on the real-time model creation task every Hth real-time sleep interval.
[0089] After the J+1th pause operation ends, the timing for the J+2th interval begins. When the timing meets the Hth real-time sleep interval, the system performs the J+1th pause on the real-time model creation task.
[0090] By repeating the above process, based on the defined real-time operation phase and the real-time sleep interval that matches the real-time operation phase, the system can respond promptly to trigger commands generated based on user operations during the process of creating batch models.
[0091] In an optional embodiment of this application, when H=5, the current real-time operation stage is the fifth real-time operation stage. Then, based on the fifth real-time operation stage, the reference sleep interval time set is searched to obtain the fifth historical operation stage, and the fifth reference sleep interval time that matches the fifth historical operation stage is determined as the fifth real-time sleep interval time of the current system.
[0092] During the fifth real-time operation phase, the system pauses the real-time model creation task once every fifth real-time sleep interval.
[0093] When J=2, after the third pause operation, the timing of the fourth interval begins. When the timing meets the fourth real-time sleep interval time, the system performs the fourth pause on the real-time model creation task.
[0094] After the fourth pause operation, the timing for the fifth interval begins. When the timer reaches the fifth real-time sleep interval, the system performs the fifth pause on the real-time model creation task.
[0095] Step S13: After each pause of the real-time model creation task, query the real-time non-creation tasks in the task list. If the real-time non-creation model task exists, obtain the real-time sleep time that matches the real-time non-creation model task; wherein, the real-time non-creation model task is executed based on the real-time sleep time.
[0096] In an optional embodiment of this application, after each pause of the real-time model creation task, the task queue corresponding to the real-time model creation task is queried. If there is a real-time non-model creation task in the task queue, the real-time sleep time matching the real-time non-model creation task is obtained.
[0097] Conversely, if there are no real-time non-model creation tasks in the task queue, there is no need to acquire real-time sleep time, and the real-time model creation task continues to be executed, and the next real-time running phase begins.
[0098] In an optional embodiment of this application, if the real-time non-creation model task exists, obtaining the real-time sleep time matching the real-time non-creation model task includes:
[0099] Based on the real-time runtime, obtain the real-time reference stage;
[0100] Based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase;
[0101] Based on the historical trigger instruction type, obtain the real-time sleep time that matches the real-time non-creation model task.
[0102] An optional embodiment of this application, based on the real-time reference phase, determines the historical trigger instruction type matching the real-time reference phase, including:
[0103] Obtain historical operation data corresponding to the real-time reference stage; wherein, the historical operation data includes a historical editing parameter set, and the historical editing parameter set includes multiple historical editing parameters;
[0104] Based on multiple historical editing parameters, the type of historical trigger instruction that matches the real-time reference stage is determined.
[0105] In an optional embodiment of this application, after the system performs a pause operation on the real-time model creation task, the duration of the pause operation is determined, which is the real-time sleep time.
[0106] Furthermore, since different real-time running times correspond to different trigger instruction types during the process of creating models in batches in the system, the embodiments of this application determine the historical trigger instruction type and the reference sleep time corresponding to the historical trigger instruction by statistically analyzing the editing stage at different running times, the trigger instruction corresponding to each editing stage, and the execution time required for each trigger instruction.
[0107] Furthermore, based on the real-time runtime of the current real-time model creation task, a real-time reference stage is determined, and historical runtime data corresponding to the real-time reference stage is obtained;
[0108] Based on historical operation data, the type of historical trigger command that matches the historical operation data is determined; wherein, the historical operation data includes historical editing parameters; the historical editing parameters include parameters such as editing status, material editing, texture, editing light source, and background; that is, in the embodiments of this application, the type of historical trigger command that matches the historical operation data can be determined based on parameters such as editing status, material editing, texture, editing light source, and background.
[0109] In an optional embodiment of this application, the real-time reference acquisition stage based on the real-time runtime includes:
[0110] The real-time running time is determined as the real-time termination time of the real-time reference phase;
[0111] The real-time start time of the real-time reference phase is determined based on the preset reference duration and the real-time termination time.
[0112] The real-time reference phase is determined based on the real-time start time and the real-time end time.
[0113] In the embodiments of this application, the real-time reference phase is a period of time prior to the real-time runtime, during which historical operating data of the system relative to the real-time runtime can be obtained; specifically, the end time of the real-time reference phase is the real-time runtime; while the start time of the real-time reference phase can be determined according to actual needs.
[0114] In one optional embodiment of this application, a reference duration of 5 minutes is assumed.
[0115] In an optional embodiment of this application, obtaining the real-time sleep time matching the real-time non-creation model task based on the historical trigger instruction type includes:
[0116] The reference trigger command type set is searched based on the historical trigger command type; wherein, the reference trigger command type set includes multiple reference trigger command types, and each reference trigger command type has a reference sleep time;
[0117] When a reference trigger instruction type that matches the historical trigger instruction type is found, the reference sleep time that matches the historical trigger instruction type is determined as the real-time sleep time.
[0118] In an optional embodiment of this application, the reference trigger instruction type set may include:
[0119] For example, 1) when the reference trigger instruction type is a modeling operation, the reference sleep time is 6 seconds;
[0120] 2) When the reference trigger command type is "Edit Light Source", the reference sleep time is 3 seconds;
[0121] 3) When the reference trigger instruction type is edit light source, the reference sleep time is 5 seconds.
[0122] By analogy, the reference sleep time corresponding to each reference trigger instruction can be obtained, so as to facilitate the subsequent algorithm calls.
[0123] An optional embodiment of this application obtains historical running data within 5 minutes prior to the real-time running time, and determines the type of historical trigger instruction based on the historical running data;
[0124] For example, the historical trigger command type can be any of the following: modeling operation, editing light source, and material editing;
[0125] After determining the historical trigger command type, the reference trigger command type set can be searched based on the historical trigger command type. When a reference trigger command type that matches the historical trigger command type is found, the reference sleep time that matches the reference trigger command type is determined as the real-time sleep time.
[0126] For example, 1) when the historical trigger instruction type is a modeling operation, the real-time sleep time is 6 seconds;
[0127] 2) When the historical trigger command type is "Edit Light Source", the real-time sleep time is 3 seconds;
[0128] 3) When the historical trigger command type is "Edit Light Source", the real-time sleep time is 5 seconds.
[0129] Step S14: After waiting for the real-time sleep time, continue the real-time model creation task.
[0130] In the embodiments of this application, during the process of batch model creation, the model creation process can be paused intermittently. In each real-time running stage, the pause is based on the real-time sleep interval corresponding to that real-time running stage, and the duration of the pause corresponding to each real-time running stage is determined based on the real-time sleep time corresponding to each real-time running stage. This ensures that the editing page has a good user interaction experience while completing the batch model creation task in the shortest possible time.
[0131] An optional embodiment of this application, wherein the above embodiment can be implemented based on the following implementation method:
[0132] 1) After the system begins editing the model to be created, it starts timing the real-time running time and determines the real-time running stage of the system;
[0133] When the system is in the first real-time running phase, it obtains the first real-time sleep interval. During the first real-time running phase, the real-time creation task is paused once every first real-time sleep interval, and the system waits for the first real-time sleep time until the system enters the second real-time running phase.
[0134] When the system is in the second real-time running phase, it obtains the second real-time sleep interval. During the second real-time running phase, the real-time creation task is paused once every second real-time sleep interval until the system enters the third real-time running phase.
[0135] ...
[0136] Repeat the above steps until the model creation task is complete;
[0137] The actual editing time for this model creation task is: the historical duration of each real-time running stage * the number of real-time running stages + each real-time running stage * the total real-time sleep time corresponding to that real-time running stage.
[0138] Specifically, the embodiments of this application involve the following operating parameters:
[0139] 1) Global variable times: The time (in seconds) required for all user-triggered event methods (including all synchronous and asynchronous logic within the event methods) to complete execution;
[0140] 2) Global variable names: Event name, the name of an event that is triggered multiple times by the user but only needs to be executed once, such as clicking the property panel, clicking the cancel batch creation button, etc.
[0141] 3) Global variable runs: The name of the event that has been executed, which is in the global variable names;
[0142] 4) Event methods: Various methods for responding to different user interactions;
[0143] 5) Asynchronous Task Queue: A data structure in the JavaScript engine where asynchronous methods are added to the asynchronous task queue; for example, event A (model A to be created in batches) or event B (model B to be created in batches).
[0144] 6) Method stack: A data structure in the JavaScript engine used to execute JavaScript code;
[0145] In one optional embodiment of this application, model A to be created in batches is preset;
[0146] After the system begins editing the model to be created, it starts timing the real-time running time and determines the real-time running stage the system is in.
[0147] When the system is in the first real-time running phase (historical duration is 1 minute), it obtains the first real-time sleep interval. During the first real-time running phase, every first real-time sleep interval (6s), the real-time creation task is paused once and waits for the first real-time sleep time (4s) until the system enters the second real-time running phase.
[0148] When the system is in the second real-time running phase, it obtains the second real-time sleep interval (10s). During the second real-time running phase, the real-time creation task is paused once every second real-time sleep interval (3s) until the system enters the third real-time running phase.
[0149] ...
[0150] Repeat the above steps until the tenth real-time running phase, model creation task A, is completed.
[0151] The actual editing time for the model creation task A is: 60s (historical duration) * 10 (total number of real-time running stages) + 10 (total number of pauses corresponding to the first real-time running stage = historical duration / first real-time sleep interval = 60s / 6s) * 4s (first real-time sleep time) + 6 (total number of pauses corresponding to the second real-time running stage = historical duration / second real-time sleep interval = 60s / 10s) * 3s (second real-time sleep time) + ...
[0152] In one optional embodiment of this application, model B is preset to be created in batches;
[0153] After the system begins editing the model to be created, it starts timing the real-time running time and determines the real-time running stage of the system.
[0154] When the system is in the first real-time running phase (historical duration is 1 minute), it obtains the first real-time sleep interval. During the first real-time running phase, every first real-time sleep interval (5s), the real-time creation task is paused once and waits for the first real-time sleep time (3s) until the system enters the second real-time running phase.
[0155] When the system is in the second real-time running phase, it obtains the second real-time sleep interval (12s). During the second real-time running phase, the real-time creation task is paused once every second real-time sleep interval (2s) until the system enters the third real-time running phase.
[0156] ...
[0157] Repeat the above steps until the ninth real-time running phase, Model Creation Task B, is completed.
[0158] The actual editing time for the model creation task B is: 60s (historical duration) * 9 (total number of real-time running stages) + 12 (total number of pauses corresponding to the first real-time running stage = historical duration / first real-time sleep interval = 60s / 5s) * 3s (first real-time sleep time) + 5 (total number of pauses corresponding to the second real-time running stage = historical duration / second real-time sleep interval = 60s / 12s) * 2s (second real-time sleep time) + ...
[0159] like Figure 2 As shown, embodiments of this application also provide a model creation apparatus 20, comprising:
[0160] The acquisition module 21 is used to acquire the real-time running stage of the real-time model creation task, and determine the real-time sleep interval time matching the real-time running stage based on the real-time running stage.
[0161] The pause module 22 is used to pause the real-time model creation task once every real-time sleep interval during the real-time operation phase.
[0162] The query module 23 is used to query the real-time non-creation tasks in the task list after each pause of the real-time model creation task. If the real-time non-creation task exists, the real-time sleep time matching the real-time non-creation task is obtained; wherein the real-time non-creation task is executed based on the real-time sleep time.
[0163] The sleep module 24 is used to continue the real-time model creation task after waiting for the real-time sleep time.
[0164] Optionally, obtaining the real-time running phase of the real-time model creation task, and determining a real-time sleep interval time matching the real-time running phase based on the real-time running phase, includes:
[0165] Obtain a set of reference sleep interval times; wherein, the set of reference sleep interval times includes multiple reference sleep interval times and historical running stages matched with each of the reference sleep interval times, and each of the historical running stages has a historical duration;
[0166] Obtain the real-time running time of the real-time model creation task, and determine the real-time running stage of the real-time model creation task based on the real-time running time and the historical duration.
[0167] Based on the real-time operation phase, the reference sleep interval time set is searched. If a historical operation phase that matches the real-time operation phase is found, the reference sleep interval time that matches the historical operation phase is determined as the real-time sleep interval time.
[0168] Optionally, obtaining the reference sleep interval time set includes:
[0169] Obtain the historical execution time of the historical model creation task, and determine the historical execution stage corresponding to the historical execution time;
[0170] Obtain the historical trigger frequency corresponding to each of the historical operation stages;
[0171] Based on the historical duration and the historical trigger frequency matching each historical operation phase, a reference sleep interval time matching each historical operation phase is determined;
[0172] The reference sleep interval set is obtained based on multiple reference sleep interval times and the historical running phases that match each historical sleep interval.
[0173] Optionally, during the real-time execution phase, the real-time model creation task is paused once every real-time sleep interval, including:
[0174] In the Hth real-time running phase, the Hth real-time running phase matches the Hth real-time sleep interval. After pausing the real-time model creation task for the Jth time, the real-time model creation task is paused for the J+1th time after the (J+1)th Hth real-time sleep interval; where H and J are both positive integers.
[0175] Optionally, if the real-time non-creating model task exists, obtaining the real-time sleep time matching the real-time non-creating model task includes:
[0176] Based on the real-time runtime, obtain the real-time reference stage;
[0177] Based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase;
[0178] Based on the historical trigger instruction type, obtain the real-time sleep time that matches the real-time non-creation model task.
[0179] Optionally, the step of obtaining the real-time reference stage based on the real-time runtime includes:
[0180] The real-time running time is determined as the real-time termination time of the real-time reference phase;
[0181] The real-time start time of the real-time reference phase is determined based on the preset reference duration and the real-time termination time.
[0182] The real-time reference phase is determined based on the real-time start time and the real-time end time.
[0183] Optionally, based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase, including:
[0184] Obtain historical operation data corresponding to the real-time reference stage; wherein, the historical operation data includes a historical editing parameter set, and the historical editing parameter set includes multiple historical editing parameters;
[0185] Based on multiple historical editing parameters, the type of historical trigger instruction that matches the real-time reference stage is determined.
[0186] Optionally, obtaining the real-time sleep time matching the real-time non-creation model task based on the historical trigger instruction type includes:
[0187] The reference trigger command type set is searched based on the historical trigger command type; wherein, the reference trigger command type set includes multiple reference trigger command types, and each reference trigger command type has a reference sleep time;
[0188] When a reference trigger instruction type that matches the historical trigger instruction type is found, the reference sleep time that matches the historical trigger instruction type is determined as the real-time sleep time.
[0189] Embodiments of this application also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the method described above.
[0190] Embodiments of this application also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the method described above.
[0191] Furthermore, other configurations and functions of the apparatus in the embodiments of this application are known to those skilled in the art, and will not be described in detail here to reduce redundancy.
[0192] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0193] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0194] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0195] In the description of this application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicating the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0196] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0197] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0198] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
[0199] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A model creation method, characterized in that, include: Obtain the real-time running phase of the real-time model creation task, and determine the real-time sleep interval time that matches the real-time running phase based on the real-time running phase; During the real-time operation phase, the real-time model creation task is paused once every real-time sleep interval. After each pause of the real-time model creation task, the real-time non-model creation task in the task list is queried. If the real-time non-model creation task exists, the real-time sleep time matching the real-time non-model creation task is obtained; wherein, the real-time non-model creation task is executed based on the real-time sleep time. After waiting for the real-time sleep period, continue the real-time model creation task; If a real-time non-created model task exists, then obtaining the real-time sleep time matching the real-time non-created model task includes: Based on real-time runtime, obtain a real-time reference stage; Based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase; Based on the historical trigger instruction type, obtain the real-time sleep time that matches the real-time non-creation model task.
2. The method according to claim 1, characterized in that, The step of obtaining the real-time running phase of the real-time model creation task, and determining the real-time sleep interval time matching the real-time running phase based on the real-time running phase, includes: Obtain a set of reference sleep interval times; wherein, the set of reference sleep interval times includes multiple reference sleep interval times and historical running stages matched with each of the reference sleep interval times, and each of the historical running stages has a historical duration; Obtain the real-time running time of the real-time model creation task, and determine the real-time running stage of the real-time model creation task based on the real-time running time and the historical duration. Based on the real-time operation phase, the reference sleep interval time set is searched. If a historical operation phase that matches the real-time operation phase is found, the reference sleep interval time that matches the historical operation phase is determined as the real-time sleep interval time.
3. The method according to claim 2, characterized in that, The process of obtaining the reference sleep interval time set includes: Obtain the historical execution time of the historical model creation task, and determine the historical execution stage corresponding to the historical execution time; Obtain the historical trigger frequency corresponding to each of the historical operation stages; Based on the historical duration and the historical trigger frequency matching each historical operation phase, a reference sleep interval time matching each historical operation phase is determined; The reference sleep interval set is obtained based on multiple reference sleep intervals and the historical running phases that match each reference sleep interval.
4. The method according to claim 1, characterized in that, During the real-time operation phase, the real-time model creation task is paused once every real-time sleep interval, including: In the Hth real-time running phase, the Hth real-time running phase matches the Hth real-time sleep interval. After pausing the real-time model creation task for the Jth time, the real-time model creation task is paused for the J+1th time after the (J+1)th Hth real-time sleep interval; where H and J are both positive integers.
5. The method according to claim 1, characterized in that, The real-time reference acquisition phase based on the real-time runtime includes: The real-time running time is determined as the real-time termination time of the real-time reference phase; The real-time start time of the real-time reference phase is determined based on the preset reference duration and the real-time termination time. The real-time reference phase is determined based on the real-time start time and the real-time end time.
6. The method according to claim 1, characterized in that, Based on the real-time reference phase, determine the historical trigger instruction type that matches the real-time reference phase, including: Obtain historical operation data corresponding to the real-time reference stage; wherein, the historical operation data includes a historical editing parameter set, and the historical editing parameter set includes multiple historical editing parameters; Based on multiple historical editing parameters, the type of historical trigger instruction that matches the real-time reference stage is determined.
7. The method according to claim 1, characterized in that, The step of obtaining the real-time sleep time matching the real-time non-creation model task based on the historical trigger instruction type includes: The reference trigger command type set is searched based on the historical trigger command type; wherein, the reference trigger command type set includes multiple reference trigger command types, and each reference trigger command type has a reference sleep time; When a reference trigger instruction type that matches the historical trigger instruction type is found, the reference sleep time that matches the historical trigger instruction type is determined as the real-time sleep time.
8. A model creation apparatus, characterized in that, For implementing the method as described in any one of claims 1 to 7, comprising: The acquisition module is used to acquire the real-time running phase of the real-time model creation task, and determine the real-time sleep interval time that matches the real-time running phase based on the real-time running phase. The pause module is used to pause the real-time model creation task once every real-time sleep interval during the real-time operation phase. The query module is used to query the real-time non-creation tasks in the task list after each pause of the real-time model creation task. If the real-time non-creation task exists, the real-time sleep time matching the real-time non-creation task is obtained; wherein, the real-time non-creation task is executed based on the real-time sleep time. The sleep module is used to wait for the real-time sleep time before continuing the real-time model creation task.
9. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method as described in any one of claims 1 to 7.