Function development method, device, electronic device and storage medium
By obtaining and verifying the identifier of the state machine, automatically generating configuration files and updating the storage path, the problem of rapid programming of smart home appliances is solved, efficient development and cost reduction are achieved, and product competitiveness is improved.
Patent Information
- Application Number
- CN202111272260.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In terms of rapid programming of smart home appliances, it is difficult for the existing technology to achieve rapid and efficient program development, resulting in extended R&D cycle and increased costs.
By obtaining the to-configured identifiers of the state machine and its nodes of the functions to be developed, determining that the identifier is within the allowable range, automatically generate configuration files, update existing configuration files under the storage path, and judge the execution conditions based on the operation instructions and function instructions. , realize functional development.
It realizes rapid programming, improves development efficiency, shortens product R&D cycle, reduces development costs, and enhances product competitiveness.
Smart Images

Figure CN114003205B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of function development technology, and in particular to a function development method, device, electronic device and storage medium. Background Art
[0002] Under the current trend of the Internet of Things (IoT), various home appliance manufacturers are rapidly developing towards smart homes. The most critical process for home appliances to achieve intelligence is programming. Manufacturers who can quickly complete programming can seize the market opportunity more quickly. Therefore, fast programming and intelligent programming of smart home appliances have become a pain point that manufacturers need to solve urgently, and it is particularly important to develop a technology that can achieve fast programming. Summary of the invention
[0003] In order to solve the technical problem of how to achieve rapid programming, the present application provides a function development method, device, electronic device and storage medium.
[0004] In a first aspect, the present application provides a function development method, the method comprising:
[0005] Obtain a state machine of the function to be developed and an identifier to be configured corresponding to each node of the state machine;
[0006] Obtaining the allowed range of identifiers pre-configured for each node of the state machine;
[0007] Determine that the identifier to be configured is within the allowed range of the identifier, and generate a configuration file for the function to be developed based on the state machine and the identifier to be configured;
[0008] Further, the state machine for acquiring the function to be developed and the identifier to be configured corresponding to each node of the state machine include:
[0009] Obtaining the input identification information of the state machine; extracting the state machine from an existing state machine library according to the identification information, and obtaining the identifier to be configured corresponding to each node of the extracted state machine;
[0010] or
[0011] The description information of each node of the entered state machine is obtained, wherein the description information includes an identifier to be configured corresponding to the node.
[0012] Further, after generating the configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes:
[0013] Using the configuration file to update the existing configuration file in the predetermined storage path;
[0014] Further, the using the configuration file to update the existing configuration file in the predetermined storage path includes:
[0015] Compare the configuration file with the existing configuration file in a predetermined storage path to obtain a difference between the configuration file and the existing configuration file;
[0016] Updating the difference part to the existing configuration file and marking the difference part;
[0017] Further, after generating the configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes:
[0018] Obtaining an operating instruction for the function to be developed;
[0019] Retrieve the configuration file according to the instruction, obtain the state machine included in the configuration file and the identifier corresponding to the state machine, and extract the first keyword included in the identifier;
[0020] Acquire a function instruction, and extract a second keyword contained in the function instruction;
[0021] Determining whether the first keyword is consistent with the second keyword;
[0022] If the first keyword is consistent with the second keyword, executing the function instruction;
[0023] Further, after generating the configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes:
[0024] Obtaining an operating instruction for the function to be developed;
[0025] Retrieving the configuration file according to the running instruction, obtaining the state machine included in the configuration file and the identifier corresponding to the state machine, and extracting the first keyword included in the identifier;
[0026] Acquire a function instruction, and extract a second keyword contained in the function instruction;
[0027] Determining whether the first keyword is consistent with the second keyword;
[0028] If the first keyword is inconsistent with the second keyword, a prompt message is sent; the prompt message is used to prompt the user that the function instruction does not meet the execution condition;
[0029] Further, the function instruction includes a voice instruction; and the step of extracting the second keyword included in the function instruction includes:
[0030] Converting the voice command into text information;
[0031] A second keyword contained in the text information is extracted.
[0032] In a second aspect, the present application provides a function development device, the device comprising:
[0033] A first acquisition module is used to acquire a state machine of a function to be developed and an identifier to be configured corresponding to each node of the state machine;
[0034] A second acquisition module is used to acquire the allowed range of identifiers pre-configured for each node of the state machine;
[0035] A generating module is used to determine that the identifier to be configured is within the allowed range of the identifier, and to generate a configuration file for the function to be developed based on the state machine and the identifier to be configured.
[0036] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0037] Memory, used to store computer programs;
[0038] The processor is used to implement the steps of the function development method described in any one of the embodiments of the first aspect when executing the program stored in the memory.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the function development method as described in any one of the embodiments of the first aspect.
[0040] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0041] The method provided by the embodiment of the present application includes: obtaining a state machine of the function to be developed, and an identifier to be configured corresponding to each node of the state machine; obtaining an allowable range of identifiers pre-configured for each node of the state machine; determining that the identifier to be configured is within the allowable range of the identifier, and generating a configuration file for the function to be developed based on the state machine and the identifier to be configured. Using the function development method of the present application, by obtaining a state machine of the function to be developed, and obtaining an identifier to be configured corresponding to each node of the state machine, when the identifier to be configured is within the allowable range of the identifier, a configuration file for the function to be developed can be automatically generated, thereby solving the technical problem of how to achieve rapid programming, achieving rapid programming, improving development efficiency, shortening the product development cycle, reducing development costs, and thus improving product competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0043] In order to more clearly illustrate the embodiments of the present invention 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.
[0044] Figure 1 A system architecture diagram of a function development method provided for one embodiment of the present application;
[0045] Figure 2 A flowchart of a function development method provided for one embodiment of the present application;
[0046] Figure 3 A flowchart of another function development method provided for one embodiment of the present application;
[0047] Figure 4 A flowchart of another function development method provided for one embodiment of the present application;
[0048] Figure 5 A flowchart of another function development method provided for one embodiment of the present application;
[0049] Figure 6 A schematic diagram of the structure of a function development device provided in one embodiment of the present application;
[0050] Figure 7 A schematic diagram of the structure of an electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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 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 making creative work are within the scope of protection of this application.
[0052] The first embodiment of the present application provides a function development method, which can be applied to Figure 1The system architecture shown includes at least an automation platform 100 and a compilation platform 101 , and the automation platform 100 and the compilation platform 101 establish a communication connection.
[0053] Among them, the automation platform 100 can obtain the state machine corresponding to the function to be developed and the identifier to be configured corresponding to each node of the state machine according to the function to be developed, and generate a configuration file of the function to be developed when the identifier to be configured meets the conditions. Further, the configuration file can be sent to the compilation platform 101 for use. The automation platform 100 is a development platform with a visual interface. Through the automation platform, development efficiency can be improved, rapid programming can be achieved, and then the product development cycle can be shortened, development costs can be reduced, and product competitiveness can be improved.
[0054] The function development method, such as Figure 2 ,include:
[0055] Step 201, obtaining a state machine of a function to be developed and an identifier to be configured corresponding to each node of the state machine.
[0056] Step 202, obtaining the allowed range of identifiers pre-configured for each node of the state machine;
[0057] Step 203: determine that the identifier to be configured is within the allowed range of identifiers, and generate a configuration file for the function to be developed based on the state machine and the identifier to be configured.
[0058] In this embodiment, after obtaining the function to be developed, the automation platform 100 obtains the state machine of the function to be developed, and obtains the identifier to be configured corresponding to each node contained in the state machine. Afterwards, the allowed range of identifiers of each node of the pre-configured state machine is obtained, and it is determined whether the identifier to be configured is within the allowed range of the identifier. When it is determined that the identifier to be configured is within the allowed range of the identifier, a configuration file for the function to be developed is generated based on the state machine and the identifier to be configured. Among them, the configuration file includes the development code. Through the state machine and the identifier of the state machine, the development code for realizing the function to be developed can be automatically generated when the conditions are met. Developing the development code for realizing the function to be developed of the smart device in a relatively short time can greatly improve the efficiency of the developers. On the other hand, the technology of converting the development code based on the state machine of the automation platform can quickly realize the function to be developed of the smart device, avoiding the limitation of the technical ability of the developers.
[0059] In one embodiment, obtaining a state machine of a function to be developed and an identifier to be configured corresponding to each node of the state machine includes two cases.
[0060] In the first case, the state machine corresponding to the function to be developed already exists in the state machine library of the automation platform. When obtaining the state machine of the function to be developed, it is only necessary to extract it from the existing state machine library of the automation platform, which may include:
[0061] Obtain identification information of the entered state machine; extract the state machine from the existing state machine library according to the identification information, and obtain the identifier to be configured corresponding to each node of the extracted state machine.
[0062] In the second case, the state machine corresponding to the function to be developed does not exist in the state machine library of the automation platform. It is necessary to first create a state machine and configure the parameters of each node of the state machine for use by the function to be developed, including: obtaining the description information of each node of the entered state machine, the description information includes the identifier to be configured corresponding to the node.
[0063] Through the above two situations, the state machine of the function to be developed and the identifier to be configured corresponding to each node of the state machine can be obtained. Furthermore, the allowed range of identifiers pre-configured for each node of the state machine can be obtained. If the identifier to be configured is within the allowed range of the identifier, a configuration file for the function to be developed is generated based on the state machine and the identifier to be configured. If the identifier to be configured is not within the allowed range of the identifier, that is, the function is not supported, the next step will not be taken. At the same time, the developer can be notified through a prompt message to make adjustments.
[0064] For example, if you need to develop code for a new smart fan, you can configure it in the automation platform. For example, first develop the switch function of the smart fan. The switch function exists in the state machine library of the automation platform. You can directly call the state machine of the switch function, obtain the identifier to be configured corresponding to each node of the switch function to be developed, and obtain the allowed range of identifiers pre-set for each node of the state machine. The allowed range varies depending on the state machine. For example, the state machine of the switch function can have identifiers of 0 and 1, 0 represents off, and 1 represents on. If the identifier to be configured is also 0 and 1, it means that the identifier to be configured is within the allowed range of the identifier. If it is a state machine representing the temperature setting of the air conditioner, the identifier can be a number between 16-30 (unit ℃). If the identifier to be configured is 10-30, the identifier to be configured is not within the allowed range of the identifier, and the next step cannot be performed using the identifier to be configured.
[0065] It should be noted that judging whether the identifier to be configured is within the permitted range of identifiers can also be expressed as whether there is a mutually exclusive relationship between the identifier to be configured and the identifier. If the identifier to be configured is not within the permitted range of identifiers, it means that there is a mutually exclusive relationship between the identifier to be configured and the identifier. For example, the state machine for setting the temperature of the air conditioner has an identifier of 16-30. If the identifier to be configured is set to 10-30, it means that there is a mutually exclusive relationship between the identifier to be configured and the identifier of the state machine. During the development process, the mutually exclusive relationship can be configured first, and a mutually exclusive parameter table can be established. The identifier, control field, etc. of the state machine can be used as the parameters of the function to solve the requirements of multi-functional applications. The mutually exclusive parameter table also includes whether there is a mutually exclusive relationship between the identifier to be configured and the identifier of the configured state machine.
[0066] In the automation platform, each device contains the required functional settings. No matter it is a gear, mode, switch, etc., it corresponds to a state machine, and the identifier, control field, type and state are defined (when it is a switch function, the identifier is 0 and 1, the control field is two, the state is on or off, 0 represents the off state, 1 represents the on state, and the type indicates which type of state machine function belongs to). The state is clear and concise. When there is a mutually exclusive relationship between state machines, it is necessary to determine whether the current state meets the setting of its state machine function. If not, the sending and receiving operations of its function are prohibited.
[0067] In one embodiment, after generating a configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes: using the configuration file to update an existing configuration file in a predetermined storage path.
[0068] In this embodiment, after generating the configuration file of the function to be developed, the configuration file is used to update the existing configuration file, and the existing configuration file is stored in a predetermined storage path. Updating the existing configuration file can be adding the configuration file to the existing configuration file, or modifying the existing configuration file according to the configuration file, or deleting some files in the existing configuration file.
[0069] In one embodiment, the configuration file is used to update the existing configuration file in the predetermined storage path, such as Figure 3 ,include:
[0070] Step 301: compare the configuration file with an existing configuration file in a predetermined storage path to obtain a difference between the configuration file and the existing configuration file.
[0071] Step 302: Update the difference part to the existing configuration file and mark the difference part.
[0072] In this embodiment, the configuration file is first compared with the existing configuration file to obtain the difference between the configuration file and the existing configuration file, the difference is updated to the existing configuration file, and the difference is marked to facilitate the user to view the modified part in the existing configuration file and to facilitate the maintenance of the configuration file.
[0073] For example, if you need to develop code for a new smart fan, you can configure it in the automation platform. For example, first develop the switch function of the smart fan. The switch function exists in the state machine library of the automation platform. You can directly call the state machine of the switch function to obtain the identifier to be configured corresponding to each node of the switch function to be developed, and obtain the pre-set allowable range of identifiers for each node of the state machine. For example, the state machine of the switch function, the identifier can be 0 and 1, 0 represents off, and 1 represents on. If the identifier to be configured is also 0 and 1, it means that the identifier to be configured is within the allowable range of the identifier, and a configuration file is generated. At this time, the configuration file includes the implementation of the smart fan switch function.
[0074] Next, the function to be developed is the function of the intelligent fan gear position. At this time, the existing configuration file is the configuration file that includes the intelligent fan switch function. The gear position function also exists in the state machine library of the automation platform. The state machine of the gear position function can be directly called to obtain the identifier to be configured corresponding to each node of the gear position function to be developed, and obtain the operating range of the identifier pre-set for each node of the state machine. For example, the state machine of the gear position function has identifiers 1, 2 and 3, 1 represents low speed, 2 represents medium speed, and 3 represents high speed. If the identifier to be configured is also 1, 2 and 3, it means that the identifier to be configured is within the allowed range of the identifier, and a configuration file is generated. At this time, the configuration file includes the intelligent fan gear position function. This configuration file is compared with the existing configuration file. Since the existing configuration file only includes the switch function but not the gear position function, the gear position function part is the distinguishing part, and the gear position function part is updated to the existing configuration file. At the same time, the gear position function part is marked to record information such as update time, modification content, and modification times, which is convenient for viewing during maintenance.
[0075] It should be noted that the updated existing configuration file is used as a new existing configuration file, and when there is another configuration file, the new existing configuration file is updated.
[0076] In one embodiment, after generating a configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes:
[0077] Obtain the running instructions for the function to be developed; call the configuration file according to the instructions, obtain the state machine included in the configuration file and the identifier corresponding to the state machine, and extract the first keyword contained in the identifier; obtain the function instruction, and extract the second keyword contained in the function instruction; determine whether the first keyword is consistent with the second keyword; if the first keyword is consistent with the second keyword, execute the function instruction.
[0078] If the first keyword is inconsistent with the second keyword, a prompt message is sent; the prompt message is used to prompt the user that the function instruction does not meet the execution condition.
[0079] In one embodiment, the function instruction includes a voice instruction; extracting the second keyword contained in the function instruction, such as Figure 4 ,include:
[0080] Step 401, converting the voice command into text information.
[0081] Step 402: extract the second keyword contained in the text information.
[0082] In this embodiment, the function instruction can be a voice instruction issued by the user. After obtaining the voice instruction, the recognized voice instruction is first converted into text information, and then the second keyword contained in the text information is extracted. If the second keyword is consistent with the first keyword, the voice instruction is considered to be an executable instruction and the voice instruction is executed. If they are inconsistent, a prompt message is issued and the instruction is not executed. Among them, the prompt message is used to prompt the user that the function instruction does not meet the execution condition. The prompt message can be a voice prompt message or a text message displayed in a designated area.
[0083] In one embodiment, if Figure 5 After generating a configuration file for the function to be developed based on the state machine and the identifier to be configured, the method further includes:
[0084] Step 501, obtaining the running instruction of the function to be developed.
[0085] Step 502: retrieve the configuration file according to the running instruction, obtain the state machine included in the configuration file and the identifier corresponding to the state machine, and extract the first keyword included in the identifier.
[0086] Step 503: Acquire voice instructions.
[0087] Step 504, converting the voice command into text information; extracting the second keyword contained in the text information.
[0088] Step 505, determine whether the first keyword is consistent with the second keyword. If consistent, execute step 506, if not consistent, execute step 507.
[0089] Step 506: If the first keyword is consistent with the second keyword, the function instruction is executed.
[0090] Step 507: If the first keyword is inconsistent with the second keyword, a prompt message is sent; the prompt message is used to prompt the user that the function instruction does not meet the execution condition.
[0091] In this embodiment, the running instructions of the completed function to be developed are first obtained, and then the configuration file is called according to the running instructions to obtain the state machine included in the configuration file and the identifier corresponding to the state machine. After obtaining the identifier, the first keyword contained in the identifier is extracted. The voice instruction is obtained, the voice instruction is first converted into text information, and then the second keyword contained in the text information is extracted. After that, it is determined whether the second keyword contained in the voice instruction is consistent with the first keyword. If they are consistent, it means that the function instruction represented by the voice instruction is an executable function instruction, the function instruction is executed, and finally the instruction is accepted and the current state is maintained. If they are inconsistent, it means that the function instruction represented by the voice instruction does not meet the execution conditions, and a prompt message is sent.
[0092] For example, take the implementation of the intelligent fan gear adjustment function as an example. After the gear function is developed, the operating instructions of the gear function are obtained, and the configuration file is called according to the operating instructions. The state machine representing the gear function included in the configuration file is obtained, as well as the identifiers corresponding to the state machine. The identifiers include 1, 2, and 3. 1 represents that the fan runs at a low speed in the first gear, 2 represents that the fan runs at a medium speed in the second gear, and 3 represents that the fan runs at a high speed in the third gear. The keywords are extracted, for example, the first keyword in identifier 1 is "one", the first keyword in identifier 2 is "two", and the first keyword in identifier 3 is "three". The voice command "run in third gear" is obtained, the voice command is converted into text information, and the second keyword "three" is extracted from the text information. At this time, it is determined that the second keyword is consistent with the first keyword in identifier 3, and the voice command for running in third gear is executed.
[0093] It should be noted that the first keyword in each identifier does not mean that it contains only one keyword, but means that it contains at least one keyword, and it can also contain multiple keywords. Similarly, the second keyword in the voice command can also contain multiple keywords. When judging whether the first keyword and the second keyword are consistent, a threshold can be set. For example, the first keyword contains 10 keywords, and the second keyword also contains 10 keywords. The threshold is set to 80% similarity. At this time, if there are 8 identical keywords between the first keyword and the second keyword, it is considered that the first keyword and the second keyword are consistent. The function instruction represented by the voice instruction can be executed.
[0094] Based on the same concept, the second embodiment of the present application also provides a function development device, such as Figure 6 , the function development device includes:
[0095] The first acquisition module 601 is used to acquire the state machine of the function to be developed and the identifier to be configured corresponding to each node of the state machine;
[0096] The second acquisition module 602 is used to obtain the allowed range of identifiers pre-configured for each node of the state machine;
[0097] The generating module 603 is used to determine that the identifier to be configured is within the allowed range of the identifier, and to generate a configuration file of the function to be developed based on the state machine and the identifier to be configured.
[0098] In this embodiment, after obtaining the function to be developed, the first acquisition module 601 obtains the state machine of the function to be developed, and obtains the identifier to be configured corresponding to each node contained in the state machine. Afterwards, the second acquisition module 602 obtains the allowed range of identifiers of each node of the pre-configured state machine, and the generation module 603 determines whether the identifier to be configured is within the allowed range of the identifier. When it is determined that the identifier to be configured is within the allowed range of the identifier, a configuration file for the function to be developed is generated based on the state machine and the identifier to be configured. Among them, the configuration file includes the development code. Through the first acquisition module 601, the second acquisition module 602 and the generation module 603, the development code for realizing the function to be developed can be automatically generated when the conditions are met by using the state machine and the identifier of the state machine. The development code for realizing the function to be developed of the intelligent device can be developed in a relatively short time, which can greatly improve the efficiency of the developers. On the other hand, the development code conversion technology based on the state machine of the automation platform can quickly realize the function to be developed of the intelligent device, avoiding the limitation of the technical ability of the developers.
[0099] like Figure 7 As shown, the third embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0100] Memory 113, used for storing computer programs;
[0101] In one embodiment of the present application, the processor 111 is used to implement the function development method provided by any one of the above method embodiments when executing the program stored in the memory 113, including:
[0102] Obtain a state machine of the function to be developed and an identifier to be configured corresponding to each node of the state machine;
[0103] Obtaining the allowed range of identifiers pre-configured for each node of the state machine;
[0104] It is determined that the identifier to be configured is within the identifier allowed range, and a configuration file for the function to be developed is generated based on the state machine and the identifier to be configured.
[0105] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0106] The communication interface is used for communication between the above terminal and other devices.
[0107] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0108] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0109] The fourth embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the function development method provided by any of the above method embodiments is implemented, including:
[0110] Obtain a state machine of the function to be developed and an identifier to be configured corresponding to each node of the state machine;
[0111] Obtaining the allowed range of identifiers pre-configured for each node of the state machine;
[0112] It is determined that the identifier to be configured is within the identifier allowed range, and a configuration file for the function to be developed is generated based on the state machine and the identifier to be configured.
[0113] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0114] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0115] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A function development method, characterized in that: The method comprises: Obtain a state machine of the function to be developed and an identifier to be configured corresponding to each node of the state machine; Obtaining the allowed range of identifiers pre-configured for each node of the state machine; Determine that the identifier to be configured is within the allowed range of the identifier, and generate a configuration file for the function to be developed based on the state machine and the identifier to be configured; Wherein, after generating the configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes: Obtaining an operating instruction for the function to be developed; Retrieving the configuration file according to the running instruction, obtaining the state machine included in the configuration file and the identifier corresponding to the state machine, and extracting the first keyword included in the identifier; Acquire a function instruction, and extract a second keyword contained in the function instruction; Determining whether the first keyword is consistent with the second keyword; If the first keyword is consistent with the second keyword, the function instruction is executed.
2. The method according to claim 1, characterized in that The state machine for acquiring the function to be developed, and the identifier to be configured corresponding to each node of the state machine, include: Obtaining the entered identification information of the state machine; extracting the state machine from an existing state machine library according to the identification information, and obtaining the identifier to be configured corresponding to each node of the extracted state machine; or The description information of each node of the entered state machine is obtained, wherein the description information includes an identifier to be configured corresponding to the node.
3. The method according to claim 1, characterized in that After generating the configuration file of the function to be developed based on the state machine and the identifier to be configured, the method further includes: The configuration file is used to update the existing configuration file in the predetermined storage path.
4. The method according to claim 3, characterized in that The using the configuration file to update the existing configuration file in the predetermined storage path includes: Compare the configuration file with the existing configuration file in a predetermined storage path to obtain a difference between the configuration file and the existing configuration file; The difference parts are updated to the existing configuration file, and the difference parts are marked.
5. The method according to claim 1, characterized in that The method further comprises: If the first keyword is inconsistent with the second keyword, a prompt message is sent; the prompt message is used to prompt the user that the function instruction does not meet the execution condition.
6. The method according to claim 1 or 5, characterized in that: The function instruction includes a voice instruction; and extracting the second keyword included in the function instruction includes: Converting the voice command into text information; A second keyword contained in the text information is extracted.
7. A function development device, characterized in that: The device comprises: A first acquisition module is used to acquire a state machine of a function to be developed and an identifier to be configured corresponding to each node of the state machine; A second acquisition module is used to acquire the allowed range of identifiers pre-configured for each node of the state machine; A generation module is used to determine that the identifier to be configured is within the allowed range of the identifier, and generate a configuration file for the function to be developed based on the state machine and the identifier to be configured; wherein, after generating the configuration file for the function to be developed based on the state machine and the identifier to be configured, it also includes: obtaining an operation instruction for the function to be developed; calling the configuration file according to the operation instruction, obtaining the state machine included in the configuration file and the identifier corresponding to the state machine, and extracting the first keyword contained in the identifier; obtaining a function instruction, extracting a second keyword contained in the function instruction; judging whether the first keyword is consistent with the second keyword; if the first keyword is consistent with the second keyword, executing the function instruction.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the function development method described in any one of claims 1 to 6 when executing a program stored in a memory.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the function development method according to any one of claims 1 to 6 are implemented.
