Method for implementing action, related device and computer program product
By detecting the configuration status of the action code in Hvigor and using the Protobuf file to determine the action code, the problem of action code configuration and implementation in the Hongmeng environment is solved, and the action execution ability is improved.
Patent Information
- Application Number
- CN202411570352.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-11
AI Technical Summary
In the Hongmeng environment, it is difficult for the existing technology to effectively simplify the configuration and implementation of action codes, which makes it difficult to implement actions and not have high execution capabilities.
By detecting whether the action code has been configured in Hvigor, if not configured, the action code is determined based on the action purpose Protobuf file, and the action code is provided to the Hvigor, and finally the action code is executed in the Hongmeng environment using Hvigor.
It has realized the simplification of action code configuration in the Hongmeng environment, reduce the difficulty of action implementation, and improve the action execution ability.
Smart Images

Figure CN119415181A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for implementing an action, an electronic device, a computer-readable medium, and a computer program product. Background Art
[0002] HarmonyOS is a new system environment and a cross-platform operating system. HarmonyOS is designed to provide a unified operating experience for various devices. It supports a variety of terminals such as smartphones, tablets, IoT devices, smart homes, etc., emphasizing efficiency, security and interconnection. Summary of the invention
[0003] Multiple aspects of the present application provide a method, device, electronic device, computer-readable storage medium and computer program product for implementing an action, which can provide code support capabilities for actions in the Harmony environment, simplify the code configuration requirements for implementing actions, reduce the difficulty of implementing actions, and improve the execution capabilities of actions in the Harmony environment.
[0004] One aspect of the present application provides a method for implementing an action, comprising: in response to detecting that a corresponding action code is not configured for an action in Hvigor, determining an action code based on an action purpose Protobuf file that can implement the action; providing the action code to Hvigor; and using Hvigor to execute the action code in a Hongmeng environment to implement the action in the Hongmeng environment.
[0005] Another aspect of the present application provides a device for implementing an action, including: an action code determination unit, configured to determine the action code in response to detecting that the corresponding action code is not configured for the action in Hvigor, based on an action purpose Protobuf file that can implement the action; an action code providing unit, configured to provide the action code to Hvigor; and an action code execution unit, configured to use Hvigor to execute the action code in the Hongmeng environment to implement the action in the Hongmeng environment.
[0006] Another aspect of the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for implementing the action provided above.
[0007] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method for implementing the actions provided above.
[0008] In another aspect of the present application, a computer program product includes a computer program having computer program instructions stored thereon, and when the computer program is executed by a processor, the method for implementing actions provided above can be implemented.
[0009] In the solution provided by the embodiment of the present application, in response to detecting that the corresponding action code is not configured for the action in Hvigor, the action code is determined based on the action purpose Protobuf file that can realize the action; the action code is provided to Hvigor; and the action code is executed in the Hongmeng environment using Hvigor to realize the action in the Hongmeng environment. As a result, it is possible to provide code support capabilities for actions in the Hongmeng environment, simplify the code configuration requirements for realizing the action, reduce the difficulty of realizing the action, and improve the execution capability of the action in the Hongmeng environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0011] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0012] Figure 1 A schematic diagram of a process for implementing an action provided in an embodiment of the present application;
[0013] Figure 2 A schematic diagram of a process for determining whether configuration information is routing information provided by an embodiment of the present application;
[0014] Figure 3 A schematic diagram of the structure of a device for implementing an action provided in an embodiment of the present application;
[0015] Figure 4 The present invention is a schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiment of the present application.
[0016] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0017] 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 creative work are within the scope of protection of this application.
[0018] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPU), input / output interface, network interface and memory.
[0019] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0020] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0021] In actual scenarios, the execution subject of the method can be an object device, or a device formed by integrating an object device and a network device through a network, or an application running on the above device. The object device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0022] When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here.
[0023] The execution subject of the process of implementing the action can be the device that actually provides the resources that support the application operation. For example, for some online applications and web pages, the execution subject can be the "server" that provides online browsing services for these applications and pages. For another example, in some cases where support can be provided to users based on local resources, the execution subject can also be the terminal device used by the user.
[0024] Figure 1 A process 100 for implementing an action provided by an embodiment of the present application is shown. The process 100 includes at least the following processing steps:
[0025] (Step) S101, in response to detecting that no corresponding action code is configured for an action in Hvigor, an action code is determined based on an action purpose Protobuf file that can realize the action.
[0026] In an embodiment of the present application, the execution entity (for example, a terminal device or server that provides configuration services for devices in the Harmony environment, or a terminal device and server running in the Harmony environment, etc.) can detect the deployment status of Hvigor in the Harmony environment to determine whether there is an action code corresponding to the action configuration.
[0027] In the Hongmeng environment, due to its independent system characteristics, it may lack the ability to read some code files that can be used in other environments (for example, Android, IOS). For example, some existing code files lack direct reading capabilities, or the components in the Hongmeng environment cannot meet the reading requirements (for example, recognition accuracy, reading speed, etc.) for code files. Therefore, you can choose to use Hvigor in the Hongmeng environment to implement reading, as well as action code configuration based on the reading results, so that the action code can be executed accurately and efficiently in the Hongmeng environment to complete the corresponding code deployment work.
[0028] Hvigor is a high-performance distributed computing framework designed to support large-scale data processing and complex computing tasks. Usually, in the Hongmeng environment, Hvigor can be used to implement actions. For example, external developers can provide the action code of the action to be implemented to Hvigor, so that Hvigor can be used to load and execute the corresponding action code to implement the corresponding action in the Hongmeng environment.
[0029] For example, when it is desired to provide an application in the Hongmeng system, the corresponding action codes for the application's basic component loading actions, component route registration actions, and implementation of the application's functions (for example, image rendering, sound rendering) can be provided to Hvigor, so that these action codes can be executed and loaded through Hvigor to actually complete actions such as basic component loading and route registration.
[0030] Accordingly, for an action that needs to be implemented by Hvigor, the execution subject can detect whether the action code corresponding to the action is actually deployed and configured to Hvigor.
[0031] For example, the action may be determined based on the action instruction, but the action code corresponding to the action has not been actually provided for deployment and configured in Hvigor. In this case, the corresponding action code is not configured for the action in Hvigor.
[0032] If the execution subject detects that the corresponding action code is not configured for the action in Hvigor, the execution subject can respond to this and determine the action code based on the action purpose Protobuf file that can realize the action.
[0033] Protobuf, short for Protocol Buffers, is a data description language that can be used to describe a lightweight and efficient structured data storage format. Protobuf can be used for structured data serialization, or serialization. Accordingly, the Protobuf file specifically corresponding to Protobuf can be converted into code that can be actually executed (for example, based on the transcription tool that is pre-associated and provided with Protobuf) to implement the corresponding code functions.
[0034] In some embodiments, a Protobuf database may be used to store Protobuf files that can implement various actions, that is, the code function corresponding to the Protobuf database is actually equivalent to the action purpose of the action.
[0035] In this regard, as an alternative or alternative, when the execution subject responds to detecting that the corresponding action code is not configured for the action in Hvigor, it can choose to extract the action purpose Protobuf file that can implement the action from such a pre-configured Protobuf database.
[0036] For example, the execution subject can extract the action purpose Protobuf file that can realize the action by calling the data interface corresponding to the pre-configured Protobuf database.
[0037] Next, the execution subject can determine the action code in TypeScript format by transcoding the Protobuf file. TypeScript is also an open source programming language, which can be understood as a superset of JavaScript.
[0038] For example, the execution entity can use the transcription tool corresponding to the Protobuf file to transcribe the Protobuf file.
[0039] Therefore, the Protobuf database, or more specifically the Protobuf file, can be used as the "code source" to provide a reference for the action code in the Hongmeng environment through Hvigor, using the "action code" that has been configured and configured but cannot currently be directly loaded into Hongmeng (for example, the Protobuf file that exists in the Protobuf data and is not independently and specifically provided for the Hongmeng environment).
[0040] Therefore, Hvigor can complete the configuration of actions in the Hongmeng environment by reproducing the actions corresponding to these action codes, improve the efficiency of action development and deployment under the Hongmeng system, and reduce the difficulty of deploying actions (codes) in the Hongmeng system.
[0041] S102, providing an action code to Hvigor.
[0042] In an embodiment of the present application, after determining the action code based on the above S101, the execution subject may provide it to Hvigor, so that Hvigor can actually implement the action through subsequent execution actions based on the action code.
[0043] In some embodiments, in the process of providing the action code (for example, providing the action code in TypeScript form), the execution subject may choose to actually encapsulate it as a code file of a HAR (HTTP Archive) project. Thus, in the process of providing the action code to Hvigor, as an alternative or alternative, the action code is provided to Hvigor by providing the code file to Hvigor.
[0044] The code file of the HAR project is a JSON formatted document that can be read by the Hongmeng environment. Therefore, using the code file of the HAR project to provide action codes can ensure that the "carrier file" of the action code can be directly read and understood by Hvigor in the Hongmeng environment, so as to avoid the situation where Hvigor cannot recognize the file containing the action code due to the incompatibility of the format.
[0045] In some embodiments, similarly, the execution subject can specifically use the plug-in in Hvigor provided in the Hongmeng environment to specifically implement the process of determining the action code and providing the action code to Hvigor. For example, the execution subject can use OhBapiGenPlugin of Hvigor to specifically implement the process of determining the action code and providing the action code to Hvigor.
[0046] OhBapiGenPlugin is a plug-in that can be used to generate BAPI (Business Application Programming Interface). Usually, OhBapiGenPlugin can quickly generate detailed API documentation by parsing comments and annotations in the code, supporting multiple formats, making it easier for developers to maintain and update documents.
[0047] For easier understanding, you can also refer to Figure 2 . Figure 2 A process 200 for generating a code file for a HAR project provided by an embodiment of the present application is shown. The process 200 includes at least the following processing steps:
[0048] For example, as discussed above, a "plugin" may be utilized to generate code files for a HAR project.
[0049] For example, OhBapiGenPlugin may be used to implement the process 200. Figure 2 As shown, OhBapiGenPlugin 210 can extract the Protobuf file that implements the action purpose of the action from the Protobuf database 220 by executing S201 .
[0050] For example, OhBapiGenPlugin 210 can access Protobuf database 220 through SyncBAPI. SyncBAPI is an application programming interface (API) for synchronizing data.
[0051] Accordingly, if such a Protobuf file (eg, the Protobuf file 215 ) exists in the Protobuf database 220 , it may return the Protobuf file 215 to the OhBapiGenPlugin 210 .
[0052] Next, after obtaining the returned Protobuf file 215 , OhBapiGenPlugin 210 may continue to execute S203 to generate a code file 217 of the HAR project of the action code based on the Protobuf file 215 .
[0053] In some embodiments, before OhBapiGenPlugin 210 is used, Hvigor may also choose to perform plug-in initialization and code initialization on OhBapiGenPlugin 210 to ensure the quality of use of OhBapiGenPlugin.
[0054] Correspondingly, after the code file 217 of the HAR project generated by OhBapiGenPlugin 210 is used or retrieved, Hvigor can also clean up the code of OhBapiGenPlugin to prevent the code file 217 of the HAR project from occupying OhBapiGenPlugin for a long time.
[0055] S103, use Hvigor to execute the action code in the Hongmeng environment to implement the action in the Hongmeng environment.
[0056] In an embodiment of the present application, after Hvigor is able to obtain and be provided with action codes corresponding to actions based on the above-mentioned method, Hvigor can execute these action codes in the Harmony environment based on these action codes, so that the actions corresponding to the action codes can be implemented in the Harmony environment, for example, calling and configuring corresponding components, etc., which will not be repeated here.
[0057] Then, the method for implementing an action provided by the present application, in response to detecting that the corresponding action code is not configured for the action in Hvigor, determines the action code based on the action purpose Protobuf file that can implement the action; provides the action code to Hvigor; and uses Hvigor to execute the action code in the Hongmeng environment to implement the action in the Hongmeng environment. As a result, it is possible to provide code support capabilities for actions in the Hongmeng environment, simplify the code configuration requirements for implementing actions, reduce the difficulty of implementing actions, and improve the execution capabilities of actions in the Hongmeng environment.
[0058] In some embodiments, as described above, an action generally corresponds to a task. For example, when it is desired to achieve or complete certain tasks in the Hongmeng environment, a series of "actions" are actually required.
[0059] Accordingly, in order to improve the execution capability of such a set of continuous actions, the execution subject is also allowed to indicate the continuous actions that need to be completed in the form of "tasks".
[0060] In some embodiments, after determining the action flow of the target task (for example, the action flow may be generated by the execution subject based on the analysis of the "target task", or the action flow may be directly provided and sent to the execution subject), the execution subject may determine the action sequence of the target task based on the action flow.
[0061] For example, in a scenario where the target task is "installing an application", such an action flow can be constructed based on a set of actions for continuously configuring components required for the application based on dependencies.
[0062] Accordingly, the execution subject can obtain the action sequence of the target task based on the action flow, that is, the "action sequence" for continuously executing actions according to the action flow. Accordingly, the action sequence is actually used to indicate the various actions that Hvigor needs to implement in sequence in the Hongmeng environment.
[0063] As a result, it is possible to configure actions as a whole based on the dimension of "task", reducing the difficulty of deploying and completing tasks in the Hongmeng environment.
[0064] In some embodiments, for example, developers may also choose to obtain and view the action sequence to understand and determine whether the action sequence meets their needs, or whether the action sequence needs to be adjusted according to different needs (for example, adding or deleting certain actions).
[0065] For example, the developer may communicate with the execution subject through the terminal device used by the developer (e.g., based on a pre-configured communication path) to send a request to view the action sequence. Accordingly, if the execution subject receives a request to view the action sequence from, for example, the target device used by the developer, the execution subject may respond to the request by providing the action sequence to the target device.
[0066] In some embodiments, as discussed above, if the developer desires to update the action sequence by insertion, he or she may instruct the execution entity to insert the update action at the target location in the action sequence (for example, add a new action to the original action sequence) through an action insertion instruction.
[0067] Accordingly, in response to receiving an action insertion instruction for an action sequence from a target device, the execution subject inserts the update action indicated by the action insertion instruction into the target position indicated by the action insertion instruction in the action sequence.
[0068] Similarly, developers can also delete the original action at the target position in the action sequence by deleting the action instruction, which will not be repeated here.
[0069] As a result, developers can more flexibly and individually adjust the configuration and deployment process of tasks in the HarmonyOS environment, thereby improving the configuration and deployment quality of tasks in the HarmonyOS environment.
[0070] In some embodiments, as discussed above, developers can only insert actions without actually configuring corresponding action codes for them. For example, developers can only insert actions, and then, based on the process discussed above, the execution subject uses the Protobuf file to determine the action code.
[0071] In some embodiments, for actions that lack corresponding action codes or have been configured with action codes based on Protobuf files, the execution entity can also configure the action codes according to, for example, the instructions of the developer, or adjust the action codes configured based on the Protobuf file.
[0072] Specifically, if the execution subject receives the configuration action code for the target action, the execution subject can respond to this and provide the configuration action code to Hvigor. For example, for an action that lacks an action code, the configuration action code can be regarded as the action code that can be adopted to implement the action. For an action that has been configured based on a Protobuf file, the configuration action code can be understood as an update or replacement of the "action code configured based on the Protobuf file".
[0073] Thus, Hvigor implements the target action in the Hongmeng environment based on executing the configured action code in the Hongmeng environment. Thus, users such as developers also have the ability to personalize the specific action code that implements the action.
[0074] The present application also provides a device for implementing an action, the structure of which is as follows: Figure 3 The device 300 shown. The device 300 includes: an action code determination unit 310, configured to determine the action code based on the action purpose Protobuf file that can implement the action in response to detecting that the corresponding action code is not configured for the action in Hvigor; an action code providing unit 320, configured to provide the action code to Hvigor; an action code execution unit 330, configured to execute the action code in the Hongmeng environment using Hvigor to implement the action in the Hongmeng environment.
[0075] In some embodiments, the action code determination unit 310 includes: a file extraction subunit, configured to extract an action purpose Protobuf file that can implement the action from a pre-configured Protobuf database in response to detecting that the corresponding action code is not configured for the action in Hvigor; a file transcription subunit, configured to transcribe the Protobuf file and determine the action code in TypeScript form.
[0076] In some embodiments, the apparatus 300 further includes: a code encapsulation unit configured to encapsulate the action code in TypeScript form into a code file of a HAR project; and the action code providing unit 320 is further configured to provide the action code to Hvigor by providing the code file to Hvigor.
[0077] In some embodiments, the device 300 also includes: an action sequence determination unit, which is configured to determine the action sequence of the target task in response to receiving the action flow of the target task based on the action flow, wherein the action sequence is used to indicate each action that Hvigor needs to implement in sequence in the Hongmeng environment.
[0078] In some embodiments, the apparatus 300 further includes: an action sequence providing unit configured to provide the action sequence to the target device in response to receiving a viewing request for the action sequence from the target device.
[0079] In some embodiments, the apparatus 300 further includes: an action sequence updating unit, configured to, in response to receiving an action insertion instruction for an action sequence from a target device, insert the update action indicated by the action insertion instruction into a target position in the action sequence, wherein the target position is indicated by the action insertion instruction.
[0080] In some embodiments, the device 300 also includes: a configuration action code providing unit, configured to provide the configuration action code to Hvigor in response to receiving the configuration action code for the target action, wherein Hvigor implements the target action in the Hongmeng environment based on executing the configuration action code in the Hongmeng environment.
[0081] Based on the same inventive concept, an electronic device, a readable storage medium and a computer program product are also provided in the embodiments of the present application. The method corresponding to the electronic device may be the method for implementing the action in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in the embodiments of the present application includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.
[0082] The electronic device may be a user device, or a device formed by integrating a user device and a network device through a network, or an application running on the above device. The user device includes but is not limited to various terminal devices such as computers, mobile phones, tablet computers, smart watches, and bracelets. The network device includes but is not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets, which can be used to implement some processing functions when setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing, where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.
[0083] Figure 4 The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the electronic device 400 includes a central processing unit (CPU, Central Processing Unit) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM, Read Only Memory) 402 or the program loaded from the storage part 408 to the random access memory (RAM, Random Access Memory) 403. In RAM 403, various programs and data required for system operation are also stored. CPU 401, ROM 402 and RAM 403 are connected to each other through bus 404. Input / output (I / O, Input / Output) interface 405 is also connected to bus 404.
[0084] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker, etc.; a storage section 408 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 409 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet.
[0085] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 401, the above functions defined in the method of the present application are executed.
[0086] Another embodiment of the present application further provides a computer-readable storage medium and a computer program product, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.
[0087] Specifically, the present embodiment can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, systems, devices or devices including but not limited to electricity, magnetism, light, electromagnetic, infrared, or semiconductors, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0088] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0089] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0090] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0091] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0092] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0093] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules and units is only a logical function division. There may be other division methods in actual implementation. For example, with units as an example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0094] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0095] In addition, each functional module or unit in each embodiment of the present application may be integrated into one processing module or unit, or each module or unit may exist physically separately, or two or more units may be integrated into one module or unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules or units.
[0096] The above-mentioned integrated modules and units implemented in the form of software function modules and units can be stored in a computer-readable storage medium. The above-mentioned software function modules and units are stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0098] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for implementing an action, characterized in that, include: In response to detecting that a corresponding action code is not configured for an action in Hvigor, determining the action code based on an action purpose Protobuf file capable of implementing the action; Providing the action code to the Hvigor; The Hvigor is used to execute the action code in the Hongmeng environment to implement the action in the Hongmeng environment.
2. The method according to claim 1, characterized in that In response to detecting that no corresponding action code is configured for the action in Hvigor, determining the action code based on an action purpose Protobuf file capable of implementing the action, comprises: In response to detecting that no corresponding action code is configured for the action in Hvigor, extracting an action purpose Protobuf file capable of implementing the action from a pre-configured Protobuf database; The Protobuf file is transcribed to determine the action code in the form of TypeScript.
3. The method according to claim 2, characterized in that Also includes: Encapsulate the action code in TypeScript format into a code file of the HAR project; as well as The providing the action code to the Hvigor comprises: The action code is provided to the Hvigor by providing the code file to the Hvigor.
4. The method according to claim 1, characterized in that: Also includes: In response to receiving the action flow of the target task, an action sequence of the target task is determined based on the action flow, wherein the action sequence is used to indicate each of the actions that the Hvigor needs to implement in sequence in the Hongmeng environment.
5. The method according to claim 4, characterized in that Also includes: In response to receiving a viewing request for the action sequence from a target device, the action sequence is provided to the target device.
6. The method according to claim 5, characterized in that Also includes: In response to receiving an action insertion instruction for the action sequence from the target device, inserting the update action indicated by the action insertion instruction into a target position in the action sequence, wherein the target position is indicated by the action insertion instruction.
7. The method according to any one of claims 1 to 6, characterized in that Also includes: In response to receiving a configuration action code for a target action, providing the configuration action code to the Hvigor, wherein the Hvigor implements the target action in the Hongmeng environment based on executing the configuration action code in the Hongmeng environment.
8. A device for implementing an action, characterized in that: include: An action code determination unit, configured to, in response to detecting that no corresponding action code is configured for an action in Hvigor, determine the action code based on an action purpose Protobuf file capable of implementing the action; an action code providing unit, configured to provide the action code to the Hvigor; An action code execution unit is configured to utilize the Hvigor to execute the action code in the Hongmeng environment to implement the action in the Hongmeng environment.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable medium, characterized in that Computer program instructions are stored thereon, and the computer program instructions can be executed by a processor to implement the method as claimed in any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.