CN114679459A - Cloud function calling method and device - Google Patents

Cloud function calling method and device Download PDF

Info

Publication number
CN114679459A
CN114679459A CN202210495164.0A CN202210495164A CN114679459A CN 114679459 A CN114679459 A CN 114679459A CN 202210495164 A CN202210495164 A CN 202210495164A CN 114679459 A CN114679459 A CN 114679459A
Authority
CN
China
Prior art keywords
cloud function
calling
charging
charging mode
caller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210495164.0A
Other languages
Chinese (zh)
Other versions
CN114679459B (en
Inventor
吴君印
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210495164.0A priority Critical patent/CN114679459B/en
Publication of CN114679459A publication Critical patent/CN114679459A/en
Application granted granted Critical
Publication of CN114679459B publication Critical patent/CN114679459B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1403Architecture for metering, charging or billing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Abstract

The present disclosure provides a cloud function calling method and device, the method including: the cloud function charging method includes the steps that a calling request of a caller for calling a cloud function through user equipment is received, a charging mode of the cloud function is obtained according to the calling request, if the charging mode is the caller charging mode, the calling of the cloud function is completed in response to the fact that the calling of the cloud function is completed, the cloud function is called by the caller for charging processing, charging information is obtained and output to the user equipment, flexibility and diversity of the charging mode are improved, and therefore the technical effect that the flexibility and the diversity of calling of the cloud function are improved is achieved.

Description

Cloud function calling method and device
Technical Field
The disclosure relates to the technical field of cloud platforms, and in particular to a cloud function calling method and device.
Background
Cloud functions (Cloud functions) provide a capability for code to run directly on the Cloud, stateless, transient, triggered by events (either triggered by hypertext Transfer Protocol (HTTP), Application Programming Interface (API), Command-Line Interface (CLI), console calls, etc.). The party creating the cloud function may be referred to as the creator, and the party calling the cloud function may be referred to as the caller.
In the related art, a creator creates a cloud function in a public cloud, and a cloud function operating system performs charging processing on the creator and generates an identifier (such as a name of the cloud function) of the cloud function, so that a user calls the cloud function from the public cloud.
Disclosure of Invention
The disclosure provides a cloud function calling method and device. The method is used for improving the diversity and flexibility of cloud function calling.
In a first aspect, an embodiment of the present disclosure provides a method for calling a cloud function, where the method is applied to a cloud platform, where a cloud function is deployed in the cloud platform, and the method includes:
receiving a call request which is initiated by a caller through user equipment and used for calling the cloud function;
acquiring a charging mode of the cloud function according to the calling request;
and if the charging mode is a caller charging mode, responding to the completion of the cloud function call, calling the cloud function by the caller for charging processing, and obtaining and outputting charging information to the user equipment.
In an embodiment of the present disclosure, the obtaining, according to the call request, a charging mode of the cloud function includes:
acquiring an attribute field of the cloud function and attribute information corresponding to the attribute field according to the calling request;
and determining the charging mode according to the attribute field and the attribute information.
In an embodiment of the present disclosure, the determining the charging mode according to the attribute field and the attribute information includes:
determining a charging field for characterizing the charging mode from the attribute field;
and extracting attribute information corresponding to the charging field from the attribute information to determine the attribute information as the charging mode.
In one embodiment of the present disclosure, the charging mode is determined based on category information and/or usage information of the cloud function.
In an embodiment of the present disclosure, the calling the cloud function to perform charging processing to obtain and output charging information to the user equipment includes:
calling the cloud function to the caller to perform charging processing to obtain the charging information;
outputting the charging information according to a preset charging mode, wherein the charging mode comprises at least one of the following modes:
a charging mode based on calling times, a charging mode based on the time for calling the cloud function, a charging mode based on the memory of the cloud function, a charging mode based on the central processing unit corresponding to the cloud function, and a charging mode based on a time interval.
In an embodiment of the present disclosure, after the receiving a call request initiated by a caller through a user equipment to call a cloud function, the method further includes:
carrying out authentication processing on the caller to obtain an authentication result, wherein the authentication result is used for representing whether the caller has a calling authority for calling the cloud function;
and if the authentication result represents that the caller has the calling authority, calling the cloud function.
In a second aspect, an embodiment of the present disclosure provides a device for calling a cloud function, which is applied to a cloud platform, where a cloud function is deployed in the cloud platform, and the device includes:
the receiving unit is used for receiving a calling request which is initiated by a caller through user equipment and used for calling the cloud function;
the obtaining unit is used for obtaining the charging mode of the cloud function according to the calling request;
the charging unit is used for responding to the completion of the cloud function call and calling the cloud function by the caller to perform charging processing to obtain charging information if the charging mode is a caller charging mode;
and the output unit is used for outputting the charging information to the user equipment.
In one embodiment of the present disclosure, the obtaining unit includes:
the obtaining subunit is configured to obtain, according to the call request, an attribute field of the cloud function and attribute information corresponding to the attribute field;
and the determining subunit is used for determining the charging mode according to the attribute field and the attribute information.
In one embodiment of the present disclosure, the determining subunit includes:
a determining module, configured to determine, from the attribute field, a charging field for characterizing the charging mode;
and the extracting module is used for extracting the attribute information corresponding to the charging field from the attribute information and determining the attribute information as the charging mode.
In one embodiment of the present disclosure, the charging mode is determined based on category information and/or usage information of the cloud function.
In an embodiment of the present disclosure, the output unit is configured to output the charging information according to a preset charging manner, where the charging manner includes at least one of:
a charging mode based on calling times, a charging mode based on time for calling the cloud function, a charging mode based on a memory of the cloud function, a charging mode based on a central processing unit corresponding to the cloud function, and a charging mode based on time intervals.
In one embodiment of the present disclosure, the apparatus further comprises:
the authentication unit is used for authenticating the caller to obtain an authentication result, wherein the authentication result is used for representing whether the caller has a calling authority for calling the cloud function;
and the calling unit is used for calling the cloud function if the authentication result represents that the caller has the calling authority.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the electronic device to perform the method of invoking the cloud function of the first aspect.
In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for calling a cloud function according to the first aspect.
In a fifth aspect, the present disclosure provides a computer program product, which includes a computer program, and when executed by a processor, the computer program implements the method for calling a cloud function according to the first aspect.
The embodiment of the disclosure provides a cloud function calling method and device, which can be used for a caller charging mode through a charging mode, and when the charging mode is the caller charging mode, the caller is charged and processed, technical characteristics of charging information transmission to the caller are obtained and transmitted, flexibility and diversity of the charging mode are improved, and further technical effects of flexibility and diversity of cloud function calling are improved.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a flowchart of a method for calling a cloud function according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of an application scenario of a method for calling a cloud function according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a method for calling a cloud function according to another embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a method for invoking a cloud function according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a cloud function calling device according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a cloud function calling device according to another embodiment of the disclosure;
fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more apparent, the technical solutions in the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The terms "first," "second," "third," and the like in the description and in the claims of the present disclosure and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein.
Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
A cloud function is a piece of code that runs in the cloud, is lightweight, unassociated, and reusable. The corresponding data result can be obtained only by writing and uploading codes without a management server.
The cloud function is a server-free (Serverless) execution environment, a user runs the code without purchasing and managing a server, the code can be run on the cloud only by writing the code by using a language supported by the cloud platform and setting a code running condition, and the cloud function is an ideal computing platform under the scenes of real-time file processing, data processing and the like.
That is, public cloud functions are an increasingly popular computing model that provides a computing model that is created and invoked directly on the public cloud. The cross-account call is one of the most important scenes, and can be understood as that different accounts call the same cloud function, that is, different callers call a certain cloud function deployed in a public cloud.
The party creating the cloud function in the public cloud is called a creator, and the party calling the cloud function may be simply called a caller.
In order to improve flexibility and diversity of cloud function calling, the cloud function calling method includes the steps of obtaining a charging mode corresponding to a calling function when a calling request initiated by a caller is received, and carrying out charging processing on the caller when the cloud function is called and the caller outputs charging information if the charging mode is the caller charging mode.
Hereinafter, the technical means of the present disclosure will be described in detail by specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
Fig. 1 is a flowchart of a method for calling a cloud function according to an embodiment of the present disclosure, where the method may be applied to a cloud platform, and the cloud function is deployed in the cloud platform.
As shown in fig. 1, the method includes:
s101: and receiving a call request for calling the cloud function, which is initiated by a caller through the user equipment.
For example, the execution subject of this embodiment may be a calling device of a cloud function (hereinafter, referred to as a calling device), and the calling device may be a server disposed on a cloud platform, and the present embodiment is not limited thereto.
As shown in fig. 2, a cloud function is deployed in the cloud platform, the user equipment may be a notebook computer, and a caller initiates a call request to a call device in the cloud platform through the notebook computer. Accordingly, the calling device receives the call request.
It should be understood that the notebook computer in fig. 2 is only used for exemplary illustration, and the user equipment may be a notebook computer, and is not to be construed as a limitation on the user equipment. For example, the user equipment may also be a Personal Computer (PC), a mobile terminal (such as a mobile phone, etc.), and the like.
S102: and acquiring the charging mode of the cloud function according to the calling request.
The charging mode refers to a charging mode for calling a cloud function, and the charging mode can be a creator charging mode or a caller charging mode. The system can perform charging processing on a creator and a caller, so as to realize charging processing from different dimensions and improve the flexibility and diversity of the charging processing.
S103: and if the charging mode is the caller charging mode, responding to the completion of cloud function calling, and performing charging processing on the cloud function called by the caller to obtain and output charging information to the user equipment.
In combination with the above analysis, the charging mode may be a caller charging mode, and when the charging mode is the caller charging mode, the caller may call a cloud function to perform charging processing, so as to implement charging processing of the cloud function from the caller side.
For example, when receiving the call request, the calling device may obtain the charging mode, and may call the cloud function, for example, execute the cloud function, if the cloud function is executed and the determined charging mode is the caller charging mode, generate the charging information that the caller calls the cloud function this time, and as shown in fig. 2, the calling device may transmit the charging information to the computer, so as to output and display the charging information through the computer.
Based on the above analysis, this embodiment provides a method for calling a cloud function, where the method may be applied to a cloud platform in which the cloud function is deployed, and the method includes: receiving a call request of a caller for calling a cloud function initiated by user equipment, obtaining a charging mode of the cloud function according to the call request, if the charging mode is the caller charging mode, responding to the completion of the cloud function call, performing charging processing on the cloud function called by the caller, and obtaining and outputting charging information to the user equipment.
Fig. 3 is a flowchart of a method for calling a cloud function according to another embodiment of the present disclosure, where the method may be applied to a cloud platform, and the cloud function is deployed in the cloud platform.
As shown in fig. 3, the method includes:
s301: and receiving a call request for calling the cloud function, which is initiated by a caller through user equipment.
It should be understood that, in order to avoid tedious statements, the technical features of the present embodiment that are the same as those of the above embodiments are not described again in this embodiment.
S302: and acquiring the attribute field of the cloud function and the attribute information corresponding to the attribute field according to the calling request.
The attribute field is a field for characterizing the attribute of the cloud function, and the attribute of the cloud function may include a name, an identifier, a charging mode, a calling mode, and the like. Correspondingly, the attribute field may be a name field, and is used for representing a field of a name; the attribute field can also be an identification field for representing the identified field; the attribute field may also be a charging field for characterizing a charging mode, and the attribute field may also be a calling field for characterizing a calling mode.
Correspondingly, the attribute information corresponding to the name field is the content of the name; the attribute information corresponding to the identification field is the identified content; the attribute information corresponding to the charging field is the content of the charging mode; and the attribute information corresponding to the calling field is the content of the calling mode.
S303: and determining a charging mode according to the attribute field and the attribute information.
In this embodiment, the charging mode is determined by combining the attribute field and the attribute information, so that the technical effect that the determined charging mode has higher accuracy can be improved.
In some embodiments, S303 may include the steps of:
the first step is as follows: from the attribute field, a charging field for characterizing the charging mode is determined.
The second step is as follows: and extracting attribute information corresponding to the charging field from the attribute information to determine the charging mode.
In connection with the above analysis, the attribute fields may include at least a name field, an identification field, a charging field, and a call field, and thus, the charging field may be selected from the attribute fields. Correspondingly, the attribute information includes the attribute information corresponding to each attribute field, so that the attribute information corresponding to the charging field can be selected from each attribute information, and the attribute information is the charging mode.
In this embodiment, the charging mode is determined by selecting the charging field from the attribute fields to select the attribute information corresponding to the charging field from the attribute information, so that the effectiveness and reliability of the determined charging mode can be improved.
In some embodiments, the charging mode is determined based on category information and/or usage information of the cloud function.
The category information may be used to characterize an application field of the cloud function or characterize an application population of the cloud function. The usage information may be used to characterize usage purposes of the cloud function.
The charging mode is determined by combining the category information and/or the application information, so that the charging mode has strong flexibility and generalization capability, and the technical effects of flexibility and diversity of cloud function calling can be realized when the cloud function is called by combining the charging mode.
S304: and if the charging mode is the caller charging mode, responding to the completion of cloud function calling, and performing charging processing on the cloud function called by the caller to obtain charging information.
S305: and outputting the charging information to the user equipment according to a preset charging mode. Wherein, the charging mode comprises at least one of the following modes:
the charging mode based on calling times, the charging mode based on time for calling a cloud function, the charging mode based on a memory of the cloud function, the charging mode based on a central processing unit corresponding to the cloud function and the charging mode based on a time interval.
The charging mode based on the calling times can be understood as single charging or multiple charging in a preset time period, for example, each time a cloud function is called to determine charging information of the time, or the total times of calling the cloud function in the preset time period are determined, and the charging information of the calling times corresponding to the preset time period is determined.
The charging mode based on the time for calling the cloud function may be understood as determining charging information of the duration based on the duration for calling the cloud function.
The cloud function needs to occupy a certain memory, and the charging mode of the memory based on the cloud function can be understood as determining the charging information based on the size of the memory occupied by the cloud function, for example, relatively speaking, the larger the memory occupied by the cloud function is, the higher the cost represented by the corresponding charging information is.
Similarly, the operation of the cloud function and the like need to consume the central processor resources, and the charging mode based on the central processor resources corresponding to the cloud function can be understood as determining the charging information based on the amount of the central processor resources consumed by the cloud function, for example, relatively, the more the central processor resources consumed by the cloud function are, the higher the cost represented by the corresponding charging information is.
The charging manner based on the time interval may be understood as determining the charging information in years, months, or the like.
It should be understood that the above examples are only used for exemplarily illustrating possible charging manners, but are not to be construed as limiting the charging methods, and the technical effects of flexibility and diversity in determining the charging information can be improved by determining the charging information in combination with the charging manners described in the above examples.
In some embodiments, in order to improve the security and reliability of information in the cloud platform, such as to avoid leakage of a cloud function, the calling device may perform authentication processing on the caller after receiving the call request, so as to call the cloud function when the caller has a call right. For example:
and authenticating the caller to obtain an authentication result, wherein the authentication result is used for representing whether the caller has the calling authority to call the cloud function, and if the authentication result represents that the caller has the calling authority, the cloud function is called.
In combination with the above analysis, the charging mode is determined based on the attribute field and the attribute information, and the charging mode may be a caller charging mode, and in some embodiments, the charging mode may also be a creator charging mode, that is, the charging mode may also be determined to be the creator charging mode based on the attribute field and the attribute information.
Correspondingly, if the charging mode is the creator charging mode, the cloud function can be executed without calling the cloud function by the caller for charging processing.
For a more profound understanding of the reader's principles of implementation of the present disclosure, reference is now made to fig. 4 for an exemplary illustration.
Therein, the branch of "creator-creation cloud function" as shown in fig. 4 is set forth as follows:
in some embodiments, the cloud platform may create a cloud function in the cloud platform based on the creator's needs, such as "create cloud function" shown in fig. 4. The cloud platform may also set a charging field and charging information of the cloud function according to the requirement of the creator to determine a charging mode through the charging field and the charging information, and may also set a call mode of the cloud function according to the requirement of the creator, such as "set charging mode and call mode" shown in fig. 4.
The charging mode may be the caller charging mode as described in the above embodiments, or may be the creator charging mode as described in the above embodiments. The calling mode can be used for supporting cross account calling or not.
In contrast, for the creator billing mode, the calling mode may be for cross-account call support, while for the caller billing mode, the calling mode may be for cross-account call support.
And as shown in fig. 4, the cloud platform may also "generate an identifier of a cloud function (e.g., a function name)". Accordingly, the caller can call the cloud function corresponding to the identifier (such as the function name) from the cloud platform based on the identifier (such as the function name) of the cloud function.
For example, with reference to fig. 2, when a user sends a call request to a calling device through a laptop, the user may configure the identifier of the cloud function in the call request.
Correspondingly, when the calling device receives the calling request, the cloud function identification carried in the calling request is extracted, and the cloud function corresponding to the identification is called.
The branch of "caller-call cloud function-billing within creator account" (i.e., billing mode is creator billing mode) as shown in fig. 4 is set forth below:
as can be seen from the above analysis and fig. 4, if the caller initiates a call request to the cloud platform (specifically, to a call device in the cloud platform), as shown in fig. 4, "call cloud function", and the charging mode is the creator charging mode, the cloud platform may authenticate the caller, as shown in fig. 4, "verify caller authentication and authorization, and confirm caller identity".
Correspondingly, if the verification is passed, that is, the authentication result represents that the caller has a call authority to call the cloud function, the cloud function is executed, as shown in "cloud function execution" in fig. 4, and if the cloud function execution is completed, as shown in "cloud function call completion" in fig. 4, the charging information is generated for the creator, and is transmitted to the creator account, as shown in "charging in the creator account" in fig. 4.
The branch of "caller-call cloud function-billing within caller account" (i.e., billing mode is caller billing mode) as shown in fig. 4 is set forth below:
as can be seen from the above analysis and fig. 4, if the caller initiates a call request to the cloud platform (specifically, the call request is made to the cloud platform), such as "call cloud function" shown in fig. 4, and the charging mode is the caller charging mode, the cloud platform may authenticate the caller, such as "check caller authentication and authorization" shown in fig. 4, and confirm caller identity ".
Correspondingly, if the verification is passed, that is, the authentication result represents that the caller has a call authority to call the cloud function, the cloud function is executed, as shown in "cloud function execution" in fig. 4, and if the cloud function execution is completed, as shown in "cloud function call completion" in fig. 4, the charging information is generated for the caller, and the charging information is transmitted to the caller account, as shown in "charging in the caller account" in fig. 4.
In some embodiments, if the calling mode is to support cross-account calling, the account of the caller is different from the account of the creator, and calling of the caller to the cloud function can also be implemented. On the contrary, if the calling mode does not support cross-account calling, the account of the caller is different from the account of the creator, and the caller cannot call the cloud function
As can be known from the principle of the cloud function calling method shown in fig. 4, in this embodiment, different charging modes are adopted to perform charging processing on a creator or a caller, so as to implement flexibility and diversity of function calling through different charging modes.
In combination with the above analysis, in this embodiment, the charging mode may be a creator charging mode or a caller charging mode, and the charging field is set in the attribute field, and the charging mode is represented by the attribute information corresponding to the charging field, on one hand, the disadvantage of low flexibility in calling the cloud function due to the fact that charging processing is performed only from the creator dimension is avoided, and flexibility and diversity in calling the cloud function are achieved; on the other hand, the defects that information leakage is caused when a provider of the cloud function provides the source code of the cloud function to a caller and the cloud function is complicated to modify (such as upgrade and the like) are overcome, and the security and the reliability of the cloud function are improved.
Fig. 5 is a schematic diagram of a device for calling a cloud function according to an embodiment of the present disclosure, and as shown in fig. 5, an embodiment of the present disclosure provides a device 500 for calling a cloud function, where the device may be applied to a cloud platform, and a cloud function is deployed in the cloud platform, where the device 500 includes:
a receiving unit 501, configured to receive a call request initiated by a caller through a user equipment to call the cloud function.
An obtaining unit 502, configured to obtain a charging mode of the cloud function according to the call request.
And a charging unit 503, configured to respond to completion of the cloud function call if the charging mode is a caller charging mode, and call the cloud function to the caller to perform charging processing, so as to obtain charging information.
An output unit 504, configured to output the charging information to the user equipment.
Fig. 6 is a schematic diagram of a device for calling a cloud function according to another embodiment of the present disclosure, and as shown in fig. 6, an embodiment of the present disclosure provides a device 600 for calling a cloud function, where the device may be applied to a cloud platform, and a cloud function is deployed in the cloud platform, where the device 600 includes:
a receiving unit 601, configured to receive a call request initiated by a caller through a user equipment to call the cloud function.
An authentication unit 602, configured to perform authentication processing on the caller to obtain an authentication result, where the authentication result is used to represent whether the caller has a call authority to call the cloud function.
A calling unit 603, configured to call the cloud function if the authentication result indicates that the caller has the calling authority.
An obtaining unit 604, configured to obtain a charging mode of the cloud function according to the call request.
As can be seen in fig. 6, in some embodiments, the obtaining unit 604 includes:
an obtaining subunit 6041, configured to obtain, according to the call request, the attribute field of the cloud function and the attribute information corresponding to the attribute field.
A determining subunit 6042, configured to determine the charging mode according to the attribute field and the attribute information.
In some embodiments, determining subunit 6042 includes:
and the determining module is used for determining a charging field for representing the charging mode from the attribute field.
And the extracting module is used for extracting the attribute information corresponding to the charging field from the attribute information and determining the attribute information as the charging mode.
In some embodiments, the charging mode is determined based on category information and/or usage information of the cloud function.
A charging unit 605, configured to respond to the completion of the cloud function call if the charging mode is a caller charging mode, and call the cloud function by the caller to perform charging processing, so as to obtain charging information.
An output unit 606, configured to output the charging information to the user equipment.
In some embodiments, the output unit 606 is configured to output the charging information according to a preset charging manner, where the charging manner includes at least one of:
a charging mode based on calling times, a charging mode based on the time for calling the cloud function, a charging mode based on the memory of the cloud function, a charging mode based on the central processing unit corresponding to the cloud function, and a charging mode based on a time interval.
Fig. 7 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present disclosure. As shown in fig. 7, an electronic device 700 of an embodiment of the present disclosure may include: at least one processor 701 (only one processor is shown in FIG. 7); and a memory 702 communicatively coupled to the at least one processor. The memory 702 stores instructions executable by the at least one processor 701, and the instructions are executed by the at least one processor 701, so that the electronic device 700 can execute the technical solution in any of the foregoing method embodiments.
Alternatively, the memory 702 may be separate or integrated with the processor 701.
When the memory 702 is a separate device from the processor 701, the electronic device 700 further comprises: a bus 703 for connecting the memory 702 and the processor 701.
The electronic device provided by the embodiment of the present disclosure may execute the technical solution of any one of the foregoing method embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
The embodiment of the present disclosure further provides a public cloud, in which a cloud function is deployed, and the public cloud further includes a device for calling the cloud function according to any one of the embodiments.
The embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the computer program is used to implement the technical solution in any of the foregoing method embodiments.
The embodiment of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the technical solution in any of the foregoing method embodiments.
The embodiment of the present disclosure further provides a chip, including: a processing module and a communication interface, wherein the processing module can execute the technical scheme in the method embodiment.
Further, the chip further includes a storage module (e.g., a memory), where the storage module is configured to store instructions, and the processing module is configured to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module causes the processing module to execute the technical solution in the foregoing method embodiment.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present disclosure are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile and non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present disclosure, and not for limiting the same; while the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (10)

1. A method for calling a cloud function is applied to a cloud platform, wherein the cloud platform is deployed with the cloud function, and the method comprises the following steps:
receiving a calling request for calling the cloud function, which is initiated by a caller through user equipment;
acquiring a charging mode of the cloud function according to the calling request;
and if the charging mode is a caller charging mode, responding to the completion of the cloud function call, calling the cloud function by the caller to perform charging processing, and obtaining and outputting charging information to the user equipment.
2. The method according to claim 1, wherein the obtaining the charging mode of the cloud function according to the call request comprises:
acquiring an attribute field of the cloud function and attribute information corresponding to the attribute field according to the calling request;
and determining the charging mode according to the attribute field and the attribute information.
3. The method of claim 2, wherein determining the charging mode based on the attribute field and the attribute information comprises:
determining a charging field for characterizing the charging mode from the attribute field;
and extracting attribute information corresponding to the charging field from the attribute information to determine the attribute information as the charging mode.
4. The method according to any of claims 1-3, wherein the charging mode is determined based on category information and/or usage information of the cloud function.
5. The method according to any one of claims 1 to 4, wherein the calling the cloud function by the caller for charging processing, obtaining and outputting charging information to the user equipment, comprises:
calling the cloud function to the caller to perform charging processing to obtain the charging information;
outputting the charging information according to a preset charging mode, wherein the charging mode comprises at least one of the following modes:
a charging mode based on calling times, a charging mode based on the time for calling the cloud function, a charging mode based on the memory of the cloud function, a charging mode based on the central processing unit corresponding to the cloud function, and a charging mode based on a time interval.
6. The method of any of claims 1-5, wherein after receiving a call request initiated by a caller via a user device to call a cloud function, the method further comprises:
carrying out authentication processing on the caller to obtain an authentication result, wherein the authentication result is used for representing whether the caller has a calling authority for calling the cloud function;
and if the authentication result represents that the caller has the calling authority, calling the cloud function.
7. The device for calling the cloud function is applied to a cloud platform, wherein the cloud platform is provided with the cloud function, and the device comprises:
the receiving unit is used for receiving a calling request which is initiated by a caller through user equipment and used for calling the cloud function;
the obtaining unit is used for obtaining the charging mode of the cloud function according to the calling request;
the charging unit is used for responding to the completion of the cloud function call and calling the cloud function by the caller to perform charging processing to obtain charging information if the charging mode is a caller charging mode;
and the output unit is used for outputting the charging information to the user equipment.
8. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the electronic device to perform the method of calling the cloud function of any of claims 1 to 6.
9. A computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the method of calling the cloud function of any of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method of calling a cloud function of any of claims 1 to 6.
CN202210495164.0A 2022-05-07 2022-05-07 Cloud function calling method and device Active CN114679459B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210495164.0A CN114679459B (en) 2022-05-07 2022-05-07 Cloud function calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210495164.0A CN114679459B (en) 2022-05-07 2022-05-07 Cloud function calling method and device

Publications (2)

Publication Number Publication Date
CN114679459A true CN114679459A (en) 2022-06-28
CN114679459B CN114679459B (en) 2024-03-12

Family

ID=82079396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210495164.0A Active CN114679459B (en) 2022-05-07 2022-05-07 Cloud function calling method and device

Country Status (1)

Country Link
CN (1) CN114679459B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117376A1 (en) * 2004-12-01 2006-06-01 Oracle International Corporation Charging via policy enforcement
US20140379539A1 (en) * 2013-06-24 2014-12-25 Infosys Limited Systems and methods for generating billing data of a composite cloud service
US20150327042A1 (en) * 2014-05-06 2015-11-12 Telefonaktiebolaget L M Ericsson (Publ) System, device and methods for billing a user for their consumption of mobile broadband services and virtualized cloud resources
WO2016107510A1 (en) * 2015-01-04 2016-07-07 华为技术有限公司 Management method and apparatus for application programming interface (api) calling record
CN110135892A (en) * 2019-04-15 2019-08-16 深圳职业技术学院 Calling charging method, device, electronic equipment and the storage medium of API
CN110233741A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 Service charging method, device, equipment and storage medium
CN112764675A (en) * 2020-12-30 2021-05-07 中国人寿保险股份有限公司上海数据中心 Real-time charging management method and system for cloud resources
CN113067709A (en) * 2021-03-11 2021-07-02 北京市商汤科技开发有限公司 Charging method, device and equipment based on cloud service and readable storage medium
CN113746646A (en) * 2021-08-30 2021-12-03 中国银联股份有限公司 Application program interface API gateway charging method, device, equipment and medium
CN114118986A (en) * 2021-11-26 2022-03-01 新华三大数据技术有限公司 Cloud service processing method, device, equipment and storage medium
CN114240416A (en) * 2021-11-17 2022-03-25 上海浦东发展银行股份有限公司 Data processing method, data processing device, computer equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060117376A1 (en) * 2004-12-01 2006-06-01 Oracle International Corporation Charging via policy enforcement
US20140379539A1 (en) * 2013-06-24 2014-12-25 Infosys Limited Systems and methods for generating billing data of a composite cloud service
US20150327042A1 (en) * 2014-05-06 2015-11-12 Telefonaktiebolaget L M Ericsson (Publ) System, device and methods for billing a user for their consumption of mobile broadband services and virtualized cloud resources
WO2016107510A1 (en) * 2015-01-04 2016-07-07 华为技术有限公司 Management method and apparatus for application programming interface (api) calling record
CN110135892A (en) * 2019-04-15 2019-08-16 深圳职业技术学院 Calling charging method, device, electronic equipment and the storage medium of API
CN110233741A (en) * 2019-05-21 2019-09-13 深圳壹账通智能科技有限公司 Service charging method, device, equipment and storage medium
CN112764675A (en) * 2020-12-30 2021-05-07 中国人寿保险股份有限公司上海数据中心 Real-time charging management method and system for cloud resources
CN113067709A (en) * 2021-03-11 2021-07-02 北京市商汤科技开发有限公司 Charging method, device and equipment based on cloud service and readable storage medium
CN113746646A (en) * 2021-08-30 2021-12-03 中国银联股份有限公司 Application program interface API gateway charging method, device, equipment and medium
CN114240416A (en) * 2021-11-17 2022-03-25 上海浦东发展银行股份有限公司 Data processing method, data processing device, computer equipment and storage medium
CN114118986A (en) * 2021-11-26 2022-03-01 新华三大数据技术有限公司 Cloud service processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114679459B (en) 2024-03-12

Similar Documents

Publication Publication Date Title
US10742582B2 (en) Launching a client application based on a message
CN105765527A (en) Method and apparatus for custom software development kit (SDK) generation
CN110377462B (en) Interface testing method and device and terminal equipment
CN109462601B (en) Multi-platform access method and device based on eSIM
CN108960839B (en) Payment method and device
US20210042150A1 (en) Method-call-chain tracking method, electronic device, and computer readable storage medium
JP2015537305A (en) Method, apparatus, facility, program and recording medium for adding plug-in to address book
CN112463634A (en) Software testing method and device under micro-service architecture
CN113157345A (en) Automatic starting method and device for front-end engineering
CN111818518B (en) 5G message receiving method and device based on application software and storage medium
CN110111188B (en) Business handling method and equipment
CN114679459B (en) Cloud function calling method and device
CN116244764A (en) Method and system for generating device unique ID of Android device
CN105141586A (en) Method and system for verifying user
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN115310958A (en) Payment method, device, equipment, system and medium based on 5G message application
CN111614676B (en) Login method, device, equipment and medium
CN113986747A (en) Data generation method and device, electronic equipment and storage medium
CN111375209A (en) Login method of fishing game application program, computer device and computer readable storage medium
CN115242767B (en) Information interaction tracking method and related equipment
CN113709710B (en) Interface management method and device
CN111885152B (en) Promotion information processing method, electronic device and computer-readable storage medium
CN110928788B (en) Service verification method and device
CN112749075B (en) Service testing method, device, storage medium and equipment based on preset data
CN111026650B (en) Method and device for testing software, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant