Function calling method, network system, node, storage medium, and program product

By introducing a distributed caching mechanism into the serverless architecture, and using multiple metadata caching nodes to cache function metadata, the problems of high time consumption and instability in obtaining metadata from gateway nodes are solved, resulting in lower function call latency and higher system availability.

WO2025243090A1PCT designated stage Publication Date: 2025-11-27CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/IB2025/052411
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-20
Filing Date
2025-03-06
Publication Date
2025-11-27

AI Technical Summary

Technical Problem

In a serverless architecture, the gateway node's retrieval of metadata from the metadata data source is time-consuming and unstable, affecting the user experience. Furthermore, the gateway's dependence on the data source reduces system availability.

Method used

A distributed caching mechanism is adopted, which caches the metadata of the called functions through multiple metadata caching nodes. The gateway node selects the caching node with the shortest network latency to obtain the metadata and synchronizes the metadata in the cache, reducing the number of times the origin is retrieved and decoupling the gateway from the data source.

Benefits of technology

It shortens function call latency, improves system stability and availability, reduces network latency for metadata retrieval, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2025052411_27112025_PF_FP_ABST
    Figure IB2025052411_27112025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a function calling method, a network system, a node, a storage medium, and a program product. The network system comprises: a gateway node, a plurality of cache nodes, and a metadata data source. The plurality of metadata cache nodes have the capability of responding to a metadata acquisition request of the gateway node; the metadata data source is used for storing metadata of a function; and the metadata of the function is used for scheduling an instance of the function. The method comprises: upon receiving a function calling request for a first function, a gateway node sends a metadata acquisition request for the first function to a first cache node, wherein the first cache node is selected by the gateway node from among a plurality of cache nodes; and upon receiving metadata of the first function returned by the first cache node, the gateway node requests to schedule an instance for processing the function calling request. The technical solution provided by the embodiments of the present disclosure can reduce the processing latency of function calling.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The present disclosure claims priority to Chinese Patent Application No. 202410627498.8, filed on May 20, 2024, and entitled "Function Calling Method, Network System, Node, Storage Medium and Program Product", the entire contents of which are incorporated herein by reference. TECHNICAL FIELD The present disclosure relates to the field of cloud computing, and particularly relates to a function calling method, a network system, a node, a storage medium and a program product. BACKGROUND In a serverless architecture, a gateway is a multi-tenant component that serves function invocation requests of all tenants. The gateway parses a function invocation request of a tenant to obtain a function name to be invoked, obtains metadata related to the function from a metadata data source (also referred to as metadata backsource), the metadata is used to create / schedule a function instance, the gateway forwards the request to the corresponding function instance to process the request and obtain response information, and the response information is returned to the requester. However, obtaining metadata from the data source is time-consuming and unstable, which affects user experience. SUMMARY In view of the above problems, the present disclosure is proposed to provide a function calling method, a network system, a node, a storage medium and a program product that solve the above problems or at least partially solve the above problems. In a first aspect, a function calling method applied to a network system is provided, the network system comprising: a gateway node, a plurality of metadata cache nodes and a metadata data source; the plurality of metadata cache nodes have the ability to respond to metadata obtaining requests of the gateway node; the metadata data source is used to store metadata of functions; the metadata of the functions is used to schedule instances of the functions; the plurality of metadata cache nodes are used to cache metadata of invoked functions in the metadata data source; the method comprises: after the gateway node receives a function invocation request for a first function, the gateway node sends a metadata obtaining request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function invocation request. That is, in the embodiment of the present disclosure, the network system provides a plurality of metadata cache nodes capable of simultaneously processing metadata obtaining requests of the gateway node, and the distributed cache can alleviate the access pressure of the metadata cache nodes, that is, each metadata cache node can share a part of the access traffic, thereby shortening the access delay of the metadata cache nodes, that is, the processing delay of the function invocation can be reduced.Also, the dependence of the gateway node on the metadata data source can be reduced by the distributed cache, and when the metadata data source fails, the cached data (i.e., inventory) related function call is not affected. In an embodiment of the first aspect of the present disclosure, the method further includes: after the first metadata cache node receives the metadata obtaining request for the first function, searching for the metadata of the first function in the cache of the first metadata cache node; if the metadata of the first function is found in the cache of the first metadata cache node, returning the metadata of the first function to the gateway node by the first metadata cache node. In the embodiment of the present disclosure, the metadata of the first function is cached in the first metadata cache node, which indicates that the first function has been called. In an embodiment of the first aspect of the present disclosure, the method further includes: if the metadata of the first function is not found in the cache of the first metadata cache node, obtaining the metadata of the first function from the metadata data source by the first metadata cache node; and sending the metadata of the first function to the gateway node and adding the metadata of the first function in the cache of the first metadata cache node by the first metadata cache node. In the embodiment of the present disclosure, if the metadata of the first function is not cached in the first metadata cache node, the first metadata cache node needs to obtain the metadata of the first function from the metadata data source and return the metadata of the first function to the gateway node, and at the same time, the metadata of the first function is cached locally, so that when the first function is called again, the first metadata cache node does not need to perform metadata back source, and the network delay of the function call can be shortened. In an embodiment of the first aspect of the present disclosure, the network system further includes: an event-driven node; the method further includes: after the first metadata cache node completes the adding operation of the metadata of the first function in the cache of the first metadata cache node, publishing a metadata adding event to the event-driven node by the first metadata cache node; sending the metadata adding event to a second metadata cache node as a subscription party of the event-driven node by the event-driven node; the second metadata cache node is a metadata cache node in the plurality of metadata cache nodes; and adding the metadata of the first function in the cache of the second metadata cache node according to the metadata adding event by the second metadata cache node. In the embodiment, the metadata cache node adds the metadata of the first function in the cache.According to the principle of time locality, the metadata can also be accessed, therefore, the metadata adding event is published to the event-driven node, so that other metadata cache nodes can timely perceive the adding event and add corresponding metadata in the self cache, realizing synchronization among the metadata cache nodes, so that the subsequent function call does not need to be sourced. Optionally, the plurality of metadata cache nodes can be the publisher of the event-driven node. Optionally, the plurality of metadata cache nodes can be the subscriber of the event-driven node. In an implementation of the first aspect of the present disclosure, the second metadata cache node adds the metadata of the first function in the cache of the second metadata cache node according to the metadata adding event, comprising: the second metadata cache node acquires the metadata of the first function from the metadata data source according to the metadata adding event; and adds the metadata of the first function in the cache of the second metadata cache node. In an implementation of the first aspect of the present disclosure, the gateway node is multiple; the plurality of gateway nodes are distributed in a plurality of availability zones; at least one gateway node and at least one metadata cache node are deployed in each availability zone. In the embodiment of the present disclosure, the gateway node is deployed in a plurality of availability zones, and the metadata cache node is deployed in each availability zone. The gateway node accesses the plurality of metadata cache nodes by timing polling to detect the network delay of each node, so that in most cases, each gateway node can access the metadata cache node in the same availability zone, which helps to ensure stable low delay. It should be noted that, generally, the metadata cache node with the lowest delay is the metadata cache node in the same availability zone. If the node in the same availability zone is overloaded, and the access delay is higher than the access delay of the cross-availability-zone node, in this case, the cross-availability-zone node is also beneficial to reduce the access delay.In an implementation of the first aspect of the present disclosure, the network system comprises a first gateway node and an event-driven node; the plurality of metadata cache nodes comprises a third metadata cache node and a fourth metadata cache node; and the method comprises: after the first gateway node receives a metadata editing request for a second function, requesting a metadata data source to edit metadata of the second function; after the metadata data source edits the metadata of the second function, the first gateway node instructing the third metadata cache node to edit the metadata of the second function in the cache of the third metadata cache node; after the third metadata cache node completes editing the metadata of the second function, publishing a metadata editing event to the event-driven node; the event-driven node sending the metadata editing event to the fourth metadata cache node as a subscriber of the event-driven node; and after the fourth metadata cache node receives the metadata editing event, editing the metadata of the second function in the cache of the fourth metadata cache node. Optionally, the metadata editing request comprises a metadata delete request and a metadata update request. In this embodiment, the metadata cache node edits the metadata in the local cache, and publishes the metadata editing event to the event-driven node, so that other metadata cache nodes can timely perceive the editing and edit their own caches, thereby realizing synchronization between the metadata cache nodes. Optionally, the metadata editing request comprises a metadata insert request. That is, when metadata of a new function is newly inserted in the metadata data source, the metadata of the new function can be stored in the metadata cache node. In an implementation of the first aspect of the present disclosure, the network system comprises a second gateway node as a subscriber of the fourth metadata cache node; after the fourth metadata cache node completes editing the metadata of the second function, the fourth metadata cache node sends a metadata editing event to the second gateway node; and the second gateway node edits the metadata of the second function in the cache of the second gateway node according to the metadata editing event. In the embodiments of the present disclosure, the metadata cache node pushes the metadata editing event to the gateway node that subscribes to the metadata editing event, so that the gateway node can timely perceive the editing event and edit its own metadata cache.In an implementation of the first aspect of the present disclosure, the method further comprises: in the case that the event-driven node fails, when the fourth metadata cache node receives a metadata obtaining request for a third function, determining a time length from a first time of source retrieval to a current time; the first time of source retrieval refers to a latest time of source retrieval of the fourth metadata cache node for metadata of the third function; when the time length is greater than or equal to a preset time length threshold, the fourth metadata cache node obtains the metadata of the third function from the metadata data source. In this embodiment, when the event-driven node fails, the metadata cache node cannot obtain the metadata change, deletion and other events, thereby causing the data cached by different metadata cache nodes to be inconsistent. In order to reduce the degree of inconsistency as much as possible, the metadata cache node enters a single-machine mode, that is, when the metadata is accessed, the time length from the latest time of source retrieval of the metadata to a current time is calculated, and if the time length is greater than a preset time length, for example, 1 minute or 5 minutes, a source retrieval is triggered, and the metadata and the time of source retrieval are updated in the cache. In an implementation of the first aspect of the present disclosure, the method further comprises: the gateway node detects network delay conditions of the plurality of metadata cache nodes; and the gateway node selects the first metadata cache node from the plurality of metadata cache nodes according to the network delay conditions of the plurality of metadata cache nodes. In this embodiment, the network node can perceive the network delay conditions of the plurality of metadata cache nodes, so that when a function is called, the metadata of the function can be requested from the metadata cache node with shorter network delay, thereby reducing the network delay of the function call, improving the network performance of the network node, and further improving the user experience. Optionally, the gateway node can detect the network delay conditions of the plurality of metadata cache nodes at a preset time interval. The size of the preset time interval can be set according to actual needs. In an implementation of the first aspect of the present disclosure, the gateway node detects the network delay conditions of the plurality of metadata cache nodes, comprising: the gateway node sends a plurality of detection requests to the metadata cache nodes, and determines the network delay conditions of the plurality of metadata cache nodes according to receiving time of response information of the plurality of detection requests received by the gateway node. In an implementation of the first aspect of the present disclosure, the first metadata cache node is a metadata cache node with the shortest network delay among the plurality of metadata cache nodes.In a second aspect, the disclosure provides a network system, comprising: a gateway node, a plurality of metadata cache nodes, and a metadata data source; the metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; the plurality of metadata cache nodes are configured to cache metadata of functions that have been invoked in the metadata data source; the gateway node, the plurality of metadata cache nodes, and the metadata data source cooperate to implement any of the methods described above. In a third aspect, the disclosure provides a gateway node in a network system, the network system comprising: the gateway node, a plurality of metadata cache nodes, and a metadata data source; the metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; the metadata cache nodes are configured to cache metadata of functions that have been invoked in the metadata data source; the gateway node comprises: a memory and a processor, wherein the memory is configured to store a program; the processor is coupled to the memory and is configured to execute the program stored in the memory to implement: the gateway node detects network latency of the plurality of metadata cache nodes; after the gateway node receives a function invocation request for a first function, the gateway node sends a metadata acquisition request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes according to the network latency of the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function invocation request.In a fourth aspect of the present disclosure, a computer readable storage medium storing a computer program is provided. The computer program, when executed by a computer, can implement: a gateway node detecting network delay conditions of a plurality of metadata cache nodes; after the gateway node receives a function call request for a first function, the gateway node sends a metadata obtaining request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes according to the network delay conditions of the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function call request; the computer readable storage medium is located in the gateway node; the gateway node and the plurality of metadata cache nodes are located in a network system, and the network system further comprises a metadata data source; the metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; and the plurality of metadata cache nodes are configured to cache metadata of functions that have been called in the metadata data source. In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements: a gateway node detecting network delay conditions of a plurality of metadata cache nodes; after the gateway node receives a function call request for a first function, the gateway node sends a metadata obtaining request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes according to the network delay conditions of the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance for processing the function call request; the computer program product is located in the gateway node; the gateway node and the plurality of metadata cache nodes are located in a network system, and the network system further comprises a metadata data source; the metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; and the plurality of metadata cache nodes are configured to cache metadata of functions that have been called in the metadata data source. BRIEF DESCRIPTION OF DRAWINGS In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained without creative labor.FIG. 1 is a structural schematic diagram of a network system according to an embodiment of the present disclosure; FIG. 2 is a first interaction signaling diagram of a communication method according to an embodiment of the present disclosure; FIG. 3 is a second interaction signaling diagram of a communication method according to an embodiment of the present disclosure; FIG. 4 is a third interaction signaling diagram of a communication method according to an embodiment of the present disclosure; FIG. 5 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION In the current Serverless architecture, although a cache is provided on the gateway node, in order to avoid cache inconsistency of different gateway nodes, the Time To Live (TTL) of the cache data is generally set to be relatively short, for example: 10 seconds to 1 minute. For functions with low access frequency, the cache of the gateway node cannot be benefited, and each time the function is called, the metadata needs to be sourced from the server, which causes time-consuming and time-varying delay. In addition to the influence of the gateway performance caused by the metadata sourcing, the direct dependence of the gateway on the data source also reduces the availability of the system. Once the data source fails, the gateway service also becomes unavailable. In order to solve or partially solve the above technical problems, the embodiments of the present disclosure provide a function calling method, a network system, a node, a storage medium and a program product. In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only some of the embodiments of the present disclosure, but not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of the present disclosure. In addition, in some of the processes described in the specification, claims and above drawings of the present disclosure, a plurality of operations appear in a specific order, which can not be executed in the order they appear in this document or in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and the operations can be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second" and the like in this document are used to distinguish different messages, devices, modules and the like, and do not represent the order of sequence, nor limit the types of "first" and "second".It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal. FIG. 1 is a schematic diagram of a communication system provided by an embodiment of the present disclosure. As shown in FIG. 1, the communication system includes: a tenant device 10 of a tenant, a user device 20 under the tenant, a gateway node 30, a metadata cache node 40, a metadata data source 50, a management and control node 60 and a service node 70. Among them, the tenant device of the tenant refers to the terminal device used by the tenant. The user device under the tenant refers to the terminal device of the user under the tenant (the user can be considered as a customer of the tenant). Optionally, the communication system can include a gateway cluster, and the gateway cluster includes a plurality of gateway nodes 30. Optionally, the communication system can include a metadata cache cluster, and the metadata cache cluster includes a plurality of metadata cache nodes 40. Optionally, the plurality of metadata cache nodes have the ability to respond to metadata acquisition requests of any gateway node at the same time. Optionally, the communication system can include a management and control cluster, and the management and control cluster includes a plurality of management and control nodes 60. Optionally, the communication system can include a service cluster, and the service cluster includes a plurality of service nodes 70. The interaction process of the communication method provided by the embodiment of the present disclosure in the function calling scene will be introduced below in combination with FIG. 1. The process can include the following steps.

[0002] 101. The user device 20 sends a function call request to the gateway node 30. The function call request can carry the function identification information of the called function, for example. The function identification information can include but is not limited to: function name, function ID (identification number). For the convenience of understanding, the function name will be taken as an example in the following description. The function call request carries the tenant identification information of the tenant to which the user device 20 belongs, for example. The tenant identification information can include: tenant ID. For the convenience of understanding, the tenant ID will be taken as an example in the following description. The function call request carries a URL (Uniform Resource Location, uniform resource locator), for example. The URL includes the tenant ID and the function name of the called function. By parsing the URL, the tenant ID and the function name of the called function can be obtained.

[0003] 102. The gateway node 30 obtains the metadata of the called function from the metadata cache node 40. The metadata of the function is used to create, to schedule an instance of the function. For example, the metadata of the function can include: function name, function code package location, function specification, environment variable, and the like configuration information. After the gateway node 30 receives the function invocation request, the gateway node 30 parses the function invocation request to obtain the function name of the called function. The gateway node 30 obtains the metadata of the called function from the metadata cache node 40 according to the function name of the called function. After the gateway node 30 obtains the metadata of the called function, the gateway node 30 performs step 103. In an optional embodiment, the gateway node 30 can first search for the metadata of the called function from its memory (i.e. single machine memory). If found, the gateway node 30 can skip step 102 and directly perform step 103. If not found, the gateway node 30 performs step 102, and after obtaining the metadata of the called function, the gateway node 30 caches the metadata of the called function in the memory of the gateway node 20. The metadata cached in the memory of the gateway node 20 is provided with a time to live TTL. When the metadata is cached in the memory of the gateway node 20 for a time to live, the gateway node 20 deletes the metadata from its memory. Generally, the TTL is set between 10 seconds and 1 minute.

[0004] 103、 The gateway node 30 requests the management and control node 60 to schedule an instance of the called function. The gateway node 30 can send an instance scheduling request to the management and control node 60, which can carry the metadata of the called function and the tenant ID. Illustratively, after receiving the instance scheduling request, the management and control node 60 creates an instance of the called function on the service node 70 according to the tenant ID and the metadata of the called function. Illustratively, after receiving the instance scheduling request, the management and control node 60 finds the created instance of the called function on the service node 70 according to the tenant ID and the metadata of the called function; if no created instance of the called function is found, an instance of the called function is created on the service node 70; if a created instance of the called function is found, it is determined whether the created instance of the called function is currently in an overload state; if the created instance is not currently in an overload state, the created instance can be reused; if the created instance is currently in an overload state, an instance of the called function is created on the service node 70. It should be noted that the instance runs on the service node 70 in the service cluster. In order to improve the utilization rate of the computing resources of the service cluster, the instance will be deleted when it is in an idle state for a preset time period.

[0005] 105、 The gateway node 30 forwards the function call request to the instance on the service node 70. The gateway node 30 forwards the function call request to the instance according to the instance information of the instance returned by the management and control node.

[0006] 106、 The service node 70 returns response information to the gateway node 30. The instance on the service node 70 processes the function call request and returns response information to the gateway node 30.

[0007] 107、 The gateway node 30 forwards the response information to the user equipment 20. In an optional embodiment, a plurality of gateway nodes 30 are distributed in a plurality of availability zones. The number of the plurality of availability zones can be greater than or equal to 3. A plurality of metadata cache nodes 40 are also distributed in the plurality of availability zones. That is, at least one gateway node 30 and at least one metadata cache node 40 are provided in each availability zone. In this way, when the gateway node 30 needs to obtain the metadata of the called function from the metadata cache cluster, the gateway node 30 can obtain the metadata of the called function from the metadata cache node 40 in the same availability zone, so as to shorten the network delay. Optionally, the metadata cache node in the embodiment of the present disclosure caches the metadata in the cache thereof, and the time consumption for reading the metadata from the cache is short. Exemplarily, the cache can be a cache memory. Optionally, the metadata cache node in the embodiment of the present disclosure caches the metadata in the memory thereof. The technical solution provided in the embodiment of the present disclosure adopts a distributed cache mechanism. When the gateway node performs origin-pulling, the metadata is obtained from the cache node, and the cache node can save the metadata related to all active functions, so as to decouple the dependence of the gateway node on the data source. The interaction process of the communication method provided in the embodiment of the present disclosure in the metadata adding scenario will be described below in combination with FIG. 2:

[0008] 201、The metadata cache node M2 subscribes to the metadata addition event, the metadata update event, and the metadata deletion event to the event-driven node. In the whole system, multiple metadata cache nodes can subscribe to the metadata addition event, the metadata update event, and the metadata deletion event to the event-driven node. In the embodiment of the present disclosure, the metadata cache node in the communication system is a publisher in the event-driven architecture and is also a subscriber in the event-driven architecture. The event-driven architecture can be based on a publish-subscribe mode. The event-driven node is provided with an event registry. In the event-driven architecture, the publisher and the subscriber do not directly communicate with each other, but interact through the event-driven. The publisher is responsible for generating events, and the publisher sends the events to the event-driven through a topic component running thereon. The publisher does not need to know which subscriber will receive the event, and it only needs to send the event to the event-driven. The event-driven receives the event sent by the publisher, and distributes the event to the corresponding subscriber according to the registration information of the subscriber. In the embodiment of the present disclosure, the node in which the event-driven component is deployed can be referred to as an event-driven node. The subscriber receives the event by registering the event type that the subscriber is interested in. When a new event reaches the event-driven, the event-driven sends the event to all subscribers that subscribe to the type of event. The event-driven is the core component of the event-driven architecture, and the event-driven component can include an MNS (Message Service) component or a Kafka component. Kafka is a high-throughput distributed publish-subscribe message system. The publisher and the subscriber interact through the event-driven node, which realizes the decoupling between the publisher and the subscriber and improves the maintainability and reusability of the code. Optionally, the metadata cache node encapsulates the access to the event-driven component in the form of an interface. In the embodiment of the present disclosure, the specific implementation of the event-driven component can be easily replaced, for example, from MNS to Kafka or from Kafka to MNS. Moreover, the metadata cache node accesses the event-driven component in the form of an interface, which is helpful to improve the scalability of the metadata cache node, where the scalability refers to increasing the number of metadata cache nodes. In the system, when any metadata cache node generates one of the metadata addition event, the metadata update event, and the metadata deletion event, the metadata cache node can send the generated event to the event-driven node; after the event-driven node receives the event, the event-driven node sends the event to multiple metadata cache nodes as subscribers.Exemplarily, the plurality of metadata cache nodes include the metadata cache node generating the event. When the metadata cache node receives the event sent by the event-driven node, the metadata cache node can determine whether the event is generated by itself. If the event is generated by itself, the metadata cache node ignores the event. If the event is not generated by itself, the metadata cache node performs corresponding processing. Exemplarily, each event can carry publisher identification information. The publisher identification information is used to identify the identity of the publisher. Exemplarily, the publisher identification information can include an IP (Internet Protocol) address of the metadata cache node.

[0009] 202. The gateway node Al receives the function call request sent by the user equipment. The gateway node Al can parse the function call request to determine the function name of the called function. In an embodiment, the gateway node Al can search for the metadata of the called function from the single machine memory. If the metadata of the called function is found, the gateway node Al requests the management node to schedule the function instance based on the metadata of the called function (for details, refer to the corresponding content in the above embodiment). If the metadata of the called function is not found, step 203 is performed.

[0010] 203. The gateway node Al requests the metadata cache node Ml to obtain the metadata of the called function. Optionally, the gateway node Al sends a metadata obtaining request to the metadata cache node Ml, and the metadata obtaining request carries the function name of the called function. It should be noted that in actual application, the number of metadata cache nodes in the communication system is multiple. The metadata cache node Ml can be any node in the plurality of metadata cache nodes or the node with the shortest current access delay (i.e., the network delay described above) in the plurality of metadata cache nodes. The current access delay of the metadata cache node refers to the delay of the gateway node Al currently accessing the metadata cache node. The gateway node Al can send N (N is greater than or equal to 1) probe requests to each metadata cache node in the plurality of metadata cache nodes at a preset time interval, and determine the metadata cache node that returns the response message of the N probe requests earliest as the node with the shortest current access delay in the plurality of metadata cache nodes. In order to avoid the influence of random conditions, N is an integer greater than 1, for example, 5. Exemplarily, the metadata cache node can provide a health check interface for the gateway node to probe. Optionally, the metadata cache node Ml can also be a metadata cache node with a current access delay less than or equal to a preset access delay threshold in the plurality of metadata cache nodes.

[0011] 204、 The metadata cache node Ml locally looks up the metadata of the called function. If the metadata cache node Ml locally finds the metadata of the called function, the metadata cache node Ml can execute step 207, i.e., returns the metadata of the called function to the gateway node Al. If the metadata cache node Ml does not locally find the metadata of the called function, the metadata cache node Ml executes the following step 205.

[0012] 205、 The metadata cache node Ml requests the metadata data source to obtain the metadata. The metadata cache node Ml sends a metadata obtaining request to the metadata data source. It should be noted that when the metadata cache node Ml needs to back source, a single flight mechanism is adopted to provide a set of suppression mechanisms for repeated function calls, for limiting repeated requests under concurrent access.

[0013] 206、 The metadata data source returns the metadata of the called function to the metadata cache node Ml. The metadata cache node Ml stores the metadata of the called function in its cache, and executes step 207.

[0014] 207、 The metadata cache node Ml returns the metadata of the called function to the gateway node Al. After the gateway node Al obtains the metadata of the called function, the gateway node Al can request the function instance to be scheduled by the management node, and the specific content can be referred to the corresponding content in the above embodiments.

[0015] 208、 The metadata cache node Ml publishes a metadata adding event to the event-driven node. The metadata adding event can carry the function name of the called function.

[0016] 209、 The event-driven node notifies the metadata cache node M2 of the metadata addition event. In an embodiment, the event-driven node can notify other metadata cache nodes in the communication system of the metadata addition event. In another embodiment, the event-driven node can notify multiple metadata cache nodes in the communication system of the metadata addition event, which carries the publisher identification information. In this way, when the metadata cache node receiving the event determines that the message is published by itself according to the publisher identification information carried in the event, the metadata cache node can be ignored. In addition, in actual application, the metadata cache node may have network anomalies. When the metadata cache node has network anomalies, the metadata cache node cannot normally receive various events sent by the event-driven node. For example, if the metadata cache node does not receive the metadata addition event about function S, the metadata cache node needs to perform source retrieval when receiving the metadata acquisition request about function S sent by the gateway node, which increases network latency. For example, if the metadata cache node does not receive the metadata update event about function S, the metadata cache node cannot update the metadata of function S cached thereon in time, which causes the metadata acquisition request about function S sent by the gateway node to return old or invalid metadata, and further causes function call failure and affects user experience. For example, if the metadata cache node does not receive the metadata deletion event about function S, the metadata cache node cannot delete the metadata of function S cached thereon in time, which causes the metadata acquisition request about function S sent by the gateway node to still return the metadata that should have been deleted, and the gateway node performs instance scheduling again after receiving the metadata. However, the invalid instance scheduling increases the scheduling pressure of the management node. To solve this problem, the event-driven node maintains the consumption position corresponding to each event, and the event-driven node can carry the consumption position corresponding to the event when sending the event to the metadata cache node. In this way, if the metadata cache node is disconnected and connected again, the metadata cache node can pull the events that have not been consumed from the event-driven node based on the consumption position corresponding to the last received event. By sending the consumption position corresponding to the event to the metadata cache node, it can be ensured that the metadata cache node will not lose events due to disconnection.

[0017] 210、 The metadata cache node M2 requests the metadata data source to acquire the metadata of the called function. The metadata cache node M2 can send a metadata acquisition request to the metadata data source.

[0018] 211、 The metadata data source returns the metadata of the called function to the metadata cache node M2.

[0019] 212、 The metadata cache node M2 stores the metadata of the called function. The metadata cache node M2 stores the metadata of the called function in its cache. It should be noted that the function name of the called function is carried in each metadata acquisition request in the above embodiment. In this scenario, the metadata cache node needs to add metadata in the cache. According to the principle of temporal locality, the metadata may also be accessed, so the metadata addition event is published to the event-driven node, so that other metadata cache nodes can timely perceive the addition and add metadata in their own caches, realize synchronization between the metadata cache nodes, and make the subsequent function call not need to go back to the source. In addition, the above method can further include the following steps (not shown) :

[0020] 213、 The metadata cache node M2 can also notify the gateway node A2 of the metadata addition event. The gateway node A2 is a gateway node that subscribes to the metadata addition event from the metadata cache node M2 in advance.

[0021] 214、 The gateway node A2 requests the metadata cache node M2 to acquire the metadata of the called function.

[0022] 215、 The metadata cache node M2 returns the metadata of the called function to the gateway node A2. That is, the metadata cache node also pushes the function name of the added metadata to the gateway node that subscribes to the metadata addition event, so that the gateway node acquires the metadata from the metadata cache node to cache. In the embodiment of the present disclosure, the gateway node is deployed in multiple availability zones, and the cache node also needs to be deployed in these availability zones. In order to avoid the gateway node accessing the cache node across the availability zones as much as possible, causing the access delay to fluctuate, the gateway node needs to perceive the access delay of each cache node, so as to select the cache node with the shortest access delay, so as to reduce the time consumption of each access. The interaction process of the communication method provided by the embodiment of the present disclosure in the metadata update scenario will be introduced below in combination with FIG. 3:

[0023] 301、The metadata cache node M2 subscribes to metadata addition events, metadata update events, and metadata deletion events to the event-driven node.

[0024] 303、The gateway node Al receives an update function request. The update function request is sent by a tenant device. The update function request carries a function name of a function to be updated and new metadata of the function to be updated. The gateway node Al can parse the update function request to obtain the function name of the function to be updated.

[0025] 304、The gateway node Al requests the metadata data source to update metadata of the function to be updated. The metadata data source updates the metadata of the function to be updated. After the update succeeds, step 305 is performed. Illustratively, the metadata data source can delete old metadata of the function to be updated, and then store new metadata of the function to be updated.

[0026] 305、The metadata data source notifies the gateway node Al of the update success. After receiving the notification, the gateway node Al performs step 306.

[0027] 306、 The gateway node Al informs the metadata cache node Ml to update the metadata of the function to be updated. The gateway node Al can inform any metadata cache node to update the metadata of the function to be updated, or the gateway node Al can inform the metadata cache nodes in the same availability zone to update the metadata of the function to be updated. It should be noted that if the gateway node Al does not receive the notification of the success of the metadata update of the function to be updated within a preset time length, the next metadata cache node in the system is informed through traversal until the notification of the success of the metadata update of the function to be updated is received.

[0028] 307、 The metadata cache node Ml deletes the metadata of the function to be updated. That is, the metadata cache node Ml deletes the metadata of the function to be updated currently stored in the cache of the metadata cache node Ml.

[0029] 308、 The metadata cache node Ml requests the metadata data source to obtain the metadata of the function to be updated. The metadata cache node Ml can send a metadata obtaining request to the metadata data source, and the request carries the function name of the function to be updated.

[0030] 309、 The metadata data source returns the metadata of the function to be updated to the metadata cache node Ml. The metadata of the function to be updated returned by the metadata cache node Ml is the updated metadata.

[0031] 310、 The metadata cache node Ml stores the metadata of the function to be updated. After receiving the metadata of the function to be updated, the metadata cache node Ml stores the metadata of the function to be updated in the cache of the metadata cache node Ml.

[0032] 311、 The metadata cache node Ml publishes a metadata update event to the event-driven node. The metadata update event carries the function name of the function to be updated. For example, the metadata update event can also carry the identification information of the publisher, and the specific role can be referred to the corresponding content in the above embodiments.

[0033] 312、 The metadata cache node Ml informs the gateway node Al of the success of the update. That is, the Ml sends the notification of the success of the metadata update of the function to be updated to the Al.

[0034] 313、 The event-driven node informs the metadata cache node M2 of the metadata update event. After receiving the metadata update event, the metadata cache node M2 performs step 314.

[0035] 314、 The metadata cache node M2 deletes the metadata of the function to be updated.

[0036] 315、 The metadata cache node M2 requests the metadata data source to obtain the metadata of the function to be updated.

[0037] 316、 The metadata data source returns the metadata of the function to be updated to the metadata cache node M2.

[0038] 317、 The metadata cache node M2 stores the metadata of the function to be updated returned by the metadata data source.

[0039] 318、 The metadata cache node M2 notifies the gateway node A2 of the metadata update event.

[0040] 319、 The gateway node A2 requests the metadata cache node M2 to obtain the metadata of the function to be updated.

[0041] 320、 The metadata cache node M2 returns the metadata of the function to be updated to the gateway node A2. After obtaining the metadata of the function to be updated, the gateway node A2 caches the metadata in the single machine memory. If the metadata of the function to be updated has been cached in the gateway node A2, the gateway node A2 caches the new metadata of the function to be updated returned by the metadata cache node M2 in the form of replacement. In this scenario, the metadata cache node needs to update the data stored by itself and publish the metadata update event to the event-driven node, so that other metadata cache nodes can timely perceive the change and update the cache of themselves, thereby realizing the synchronization between the metadata cache nodes. The metadata cache node also pushes the function name of the changed metadata to the gateway node subscribed to the metadata change event, so that the gateway node obtains the latest data from the metadata cache node. The interaction process of the communication method provided by the embodiment of the present disclosure in the metadata deletion scenario will be introduced below in combination with FIG. 4:

[0042] 401、 The metadata cache node M2 subscribes to the metadata addition event, the metadata update event and the metadata deletion event to the event-driven node.

[0043] 402、 The gateway node A2 subscribes to the metadata update event and the deletion event to the metadata cache node M2. It needs to be noted that the step 401 above and the step 301 in FIG. 3 are the same step; the step 402 above and the step 302 in FIG. 3 are the same step. Optionally, the gateway node A2 can subscribe to the metadata addition event to the metadata cache node M2.

[0044] 403、 The gateway node A1 receives a function deletion request. For example, the function deletion request carries the function name of the function to be deleted.

[0045] 404、 The gateway node Al requests the metadata data source to delete the metadata of the function to be deleted. After receiving the request, the metadata data source deletes the metadata of the function to be deleted.

[0046] 405、 The metadata data source notifies the gateway node Al of the success of deletion. After receiving the notification, the gateway node Al performs step 406.

[0047] 406、 The gateway node Al notifies the metadata cache node Ml of the deletion of the metadata of the function to be deleted. The metadata cache node Ml can be any one of the plurality of metadata cache nodes or a metadata cache node in the same availability zone as the gateway node Al. It should be noted that if the gateway node Al does not receive the notification of the success of deletion of the metadata of the function to be deleted within a preset time length, the next metadata cache node in the system is notified in a traversal manner until the notification of the success of deletion of the metadata of the function to be deleted is received. After receiving the notification, the metadata cache node Ml performs step 407.

[0048] 407、 The metadata cache node Ml deletes the metadata of the function to be deleted.

[0049] 408、 The metadata cache node Ml publishes a metadata deletion event to the event-driven node. After publishing the metadata deletion event to the event-driven node, the metadata cache node Ml can also notify the gateway node Al of the success of deletion, so that the gateway node Al does not need to notify other metadata cache nodes to delete the metadata of the function to be deleted.

[0050] 409、 The event-driven node sends a metadata deletion event (i.e., a notification) to the metadata cache node M2. After receiving the metadata deletion event, the event-driven node can send the metadata deletion event to a plurality of metadata cache nodes.

[0051] 410、 The metadata cache node M2 deletes the metadata of the function to be deleted.

[0052] 411、 The metadata cache node M2 sends a metadata deletion event (i.e., a notification) to the gateway node A2.

[0053] 412、 The gateway node A2 deletes the metadata of the function to be deleted. After receiving the metadata deletion event, the gateway node A2 deletes the metadata of the function to be deleted. In the present scenario, the metadata cache node needs to delete the data stored by itself and publish the metadata deletion event to the event-driven node, so that other metadata cache nodes can timely perceive the deletion and delete the cache by themselves, thereby realizing the synchronization among the metadata cache nodes. The metadata cache node also pushes the function name of the deleted metadata to the gateway node that subscribes to the metadata deletion event, so that the gateway node deletes the metadata. The processing manner of metadata deletion is similar to that of metadata update, but the value in the cache is not updated but deleted. In the above metadata update and deletion scenarios, when the user modifies the function attribute, the related metadata stored by all cache nodes also needs to be timely updated and pushed to the gateway node, so that the time of inconsistent cache data of all gateway nodes is as low as possible, so that the function call request of the user hitting any gateway node is processed using the latest metadata, and inconsistency does not occur, thereby avoiding processing the request using old metadata and avoiding the user's feeling that the metadata update and metadata deletion take a long time to take effect. In addition, in actual applications, the failure of the event-driven node can cause the metadata cache node to fail to obtain metadata change, deletion and other events, thereby causing the data cached by different metadata cache nodes to be inconsistent. In order to reduce the degree of inconsistency as much as possible, the metadata cache node enters a single machine mode, that is, when the metadata is accessed, the time length from the current time to the last time of the metadata is calculated. If the time length is greater than a first preset time threshold, for example, 1 minute or 5 minutes, a source is triggered once (that is, the metadata is obtained from the metadata data source), and the metadata and the source time are updated in the cache. When the metadata cache node is disconnected, if the disconnection of the metadata cache node lasts for a time length greater than a second preset time threshold, the metadata cache node is restarted after the network is restored. The metadata cached by the metadata cache node before the restart is emptied. Optionally, in the present disclosure, the metadata cached in the metadata cache node can be set to be permanent and not expire. In summary, the technical scheme provided by the embodiments of the present disclosure can bring the following beneficial effects:

[0054] 1. Reduce the system side time consumption. For a function call, when the gateway node does not cache the metadata of the function, the gateway node requests to access the metadata cache node; the metadata cache node can quickly find the metadata from its cache; if the metadata cache node finds the metadata of the function, it returns to the gateway node, in which case the time consumption is short; if the metadata cache node does not find it, it requests the metadata data source to find the metadata, the metadata data source returns the metadata to the metadata cache node, and the metadata cache node returns the metadata to the gateway node, in which case the time consumption is longer, but other metadata cache nodes can timely perceive the metadata addition event of the metadata cache node and complete the metadata addition, so that any metadata cache node in the subsequent system can quickly return to the gateway node when receiving the metadata access request of the function from the gateway node, thereby shortening the time consumption. In addition, each gateway node is provided with a metadata cache node in an availability zone, and the gateway node accesses multiple metadata cache nodes by periodic polling to detect the network delay of each node, so that the metadata cache node with the lowest delay can be selected from the multiple metadata cache nodes, which helps to ensure stable low delay. Usually, the metadata cache node with the lowest delay is the metadata cache node in the same availability zone, and the single data acquisition time consumption is within 1ms. Different availability zones of network nodes can enjoy consistent performance. Of course, if the metadata cache node in the same availability zone is overloaded, the access delay is higher than that of the metadata cache node across the availability zones, in which case the metadata cache node across the availability zones is also beneficial to reduce the access delay. It can be seen that the technical scheme provided by the embodiment of the present disclosure can reduce the system side time consumption and improve the user experience. Experiments show that the metadata acquisition time consumption is reduced from 20-300ms to within 1ms.

[0055] 2. Reduce the time of inconsistent metadata cached between gateway nodes. The TTL of the single machine cache of the gateway node is set to 1 minute, and after the metadata is changed, different gateway nodes will hold inconsistent new and old data within the 1-minute window. By using the ability of the gateway node to subscribe to the metadata cache node, the gateway node can timely perceive the data change and update, and reduce the metadata inconsistency time from minutes to hundreds of milliseconds.

[0056] 3. Reduce the time of inconsistent metadata cached between metadata cache nodes. Through the publish / subscribe function, the inconsistency time of the cache between nodes is reduced to hundreds of milliseconds.

[0057] 4. Improve system availability. When the data source fails, the gateway node can still get cached data from the metadata cache node, and will not be blocked in accessing the metadata data source logic.

[0058] 5. Metadata cache cluster is a distributed cache, using stateless design, can horizontally scale any number of nodes, generally in an availability zone to deploy a node. If the single node load is too high, you only need to expand the node, combined with the gateway node dynamic perception of each metadata cache node latency mechanism, the gateway node will send the request to the new node with low load, strong scalability, and simple logic easy to maintain. And the cache node online and offline does not affect the service.

[0059] 6、 improve the fault tolerance of the entire system. For example, when the metadata data source fails, the cached data (i.e., inventory) related function calls are not affected, but the metadata related to the incremental function calls cannot be obtained. The embodiments of the present disclosure also provide a network system. As shown in FIG. 1, the network system includes: a gateway node 30, a plurality of metadata cache nodes 40, and a metadata data source 50; the plurality of metadata cache nodes 40 have the ability to respond to metadata acquisition requests of the gateway node 30; the metadata data source 50 is used to store metadata of a function; the metadata of the function is used to schedule an instance of the function; the plurality of metadata cache nodes 40 are used to cache metadata of a called function in the metadata data source 50; the gateway node 30, the plurality of metadata cache nodes 40, and the metadata data source 50 cooperate with each other to implement the methods described in the above embodiments. Optionally, the above network system can be a serverless architecture. FIG. 5 shows a structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG. 5, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various data to support operations on the electronic device. Examples of the data include instructions of any application or method for operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk. The memory 1101 is configured to store a program; and the processor 1102, coupled with the memory 1101, is configured to execute the program stored in the memory 1101 to implement the method provided by any of the above method embodiments. Further, as shown in FIG. 5, the electronic device further includes a communication component 1103, a display 1104, a power component 1105, an audio component 1106, and other components.The components shown in FIG. 5 are only schematic and do not mean that the electronic device only includes the components shown in FIG. 5. Accordingly, the embodiments of the present disclosure also provide a computer readable storage medium storing a computer program, which can implement the steps or functions of the methods provided by the above-mentioned method embodiments when the computer program is executed by a computer. The embodiments of the present disclosure also provide a computer program product, including computer programs / instructions, which can implement the steps or functions of the methods provided by the above-mentioned method embodiments when the computer programs / instructions are executed by a processor. The above-described device embodiments are only schematic and the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor. Through the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software plus necessary universal hardware platforms, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, which can be stored in a computer readable storage medium, such as ROM (Read Only Memory, read-only memory) / RAM (Random Access Memory, random access memory), magnetic disk, optical disk, etc., including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments. Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure.

Claims

CLAIM 1. A function call method applied to a network system, wherein, The network system comprises: a gateway node, a plurality of metadata cache nodes and a metadata data source; the plurality of metadata cache nodes have the capability of responding to metadata acquisition requests of the gateway node; the metadata data source is used to store metadata of functions; the metadata of the functions is used to schedule instances of the functions; the plurality of metadata cache nodes are used to cache metadata of functions that are invoked in the metadata data source; the method comprises: after the gateway node receives a function invocation request for a first function, the gateway node sends a metadata acquisition request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function invocation request.

2. The method of claim 1, wherein, Further comprising: After the first metadata cache node receives the metadata acquisition request for the first function, the first metadata cache node searches for metadata of the first function in a cache of the first metadata cache node. If the metadata of the first function is found in the cache of the first metadata cache node, the first metadata cache node returns the metadata of the first function to the gateway node.

3. The method of claim 2, wherein, Further comprising: If the metadata of the first function is not found in the cache of the first metadata cache node, the first metadata cache node acquires the metadata of the first function from the metadata data source. The first metadata cache node sends the metadata of the first function to the gateway node and adds the metadata of the first function in the cache of the first metadata cache node.

4. The method according to claim 3, wherein, The network system further comprises: an event-driven node; the method further comprises: after the first metadata cache node completes the adding operation of the metadata of the first function in the cache of the first metadata cache node, the first metadata cache node publishes a metadata adding event to the event-driven node; the event-driven node sends the metadata adding event to a second metadata cache node that is a subscription party of the event-driven node; the second metadata cache node is a metadata cache node in the plurality of metadata cache nodes; the second metadata cache node adds the metadata of the first function in a cache of the second metadata cache node according to the metadata adding event.

5. The method according to claim 4, wherein, The second metadata cache node adds the metadata of the first function in the cache of the second metadata cache node according to the metadata adding event, comprising: the second metadata cache node acquires the metadata of the first function from the metadata data source according to the metadata adding event; the second metadata cache node adds the metadata of the first function in the cache of the second metadata cache node.

6. The method according to any one of claims 1-5, wherein, The gateway nodes are multiple; the multiple gateway nodes are distributed in multiple availability zones; each availability zone is deployed with at least one gateway node and at least one metadata cache node.

7. The method according to any one of claims 1 to 6, wherein, The network system comprises a first gateway node and an event-driven node; The multiple metadata cache nodes comprise a third metadata cache node and a fourth metadata cache node; the method comprises: after the first gateway node receives a metadata editing request for a second function, requesting a metadata data source to edit metadata of the second function; After the metadata data source edits the metadata of the second function, the first gateway node notifies the third metadata cache node to edit the metadata of the second function in the cache of the third metadata cache node; after the third metadata cache node completes the editing of the metadata of the second function, the third metadata cache node sends a metadata editing event to the event-driven node; the event-driven node sends the metadata editing event to a fourth metadata cache node as a subscriber of the event-driven node; after the fourth metadata cache node receives the metadata editing event, the fourth metadata cache node edits the metadata of the second function in the cache of the fourth metadata cache node.

8. The method according to claim 7, wherein, The network system comprises a second gateway node as a subscriber of the fourth metadata cache node; after the fourth metadata cache node completes the editing of the metadata of the second function, the fourth metadata cache node sends a metadata editing event to the second gateway node; The second gateway node edits the metadata of the second function in the cache of the second gateway node according to the metadata editing event.

9. The method according to claim 7 or 8, wherein, Further comprising: In the case that the event-driven node fails, when the fourth metadata cache node receives a metadata obtaining request for a third function, the fourth metadata cache node determines a time length from a first source returning time point; the first source returning time point refers to a latest source returning time point of the fourth metadata cache node for metadata of the third function; when the time length is greater than or equal to a preset time length threshold, the fourth metadata cache node obtains the metadata of the third function from the metadata data source.

10. The method according to any one of claims 7-9, wherein, The metadata editing request comprises a metadata updating request and a metadata deleting request.

11. The method according to any one of claims 1-10, wherein, Further comprising: the gateway node detects network delay conditions of the multiple metadata cache nodes; the gateway node selects the first metadata cache node from the multiple metadata cache nodes according to the network delay conditions of the multiple metadata cache nodes.

12. The method according to any one of claims 1-11, wherein, The gateway node detects the network delay conditions of the multiple metadata cache nodes, comprising: the gateway node sends multiple detection requests to the metadata cache nodes, and determines the network delay conditions of the multiple metadata cache nodes according to receiving time points of response information of the multiple detection requests received by the gateway node 13. The method according to any one of claims 1 to 12, wherein, The first metadata cache node is a metadata cache node with the shortest network delay among the multiple metadata cache nodes.

14. A network system, wherein, Comprise: The gateway node, the plurality of metadata cache nodes, and the metadata data source; The plurality of metadata cache nodes have the ability to respond to metadata obtaining requests from the gateway node; The metadata data source is configured to store metadata of functions; The metadata of the functions is configured to schedule instances of the functions; The plurality of metadata cache nodes are configured to cache metadata of functions that have been invoked in the metadata data source; The gateway node, the plurality of metadata cache nodes, and the metadata data source cooperate to implement the method of any one of claims 1-13.

15. A gateway node in a network system, wherein, The network system comprises: the gateway node, the plurality of metadata cache nodes, and the metadata data source; the plurality of metadata cache nodes have the ability to respond to metadata obtaining requests from the gateway node; the metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; the plurality of metadata cache nodes are configured to cache metadata of functions that have been invoked in the metadata data source; the gateway node comprises: a memory and a processor, wherein, The memory is configured to store a program; the processor, coupled to the memory, is configured to execute the program stored in the memory to implement: after the gateway node receives a function invocation request for a first function, the gateway node sends a metadata obtaining request for the first function to a first metadata cache node; the first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes; after the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function invocation request.

16. A computer-readable storage medium storing a computer program, wherein, The computer program is executed by a computer to implement: after the gateway node receives a function invocation request for a first function, the gateway node sends a metadata obtaining request for the first function to a first metadata cache node; The first metadata cache node is selected by the gateway node from the plurality of metadata cache nodes; the plurality of metadata cache nodes have the ability to respond to metadata obtaining requests from the gateway node; After the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function invocation request; The computer readable storage medium is located in the gateway node; The gateway node and the plurality of metadata cache nodes are located in a network system, and the network system further comprises a metadata data source; The metadata data source is configured to store metadata of functions; the metadata of the functions is configured to schedule instances of the functions; the plurality of metadata cache nodes are configured to cache metadata of functions that have been invoked in the metadata data source.

17. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements: after the gateway node receives a function call request for a first function, sending a metadata obtaining request for the first function to a first metadata cache node; The first metadata cache node is selected by the gateway node from a plurality of metadata cache nodes; the plurality of metadata cache nodes have the ability to respond to metadata obtaining requests of the gateway node; After the gateway node receives metadata of the first function returned by the first metadata cache node, the gateway node requests to schedule an instance of the first function for processing the function call request; the computer program product is located in the gateway node; The gateway node and the plurality of metadata cache nodes are located in a network system, and the network system further comprises a metadata data source; The metadata data source is used for storing metadata of functions; the metadata of the functions is used for scheduling instances of the functions; and the plurality of metadata cache nodes are used for caching metadata of functions called in the metadata data source. 17

Citation Information

Patent Citations

  • Method and device for reading and writing data

    CN106201923A

  • Service request transmission method and device

    CN111049854A

  • Private cloud-based service security policy management method

    CN114189358A

  • Systems and methods for 5g location support using service based interfaces

    US20230403533A1