Function distribution method, device, equipment, system and medium

By sending the distribution function from the cloud server to the first edge node during the function distribution process, and using the generated target download address information, efficient function distribution from the first edge node to the user-side edge node is achieved, solving the current problem. There are technical problems with long function distribution and high resource consumption, which improves the user experience.

CN119363712APending Publication Date: 2025-01-24BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310913196.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, there are problems such as slow container startup, large resource consumption, and long time-consuming function distribution during function distribution, resulting in poor user experience.

Method used

The distribution function is sent to the first edge node through the cloud server, and the target download address information generated by it is sent to the second edge node after saving, so that the distribution function is pulled from the first edge node according to the target download address information.

Benefits of technology

Reduced functional time and resource consumption, and improved the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363712A_ABST
    Figure CN119363712A_ABST
Patent Text Reader

Abstract

The invention relates to a function distribution method, device, equipment, system and medium, and the method comprises the steps that a cloud server sends a distribution function to a first edge node, and the first edge node is an edge node corresponding to an Internet data center; the cloud server receives target downloading address information corresponding to the distribution function sent by the first edge node, and stores the target downloading address information; the cloud server sends the target downloading address information to a second edge node, the second edge node is an edge node of a user side, and the second edge node is used for pulling the distribution function from the first edge node according to the target downloading address information, so that the distribution function can be directly pulled to the second edge node according to the target downloading address; time consumption and resource consumption of function distribution are reduced, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication network technology, and in particular to a function distribution method, device, equipment, system and medium. Background Art

[0002] In the edge computing scenario, a function refers to a small piece of code that completes simple business logic by running this small piece of code. Compared with traditional applications that consume a lot of time and energy to run, functions are lightweight and fast. Function distribution refers to the process of developers distributing the developed code from their local computers to edge nodes that are used to receive and process data acquisition requests sent by users.

[0003] In the existing function distribution process, the main function distribution solution is based on containers. The specific process is that the developer's local computer makes the function to be distributed into an image file based on the container, and stores the image file in the image warehouse, where the image warehouse is deployed on the cloud server. When the edge node receives the data acquisition request sent by the user, it needs to pull the function corresponding to the data acquisition request from the image warehouse of the cloud server to complete the function distribution.

[0004] However, after receiving the user's data acquisition request, the function corresponding to the data acquisition request is pulled from the image repository of the cloud server, which has problems such as slow container startup, high resource consumption, and long function distribution time, resulting in a poor user experience. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides a function distribution method, device, equipment, system and medium.

[0006] A first aspect of an embodiment of the present disclosure provides a function distribution method, the method comprising:

[0007] The cloud server sends a distribution function to a first edge node, where the first edge node is an edge node corresponding to an Internet data center;

[0008] The cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, and saves the target download address information;

[0009] The cloud server sends the target download address information to the second edge node, which is an edge node on the user side, so that the second edge node pulls the distribution function from the first edge node according to the target download address information.

[0010] A second aspect of an embodiment of the present disclosure provides a function distribution method, the method comprising:

[0011] The second edge node receives target download address information sent by the cloud server, where the target download address information is generated by the first edge node after the cloud server sends a distribution function to the first edge node, and the first edge node is an edge node corresponding to the Internet data center;

[0012] The second edge node pulls the distribution function from the first edge node according to the target download address information, and the second edge node is an edge node on the user side.

[0013] A third aspect of an embodiment of the present disclosure provides a function distribution device, the device comprising:

[0014] A function distribution module, used for the cloud server to send a distribution function to the first edge node, where the first edge node is an edge node corresponding to the Internet data center;

[0015] An address saving module, used for the cloud server to receive the target download address information corresponding to the distribution function sent by the first edge node, and save the target download address information;

[0016] The address sending module is used for the cloud server to send the target download address information to the second edge node, and the second edge node is the edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information.

[0017] A fourth aspect of an embodiment of the present disclosure provides a function distribution device, the device comprising:

[0018] An address receiving module is used for the second edge node to receive target download address information sent by the cloud server, where the target download address information is generated by the first edge node after the cloud server sends a distribution function to the first edge node, and the first edge node is an edge node corresponding to the Internet data center;

[0019] The function pulling module is used for the second edge node to pull the distribution function from the first edge node according to the target download address information, and the second edge node is the edge node on the user side.

[0020] A fifth aspect of the embodiments of the present disclosure provides an electronic device, the device comprising:

[0021] Memory;

[0022] Processor; and

[0023] A computer program, wherein the computer program is stored in a memory and is configured to be executed by a processor to implement the function distribution method of the first aspect or the function distribution method of the second aspect.

[0024] A sixth aspect of the embodiments of the present disclosure provides a function distribution system, the system comprising a cloud server, a first edge node and a second edge node;

[0025] The cloud server sends a distribution function to a first edge node, which is an edge node corresponding to an Internet data center; the cloud server receives target download address information corresponding to the distribution function sent by the first edge node, saves the target download address information, and sends the target download address information to a second edge node, which is an edge node on the user side;

[0026] The first edge node receives the distribution function sent by the cloud server, generates target download address information corresponding to the distribution function, and sends the target download address information to the cloud server;

[0027] The second edge node receives the target download address information sent by the cloud server; and pulls the distribution function from the first edge node according to the target download address information.

[0028] A seventh aspect of an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the function distribution method of the first aspect or the function distribution method of the second aspect is implemented.

[0029] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0030] The function distribution method, apparatus, device, system and medium provided by the embodiments of the present disclosure can send a distribution function to a first edge node through a cloud server, where the first edge node is an edge node corresponding to an Internet data center. Furthermore, after the cloud server sends the distribution function to the first edge node, it receives target download address information corresponding to the distribution function sent by the first edge node, saves the target download address information, and sends the target download address information to a second edge node, where the second edge node is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information. Thus, the target download address information sent by the first edge node can be received through the cloud server, and the target download address information can be sent to the second edge node, so that the second edge node can pull the distribution function from the first edge node to the local disk according to the target download address information, thereby reducing the time and resource consumption of function distribution and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0033] Figure 1 is a flow chart of a function distribution method provided by an embodiment of the present disclosure;

[0034] Figure 2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0035] Figure 3 is a flow chart of another function distribution method provided by an embodiment of the present disclosure;

[0036] Figure 4 is a flowchart of another function distribution method provided by an embodiment of the present disclosure;

[0037] Figure 5 It is a structural schematic diagram of a function distribution device provided by an embodiment of the present disclosure;

[0038] Figure 6 is a structural schematic diagram of another function distribution device provided by an embodiment of the present disclosure;

[0039] Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0041] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0042] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0043] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0044] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0045] Normally, in the existing function distribution process, the function distribution solution is mainly based on the container. The specific process is that the developer's local computer makes the function to be distributed into an image file based on the container, and stores the image file in the image warehouse, where the image warehouse is deployed on the cloud server. When the edge node receives the data acquisition request sent by the user, it is necessary to pull the function corresponding to the data acquisition request from the image warehouse of the cloud server to complete the distribution of the function. However, after receiving the user's data acquisition request, the function corresponding to the data acquisition request is pulled from the image warehouse of the cloud server. There are problems such as slow container startup, high resource consumption, and long function distribution time, resulting in a poor user experience. To address this problem, the embodiment of the present disclosure provides a function distribution method, which is described below in conjunction with a specific embodiment.

[0046] Figure 1 is a flow chart of a function distribution method provided by an embodiment of the present disclosure. The method can be executed by a function distribution device. The function distribution device can be implemented in software and / or hardware. The function distribution device can be configured in an electronic device, such as a server or a terminal or a server cluster. The terminal can specifically include a computer or a tablet computer, a vehicle-mounted terminal, etc. In addition, the method can be applied to Figure 2 The application scenario shown includes a cloud server 21, a first edge node 22 and a second edge node 23. It can be understood that the function distribution method provided in the embodiment of the present disclosure can also be applied in other scenarios.

[0047] like Figure 2In the application scenario shown, the cloud server 21, the first edge node 22 and the second edge node 23 can communicate through the network. The edge nodes can provide storage, computing, network and other resources, and sink some key business applications to the edge of the access network to reduce the width and delay losses caused by network transmission and multi-level forwarding.

[0048] Among them, the first edge node 22 can be an edge node corresponding to an Internet data center, and can also be understood as an edge node of a cloud vendor, such as a content delivery network node (Content Delivery Network, CDN) node.

[0049] The second edge node 23 may be an edge node on the user side.

[0050] Combine the following Figure 2 The application scenario shown is Figure 1 The function distribution method shown is introduced, for example, Figure 2 The cloud server 21 in the embodiment can execute the method. Figure 1 As shown, the function distribution method provided by the embodiment of the present disclosure includes the following steps.

[0051] S110. The cloud server sends a distribution function to a first edge node, where the first edge node is an edge node corresponding to an Internet data center.

[0052] In the disclosed embodiment, the cloud server may receive the distribution function in real time and send the distribution function to the first edge node.

[0053] A function can be understood as a small piece of code that completes simple business logic by running this small piece of code.

[0054] The distribution function refers to the function that needs to be distributed from the developer's local computer to the edge node for receiving and processing the data acquisition request sent by the user.

[0055] Specifically, the cloud server may receive the distribution function sent from the developer's local calculation based on a preset code program, and after receiving the distribution function, send the distribution function to the first edge node.

[0056] The preset code program may be a pre-set code program for receiving a distribution function, such as a fass controller service of a cloud server.

[0057] S120. The cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, and saves the target download address information.

[0058] In the disclosed embodiment, after sending the distribution function to the first edge node, the cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, and saves the target download address information.

[0059] In the embodiment of the present disclosure, the target download address information is the download address information corresponding to the distribution function generated by the first edge node after receiving the distribution function, and can also be understood as the storage location of the distribution function in the first edge node.

[0060] After receiving the target download address information, the cloud server saves it to the target database.

[0061] The target database is a preset database in the cloud server. The target database can be a database of a container-based cluster management platform (Kuberentes, k8s) deployed on the cloud server, such as etcd / apiServer. The k8s deployed on the cloud server provides a set of perception mechanisms for the database. The perception mechanism can enable the second edge node to perceive the address information change of the target database when the target download address information is saved in the target database.

[0062] Exemplarily, saving the target download address information to the target database may be modifying the address information of a preset location in a file of a preset category in the target database into the target download address information, wherein the file of the preset category may be a yaml file.

[0063] S130. The cloud server sends target download address information to the second edge node, where the second edge node is an edge node on the user side, so that the second edge node pulls the distribution function from the first edge node according to the target download address information.

[0064] In the disclosed embodiment, after saving the target download address information, the cloud server sends the target download address information to the second edge node, which is an edge node on the user side, so that the second edge node pulls the distribution function from the first edge node according to the target download address information.

[0065] Specifically, after the cloud server distributes the distribution function to the first edge node, the first edge node generates target download address information corresponding to the distribution function based on the distribution function, and sends the target download address information to the cloud server through the network. The cloud server then obtains the target download address information corresponding to the distribution function returned by the first edge node, saves the target download address information to the target database, and then sends the target download address information to the second edge node through the network, so that the second edge node pulls the distribution function from the first edge node according to the target download address information.

[0066] In the disclosed embodiment, a distribution function can be sent to a first edge node through a cloud server, and the first edge node is an edge node corresponding to an Internet data center. Furthermore, after the cloud server sends the distribution function to the first edge node, the target download address information corresponding to the distribution function sent by the first edge node is received, and the target download address information is saved, and the target download address information is sent to a second edge node, and the second edge node is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information. Thus, the target download address information sent by the first edge node can be received through the cloud server, and the target download address information can be sent to the second edge node, so that the second edge node can pull the distribution function from the first edge node to the local disk according to the target download address information, thereby reducing the time and resource consumption of function distribution, and improving the user experience.

[0067] Based on the above-mentioned embodiments of the present disclosure, the cloud server sends the distribution function to the first edge node in S110, which may specifically include: the cloud server compresses and encrypts the distribution function to obtain an encrypted compressed package corresponding to the distribution function; and sends the compressed package to the first edge node.

[0068] In the embodiments of the present disclosure, the encryption process may adopt a symmetric key encryption method or other existing encryption methods.

[0069] Specifically, after receiving the distribution function, the cloud server can compress and encrypt the distribution function based on a preset code program such as the fass controller service of the cloud server, obtain an encrypted compressed package corresponding to the distribution function, store the encrypted compressed package and distribute it to the first edge node.

[0070] In the embodiment of the present disclosure, after receiving the distribution function, the distribution function can be encrypted based on a preset code program to obtain an encrypted compressed package corresponding to the distribution function, and the encrypted compressed package can be distributed to the first edge node, thereby improving the security of the distribution function during the distribution process.

[0071] In the embodiment of the present disclosure, before the cloud server compresses and encrypts the distribution function, the function distribution method may also include: the cloud server compiles the distribution function based on a preset code program to obtain a compiled target binary distribution function, wherein the preset code program is used to receive the distribution function and compile the distribution function, and the compiled distribution function is the target binary programming language under the cloud server platform.

[0072] In the disclosed embodiment, since the distribution function is a high-level programming language, it is necessary to compile the distribution function into a low-level programming language that can be recognized by the cloud server.

[0073] The cloud server platform can be understood as the operating system of the cloud server, such as the Linux operating system.

[0074] The target binary programming language may be a wasm binary programming language. In the embodiment of the present disclosure, wasm may be understood as a lightweight virtual machine in the second edge node.

[0075] Furthermore, the compiled target binary distribution function is encrypted to obtain a compressed package corresponding to the compiled target binary distribution function, and the compressed package corresponding to the compiled target binary distribution function is distributed to the first edge node.

[0076] The target binary distribution function includes a distribution function executable by the lightweight virtual machine.

[0077] In the embodiment of the present disclosure, after receiving the distribution function, the distribution function can be compiled, and the compiled distribution function can be compressed and encrypted. The distribution function will be distributed to the first edge node only after the encryption process. In this way, while ensuring the security of the distribution function during the distribution process, it can provide a basis for the subsequent loading of the distribution function, thereby improving the loading rate and further improving the function distribution rate.

[0078] In an embodiment of the present disclosure, when there are at least two versions corresponding to the distribution function, the distribution functions corresponding to the at least two versions are distributed to the first edge node; the cloud server receives the download address information corresponding to the at least two versions sent by the first edge node, and saves the download address information corresponding to the at least two versions into the target database.

[0079] Specifically, when there are at least two versions corresponding to the distribution function, the cloud server distributes the distribution functions corresponding to the at least two versions to the first edge node. After receiving the distribution functions corresponding to the at least two versions, the first edge node generates download address information corresponding to the at least two versions of the distribution functions, and returns it to the cloud server. Then, the cloud server obtains the download address information corresponding to the at least two versions returned by the first edge node, saves the download address information corresponding to the at least two versions in the target database, and sends the download address information corresponding to the at least two versions to the second edge node, so that the second edge node pulls different versions of the distribution function from the first edge node based on the download address information corresponding to the at least two versions.

[0080] The specific implementation of saving the download address information corresponding to at least two versions into the target database is similar to the implementation of saving the target download address information into the target database in the above embodiment, and will not be described in detail here.

[0081] In the disclosed embodiment, when there are at least two versions corresponding to a distribution function, the cloud server distributes the distribution functions corresponding to the at least two versions to the first edge node, and the first edge node generates download address information corresponding to the at least two versions of the distribution functions, and returns it to the cloud server. The cloud server then obtains the download address information corresponding to the at least two versions returned by the first edge node, saves the download address information corresponding to the at least two versions in a target database, and sends the download address information corresponding to the at least two versions to the second edge node, so that the second edge node pulls different versions of the distribution function from the first edge node based on the download address information corresponding to the at least two versions. As a result, when distributing the function, the version information of the distribution function can be taken into consideration to achieve the technical effect of grayscale distribution.

[0082] Figure 3 is a flowchart of another function distribution method provided by an embodiment of the present disclosure, such as Figure 3 As shown, the function distribution method includes the following steps:

[0083] S310: The cloud server receives the distribution function, compiles the distribution function based on a preset code program, and obtains a compiled target binary distribution function.

[0084] S320: Encrypt the compiled target binary distribution function to obtain a compressed package corresponding to the target binary distribution function, and distribute the compressed package corresponding to the target binary distribution function to the first edge node.

[0085] S330. The cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, saves the target download address information to the target database, and then sends the target download address information to the second edge node.

[0086] It should be noted that the specific implementation of steps S310-S330 is similar to that in the above embodiment and will not be described in detail here.

[0087] In the disclosed embodiment, a distribution function can be received through a cloud server, and the distribution function is compiled based on a preset code program to obtain a compiled target binary distribution function, and the compiled target binary distribution function is encrypted to obtain a compressed package corresponding to the target binary distribution function, and the compressed package corresponding to the target binary distribution function is distributed to a first edge node. The cloud server obtains the target download address information corresponding to the distribution function returned by the first edge node, and after saving the target download address information to a target database, the target download address information is sent to a second edge node, so that the second edge node pulls the distribution function from the first edge node according to the target download address information. Thus, the security of the distribution function is ensured based on the encryption processing during the function distribution process, and at the same time, a basis is provided for the subsequent loading of the distribution function based on the compilation processing, thereby improving the loading rate, further improving the function distribution rate, reducing the time and resource consumption of function distribution, and improving the user experience.

[0088] Figure 4 is a flowchart of another function distribution method provided by an embodiment of the present disclosure, such as Figure 4 The function distribution method shown can be based on Figure 2 The second edge node 23 in the embodiment is executed, such as Figure 4 As shown, the function distribution method includes the following steps:

[0089] S410. The second edge node receives the target download address information sent by the cloud server. The target download address information is generated by the first edge node after the cloud server sends the distribution function to the first edge node. The first edge node is the edge node corresponding to the Internet data center.

[0090] In the disclosed embodiment, the second edge node can receive the target download address information sent by the cloud server based on a preset agent program, wherein the preset agent program is a pre-set program for receiving the target download address information sent by the cloud server, such as the rt Engine agent program set by the second edge node. It can also be understood that the preset agent program has the function of subscribing to the update of files of preset categories in the target database, wherein the files of the preset categories can be yaml files, and once the address information of the yaml files in the target database is updated, the preset agent program can perceive it.

[0091] S420: The second edge node pulls the distribution function from the first edge node according to the target download address information, where the second edge node is an edge node on the user side.

[0092] In the embodiment of the present disclosure, after receiving the target download address information, the second edge node pulls the distribution function from the first edge node according to the target download address information.

[0093] Specifically, after receiving the target download address information, the second edge node pulls the distribution function from the first edge node based on the target download address information based on the preset agent program, decrypts the distribution function, and then decompresses and stores it in the local disk of the second edge node.

[0094] The preset agent program also has the function of determining the version corresponding to the distribution function to be pulled.

[0095] In some embodiments of the present disclosure, when there are at least two versions of a distribution function, the cloud server will distribute the distribution functions corresponding to the at least two versions to the first edge node, and the first edge node will generate download address information corresponding to the distribution functions corresponding to the at least two versions, and return it to the cloud server, so that the cloud server saves the download address information corresponding to the distribution functions corresponding to the at least two versions to the target database, and sends the distribution functions corresponding to the at least two versions to the second edge node, so that the second edge node receives the download address information corresponding to the distribution functions corresponding to the at least two versions sent by the cloud server based on a preset agent program, and determines the version of the distribution function to be pulled by the second edge node based on the preset agent program, and then pulls the distribution function corresponding to the version to be pulled from the first edge node based on the download address information of the distribution function corresponding to the version to be pulled.

[0096] In the disclosed embodiment, the target download address information sent by the cloud server can be received through the second edge node. The target download address information is generated by the first edge node after the cloud server receives the distribution function and distributes the distribution function to the first edge node. The first edge node is the edge node corresponding to the Internet data center. After receiving the target download address information, the second edge node pulls the distribution function from the first edge node according to the target download address information. The second edge node is an edge node on the user side. Therefore, by receiving the target download address information sent by the cloud server and pulling the distribution function from the first edge node to the local disk according to the target download address information, the time and resource consumption of function distribution are reduced, and the user experience is improved. At the same time, when the distribution function corresponds to at least two versions, the technical effect of reply distribution is achieved.

[0097] Further, in Figure 4 Based on the function distribution method shown, after S420, the function distribution method may also include: the second edge node receives a data acquisition request sent by the user end; the lightweight virtual machine runtime in the second edge node obtains the target distribution function corresponding to the data acquisition request from the second edge node; the lightweight virtual machine runtime in the second edge node executes the target distribution function, and feeds back the execution result to the user end.

[0098] After the second edge node receives the data acquisition request sent by the user end, it shakes hands with the user end to establish a connection, and at the same time triggers the lightweight virtual machine runtime in the second edge node to load the target distribution function corresponding to the data acquisition request from the local disk of the second edge node to the memory of the runtime; sends the data acquisition request to the lightweight virtual machine runtime, so that the lightweight virtual machine runtime executes the target distribution function, and feeds back the execution result to the user end.

[0099] The data acquisition request may be an https request, which is not limited here.

[0100] In the embodiment of the present disclosure, after receiving the data acquisition request sent by the user end, the second edge node shakes hands with the user end to establish a connection. The specific implementation method is similar to the existing method of establishing a connection through handshake, and will not be repeated here.

[0101] In the embodiment of the present disclosure, the lightweight virtual machine runtime may be a wasm virtual machine runtime.

[0102] In an embodiment of the present disclosure, when there are multiple lightweight virtual machine runtimes, only any one of the multiple lightweight virtual machine runtimes can be triggered to load the target distribution function corresponding to the data acquisition request from the local disk of the second edge node into the runtime's memory.

[0103] Specifically, the second edge node receives the data acquisition request sent by the user end based on the edge entry gateway, and after receiving the data acquisition request sent by the user end, it shakes hands with the user end based on the edge entry gateway to establish a connection, and at the same time triggers the lightweight virtual machine runtime in the second edge node to load the target distribution function corresponding to the data acquisition request from the local disk of the second edge node to the memory of the lightweight virtual machine runtime, so that the lightweight virtual machine runtime executes the target distribution function and feeds back the execution result to the user end.

[0104] Among them, the edge entry gateway can be a pre-set httpproxy program.

[0105] In an embodiment of the present disclosure, before receiving a data acquisition request sent by a user terminal, the distribution function can be pulled to the local disk of the second edge node, and then after receiving the data acquisition request sent by the user terminal, while shaking hands with the user terminal to establish a connection, the lightweight virtual machine runtime in the second edge node is triggered to load the target distribution function corresponding to the data acquisition request from the local disk of the second edge node into the memory of the lightweight virtual machine runtime, and the data acquisition request is sent to the lightweight virtual machine runtime, so that the lightweight virtual machine runtime executes the target distribution function, and feeds back the execution result to the user terminal for direct triggering, thereby improving the speed of processing data acquisition requests.

[0106] In some embodiments of the present disclosure, when the second edge node includes multiple lightweight virtual machine runtimes, before executing the target distribution function through the lightweight virtual machine runtime in the second edge node, the function distribution method may also include: searching for a target lightweight virtual machine runtime that includes the target distribution function from the multiple lightweight virtual machine runtimes; and sending a data acquisition request to the target lightweight virtual machine runtime for executing the target distribution function through the target lightweight virtual machine.

[0107] Specifically, the second edge node may determine the target lightweight virtual machine runtime based on the saved record when the runtime loads the target distribution function.

[0108] Further, executing the target distribution function by the lightweight virtual machine runtime in the second edge node may specifically include: executing the target distribution function by the target lightweight virtual machine runtime.

[0109] In the embodiment of the present disclosure, when multiple lightweight virtual machine runtimes are included in the second edge node, a target lightweight virtual machine runtime containing a target distribution function can be searched from the multiple lightweight virtual machine runtimes, thereby ensuring that the data acquisition request can be accurately sent to the lightweight virtual machine runtime loaded with the target distribution function corresponding to the data acquisition request, thereby avoiding waste of resources.

[0110] In some embodiments of the present disclosure, a DNS server is deployed inside the second edge node. When the data acquisition request of the user terminal reaches the second edge node, the request processing corresponding to the data acquisition request is completed at the second edge node, such as DNS resolution, etc., to ensure the delay.

[0111] In some other embodiments of the present disclosure, developers can realize automatic scaling of the second edge node by setting preset scaling codes, and then realize the addition and deletion of the second edge node, including initialization of the second edge node, installation of the application, etc., so as to achieve more effective scaling scenarios after the second edge node is linked to the public domain name.

[0112] Figure 5 1 is a schematic diagram of the structure of a function distribution device provided in an embodiment of the present disclosure. The function distribution device in the embodiment of the present disclosure can be set in an electronic device, and the electronic device can be a server or a terminal or a server cluster, wherein the terminal can specifically include a computer or a tablet computer, a vehicle-mounted terminal, etc., which is not limited here.

[0113] like Figure 5 As shown, the function distribution device 500 may include a function distribution module 510 , an address storage module 520 and an address sending module 530 .

[0114] The function distribution module 510 can be used by the cloud server to send a distribution function to the first edge node, and the first edge node is an edge node corresponding to the Internet data center.

[0115] The address storage module 520 can be used for the cloud server to receive the target download address information corresponding to the distribution function sent by the first edge node, and save the target download address information.

[0116] The address sending module 530 can be used by the cloud server to send target download address information to the second edge node, which is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information.

[0117] In the disclosed embodiment, a distribution function can be sent to a first edge node through a cloud server, and the first edge node is an edge node corresponding to an Internet data center. Furthermore, after the cloud server sends the distribution function to the first edge node, the target download address information corresponding to the distribution function sent by the first edge node is received, and the target download address information is saved, and the target download address information is sent to a second edge node, and the second edge node is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information. Thus, the target download address information sent by the first edge node can be received through the cloud server, and the target download address information can be sent to the second edge node, so that the second edge node can pull the distribution function from the first edge node to the local disk according to the target download address information, thereby reducing the time and resource consumption of function distribution, and improving the user experience.

[0118] In some embodiments of the present disclosure, the function distribution module 510 may include an encryption unit.

[0119] The encryption unit can be used in the cloud server to compress and encrypt the distribution function to obtain an encrypted compressed package corresponding to the distribution function; and send the compressed package to the first edge node.

[0120] In some embodiments of the present disclosure, the function distribution module 510 may further include a compilation unit.

[0121] The compilation unit can be used for the cloud server to compile the distribution function before the cloud server compresses and encrypts the distribution function to obtain the compiled target binary distribution function.

[0122] The encryption unit can be specifically used to encrypt the compiled target binary distribution function to obtain a compressed package corresponding to the target binary distribution function.

[0123] In some embodiments of the present disclosure, the target binary distribution function includes a distribution function executable by a lightweight virtual machine.

[0124] In some embodiments of the present disclosure, the distribution function corresponds to at least two versions.

[0125] The function distribution module 510 may be specifically configured for the cloud server to send at least two versions of distribution functions corresponding to the first edge node.

[0126] The address storage module 520 may be specifically used for the cloud server to receive the download address information corresponding to at least two versions respectively sent by the first edge node.

[0127] It should be noted that Figure 5 The function distribution device 500 shown can perform the above Figures 1 to 3 The method embodiments and Figures 1 to 3 The corresponding steps in the method embodiment, and the various processes and effects in the above method embodiment are implemented, which will not be described in detail here.

[0128] Figure 6 1 is a schematic diagram of the structure of another function distribution device provided in an embodiment of the present disclosure. The function distribution device in the embodiment of the present disclosure can be set in an electronic device, and the electronic device can be a server or a terminal or a server cluster, wherein the terminal can specifically include a computer or a tablet computer, a vehicle-mounted terminal, etc., which is not limited here.

[0129] like Figure 6 As shown, the function distribution device 600 may include an address receiving module 610 and a function pulling module 620 .

[0130] The address receiving module 610 can be used for the second edge node to receive the target download address information sent by the cloud server. The target download address information is generated by the first edge node after the cloud server receives the distribution function sent to the first edge node. The first edge node is the edge node corresponding to the Internet data center.

[0131] The function pulling module 620 may be used for the second edge node to pull the distribution function from the first edge node according to the target download address information, and the second edge node is an edge node on the user side.

[0132] In the disclosed embodiment, the target download address information sent by the cloud server can be received through the second edge node. The target download address information is generated by the first edge node after the cloud server receives the distribution function and distributes the distribution function to the first edge node. The first edge node is the edge node corresponding to the Internet data center. After receiving the target download address information, the second edge node pulls the distribution function from the first edge node according to the target download address information. The second edge node is an edge node on the user side. Therefore, by receiving the target download address information sent by the cloud server and pulling the distribution function from the first edge node to the local disk according to the target download address information, the time consumption and resource consumption of function distribution are reduced, while the user experience is improved.

[0133] In some embodiments of the present disclosure, the function distribution device 600 may further include a request acquisition module, a function determination module and a function execution module.

[0134] The request acquisition module can be used for the second edge node to receive a data acquisition request sent by the user terminal.

[0135] The function determination module may be used to obtain a target distribution function corresponding to the data acquisition request from the second edge node when the lightweight virtual machine in the second edge node is running.

[0136] The function execution module can be used to execute the target distribution function through the lightweight virtual machine runtime in the second edge node, and feed back the execution result to the user end.

[0137] In some embodiments of the present disclosure, the second edge node includes multiple lightweight virtual machine runtimes.

[0138] The function distribution device 600 may further include a search module.

[0139] The search module can be used to search for a target lightweight virtual machine runtime including a target distribution function from multiple lightweight virtual machine runtimes; and send a data acquisition request to the target lightweight virtual machine runtime to execute the target distribution function through the target lightweight virtual machine.

[0140] It should be noted that Figure 6 The function distribution device 600 shown can perform the above Figure 4 The method embodiments described and Figure 4 The corresponding steps in the method embodiment, and the various processes and effects in the above method embodiment are implemented, which will not be described in detail here.

[0141] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown.

[0142] In the disclosed embodiment, Figure 7 The electronic device shown may be a server or a terminal or a server cluster, wherein the terminal may specifically include a computer or a tablet computer, a vehicle-mounted terminal, etc., such as the cloud server, the second edge node, etc. described in the above method embodiments and device embodiments, which are not limited here.

[0143] like Figure 7 As shown, the electronic device may include a processor 710 and a memory 720 storing computer program instructions.

[0144] Specifically, the processor 710 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0145] The memory 720 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 720 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 720 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 720 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 720 is a non-volatile solid-state memory. In a particular embodiment, the memory 720 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.

[0146] The processor 710 reads and executes the computer program instructions stored in the memory 720 to perform the above-mentioned Figures 1 to 3 The method embodiments and Figures 1 to 3 The steps of the function distribution method provided by the corresponding method embodiment, or the above-mentioned Figure 4 The method embodiments described and Figure 4The steps of the function distribution method provided by the corresponding method embodiment.

[0147] In one example, the electronic device may further include a transceiver 730 and a bus 740. Figure 7 As shown, the processor 710, the memory 720 and the transceiver 730 are connected via a bus 740 and communicate with each other.

[0148] The bus 740 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 740 may include one or more buses.

[0149] The present disclosure also provides a computer-readable storage medium, which can store a computer program. When the computer program is executed by a processor, the processor implements the above-mentioned Figures 1 to 3 The method embodiments and Figures 1 to 3 The steps of the function distribution method provided by the corresponding method embodiment, or the above-mentioned Figure 4 The method embodiments described and Figure 4 The steps of the function distribution method provided by the corresponding method embodiment.

[0150] The above-mentioned storage medium may, for example, include a memory 720 of computer program instructions, and the above-mentioned instructions may be executed by the processor 710 of the electronic device to complete the function distribution method provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (Compact Disc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0151] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0152] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A function distribution method, characterized in that: The method comprises: The cloud server sends a distribution function to a first edge node, where the first edge node is an edge node corresponding to an Internet data center; The cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, and saves the target download address information; The cloud server sends the target download address information to a second edge node, which is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information.

2. The method according to claim 1, characterized in that The cloud server sends a distribution function to the first edge node, including: The cloud server compresses and encrypts the distribution function to obtain an encrypted compressed package corresponding to the distribution function; Send the compressed packet to the first edge node.

3. The method according to claim 2, characterized in that Before the cloud server compresses and encrypts the distribution function, the method further includes: The cloud server compiles the distribution function to obtain a compiled target binary distribution function; The cloud server compresses and encrypts the distribution function to obtain an encrypted compressed package corresponding to the distribution function, including: The compiled target binary distribution function is encrypted to obtain a compressed package corresponding to the target binary distribution function.

4. The method according to claim 3, characterized in that The target binary distribution function includes a distribution function executable by a lightweight virtual machine.

5. The method according to claim 1, characterized in that The distribution function corresponds to at least two versions, and the cloud server sends the distribution function to the first edge node, including: The cloud server sends the distribution functions corresponding to the at least two versions to the first edge node; The cloud server receives the target download address information corresponding to the distribution function sent by the first edge node, including: The cloud server receives the download address information corresponding to the at least two versions respectively sent by the first edge node.

6. A function distribution method, characterized in that: The method comprises: The second edge node receives target download address information sent by the cloud server, where the target download address information is generated by the first edge node after the cloud server sends a distribution function to the first edge node, where the first edge node is an edge node corresponding to an Internet data center; The second edge node pulls the distribution function from the first edge node according to the target download address information, and the second edge node is an edge node on the user side.

7. The method according to claim 6, characterized in that After the second edge node pulls the distribution function from the first edge node according to the target download address information, the method further includes: The second edge node receives a data acquisition request sent by a user terminal; The lightweight virtual machine in the second edge node acquires a target distribution function corresponding to the data acquisition request from the second edge node when the lightweight virtual machine in the second edge node is running; The target distribution function is executed by the lightweight virtual machine runtime in the second edge node, and the execution result is fed back to the user end.

8. The method according to claim 7, characterized in that When the second edge node includes a plurality of lightweight virtual machine runtimes, before executing the target distribution function by the lightweight virtual machine runtime in the second edge node, the method further includes: Searching for a target lightweight virtual machine runtime including the target distribution function from the plurality of lightweight virtual machine runtimes; The data acquisition request is sent to the target lightweight virtual machine runtime, so as to be used for executing the target distribution function through the target lightweight virtual machine.

9. A function distribution device, characterized in that: include: A function distribution module, used for the cloud server to send a distribution function to a first edge node, where the first edge node is an edge node corresponding to an Internet data center; An address saving module, used for the cloud server to receive the target download address information corresponding to the distribution function sent by the first edge node, and save the target download address information; The address sending module is used for the cloud server to send the target download address information to the second edge node, where the second edge node is an edge node on the user side, so that the second edge node can pull the distribution function from the first edge node according to the target download address information.

10. A function distribution device, characterized in that: include: An address receiving module, configured for the second edge node to receive target download address information sent by the cloud server, wherein the target download address information is generated by the first edge node after the cloud server sends a distribution function to the first edge node, and the first edge node is an edge node corresponding to an Internet data center; The function pulling module is used for the second edge node to pull the distribution function from the first edge node according to the target download address information, and the second edge node is an edge node on the user side.

11. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 5, or the method according to any one of claims 6 to 8.

12. A function distribution system, characterized in that: The system includes a cloud server, a first edge node, and a second edge node; The cloud server sends a distribution function to a first edge node, the first edge node is an edge node corresponding to an Internet data center; the cloud server receives target download address information corresponding to the distribution function sent by the first edge node, saves the target download address information, and sends the target download address information to a second edge node, the second edge node is an edge node on the user side; The first edge node receives the distribution function sent by the cloud server, generates target download address information corresponding to the distribution function, and sends the target download address information to the cloud server; The second edge node receives the target download address information sent by the cloud server; and pulls the distribution function from the first edge node according to the target download address information.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 or the method according to any one of claims 6 to 8 is implemented.