Method, device and system for processing wasm code

CN116775262BActive Publication Date: 2026-10-27GUIZHOU BAISHANCLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210242389.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2026-10-27
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

[0004]本申请的一个目的是提供一种代码处理方法、设备及系统,至少用以部分解决目前的WASM代码部署方式灵活不足,可能将WASM代码部署至不适合其运行的边缘节点、不能够合理地利用不同类型的边缘节点的资源的问题

Benefits of technology

[0036]本申请实施例还提供了一种WASM代码的处理系统,其特征在于,该系统应用于边缘云网络,包括中心节点和边缘节点,所述中心节点和边缘节点分别执行前述的WASM代码的处理方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116775262B_ABST
    Figure CN116775262B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a WASM code processing method, device and system. In the process of processing WASM code, the scheme can realize the compilation and release of WASM code according to the customized processing strategy of an application program or a function, so that the on-demand compilation and on-demand release of WASM code can be realized, the deployment of WASM code is more flexible, and the WASM code is avoided from being deployed to an edge node that is not suitable for running. In addition, the edge node is determined by the scheduling module according to the customized processing strategy of the WASM code determined by the related information of the first application program or function, and is indicated to the edge node accessed by the requestor, so that the on-demand running of the WASM code can be realized based on the customized processing strategy, and the resources in different types of edge nodes can be reasonably utilized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, and in particular to a method, device and system for processing WASM code. Background Technology

[0002] WASM, or WebAssembly, is a technology that allows code to be written in non-JavaScript programming languages ​​and run in a browser. Currently, when most WASM code is deployed in edge cloud networks, the central node determines whether the WASM code is compatible with the edge node's capabilities based on pre-configured settings. This determination method is relatively simple and lacks flexibility. Therefore, WASM code may be compiled by the central node and deployed to edge nodes that are not suitable for running.

[0003] Furthermore, edge cloud networks lack personalized code execution schemes and often opt to execute uniformly on the nearest edge nodes, thus failing to make reasonable use of the resources of different types of edge nodes. Summary of the Invention

[0004] One objective of this application is to provide a code processing method, device, and system that at least partially addresses the current inflexibility of WASM code deployment methods, which may lead to the deployment of WASM code to edge nodes unsuitable for its operation and the inability to reasonably utilize the resources of different types of edge nodes.

[0005] To achieve the above objectives, some embodiments of this application provide a method for processing WASM code, which is applied to the central node or edge node of an edge cloud network, including:

[0006] Retrieve the WASM code of the application or function uploaded by the developer;

[0007] Determine the customized processing strategy for the WASM code based on the relevant information of the application or function;

[0008] The WASM code is compiled according to the customized processing strategy to obtain WASM bytecode, and the WASM bytecode is distributed to the first edge node in the edge cloud network.

[0009] This application also provides a method for processing WASM code, which is applied to edge nodes of an edge cloud network, including:

[0010] Obtain WASM bytecode distributed by the central node or other edge nodes, wherein the WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, the customized processing strategy of the WASM code is determined according to the relevant information of the application or function;

[0011] Code deployment is completed based on the compiled WASM bytecode.

[0012] This application also provides a method for processing WASM code, which is applied to edge nodes of an edge cloud network, including:

[0013] Receive WASM code call requests or external events for a service targeting a first application or function;

[0014] Respond to the call request or external event;

[0015] The edge node is determined by the scheduling module based on the customized processing strategy of the WASM code determined by the relevant information of the first application or function, and is then indicated to the requesting party as the edge node to be accessed.

[0016] This application also provides a method for processing WASM code, which is applied to the scheduling module of an edge cloud network. The method includes:

[0017] Retrieve the WASM code of the service for the first application or function from the call request or external event;

[0018] The second edge node is determined based on the customized processing strategy of the WASM code determined according to the relevant information of the first application or function;

[0019] The call request or external event is assigned to a second edge node so that the second edge node can respond to the call request or external event.

[0020] This application embodiment also provides a WASM code processing device, wherein the device is a central node or edge node of an edge cloud network, including:

[0021] The first receiving module is used to obtain the WASM code of the application or function uploaded by the developer;

[0022] The first processing module is used to determine a customized processing strategy for the WASM code based on relevant information of the application or function; and to compile the WASM code according to the customized processing strategy to obtain WASM bytecode.

[0023] The first sending module is used to distribute the WASM bytecode to the first edge node in the edge cloud network.

[0024] This application embodiment also provides a WASM code processing device, wherein the device is an edge node of an edge cloud network, comprising:

[0025] The second receiving module is used to obtain WASM bytecode distributed by the central node or other edge nodes. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to the relevant information of the application or function, by determining the customized processing strategy of the WASM code.

[0026] The second processing module is used to deploy code based on the compiled WASM bytecode.

[0027] This application embodiment also provides a WASM code processing device, wherein the device is an edge node of an edge cloud network, comprising:

[0028] The third receiving module is used to receive WASM code call requests or external events for services targeting the first application or function;

[0029] The third processing module is used to respond to the call request or external event, wherein the edge node is determined by the scheduling module based on the customized processing strategy of the WASM code determined by the relevant information of the first application or function and is indicated to the edge node accessed by the requester.

[0030] This application embodiment also provides a WASM code processing device, which is a scheduling module for an edge cloud network, and the device includes:

[0031] The fourth receiving module is used to obtain WASM code call requests or external events for services targeting the first application or function;

[0032] The fourth processing module is used to determine the second edge node based on the customized processing strategy of the WASM code determined by the relevant information of the first application or function;

[0033] The fourth sending module is used to distribute the call request or external event to the second edge node, so that the second edge node can respond to the call request or external event.

[0034] This application embodiment also provides a WASM code processing device, which includes a memory for storing computer-readable instructions and a processor for executing the computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, the device is triggered to execute the WASM code processing method.

[0035] This application also provides a computer-readable medium storing computer-readable instructions that can be executed by a processor to implement the WASM code processing method.

[0036] This application also provides a WASM code processing system, characterized in that the system is applied to an edge cloud network, including a central node and edge nodes, wherein the central node and edge nodes respectively execute the aforementioned WASM code processing method.

[0037] This application also provides a WASM code processing system, characterized in that the access processing system is applied to an edge cloud network, including edge nodes and a scheduling module, wherein the edge nodes and the scheduling module respectively execute the aforementioned WASM code processing method.

[0038] Compared to existing technologies, the WASM code processing scheme provided in this application embodiment allows the central or edge node of the edge cloud network to obtain the WASM code of an application or function uploaded by the developer. Then, based on the relevant information of the application or function, a customized processing strategy for the WASM code is determined. Following this customized processing strategy, the WASM code is compiled to obtain WASM bytecode, which is then distributed to the first edge node in the edge cloud network. Because the compilation and distribution of the WASM code are based on the customized processing strategy of the application or function during processing, on-demand compilation and deployment of the WASM code can be achieved, making WASM code deployment more flexible and avoiding deployment of WASM code to edge nodes unsuitable for its operation.

[0039] Furthermore, this application embodiment also provides another WASM code processing scheme. In this scheme, after the edge nodes of the edge cloud network complete the WASM code deployment, they can receive WASM code call requests or external events for services of a first application or function, and respond to the call requests or external events. Since the edge nodes are determined and indicated to the requesting party by the scheduling module based on the customized processing strategy of the WASM code determined according to the relevant information of the first application or function, the on-demand execution of the WASM code can be achieved based on the customized processing strategy, thereby making reasonable use of resources in different types of edge nodes. Attached Figure Description

[0040] Figure 1 A flowchart illustrating the processing method of WASM code provided in this application embodiment when applied to the central node or edge node of an edge cloud network;

[0041] Figure 2 A flowchart illustrating the processing method of WASM code provided in this application embodiment when applied to edge nodes of an edge cloud network;

[0042] Figure 3 A flowchart illustrating the processing of another WASM code processing method provided in this application embodiment when applied to an edge node of an edge cloud network;

[0043] Figure 4 A flowchart illustrating the processing method of another WASM code provided in this application embodiment when applied to the scheduling module of an edge cloud network;

[0044] Figure 5 A flowchart illustrating the overall process of deploying and processing WASM code using the solution provided in this application's embodiments;

[0045] Figure 6 A schematic diagram of the structure of a WASM code processing device provided in an embodiment of this application;

[0046] Figure 7 A schematic diagram of the structure of a WASM code processing device provided in an embodiment of this application;

[0047] Figure 8 A schematic diagram of the structure of a WASM code processing device provided in an embodiment of this application;

[0048] Figure 9 A schematic diagram of the structure of a WASM code processing device provided in an embodiment of this application;

[0049] Figure 10 This is a schematic diagram of the structure of another WASM code processing device provided in an embodiment of this application. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0051] In a typical configuration of this application, the terminal and the service network devices each include one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0052] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0053] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable 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 technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0054] In the WASM code processing method provided in this application embodiment, the WASM code is compiled and deployed according to the customized processing strategy of the application or function. Therefore, on-demand compilation and on-demand deployment of WASM code can be realized, making WASM code deployment more flexible and avoiding deployment of WASM code to edge nodes that are not suitable for its operation.

[0055] Figure 1 This paper illustrates a processing flow of a WASM code processing method provided in an embodiment of this application. This method can be applied to edge cloud networks. The edge cloud network is a cloud computing platform built on edge infrastructure based on the core of cloud computing technology and edge computing capabilities, forming a comprehensive elastic cloud platform with capabilities in computing, networking, storage, security, and applications at the edge location. Therefore, the method provided in this embodiment can be applied to edge nodes or central nodes of an edge cloud network, and may include at least the following processing steps:

[0056] Step S101: Obtain the WASM code of the application or function uploaded by the developer. In practical scenarios, to facilitate the upload of WASM code by developers, the central node or edge node can provide developers with a graphical user interface (GUI) for human-computer interaction. This allows developers to display the GUI through a client program on the user's device or a browser, and upload the WASM code of the application or function through the relevant interactive controls in the GUI.

[0057] In this embodiment, when obtaining the WASM code of an application or function uploaded by a developer, the central node or edge node can directly receive the WASM code. For example, the developer can pre-convert the native language code of the application or function into the corresponding WASM code before uploading, and then upload the converted WASM code to the central node or edge node. Alternatively, the central node or edge node can also receive the native language code of the application or function uploaded by the developer and convert the native language code into WASM code. In this method, the developer does not need to pre-convert the native language code of the application or function into the corresponding WASM code, but can directly upload the native language code to the central node or edge node, which will then convert it to obtain the WASM code of the application or function. Therefore, this embodiment provides developers with multiple optional WASM code upload methods, namely, directly uploading unconverted native language code or uploading converted WASM code, giving developers more diverse choices when uploading, thereby improving the developer's user experience.

[0058] Step S102: Determine the customized processing strategy for the WASM code based on the relevant information of the application or function. When the central node or edge node obtains the WASM code of the application or function uploaded by the developer, it can simultaneously obtain the relevant information of the application or function. For example, in a real-world scenario, a graphical user interface can prompt the developer to submit the relevant information of the application or function when uploading the code.

[0059] The relevant information may include the original development language used by the application or function and / or the application scenario and / or computing power requirements. The original development language refers to the programming language used by the developer when writing the native language code of the application or function, such as C, C++, Go, or Javascript. The application scenario is related to the specific purpose of the WASM code corresponding to the application or function after deployment or the type of business it needs to participate in. For example, if the WASM code corresponding to the application or function is used for image parsing in face recognition after deployment, then the application scenario of the WASM code can be determined as an image parsing scenario. The computing power requirements information is related to the specific computing power resources required by the WASM code corresponding to the application or function during actual operation. For example, if the WASM code corresponding to a certain application or function requires a large amount of GPU resources during operation, then its resource requirements information can be determined as GPU resources. In addition, computing power resources can also be CPU, memory, storage space, I / O resources, etc. In practical scenarios, the relevant information can be any one or any combination of several specific information items such as the original development language, application scenario, and computing power requirements. In this regard, those skilled in the art should understand that the specific content of the above-mentioned application or function information is only an example. Other forms based on similar principles that exist or will appear in the future and are applicable to this application should also be included within the scope of protection of this application and are incorporated herein by reference.

[0060] Step S103: Compile the WASM code according to the customized processing strategy to obtain WASM bytecode, and distribute the WASM bytecode to the first edge node in the edge cloud network.

[0061] In some embodiments of this application, the customized processing strategy includes at least one of a compilation strategy and a distribution strategy. The compilation strategy generates WASM bytecode corresponding to the WASM code and operates on the compilation process of compiling the WASM code to obtain the WASM bytecode. The distribution strategy determines the first edge node receiving the WASM bytecode and operates on the distribution process of distributing the compiled WASM bytecode to the first edge node in the edge cloud network. Because the compilation and distribution of WASM code are implemented based on a customized processing strategy for the application or function, on-demand compilation and on-demand distribution of WASM code can be achieved, making WASM code deployment more flexible and avoiding deployment of WASM code to edge nodes unsuitable for its operation.

[0062] When the customized processing strategy includes the compilation strategy, when the central node or edge node determines the customized processing strategy of the WASM code based on the relevant information of the application or function, it can generate the unique identifier of the code based on the relevant information of the application or function, and then determine the compilation strategy based at least on the unique identifier of the code and the WASM code.

[0063] In practical scenarios, the mapping relationship between relevant information and unique code identifiers can be pre-built and stored in central or edge nodes. After obtaining relevant information, central or edge nodes can query the corresponding unique code identifier based on the mapping relationship according to the specific content. For example, for a WASM code code1, if the original development language used in the relevant information is Go, its corresponding unique code identifier can be determined as tagA1 according to the pre-configured mapping relationship. Similarly, if the application scenario in the relevant information is image parsing, the central or edge node can determine its corresponding unique code identifier as tagB2 according to the pre-configured mapping relationship. Or, if the computing power requirement information in the relevant information is GPU, its corresponding unique code identifier can be determined as tagC1 according to the pre-configured mapping relationship. Thus, central or edge nodes can generate unique code identifiers for the WASM code code1 as tagA1, tagB2, and tagC1.

[0064] Here, tagA1, tagB2, and tagC1 represent the specific requirements of the WASM code during compilation. These tags are dynamically generated based on relevant information uploaded by the developer. Based on this, the central node or edge node can determine the compilation strategy, at least according to the unique code identifier and the WASM code. This allows the central node or edge node to use the determined compilation strategy when compiling the WASM code according to the customized processing strategy to obtain WASM bytecode and distributing it to the first edge node in the edge cloud network. For example, different unique code identifiers can allow the central node or edge node to use different SDKs (Software Development Kits) or WASM OCI (Open Container Initiative) configurations when compiling the WASM code, thereby obtaining different compilation results. This enables on-demand compilation of WASM code and optimizes the execution capability of the application or function after compilation.

[0065] When the customized processing strategy includes a release strategy, when the central node or edge node determines the customized processing strategy for the WASM code based on the relevant information of the application or function, it can generate a unique identifier for the code based on the relevant information of the application or function, and then determine the release strategy based at least on the unique identifier for the code, the service type supported by the edge node, and the computing power of the edge node.

[0066] Similarly, in this embodiment, the mapping relationship between relevant information and unique code identifiers can also be pre-built and stored in the central node or edge node. For another WASM code code2, if the application scenario in the relevant information is speech recognition, the central node or edge node can determine its corresponding unique code identifier as tagB4 based on the pre-configured mapping relationship. Alternatively, if the computing power requirement information in the relevant information is CPU, then its corresponding unique code identifier can be determined as tagC2 based on the pre-configured mapping relationship. Thus, the central node or edge node can generate unique code identifiers for the WASM code code2 as tagB4 and tagC2.

[0067] At this point, the central node or edge node can determine the deployment strategy based at least on one of the following: the unique code identifier, the service type supported by the edge node, and the computing power of the edge node. This allows the central node or edge node to distribute the WASM bytecode to the first edge node in the edge cloud network after compiling the WASM code according to the customized processing strategy. The first edge node is the edge node in the edge cloud network suitable for deploying the WASM code, determined based on the unique code identifier, the service type supported by the edge node, and the computing power of the edge node. For example, in a practical scenario, the service type and computing power of all available edge nodes in the edge cloud network can be matched with the unique code identifier. If a matching available edge node exists, that edge node is designated as the first edge node, and the compiled WASM bytecode is then distributed to the first edge node. This achieves on-demand deployment of the WASM code.

[0068] Custom processing strategies, such as compilation and release strategies, can be pre-configured according to the needs of the actual scenario. For example, n compilation strategies and m release strategies can be pre-configured. After obtaining relevant information about the application or function, the central or edge node can determine a suitable custom processing strategy based on this information. In a real-world scenario, the specific method for determining the custom processing strategy can be based on matching relevant information with pre-configured custom processing strategies, thereby selecting at least one suitable custom processing strategy from multiple configured strategies.

[0069] Taking n pre-configured compilation strategies in the customized processing strategy as an example, the central node or edge node can generate the unique code identifier based on the relevant information of the application or function. Then, using the unique code identifier and the WASM code as the matching criteria, a suitable compilation strategy is determined from the n configured compilation strategies to implement the compilation process of the WASM code. Taking m pre-configured release strategies in the customized processing strategy as an example, the central node or edge node can generate the unique code identifier based on the relevant information of the application or function. Then, using the unique code identifier and one of the following as the matching criteria—the business type supported by the edge node and the computing power of the edge node—a suitable release strategy is determined from the m configured release strategies to implement the release process of the WASM bytecode.

[0070] In some embodiments of this application, the customized processing strategy further includes a running strategy. This running strategy is used to receive a call request or external event for the WASM code of the application or function's service when the service needs to be invoked and the edge node is the optimal service node, and to respond to the call request or external event. The running strategy can be used to determine whether an edge node with deployed WASM code is the optimal service node when the service of the corresponding application or function is invoked. A service node refers to an edge node that has the WASM bytecode corresponding to the application or function and can be invoked to respond to the call request or external event for the application or function. The optimal service node is the service node among all service nodes that best meets the requirements corresponding to the running strategy.

[0071] For example, for an edge node 'node1' deployed with WASM code, when the service of the corresponding application or function needs to be invoked, and edge node1 is the optimal service node, then edge node1 can receive the invocation request or external event of the WASM code for the service of that application or function, and respond to the invocation request or external event. However, when the running strategy determines that edge node1 is not the optimal service node, the possible reasons could be mismatched computing power, mismatched business type, or insufficient distance from the requester. In this case, even if edge node1 has completed the compilation and release of the corresponding WASM bytecode, it will not receive the invocation request or external event of the WASM code for the service of that application or function, and will not respond to the invocation request or external event. Thus, on-demand code execution is achieved, ensuring that code invocations conform to the running strategy, thereby improving the more rational utilization of resources on each edge node.

[0072] In some embodiments of this application, before the central node or edge node compiles the WASM code according to the customized processing strategy to obtain WASM bytecode and distributes the WASM bytecode to the first edge node in the edge cloud network, the WASM bytecode can be tested in a test environment to obtain the test results. Then, the customized processing strategy of the WASM code is updated based on the test results. Thus, the central node can use a test run approach to update the initially determined customized processing strategy, making the customized processing strategy more accurate and reasonable. Therefore, when compiling, distributing, and running WASM code on demand, results that better meet the needs of actual operating scenarios can be obtained, resulting in stronger execution capabilities of applications or functions, enabling them to run in more suitable edge nodes and provide services to users.

[0073] In other embodiments of this application, before the central node or edge node compiles the WASM code according to the customized processing strategy to obtain WASM bytecode and distributes the WASM bytecode to the first edge node in the edge cloud network, it can also perform a security check on the WASM bytecode in a test environment to determine if the WASM bytecode passes the security check. Since in real-world scenarios, WASM code is uploaded to the central node or edge node by developers, it cannot be guaranteed that every developer's uploaded WASM code is secure. Therefore, the central node or edge node can perform a security check on the WASM bytecode in a test environment before distribution and deployment. Only WASM bytecode that passes the security check will be distributed by the central node or edge node to the first edge node in the edge cloud network; WASM bytecode that fails the security check will not be distributed and deployed, thereby ensuring the security of the edge cloud network.

[0074] During security checks, if the WASM bytecode fails the security check, the central node or edge node can return a notification to the developer, informing them that the uploaded WASM code has not been successfully deployed. In practical scenarios, the notification may include the results of the security check and the reasons for the failure, allowing the developer to modify the WASM code accordingly and successfully complete the deployment.

[0075] After the central node or edge node completes the compilation of the WASM bytecode, it can perform security checks and trial runs in the test environment. After completing the security checks and trial runs, the WASM bytecode is then distributed to the first edge node in the edge cloud network. This ensures the security of the edge cloud network while enabling more accurate on-demand deployment and operation.

[0076] In real-world scenarios, during the distribution of WASM bytecode from a central node or edge node to a first edge node, the WASM bytecode may be maliciously intercepted and modified, leading to security vulnerabilities in the WASM bytecode actually received by the first edge node. Therefore, in the solution of this application embodiment, when the central node or edge node compiles the WASM code according to the customized processing strategy to obtain WASM bytecode and distributes it to the first edge node in the edge cloud network, it can first compile the WASM code according to the customized processing strategy to obtain WASM bytecode, then encrypt the WASM bytecode to obtain ciphertext, and then distribute the ciphertext of the WASM bytecode to the first edge node in the edge cloud network. This allows the first edge node to decrypt the ciphertext based on a preset key after receiving it, obtaining the corresponding WASM bytecode, instead of directly sending the plaintext WASM bytecode. Because of the encrypted transmission method, even if the ciphertext is maliciously intercepted, the WASM bytecode cannot be modified due to the lack of a corresponding decryption method, thus ensuring the security of the code deployment.

[0077] The encryption method can be selected according to the needs of the actual scenario, such as random encryption algorithms or asymmetric encryption algorithms. Taking asymmetric encryption algorithms as an example, the central node or edge node can pre-generate private and public keys, and distribute the public key to the edge nodes in the edge cloud network. After compiling and obtaining WASM bytecode and completing security verification and trial operation, the private key is used to encrypt the WASM bytecode to obtain the ciphertext of the WASM bytecode. The ciphertext of the WASM bytecode is then distributed to the first edge node in the edge cloud network. After receiving the ciphertext, the first edge node can decrypt the ciphertext based on the pre-obtained public key to obtain the WASM bytecode, thereby completing the code deployment.

[0078] Furthermore, in addition to encrypted transmission, integrity verification can be added to address the verification of whether the WASM bytecode is complete and has not been tampered with. For example, in some embodiments of this application, before distributing the WASM bytecode, the central node or edge node can use a pre-agreed hash algorithm to calculate the digest information of the WASM bytecode. This digest information, along with the WASM bytecode, is then encrypted and sent to the edge node that meets the operational requirements. The edge node can then decrypt the ciphertext to obtain the digest information and the WASM bytecode. At this point, the edge node can use the same hash algorithm to perform a hash calculation on the WASM bytecode. If the calculated digest information matches the received digest information, it indicates that the WASM bytecode is complete and has not been tampered with, i.e., it passes the integrity verification and can be deployed. Otherwise, it indicates that the WASM bytecode has failed the integrity verification and will be discarded, and deployment will not proceed. This mechanism effectively avoids the problem of malicious interception and modification of the WASM bytecode during transmission, thereby improving the security of WASM code deployment.

[0079] Figure 2 The present invention illustrates a processing flow of a WASM code processing method provided in an embodiment of this application. The method is applied to edge nodes of an edge cloud network and includes the following processing steps:

[0080] Step S201: Obtain WASM bytecode distributed by the central node or other edge nodes. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to the relevant information of the application or function, by determining the customized processing strategy of the WASM code.

[0081] Step S202: Deploy the code based on the compiled WASM bytecode, thereby realizing on-demand release of WASM code.

[0082] Furthermore, when edge nodes receive WASM bytecode distributed by the central node or other edge nodes, they can also receive ciphertext related to the WASM bytecode distributed by the central node or other edge nodes. This ciphertext is obtained by the central node or other edge node encrypting the WASM bytecode. After obtaining the ciphertext, it can be decrypted using a preset key to obtain the corresponding WASM bytecode. Therefore, by pre-encrypting and then decrypting upon receipt, the security of data transmission is improved.

[0083] Based on the code deployment using the above-described scheme, this application also provides another method for processing WASM code. This method can be applied to edge nodes of an edge cloud network to process code call requests or external events. The processing flow is as follows: Figure 3 As shown, it includes at least the following processing steps:

[0084] Step S301: Receive a call request or external event from the WASM code of a service for a first application or function. The first application or function is the target application or function to be called by the call request or external event. The edge node can respond to the call request or external event by running the WASM bytecode corresponding to the first application or function.

[0085] Step S302: Respond to the call request or external event.

[0086] Both the access request and the external event can include data to be processed. When the WASM bytecode is executed, it can generate a processing result based on this data and return it to the initiating device of the access request or external event or a pre-defined target device, thereby completing the response to the call request or external event. The initiating device of the access request or external event can be various user terminal devices, such as computers, mobile phones, and smartwatches, or various Internet of Things (IoT) devices, or other computing nodes in a distributed network (such as other edge nodes). The target device can be any user terminal device, IoT device, or other computing node determined according to actual business needs.

[0087] In different application scenarios, the code invoked for a call request or external request varies. The access request can be a message with a clear processing purpose, requiring the result to be processed within the scope of the initiating device. For example, if the initiating device initiates an image processing request, the edge node, upon receiving the access request, will scale the image, add a watermark, and finally return the scaled and watermarked image to the initiating device. Similarly, if the initiating device initiates a face recognition access request, when edge node1 receives the request, it can forward the return request to edge node2. Edge node2 will then receive the access request forwarded from other edge nodes, identify the face image or facial feature information carried in the access request, determine the corresponding identity information, and return the identity information as the processing result directly or via edge node1 to the initiating device. Here, the initiating device can be a surveillance camera, a computer, a mobile phone, or other IoT devices that require data processing.

[0088] The external event can be a message used to notify specific event information. Taking a temperature alarm event sent by a temperature sensor of a power generation device as an example, after receiving the event information, the edge node processes the specific content of the temperature alarm event and does not need to return the processed result to the initiating device (i.e., the temperature sensor). Instead, it can return the processed result to the corresponding target device. For example, if the specific content of the temperature alarm event is that the temperature exceeds a threshold, the edge node can generate a control command to shut down the power generation device based on this information and send the control command to the control terminal of the power generation device. In this case, the control terminal is the target device.

[0089] It should be understood by those skilled in the art that the specific forms of the above-mentioned access requests and external events are merely examples, and other forms based on similar principles that exist or will appear in the future and are applicable to this application should also be included within the scope of protection of this application and are incorporated herein by reference.

[0090] In this method, the edge node executing the method is determined by the scheduling module based on a customized processing strategy for the WASM code, which is determined by the relevant information of the first application or function, and then instructed to the edge node accessed by the requester. Therefore, on-demand execution of the WASM code can be achieved based on the customized processing strategy, thereby ensuring smoother and more efficient processing of call requests or external events.

[0091] Figure 4 The document illustrates a processing flow for WASM code in a scheduling module applied to an edge cloud network, including at least the following processing steps:

[0092] Step S401: Obtain the WASM code call request or external event for the service of the first application or function.

[0093] Step S402: Determine the second edge node based on the customized processing strategy of the WASM code determined according to the relevant information of the first application or function.

[0094] Step S403: Assign the call request or external event to the second edge node so that the second edge node can respond to the call request or external event.

[0095] The customized processing strategy may include an execution strategy. Therefore, when the scheduling module determines the second edge node based on the customized processing strategy of the WASM code determined according to the relevant information of the first application or function, it can also determine the execution strategy of the WASM code based on the relevant information of the first application or function, and then determine the second edge node based on the execution strategy. The second edge node is the optimal service node for the service of the application or function to be invoked. Since the second edge node determined by the scheduling module is an edge node in the edge cloud network suitable for processing the call request or external event, on-demand execution of the WASM code can be achieved, thereby ensuring smoother and more efficient processing of call requests or external events.

[0096] Taking a call request as an example, in a face recognition scenario, a call request can be a processing request issued by a terminal device to perform image analysis on the images it has acquired. In this case, the code that the user's call request needs to invoke is the code of the first application or function used to implement image analysis. By using the relevant information of the first application or function, its corresponding customized processing strategy can be determined, including the application scenario being image recognition and the computing power requirement being GPU, etc. The scheduling module can determine a suitable edge node, node1, based on the customized processing strategy. This node1 is the second edge node in this embodiment. Therefore, the scheduling module can instruct the requester that the edge node, node1, is the optimal service node for the call request, thereby allocating the request to this edge node so that the second edge node can respond to the call request.

[0097] Figure 5 The overall flow of WASM code processing using the solution provided in this application embodiment is illustrated. The devices involved in this solution include at least a central node 510, an edge node 520, an edge node 530, a developer client 540, a user client 550, and a scheduling module 560. The interaction process between the above devices includes:

[0098] In step S501, the developer client 540 uploads the native language code or WASM code of the application or function developed by the developer to the central node 510. During the upload, relevant information about the application or function can be included, such as the original development language, application scenario, and resource requirements of the WASM code. For example, in this embodiment, the relevant information of the WASM code uploaded by the developer may include: original development language: Go programming language, application scenario: image parsing, and resource requirements: GPU consumption. When native language code is uploaded, the central node converts the received native language code into WASM code.

[0099] In step S502, the central node 510 determines different processing customization strategies based on relevant information. These customized processing strategies may include at least a compilation strategy, a release strategy, and a runtime strategy. In this step, the WASM code is compiled according to the compilation strategy within the processing customization strategy to obtain WASM bytecode.

[0100] In step S503, after compiling the WASM bytecode, the central node 510 distributes it to the test environment for security checks and trial runs, and returns the results of the security checks and trial runs. The results of the trial runs are used to update the runtime requirements of the WASM code, while the results of the security checks are used as the basis for determining whether to continue subsequent processing. If the security check fails, a prompt message is returned to the developer client; if the security check passes, the process continues to the next step, S504.

[0101] In real-world scenarios, the information about WASM bytecode generated by the above steps, such as resource identification information, code identification, and runtime requirements, can all be used as metadata for the WASM bytecode and distributed along with the WASM bytecode to the edge nodes to be deployed.

[0102] In step S504, before sending WASM bytecode and metadata to the edge nodes, the central node 510 can encrypt the WASM bytecode and metadata to prevent the communication process between the central node and the edge nodes from being maliciously cracked.

[0103] In step S505, the central node 510 sends the encrypted WASM bytecode and metadata to the appropriate edge nodes according to the distribution strategy in the customized processing strategy. For example, if the WASM bytecode requires a large amount of GPU resources to run, it will be distributed to the edge node 520 that can provide a large amount of GPU resources. If the WASM bytecode requires a large amount of memory resources to run, it will be distributed to the edge node 530 that can provide a large amount of memory resources, thereby making more rational use of resources in different types of edge nodes.

[0104] In step S506, after receiving the encrypted WASM bytecode and metadata, the edge node decrypts it using the key obtained in advance through communication with the central node, and then verifies the data integrity (e.g., whether the data is complete, whether it has been tampered with, and other trust issues). After passing the verification, the code can be deployed.

[0105] In step S507, when user client 550 accesses the services provided by the edge cloud network, it will send a call request or external event to the edge cloud network.

[0106] In step S508, the scheduling module 560 of the edge cloud network can schedule call requests or external events according to the operation strategy and allocate them to edge nodes that can serve as the optimal service nodes.

[0107] Step S509: The optimal service node invokes the corresponding WASM bytecode to respond to the call request or external event and returns the processing result. Since the aforementioned operating strategy can be used to receive call requests or external events for the WASM code of the application or function's service when the application or function's service needs to be invoked, and the central node or edge node is the optimal service node, it allows the WASM bytecode to run on demand, ensuring smoother and more efficient processing of call requests or external events.

[0108] This application provides a WASM code processing device, which can be a central node or an edge node of an edge cloud network, and its structure is as follows. Figure 6 As shown, the system includes at least a first receiving module 610, a first processing module 620, and a first sending module 630. The first receiving module 610 is used to acquire the WASM code of an application or function uploaded by the developer. The first processing module 620 is used to determine a customized processing strategy for the WASM code based on relevant information of the application or function; and to compile the WASM code according to the customized processing strategy to obtain WASM bytecode. The first sending module 630 is used to distribute the WASM bytecode to a first edge node in the edge cloud network.

[0109] The first receiving module is used to directly receive the WASM code of the application or function uploaded by the developer; or to receive the native language code of the application or function uploaded by the developer and convert the native language code into WASM code.

[0110] The relevant information includes the original development language used by the application or function and / or the application scenario and / or computing power requirements.

[0111] The customized processing strategy includes at least one of a compilation strategy and a release strategy. The compilation strategy is used to generate WASM bytecode corresponding to the WASM code. The release strategy is used to determine the first edge node that receives the WASM bytecode.

[0112] When the customized processing strategy includes the compilation strategy, the first processing module is used to generate the unique code identifier based on the relevant information of the application or function; and at least based on the unique code identifier and the WASM code, determine the compilation strategy.

[0113] When the customized processing strategy includes a release strategy, the first processing module is used to generate the unique code identifier based on the relevant information of the application or function; and to determine the release strategy based at least on the unique code identifier, the service type supported by the edge node, and the computing power of the edge node.

[0114] The customized processing strategy also includes a running strategy; the running strategy is used to receive, through the first receiving module, a call request or external event for the WASM code of the service of the application or function when the service of the application or function needs to be called and the central node or edge node is the optimal service node; and to respond to the call request or external event through the first processing module.

[0115] The first processing module is further configured to, before compiling the WASM code according to the customized processing strategy to obtain WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, test the WASM bytecode in a test environment and obtain the test results; and update the customized processing strategy of the WASM code according to the test results.

[0116] The first processing module is further configured to perform a security check on the WASM bytecode in a test environment before compiling the WASM code according to the customized processing strategy to obtain the WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, and to determine that the WASM bytecode passes the security check.

[0117] The first sending module is also configured to return a prompt message to the developer if the WASM bytecode fails the security check.

[0118] The first processing module is further configured to compile the WASM code according to the customized processing strategy to obtain WASM bytecode; encrypt the WASM bytecode to obtain the ciphertext of the WASM bytecode;

[0119] The first sending module is used to distribute the ciphertext of the WASM bytecode to a first edge node in the edge cloud network, so that the first edge node can decrypt the ciphertext based on a preset key after receiving the ciphertext and obtain the corresponding WASM bytecode.

[0120] This application also provides another WASM code processing device, which is an edge node of an edge cloud network, and its structure is as follows: Figure 7 As shown, the system includes a second receiving module 710 and a second processing module 720. The second receiving module 710 is used to acquire WASM bytecode distributed by the central node or other edge nodes. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to relevant information of the application or function, by determining a customized processing strategy for the WASM code. The second processing module 720 is used to complete code deployment based on the compiled WASM bytecode.

[0121] The second receiving module is used to receive ciphertext about WASM bytecode distributed by the central node or other edge nodes, the ciphertext being obtained by the central node or other edge nodes encrypting the WASM bytecode; and to decrypt the ciphertext based on a preset key to obtain the corresponding WASM bytecode.

[0122] This application also provides a WASM code processing device, wherein the access processing device is an edge node of an edge cloud network, and its structure is as follows: Figure 8 As shown, the edge node includes a third receiving module 810 and a third processing module 820. The third receiving module 810 is used to receive a call request or external event for the WASM code of a service for a first application or function; the third processing module 820 is used to respond to the call request or external event, wherein the edge node is determined and indicated to the requesting party by the scheduling module based on the customized processing strategy of the WASM code determined according to the relevant information of the first application or function.

[0123] This application embodiment also provides another WASM code processing device, wherein the access processing device is a scheduling module of an edge cloud network, and its structure is as follows: Figure 9As shown, the scheduling module includes a fourth receiving module 910, a fourth processing module 920, and a fourth sending module 930. Specifically, the fourth receiving module 910 is used to acquire call requests or external events from WASM code for a service of a first application or function; the fourth processing module 920 is used to determine a second edge node based on a customized processing strategy for the WASM code determined according to relevant information of the first application or function; and the fourth sending module 930 is used to allocate the call requests or external events to the second edge nodes, so that the second edge nodes can respond to the call requests or external events.

[0124] The fourth processing module is used to determine the execution strategy of the WASM code based on the relevant information of the first application or function; and to determine a second edge node based on the execution strategy, wherein the second service node is the optimal service node for the service of the application or function to be invoked.

[0125] In some embodiments of this application, a WASM code processing system is also provided. This system is applied to an edge cloud network and includes a central node and edge nodes. The central node and edge nodes respectively execute the WASM code processing method in the aforementioned scheme to realize the deployment of WASM code.

[0126] In some other embodiments of this application, a WASM code processing system is also provided. This system is applied to an edge cloud network and includes an edge node and a scheduling module. The edge node and the scheduling module respectively execute the WASM code processing method in the aforementioned scheme to realize the call request or external event response after the WASM code is deployed.

[0127] Furthermore, embodiments of this application also provide a WASM code processing device, the structure of which is as follows: Figure 10 As shown, the device includes a memory 1010 for storing computer-readable instructions and a processor 1020 for executing the computer-readable instructions. When the computer-readable instructions are executed by the processor, the device is triggered to execute the aforementioned WASM code processing method.

[0128] The methods and / or embodiments in this application can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. When the computer program is executed by a processing unit, it performs the functions defined in the methods of this application.

[0129] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0130] In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, capable of transmitting, propagating, or transmitting a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.

[0131] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0132] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0133] In another aspect, embodiments of this application also provide a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The aforementioned computer-readable medium carries one or more computer-readable instructions, which may be executed by a processor to implement the steps of the methods and / or technical solutions of the various embodiments of this application.

[0134] Furthermore, this application also provides a computer program stored in a computer device, which causes the computer device to execute the method for executing the control code.

[0135] It should be noted that this application can be implemented in software and / or a combination of software and hardware, for example, using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. Furthermore, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.

[0136] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, 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 recited in the apparatus claims may also be implemented by a single unit or device in software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.

Claims

1. A method for processing WASM code, characterized in that, The method is applied to the central node or any edge node of the edge cloud network, including: Retrieve the WASM code of the application or function uploaded by the developer; A customized processing strategy for the WASM code is determined based on relevant information about the application or function. This relevant information includes the application scenario and / or computing power requirements of the application or function. The customized processing strategy includes a compilation strategy and a deployment strategy. The compilation strategy is used to generate WASM bytecode corresponding to the WASM code. The compilation strategy is determined based on the unique code identifier of the WASM code generated according to the relevant information of the application or function, and at least based on the unique code identifier and the WASM code. The deployment strategy is used to determine the first edge node to receive the WASM bytecode. The deployment strategy is determined based on the unique code identifier of the WASM code generated according to the relevant information of the application or function, and at least based on the unique code identifier, the service type supported by the edge node, and the computing power processing capability of the edge node. The WASM code is compiled according to the customized processing strategy to obtain WASM bytecode, and the WASM bytecode is distributed to the first edge node in the edge cloud network. When the method is applied to any edge node, the first edge node is another edge node in the edge cloud network that is different from the edge node that executes the method.

2. The method according to claim 1, characterized in that, The process of obtaining the WASM code of the application or function uploaded by the developer includes: Directly receive WASM code for applications or functions uploaded by developers; or, Receive native language code for applications or functions uploaded by developers and convert the native language code into WASM code.

3. The method according to claim 1, characterized in that, The method further includes: The customized processing strategy also includes an execution strategy; The operating strategy is used to receive WASM code call requests or external events for the services of the application or function when the service of the application or function needs to be called and the edge node that has completed code deployment is the optimal service node. Respond to the call request or external event.

4. The method according to claim 1, characterized in that, Before compiling the WASM code according to the customized processing strategy to obtain WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, the process also includes: The WASM bytecode was tested in a test environment, and the test results were obtained. The customized processing strategy for the WASM code is updated based on the trial run results.

5. The method according to claim 1, characterized in that, Before compiling the WASM code according to the customized processing strategy to obtain WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, the process also includes: The WASM bytecode was subjected to a security check in a test environment to determine that the WASM bytecode passed the security check.

6. The method according to claim 5, characterized in that, The method further includes: If the WASM bytecode fails the security check, a warning message is returned to the developer.

7. The method according to claim 1, characterized in that, After compiling the WASM code according to the customized processing strategy to obtain WASM bytecode, the WASM bytecode is distributed to the first edge node in the edge cloud network, including: The WASM code is compiled according to the customized processing strategy to obtain WASM bytecode. The WASM bytecode is encrypted to obtain the ciphertext of the WASM bytecode; The ciphertext of the WASM bytecode is distributed to the first edge node in the edge cloud network, so that the first edge node, upon receiving the ciphertext, decrypts the ciphertext based on a preset key to obtain the corresponding WASM bytecode.

8. A method for processing WASM code, characterized in that, The method is applied to the first edge node of the edge cloud network, including: The process involves acquiring WASM bytecode distributed by a central node or other edge nodes. The WASM bytecode is generated by the central node or other edge nodes based on the WASM code of an application or function uploaded by a developer. The central node or other edge nodes determine a customized processing strategy for the WASM code based on relevant information about the application or function, compile and distribute the WASM code, and distribute the WASM code. The relevant information includes the application scenario and / or computing power requirements of the application or function. The customized processing strategy includes a compilation strategy and a distribution strategy. The compilation strategy generates the WASM bytecode corresponding to the WASM code. This compilation strategy is determined based on the unique identifier of the WASM code generated according to the relevant information of the application or function, and is based at least on the unique identifier and the WASM code itself. The distribution strategy determines the first edge node to receive the WASM bytecode. This distribution strategy is determined based on the unique identifier of the WASM code generated according to the relevant information of the application or function, and is based at least on the unique identifier, the service type supported by the edge node, and the computing power processing capability of the edge node. Code deployment is completed based on the compiled WASM bytecode.

9. The method according to claim 8, characterized in that, Obtain WASM bytecode distributed by the central node or other edge nodes, including: Receive ciphertext about WASM bytecode distributed by the central node or other edge nodes, the ciphertext being obtained by the central node or other edge nodes encrypting the WASM bytecode; The ciphertext is decrypted using a preset key to obtain the corresponding WASM bytecode.

10. A method for processing WASM code, characterized in that, The method is applied to the second edge node of the edge cloud network, including: The process involves acquiring WASM bytecode distributed by a central node or other edge nodes. The WASM bytecode is generated by the central node or other edge nodes based on the WASM code of an application or function uploaded by a developer. The central node or other edge nodes determine a customized processing strategy for the WASM code based on relevant information about the application or function, compile and distribute the WASM code, and distribute the WASM code. The relevant information includes the application scenario and / or computing power requirements of the application or function. The customized processing strategy includes a compilation strategy and a distribution strategy. The compilation strategy generates the WASM bytecode corresponding to the WASM code. This compilation strategy is determined based on the unique identifier of the WASM code generated according to the relevant information of the application or function, and is based at least on the unique identifier and the WASM code itself. The distribution strategy determines the first edge node to receive the WASM bytecode. This distribution strategy is determined based on the unique identifier of the WASM code generated according to the relevant information of the application or function, and is based at least on the unique identifier, the service type supported by the edge node, and the computing power processing capability of the edge node. Code deployment is completed based on the compiled WASM bytecode; Receive WASM code call requests or external events for a service targeting a first application or function; Respond to the call request or external event; The second edge node is determined by the scheduling module based on the customized processing strategy of the WASM code determined by the relevant information of the first application or function, and is then indicated to the requesting party as the edge node to be accessed.

11. A method for processing WASM code, characterized in that, The method is applied to the scheduling module of an edge cloud network, and the method includes: Retrieve the WASM code of the service for the first application or function from the call request or external event; Based on the relevant information of the first application or function, a customized processing strategy for the WASM code is determined, and a second edge node is determined based on the customized processing strategy. The second edge node obtains WASM bytecode distributed by the central node or other edge nodes, and completes code deployment based on the compiled WASM bytecode. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to the relevant information of the application or function, based on the customized processing strategy determined by the central node or other edge nodes. The relevant information includes the application scenario used by the application or function and / or The computing power requirement information, the customized processing strategy includes a compilation strategy and a deployment strategy. The compilation strategy is used to generate WASM bytecode corresponding to the WASM code. The compilation strategy is determined based on the relevant information of the application or function, after generating a unique code identifier for the WASM code, and at least based on the unique code identifier and the WASM code. The deployment strategy is used to determine the first edge node to receive the WASM bytecode. The deployment strategy is determined based on the relevant information of the application or function, after generating a unique code identifier for the WASM code, and at least based on the unique code identifier, the service type supported by the edge node, and the computing power processing capability of the edge node. The call request or external event is assigned to a second edge node so that the second edge node can respond to the call request or external event.

12. The method according to claim 11, characterized in that, The customized processing strategy includes the execution strategy; Based on the relevant information of the first application or function, a customized processing strategy for the WASM code is determined, and a second edge node is determined based on the customized processing strategy, including: The execution strategy of the WASM code is determined based on the relevant information of the first application or function; The second edge node is determined according to the operating strategy. The second edge node is the optimal service node where the service of the application or function is invoked.

13. A WASM code processing device, characterized in that, The device is a central node or any edge node of the edge cloud network, including: The first receiving module is used to obtain the WASM code of the application or function uploaded by the developer; The first processing module is configured to determine a customized processing strategy for the WASM code based on relevant information of the application or function; compile the WASM code according to the customized processing strategy to obtain WASM bytecode; the relevant information includes the application scenario and / or computing power requirements used by the application or function; the customized processing strategy includes a compilation strategy and a deployment strategy; the compilation strategy is used to generate the WASM bytecode corresponding to the WASM code; the compilation strategy is determined based on at least the unique code identifier and the WASM code after generating a unique code identifier for the WASM code based on relevant information of the application or function; the deployment strategy is used to determine the first edge node receiving the WASM bytecode; the deployment strategy is determined based on at least the unique code identifier and one of the following: the service type supported by the edge node and the computing power processing capability of the edge node. The first sending module is used to distribute the WASM bytecode to a first edge node in the edge cloud network. When the device is any edge node, the first edge node is another edge node in the edge cloud network that is different from the edge node that is the processing device.

14. The device according to claim 13, characterized in that, The first receiving module is used to directly receive WASM code of an application or function uploaded by the developer; or to receive native language code of an application or function uploaded by the developer and convert the native language code into WASM code.

15. The device according to claim 13, characterized in that, The customized processing strategy also includes a running strategy; the running strategy is used to receive, through the first receiving module, a call request or external event for the WASM code of the service of the application or function when the service of the application or function needs to be called and the edge node that has completed the code deployment is the optimal service node. And responding to the call request or external event through the first processing module.

16. The device according to claim 13, characterized in that, The first processing module is further configured to, before compiling the WASM code according to the customized processing strategy to obtain WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, test the WASM bytecode in a test environment and obtain the test results; and update the customized processing strategy of the WASM code according to the test results.

17. The device according to claim 13, characterized in that, The first processing module is further configured to perform a security check on the WASM bytecode in a test environment before compiling the WASM code according to the customized processing strategy to obtain the WASM bytecode and distributing the WASM bytecode to the first edge node in the edge cloud network, and to determine that the WASM bytecode passes the security check.

18. The device according to claim 17, characterized in that, The first sending module is also configured to return a prompt message to the developer if the WASM bytecode fails the security check.

19. The device according to claim 13, characterized in that, The first processing module is further configured to compile the WASM code according to the customized processing strategy to obtain WASM bytecode; encrypt the WASM bytecode to obtain the ciphertext of the WASM bytecode; The first sending module is used to distribute the ciphertext of the WASM bytecode to a first edge node in the edge cloud network, so that the first edge node can decrypt the ciphertext based on a preset key after receiving the ciphertext and obtain the corresponding WASM bytecode.

20. A device for processing WASM code, characterized in that, The device is the first edge node of the edge cloud network, including: The second receiving module is used to obtain WASM bytecode distributed by the central node or other edge nodes. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to the relevant information of the application or function, by determining the customized processing strategy of the WASM code. The second processing module is used to deploy code based on the compiled WASM bytecode.

21. The device according to claim 20, characterized in that, The second receiving module is used to receive ciphertext about WASM bytecode distributed by the central node or other edge nodes, wherein the ciphertext is obtained by the central node or other edge nodes encrypting the WASM bytecode; The ciphertext is decrypted using a preset key to obtain the corresponding WASM bytecode.

22. A device for processing WASM code, characterized in that, The device is a second edge node of the edge cloud network, including: The third receiving module is used to acquire WASM bytecode distributed by the central node or other edge nodes. The WASM bytecode is generated by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer. The central node or other edge nodes determine a customized processing strategy for the WASM code according to relevant information of the application or function, compile and distribute the WASM code, and the relevant information includes the application scenario and / or computing power requirements of the application or function. The customized processing strategy includes a compilation strategy and a distribution strategy. The compilation strategy is used to generate the WASM bytecode corresponding to the WASM code. The compilation strategy is determined based on the relevant information of the application or function, generating a unique code identifier for the WASM code, and then determining the distribution strategy based on at least the unique code identifier and the WASM code. The distribution strategy is used to determine the first edge node receiving the WASM bytecode. The distribution strategy is determined based on the relevant information of the application or function, generating a unique code identifier for the WASM code, and then determining the distribution strategy based on at least the unique code identifier, the service type supported by the edge node, and the computing power processing capability of the edge node. The module is also used to receive WASM code call requests or external events for services targeting the first application or function. The third processing module is used to complete code deployment based on the compiled WASM bytecode; and to respond to the call request or external event, wherein the edge node is determined by the scheduling module based on the customized processing strategy of the WASM code determined by the relevant information of the first application or function and indicated to the edge node accessed by the requester.

23. A device for processing WASM code, characterized in that, The device is a scheduling module for an edge cloud network, and the device includes: The fourth receiving module is used to obtain WASM code call requests or external events for services targeting the first application or function; The fourth processing module is used to determine a customized processing strategy for the WASM code based on the relevant information of the first application or function, and to determine a second edge node based on the customized processing strategy. The second edge node obtains WASM bytecode distributed by the central node or other edge nodes, and completes code deployment based on the compiled WASM bytecode. The WASM bytecode is compiled and distributed by the central node or other edge nodes based on the WASM code of the application or function uploaded by the developer, according to the relevant information of the application or function, by determining the customized processing strategy for the WASM code, and the relevant information includes the application context used by the application or function. The customized processing strategy includes a compilation strategy and a deployment strategy. The compilation strategy is used to generate WASM bytecode corresponding to the WASM code. The compilation strategy is determined based on the application or function's relevant information, after generating a unique code identifier for the WASM code, and at least based on the unique code identifier and the WASM code. The deployment strategy is used to determine the first edge node to receive the WASM bytecode. The deployment strategy is determined based on the application or function's relevant information, after generating a unique code identifier for the WASM code, and at least based on the unique code identifier, the service type supported by the edge node, and the edge node's computing power processing capability. The fourth sending module is used to distribute the call request or external event to the second edge node, so that the second edge node can respond to the call request or external event.

24. The device according to claim 23, characterized in that, The customized processing strategy includes the execution strategy; The fourth processing module is used to determine the execution strategy of the WASM code based on the relevant information of the first application or function; The second edge node is determined according to the operating strategy. The second edge node is the optimal service node where the service of the application or function is invoked.

25. A WASM code processing apparatus, the apparatus comprising a memory for storing computer-readable instructions and a processor for executing the computer-readable instructions, wherein, When the computer-readable instruction is executed by the processor, the device is triggered to perform the method of any one of claims 1 to 12.

26. A computer-readable medium having stored thereon computer-readable instructions that can be executed by a processor to implement the method as claimed in any one of claims 1 to 12.

27. A WASM code processing system, characterized in that, The system is applied to an edge cloud network and includes a central node and edge nodes, wherein the central node is used to perform the method of any one of claims 1 to 7, and the edge nodes are used to perform the method of any one of claims 1 to 10.

28. A WASM code processing system, characterized in that, The processing system is applied to an edge cloud network and includes an edge node and a scheduling module. The edge node is used to execute the method of any one of claims 1 to 10, and the scheduling module is used to execute the method of claim 11 or 12.

Citation Information

Patent Citations

  • Method and device for caching and executing smart contract

    CN111045792A

  • WebAssembly-based edge calculation method and device

    CN113032138A