Edge scenario execution method and device, storage medium and electronic device
By grouping and parallelizing scene actions in edge scenes, the problem of excessive time-consuming actions caused by serialization during edge scene execution is solved, and more efficient scene execution and improved user experience is achieved.
Patent Information
- Application Number
- CN202210753971.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-06-29
AI Technical Summary
When executing edge scenes, each scene action is executed serially, resulting in too long execution of scenes and poor user experience.
By obtaining the scene action list of the edge scene to be executed, the scene action is divided into multiple groups according to the preset grouping rules, a set of scene actions corresponding to each group are executed in parallel, and a scene action corresponding to multiple groups is executed in serial.
Improve the efficiency of edge scenario execution, shorten the scene execution time, and improve user experience.
Smart Images

Figure CN115268283B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home technology, and more specifically, to an edge scenario execution method and device, a storage medium, and an electronic device. Background Art
[0002] In the related technology, when executing a scene at the edge, each scene action is executed serially. After the previous action is executed, the next action is executed only after receiving an acknowledgement (ACK). That is, the scene execution time is almost equal to the total execution time of all actions, which is extremely inefficient. As a result, the user's execution progress is slow and time-consuming after executing the scene, resulting in a poor user experience.
[0003] In the related technologies, when edge scenarios are executed, the actions of each scenario are executed serially, the scenario execution takes too long, and the user experience is poor. No effective solution has been proposed yet.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] Embodiments of the present invention provide an edge scene execution method and device, a storage medium, and an electronic device to at least solve the problem in the related art that when an edge scene is executed, each scene action is executed serially, the scene execution takes too long, and the user experience is poor.
[0006] According to one aspect of an embodiment of the present invention, a method for executing an edge scene is provided, comprising: obtaining a scene action list of an edge scene to be executed; dividing the scene actions included in the scene action list into multiple groups according to a preset grouping rule, wherein the functions of the scene actions in each of the multiple groups are the same; executing a group of scene actions corresponding to each group in parallel, and executing the scene actions corresponding to the multiple groups in serial, so as to execute the edge scene.
[0007] In an exemplary embodiment, the scene actions included in the scene action list are divided into multiple groups according to preset grouping rules, including: determining the number and position of target scene actions from the scene actions included in the scene action list, wherein the position includes: identification information of the target scene action in the scene action list; and dividing the scene actions included in the scene action list into multiple groups according to the number and position of the target scene actions.
[0008] In an exemplary embodiment, the scene actions included in the scene action list are divided into multiple groups according to the number and position of the target scene actions, including: obtaining a first type of scene action set between the target scene action and the target position in the scene action list, and / or a second type of scene action set between any two target scene actions according to the number and position of the target scene actions, wherein the target position includes at least one of the following: the header of the scene action list, the footer of the scene action list; determining the target scene action as a scene action included in a third type of scene action set, wherein the number of the third type of scene action set is the same as the number of the target scene action; determining the first type of scene action set, the second type of scene action set, and the third type of scene action set as the multiple groups.
[0009] In an exemplary embodiment, after obtaining a first type of scene action set between the target scene action and the target position in the scene action list, and / or a second type of scene action set between any two scene actions according to the number and position of the target scene actions, the method further includes: dividing the scene actions included in the scene action list into multiple groups according to the functions in the scene action set, wherein the scene action set includes at least one of the following: the first type of scene action set, the second type of scene action set.
[0010] In an exemplary embodiment, the scene actions included in the scene action list are divided into multiple groups according to the functions in the first category of scene action set and / or the second category of scene action set, including: determining the functions included in any scene action set; when any scene action set includes only one function, determining any scene set as a group corresponding to a group of scene actions; when any scene action set includes at least two functions, dividing the scene actions with the same function into the same group.
[0011] In an exemplary embodiment, in the process of serially executing the scene actions corresponding to the multiple groups, the method also includes: obtaining the execution result of the scene action corresponding to the first group; upon receiving the execution result and the execution result indicating that the first group has been successfully executed, executing the scene action corresponding to the second group, wherein the second group is the next group of the first group.
[0012] In an exemplary embodiment, obtaining a scene action list of an edge scene to be executed includes: obtaining all scene actions of the edge scene to be executed; sorting all the scene actions according to the order of action execution to obtain sorted scene actions; and determining the sorted scene actions as the scene action list.
[0013] According to another aspect of an embodiment of the present invention, there is also provided an execution device for an edge scene, including: an acquisition module, used to acquire a scene action list of an edge scene to be executed; a grouping module, used to divide the scene actions included in the scene action list into multiple groups according to a preset grouping rule, wherein the functions of the scene actions in each of the multiple groups are the same; an execution module, used to execute a group of scene actions corresponding to each group in parallel, and to execute the scene actions corresponding to the multiple groups in serial, so as to execute the edge scene.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned edge scenario execution method when running.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the execution method of the edge scenario through the computer program.
[0016] Through the present invention, a scene action list of an edge scene to be executed is obtained; the scene actions included in the scene action list are divided into multiple groups according to a preset grouping rule, wherein the functions of the scene actions in each of the multiple groups are the same; a group of scene actions corresponding to each group are executed in parallel, and the scene actions corresponding to the multiple groups are executed serially to execute the edge scene; the above-mentioned technical scheme is adopted to solve the problem in the related art that when executing the edge scene, each scene action is executed serially, the scene execution takes too long, and the user experience is poor; and the technical effect of improving the execution efficiency of the edge scene is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] Figure 1 is a hardware environment diagram of an optional edge scenario execution method according to an embodiment of the present application;
[0020] Figure 2is a flowchart of an optional edge scenario execution method according to an embodiment of the present application;
[0021] Figure 3 It is a timing diagram of an optional execution method of an edge scenario in the prior art;
[0022] Figure 4 is a timing diagram of an optional execution method of an edge scenario according to an embodiment of the present application;
[0023] Figure 5 is a timing diagram of an optional action scheduling algorithm according to an embodiment of the present application;
[0024] Figure 6 is a schematic diagram of an optional action arrangement process according to an embodiment of the present application;
[0025] Figure 7 It is a structural block diagram of an optional execution device of an edge scenario according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] According to one aspect of an embodiment of the present application, a method for executing an edge scenario is provided. The method for executing the edge scenario is widely used in smart home (Smart Home), smart home, smart home device ecology, smart house (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for executing the edge scenario can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0029] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0030] In order to solve the above problems, an execution method of an edge scenario is provided in this embodiment, including but not limited to being applied to a server, Figure 2 is a flowchart of a method for executing an edge scenario according to an embodiment of the present invention, the process comprising the following steps:
[0031] Step S202: Obtain a scene action list of edge scenes to be executed;
[0032] Step S204: dividing the scene actions included in the scene action list into a plurality of groups according to a preset grouping rule, wherein the function of the scene actions in each of the plurality of groups is the same;
[0033] Step S206: executing a set of scene actions corresponding to each group in parallel, and executing the scene actions corresponding to the multiple groups in series, so as to execute the edge scene.
[0034] It should be noted that after the scene actions included in the scene action list are divided into multiple groups according to the preset grouping rules, the multiple groups obtained need to be sorted according to the priority of the scene action category in each segment, and the basis of segmentation is the delayed action (equivalent to the above-mentioned target scene action); since the functions of the scene actions in each of the multiple groups obtained are the same, the priority of the scene actions in each group is the priority of the group; the priorities of the scene action categories include: device function, device skill, other, and delay. That is, in each segment, each group is sorted according to the above-mentioned priority to obtain multiple sorted groups, and the scene actions corresponding to the multiple groups are serially executed according to the sorting order of the multiple groups to execute the edge scene.
[0035] Through the above steps, a scene action list of the edge scene to be executed is obtained; the scene actions included in the scene action list are divided into multiple groups according to a preset grouping rule, wherein the functions of the scene actions in each of the multiple groups are the same; a group of scene actions corresponding to each group are executed in parallel, and the scene actions corresponding to the multiple groups are executed serially, thereby improving the execution speed of the scene actions to execute the edge scene; the above technical solution is adopted to solve the problem in the related technology that when executing the edge scene, each scene action is executed serially, the scene execution takes too long, and the user experience is poor; and the technical effect of improving the execution efficiency of the edge scene is achieved.
[0036] Among them, the scene actions included in the scene action list are divided into multiple groups according to preset grouping rules, including: determining the number and position of target scene actions from the scene actions included in the scene action list, wherein the position includes: identification information of the target scene action in the scene action list; dividing the scene actions included in the scene action list into multiple groups according to the number and position of the target scene actions.
[0037] Before grouping scene actions, it is necessary to segment the scene actions included in the scene action list according to the delayed actions (equivalent to the above-mentioned target scene actions). Therefore, it is necessary to first determine the number and position of the delayed actions, obtain the identification information of all delayed actions in the scene action list, that is, the subscript in the scene action list, and determine the position of the delayed action according to the subscript; then divide the scene actions included in the scene action list into multiple groups according to the number and position of the delayed actions.
[0038] Based on the above steps, the scene actions included in the scene action list are divided into multiple groups according to the number and position of the target scene actions, including: obtaining a first type of scene action set between the target scene action and the target position in the scene action list, and / or a second type of scene action set between any two scene actions according to the number and position of the target scene actions, wherein the target position includes at least one of the following: the header of the scene action list, the footer of the scene action list; determining the target scene action as a scene action included in a third type of scene action set, wherein the number of the third type of scene action set is the same as the number of the target scene action; determining the first type of scene action set, the second type of scene action set, and the third type of scene action set as the multiple groups.
[0039] When grouping scene actions, the scene actions in the scene action list are numbered, the number and position of all delayed actions are determined (i.e., the numbers of all delayed actions are determined), and the scene actions are segmented according to the number and position of delayed actions, that is, the scene actions between the head of the list and the first delayed action, and between the last delayed action and the end of the list are divided into the first type of scene action set; the scene actions between any two adjacent delayed actions are divided into the second type of scene action set; finally, the delayed actions are divided into the third type of scene action set, and one delayed action is separately regarded as a third type of scene action set, that is, the number of delayed actions is the same as the number of the third type of scene action set. Finally, each of the first type of scene action set, the second type of scene action set, and the third type of scene action set is determined as a group, and multiple groups are obtained.
[0040] Based on the above steps, after obtaining the first category scene action set between the target scene action and the target position in the scene action list, and / or the second category scene action set between any two scene actions according to the number and position of the target scene actions, the method also includes: dividing the scene actions included in the scene action list into multiple groups according to the functions in the scene action set, wherein the scene action set includes at least one of the following: the first category scene action set, the second category scene action set.
[0041] After determining the first category scene action set and the second category scene action set, since each scene action set may include multiple categories of scene actions, each scene action set needs to be further grouped; the scene action set is divided into multiple groups according to the function of the scene action in each scene action set, and the scene action set includes all the first category scene action sets and the second category scene action sets.
[0042] Specifically, the scene actions included in the scene action list are divided into multiple groups according to the functions in the first category of scene action set and / or the second category of scene action set, including: determining the functions included in any scene action set; when any scene action set includes only one function, determining any scene action set as a group corresponding to a group of scene actions; when any scene action set includes at least two functions, dividing scene actions with the same function into the same group.
[0043] The scene actions included in the scene action list are divided into multiple groups according to the functions in the scene action set, including the following steps: determining the function categories included in the scene actions in each scene action set, wherein the function categories included in the scene actions are: device function, device skill, delay, and others. When each scene action set includes only one function, for example, when all functions in a scene action set are in the device skill category, the scene action set is determined as a group corresponding to a group of scene actions; if the scene action set includes at least two functions, the scene actions with the same function category are divided into the same group; for example, if a scene action set includes both device functions and device skills, all scene actions classified as device functions are divided into the same group, and all scene actions classified as device skills are divided into the same group.
[0044] It should be noted that device functions generally refer to basic attribute functions of devices, which have a smaller granularity; while device skills generally refer to device capabilities, which have a granularity greater than the attribute functions of devices; for example, turning a device on and off is a device function, while controlling a device to play music is a device skill.
[0045] Among them, in the process of serially executing the scene actions corresponding to the multiple groups, the method also includes: obtaining the execution result of the scene action corresponding to the first group; upon receiving the execution result and the execution result indicating that the first group has been successfully executed, executing the scene action corresponding to the second group, wherein the second group is the next group of the first group.
[0046] In the process of serially executing scene actions corresponding to multiple groups according to the sorting order of the multiple groups, it is also necessary to obtain the execution result of the scene action corresponding to each group. When the execution result is received and the execution result indicates that the scene action corresponding to the group has been successfully executed, the scene action corresponding to the next group is executed; if the execution result is not received, continue to wait for reception; if the received execution result indicates that the scene action corresponding to the group has failed to execute, report the result to the user, and after obtaining confirmation from the user, continue to execute the scene action corresponding to the next group.
[0047] In an exemplary embodiment, obtaining a scene action list of an edge scene to be executed includes: obtaining all scene actions of the edge scene to be executed; sorting all the scene actions according to the order of action execution to obtain sorted scene actions; and determining the sorted scene actions as the scene action list.
[0048] After the edge scene starts to execute, it is necessary to first obtain all the scene actions that need to be executed in the edge scene and determine the execution order of all scene actions. For example, it is necessary to control the device to turn on first, then control the device to play music, and then control the light to turn on after a delay action; all scene actions to be executed are sorted according to the order of action execution, and the sorted scene actions are determined as the scene action list for subsequent grouping.
[0049] Obviously, the above-described embodiments are only part of the embodiments of the present invention, not all of the embodiments. In order to better understand the execution method of the above edge scenario, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solution of the embodiments of the present invention, specifically:
[0050] In an alternative embodiment, Figure 3 It is a timing diagram of an optional edge scenario execution method in the prior art, such as Figure 3 As shown, there are the following steps:
[0051] Step 3.1: Start executing the scenario;
[0052] Step 3.1.1: Number the action list in order according to the scene;
[0053] Step 3.1.2: Save the action list;
[0054] Step 3.1.3: Control component to perform actions;
[0055] Step 3.1.4: Component synchronous response;
[0056] Step 3.1.5: Process the response result;
[0057] Step 3.1.5.1: Update the action status to the database;
[0058] Step 3.2: Receive the action execution result fed back by the component;
[0059] Step 3.2.1: Update action;
[0060] Step 3.2.2: Query the scene action list;
[0061] Step 3.2.3: Receive the scene action list fed back by the database;
[0062] Step 3.2.4: Find the next action according to the order of the scene actions in the list;
[0063] Step 3.2.5: Execute the next action found;
[0064] It can be seen that all scene actions in the prior art are executed serially, and the next action can only be executed when a response is received after each action is executed, that is, the scene execution time is almost equal to the sum of the execution times of all actions, resulting in slow scene execution progress and long time consumption when the user executes the scene, resulting in a poor user experience.
[0065] In order to solve the problem that the execution of the above scenario takes too long, the above process is described below in conjunction with another embodiment, but it is not intended to limit the technical solution of the embodiment of the present invention. Figure 4 , Figure 4 It is a timing diagram of an optional edge scenario execution method of an embodiment of the present application, which specifically includes:
[0066] Step 4.1: Start executing the scenario;
[0067] Step 4.1.1: Segment and group the scene actions;
[0068] Step 4.1.2: Save the action list;
[0069] Step 4.1.3: Execute the action group;
[0070] Step 4.1.4: The component feeds back the action execution response;
[0071] Step 4.1.5: Process the response;
[0072] Step 4.1.5.1: Update the action status to the database;
[0073] Step 4.2: The component feeds back the execution result of a single action;
[0074] Step 4.2.1: Update the action to the database;
[0075] Step 4.2.2: Query the scene action list from the database;
[0076] Step 4.2.3: Determine whether the current action group has been executed;
[0077] Step 4.2.3.1: If the execution is completed, filter out the current action group;
[0078] Step 4.2.3.2: Determine whether the current action group has been fully executed;
[0079] Step 4.2.4: If the current action group has been fully executed, filter out the next action group;
[0080] Step 4.2.5: If there is a next action group, execute the next action group.
[0081] This application proposes an execution method for the above-mentioned edge scene. After starting to execute the scene, all scene actions are first segmented and grouped, each scene action group is executed in parallel, and the execution response of each action is received synchronously. After receiving the response, the execution status of the action is updated; after a group of actions is fully executed, the next action group is filtered out until all scene actions are executed. Through the above-mentioned technical solution, the problem that each scene action is executed serially when executing the edge scene in the related technology, the scene execution takes too long, and the user experience is poor is solved; the technical effect of improving the execution efficiency of the edge scene is achieved.
[0082] In order to help further understand the execution method of the above edge scenario, this application proposes a timing diagram of an optional action scheduling algorithm to further describe the process of grouping actions in the execution method of the above edge scenario, such as Figure 5 As shown, the following steps are included:
[0083] Step 5.1: Start choreographing the movements;
[0084] Step 5.2: Concatenate special strings through action lists;
[0085] Step 5.2.1: Loop to obtain the action table of each action in the action list;
[0086] Step 5.2.2: If it is a delayed action, add “#” before and after the subscript of the delayed action;
[0087] Step 5.2.3: If it is not a delayed action, concatenate the subscript and a space character to the action;
[0088] Step 5.3: Use the Java string.split method to split the string by “#” to segment the action list;
[0089] Step 5.4: Loop through each segment and use the Java string.split method to split the string of each segment by space character;
[0090] Step 5.5: Obtain the corresponding action through the obtained subscripts of each segment;
[0091] Step 5.6: Output a segmented two-dimensional action array;
[0092] Step 5.7: Loop to group and sort each segmented action by type;
[0093] Step 5.8: Sort and number all actions;
[0094] Through the above steps, number each action in the action list, obtain the action subscript, and concatenate special characters for the subscript of each action. If it is a delayed action, concatenate "#" before and after, if not, concatenate spaces; segment the scene action list through the "#" through the Java string.split method, obtain the action corresponding to the subscript of each segment through the space, and obtain the segmented two-dimensional action array; group and sort the actions in each segment according to type, and finally flatten all action groups and sort and number all action groups. Using the above technical solution, the scene actions are grouped and sorted according to the priority and execution order of the scene actions, realizing the effective sorting of the scene actions.
[0095] In order to help understand the above action scheduling algorithm, the present invention proposes a flow chart of action scheduling, as shown in FIG. Figure 6 As shown, Figure 6 This is a schematic diagram of an optional action arrangement process according to an embodiment of the present application, including the following steps:
[0096] Step 6.1: Start choreographing the movements;
[0097] Step 6.2: Get the initial action list, including 11 actions as shown in the figure;
[0098] Step 6.3: Obtain the delayed actions in the action list, and divide them into segments according to the delay, wherein the delay is regarded as a separate segment, that is, the action list is divided into multiple segments by the delay;
[0099] Step 6.4: sorting the obtained multiple actions according to the business groups, wherein the grouping basis is the action category, and the sorting basis is the priority of the action category, wherein the priority of the device function is higher than that of the device skill;
[0100] Step 6.5: Finally, the multiple groups of actions after grouping and sorting are numbered to obtain multiple ordered groups of actions, and the multiple groups of actions are executed serially according to the sorting, and each group of actions is executed in parallel.
[0101] The above steps combine actual examples to further illustrate the scene action choreography process. The above technical solution solves the problem in the related technology that when edge scenes are executed, all scene actions are executed serially, the scene execution takes too long, and the user experience is poor; the technical effect of improving the execution efficiency of edge scenes is achieved.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0103] In this embodiment, an execution device for an edge scenario is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0104] Figure 7 is a structural block diagram of an optional edge scenario execution device according to an embodiment of the present invention, the device comprising:
[0105] An acquisition module 72, used to acquire a scene action list of an edge scene to be executed;
[0106] A grouping module 74, configured to divide the scene actions included in the scene action list into a plurality of groups according to a preset grouping rule, wherein the functions of the scene actions in each of the plurality of groups are the same;
[0107] The execution module 76 is used to execute a group of scene actions corresponding to each group in parallel, and to execute the scene actions corresponding to the multiple groups in series, so as to execute the edge scene.
[0108] Through the above-mentioned device, a scene action list of the edge scene to be executed is obtained; the scene actions included in the scene action list are divided into multiple groups according to preset grouping rules, wherein the functions of the scene actions in each of the multiple groups are the same; a group of scene actions corresponding to each group are executed in parallel, and the scene actions corresponding to the multiple groups are executed serially, thereby improving the execution speed of the scene actions to execute the edge scene; the above-mentioned technical solution is adopted to solve the problem that when executing the edge scene in the related technology, each scene action is executed serially, the scene execution takes too long, and the user experience is poor; and the technical effect of improving the execution efficiency of the edge scene is achieved.
[0109] Among them, the grouping module 74 is also used to determine the number and position of target scene actions from the scene actions included in the scene action list, wherein the position includes: identification information of the target scene action in the scene action list; and dividing the scene actions included in the scene action list into multiple groups according to the number and position of the target scene actions.
[0110] Before grouping scene actions, it is necessary to segment the scene actions included in the scene action list according to the delayed actions (equivalent to the above-mentioned target scene actions). Therefore, it is necessary to first determine the number and position of the delayed actions, obtain the identification information of all delayed actions in the scene action list, that is, the subscript in the scene action list, and determine the position of the delayed action according to the subscript; then divide the scene actions included in the scene action list into multiple groups according to the number and position of the delayed actions.
[0111] Based on the above steps, the grouping module 74 is also used to obtain a first type of scene action set between the target scene action and the target position in the scene action list, and / or a second type of scene action set between any two scene actions according to the number and position of the target scene actions, wherein the target position includes at least one of the following: the header of the scene action list, the footer of the scene action list; determine the target scene action as the scene action included in a third type of scene action set, wherein the number of the third type of scene action set is the same as the number of the target scene action; determine the first type of scene action set, the second type of scene action set, and the third type of scene action set as the multiple groups.
[0112] When grouping scene actions, the scene actions in the scene action list are numbered, the number and position of all delayed actions are determined (i.e., the numbers of all delayed actions are determined), and the scene actions are segmented according to the number and position of delayed actions, that is, the scene actions between the head of the list and the first delayed action, and between the last delayed action and the end of the list are divided into the first type of scene action set; the scene actions between any two adjacent delayed actions are divided into the second type of scene action set; finally, the delayed actions are divided into the third type of scene action set, and one delayed action is separately regarded as a third type of scene action set, that is, the number of delayed actions is the same as the number of the third type of scene action set. Finally, each of the first type of scene action set, the second type of scene action set, and the third type of scene action set is determined as a group, and multiple groups are obtained.
[0113] Based on the above steps, the acquisition module 72 is also used to divide the scene actions included in the scene action list into multiple groups according to the functions in the scene action set, wherein the scene action set includes at least one of the following: the first category scene action set, the second category scene action set.
[0114] After determining the first category scene action set and the second category scene action set, since each scene action set may include multiple categories of scene actions, each scene action set needs to be further grouped; the scene action set is divided into multiple groups according to the function of the scene action in each scene action set, and the scene action set includes all the first category scene action sets and the second category scene action sets.
[0115] Specifically, the grouping module 74 is also used to determine the functions included in any scene action set; when any scene action set includes only one function, the any scene action set is determined as a group corresponding to a group of scene actions; when any scene action set includes at least two functions, the scene actions with the same functions are divided into the same group.
[0116] The scene actions included in the scene action list are divided into multiple groups according to the functions in the scene action set, including the following steps: determining the function categories included in the scene actions in each scene action set, wherein the function categories included in the scene actions are: device function, device skill, delay, and others. When each scene action set includes only one function, for example, when all functions in a scene action set are in the device skill category, the scene action set is determined as a group corresponding to a group of scene actions; if the scene action set includes at least two functions, the scene actions with the same function category are divided into the same group; for example, if a scene action set includes both device functions and device skills, all scene actions classified as device functions are divided into the same group, and all scene actions classified as device skills are divided into the same group.
[0117] Among them, the execution module 76 is also used to obtain the execution result of the scene action corresponding to the first group; when the execution result is received and the execution result indicates that the first group has been successfully executed, the scene action corresponding to the second group is executed, wherein the second group is the next group of the first group.
[0118] In the process of serially executing scene actions corresponding to multiple groups according to the sorting order of the multiple groups, it is also necessary to obtain the execution result of the scene action corresponding to each group. When the execution result is received and the execution result indicates that the scene action corresponding to the group has been successfully executed, the scene action corresponding to the next group is executed; if the execution result is not received, continue to wait for reception; if the received execution result indicates that the scene action corresponding to the group has failed to execute, report the result to the user, and after obtaining confirmation from the user, continue to execute the scene action corresponding to the next group.
[0119] In an exemplary embodiment, the acquisition module 72 is also used to obtain all scene actions of the edge scene to be executed; sort all the scene actions according to the order of action execution to obtain sorted scene actions; and determine the sorted scene actions as the scene action list.
[0120] After the edge scene starts to execute, it is necessary to first obtain all the scene actions that need to be executed in the edge scene and determine the execution order of all scene actions. For example, it is necessary to control the device to turn on first, then control the device to play music, and then control the light to turn on after a delay action; all scene actions to be executed are sorted according to the order of action execution, and the sorted scene actions are determined as the scene action list for subsequent grouping.
[0121] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0122] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0123] S1, obtain a list of scene actions of edge scenes to be executed;
[0124] S2, dividing the scene actions included in the scene action list into multiple groups according to a preset grouping rule, wherein the scene actions in each of the multiple groups have the same function;
[0125] S3, executing a group of scene actions corresponding to each group in parallel, and executing the scene actions corresponding to the multiple groups in series, so as to execute the edge scene.
[0126] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0127] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0128] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0129] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0130] S1, obtain a list of scene actions of edge scenes to be executed;
[0131] S2, dividing the scene actions included in the scene action list into multiple groups according to a preset grouping rule, wherein the scene actions in each of the multiple groups have the same function;
[0132] S3, executing a group of scene actions corresponding to each group in parallel, and executing the scene actions corresponding to the multiple groups in series, so as to execute the edge scene.
[0133] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0134] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0135] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0136] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for executing an edge scenario, characterized in that: include: Get the scene action list of the edge scene to be executed; Dividing the scene actions included in the scene action list into a plurality of groups according to a preset grouping rule, wherein the function of the scene actions in each of the plurality of groups is the same; A set of scene actions corresponding to each group is executed in parallel, and scene actions corresponding to the multiple groups are executed in series to execute the edge scene, wherein the scene actions included in the scene action list are divided into multiple groups according to a preset grouping rule, including: Determining the number and position of the target scene action from the scene actions included in the scene action list, wherein the position includes: identification information of the target scene action in the scene action list; Dividing the scene actions included in the scene action list into a plurality of groups according to the number and position of the target scene actions; The scene actions included in the scene action list are divided into a plurality of groups according to the number and position of the target scene actions, including: Acquire a first type of scene action set between the target scene action and a target position in the scene action list, and / or a second type of scene action set between any two target scene actions according to the number and position of the target scene action, wherein the target position includes at least one of the following: a header of the scene action list, and a footer of the scene action list; Determine the target scene action as a scene action included in a third type of scene set, wherein the number of the third type of scene set is the same as the number of the target scene actions; The first category scene action set, the second category scene action set, and the third category scene action set are determined as the multiple groups.
2. The method for executing edge scenarios according to claim 1, characterized in that: After obtaining a first type of scene action set between the target scene action and the target position in the scene action list and / or a second type of scene action set between any two scene actions according to the number and position of the target scene action, the method further includes: The scene actions included in the scene action list are divided into multiple groups according to functions in the scene action set, wherein the scene action set includes at least one of the following: the first category scene action set, the second category scene action set.
3. The method for executing edge scenarios according to claim 2, characterized in that: The scene actions included in the scene action list are divided into a plurality of groups according to functions in the first category scene action set and / or the second category scene action set, including: Determine the functions included in any scene action set; In the case that any scene action set includes only one function, determining any scene action set as a group corresponding to a set of scene actions; In the case that any scene action set includes at least two functions, scene actions with the same functions are divided into the same group.
4. The method for executing edge scenarios according to claim 1, characterized in that: In the process of serially executing the scene actions corresponding to the multiple groups, the method further includes: Obtain the execution result of the scene action corresponding to the first group; When the execution result is received and the execution result indicates that the first group has been successfully executed, a scene action corresponding to the second group is executed, wherein the second group is the next group of the first group.
5. The method for executing edge scenarios according to claim 1, characterized in that: Get the scene action list of the edge scene to be executed, including: Obtain all scene actions of the edge scene to be executed; Sorting all the scene actions according to the order of action execution to obtain sorted scene actions; The sorted scene actions are determined as the scene action list.
6. An execution device for an edge scenario, characterized in that: include: An acquisition module, used to obtain a list of scene actions of edge scenes to be executed; A grouping module, used to divide the scene actions included in the scene action list into multiple groups according to a preset grouping rule, wherein the functions of the scene actions in each of the multiple groups are the same; an execution module, used to execute a group of scene actions corresponding to each group in parallel, and to execute the scene actions corresponding to the multiple groups in series, so as to execute the edge scene, wherein: The grouping module is further used to determine the number and position of target scene actions from the scene actions included in the scene action list, wherein the position includes: identification information of the target scene action in the scene action list; and divide the scene actions included in the scene action list into a plurality of groups according to the number and position of the target scene actions; The grouping module is also used to obtain a first type of scene action set between the target scene action and the target position in the scene action list, and / or a second type of scene action set between any two target scene actions according to the number and position of the target scene actions, wherein the target position includes at least one of the following: the header of the scene action list, the footer of the scene action list; determine the target scene action as the scene action included in a third type of scene set, wherein the number of the third type of scene sets is the same as the number of the target scene actions; determine the first type of scene action set, the second type of scene action set, and the third type of scene action set as the multiple groups.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 5 when executed.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Reducing noise during rendering by performing parallel path space filtering utilizing hashing
CN110766778A
Linkage control configuration method, linkage control method and linkage control system
CN114500138A