CN115373816A - Server-free computing application execution method and system based on application control state management - Google Patents

Server-free computing application execution method and system based on application control state management Download PDF

Info

Publication number
CN115373816A
CN115373816A CN202210869036.8A CN202210869036A CN115373816A CN 115373816 A CN115373816 A CN 115373816A CN 202210869036 A CN202210869036 A CN 202210869036A CN 115373816 A CN115373816 A CN 115373816A
Authority
CN
China
Prior art keywords
control state
state management
function
application
free
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.)
Pending
Application number
CN202210869036.8A
Other languages
Chinese (zh)
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.)
Institute of Computing Technology of CAS
Original Assignee
Institute of Computing Technology of CAS
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 Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CN202210869036.8A priority Critical patent/CN115373816A/en
Publication of CN115373816A publication Critical patent/CN115373816A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/256Integrating or interfacing systems involving database management systems in federated or virtual databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Multi Processors (AREA)

Abstract

The invention provides a method and a system for executing serverless computing application based on application control state management, wherein the method comprises the following steps: the method comprises the steps that a server-free computing platform obtains server-free computing application, and a cloud function of the server-free computing platform achieves a control state management function by introducing a control state management program library; creating a control state object by using an application programming interface provided by the control state management program library according to a function, and creating a globally unique character string for the control state object to be used as an object reference of the control state object; using the application programming interface to input a function name and the object reference, starting a target function corresponding to the function name, and using the object reference as a parameter to transmit, so that the target function shares the control state object; and obtaining the execution result of the server-free computing application until all the user codes of the server-free computing application are executed.

Description

Server-free computing application execution method and system based on application control state management
Technical Field
The invention relates to the technical field of application state management in Serverless computing, in particular to a method and a system for managing a Serverless application control state.
Background
Serverless computing Serverless is rapidly developing as a new cloud computing model. Currently, function as a Service (FaaS) is the main form of providing Serverless computing services. The user only needs to write a cloud function (user code) in any high-level programming language for developing the application on the Serverless computing platform, the event which can trigger the cloud function is configured, the application of the user can be operated by utilizing the cloud resource, and all other fussy things (such as server configuration, load balancing, scaling and application deployment) are taken charge of by the platform. By using the Serverless computing platform, developers can write a function by using different programming languages, then upload the function to the cloud, and obtain a calling interface to randomly and remotely call the function. By means of a simple programming model, rich cloud resource services and a low-cost pay-per-view mode, serverless becomes an important computing service form of cloud computing.
The Serverless computing platform provides server configuration and computing resources for developers, and can execute function flexible expansion and contraction capacity according to the real-time application load condition. The resilient extensibility capability of existing Serverless relies on compute and store separation, which requires that Serverless functions must be stateless since existing Serverless computing fails to provide a systematic state management capability. Stateless means that state cannot be shared between each invocation of the Serverless function, and the user needs to store the state that the function needs to use (e.g., persistent data, messages between functions for collaboration, and intermediate results of function execution) in the external storage service.
In Serverless application computation, there is a special state, control state, including messages sent among Serverless functions, mutual exclusion locks for multi-function synchronization, and shared objects that need to be read and written frequently. Unlike other states, the use of control states requires a Serverless platform to provide special semantic support due to special consistency and performance requirements; while the other states serve primarily the business requirements of the application and do not require interaction with the platform.
Currently, serverless lacks an efficient state management mechanism, and usually uses external storage as access management of all states, which makes implementing applications requiring use of control states on a Serverless platform face a series of problems:
(1) Control state access performance is difficult to guarantee. The control state has the delay sensitive computing characteristic, and the external storage service generally has higher access delay, so that fine-grained and high-frequency access to the control state is difficult to support. This has a large performance impact on Serverless applications that are closely coordinated based on control state.
(2) The consistency requirements for controlling state access are difficult to guarantee. The control state has diversified consistency requirements, and the requirements are difficult to be directly met by common external storage services. A user needs to configure various storage services for control objects with different consistency requirements and performance requirements and manually manage the storage services, so that the operation is very difficult.
(3) Automatic scaling of the control states is difficult to achieve. The concurrency of the Serverless function can be increased to a large value in a short time, and the storage system does not usually have corresponding automatic capacity expansion and reduction capability, so that the concurrency of the Serverless function becomes a performance bottleneck of the whole system and influences the application computing performance.
Disclosure of Invention
The invention aims to solve the problems of diverse consistency requirements, programming difficulty and performance of Serverless application of multi-function cooperation. The invention provides a programming interface suitable for different cooperation scenes, simplifies the Serverless application development of multi-function cooperation and has excellent performance. Based on the system, application developers do not need to build and maintain external storage by themselves, and can build the Serverless application depending on state management, such as a distributed consensus algorithm or a distributed database system, and the like, easily only by paying attention to messages and shared objects needing to be transmitted in cooperation among functions.
Aiming at the defects of the prior art, the invention provides a server-free computing application execution method based on application control state management, which comprises the following steps:
step 1, a server-free computing platform acquires server-free computing application to be executed, wherein the server-free computing application comprises at least one cloud function, the cloud function realizes a control state management function by introducing a control state management program library, and the control state management program library starts a control state management client;
step 2, the control state management client uses an application programming interface provided by the control state management program library to create a control state object according to a function, and creates a globally unique character string for the control state object to be used as an object reference of the control state object;
step 3, the control state management client uses the application programming interface to transmit a function name and the object reference, starts a target function corresponding to the function name, and transmits the object reference as a parameter to enable the target function to share the control state object;
and 4, repeating the steps 2 and 3 until the execution of the serverless computing application is finished, saving the current control state object as an execution result, and closing the control state management client by the control state management program library.
The server-free computing application execution method based on application control state management is characterized in that the server-free computing platform runs a daemon process for the running instance of the function, and the daemon process is used for executing user codes when the function reference request comes; the life cycle of the control state management client is consistent with that of the daemon process; the control state management client maintains a reference to the control state object and an identifier of the function call.
The execution method of the serverless computing application based on the application control state management comprises the following steps that a control state object comprises a basic data object, a conflict-free copy object and a mutex;
the basic data object comprises floating point number and character string, and any function holding the object reference can read and write the basic data object; and processing write conflicts by adopting a last writer winning strategy, wherein the object copy of each holder asynchronously updates the winning write operation;
the conflict-free copy object comprises a counter, a list and a text object, all operations of the conflict-free copy object can be exchanged, and any function holding the object reference can read and write the conflict-free copy object, but no write conflict occurs; the object copies of each owner will asynchronously update all operations on the same conflict-free replicated object;
the mutex is a locked floating point number and a character string, and the mutex can be read and written only after the function holds the mutex lock.
The execution method of the serverless computing application based on application control state management comprises the following steps that a control state management client stores a calling identifier of a function of a control state management function, and a globally unique identifier is generated during each calling of the function so as to distinguish different calling of the same function;
and all functions sharing the same control state object form a full-connection network through the control state management client, and the control state object is accessed in a decentralized implementation mode.
The invention also provides a serverless computing application execution system based on application control state management, which comprises the following steps:
the system comprises an initial module, a control state management program library and a server-free computing platform, wherein the initial module is used for sending a server-free computing application to a server-free computing platform, the server-free application comprises at least one cloud function, the cloud function realizes a control state management function by introducing the control state management program library, and the control state management program library starts a control state management client;
the creating module is used for enabling the control state management client to create a control state object by using an application programming interface provided by the control state management program library according to a function, and creating a globally unique character string for the control state object to serve as an object reference of the control state object;
the transfer module is used for enabling the control state management client to use the application programming interface to transmit a function name and the object reference, starting an objective function corresponding to the function name, transferring the object reference as a parameter and enabling the objective function to share the control state object;
and the execution module is used for repeating the creation module and the transmission module until the execution of the serverless computing application is finished, saving the current control state object as an execution result, and closing the control state management client by the control state management program library.
The server-free computing application execution method based on application control state management is characterized in that the server-free computing platform runs a daemon process for the running instance of the function, and the daemon process is used for executing user codes when the function reference request comes; the life cycle of the control state management client is consistent with that of the daemon process; the control state management client maintains a reference to the control state object and a function call identifier.
The execution method of the serverless computing application based on the application control state management comprises the following steps that a control state object comprises a basic data object, a conflict-free copy object and a mutex;
the basic data object comprises floating point number and character string, and any function holding the object reference can read and write the basic data object; and processing write conflicts by adopting a last writer winning strategy, wherein the object copy of each holder asynchronously updates the winning write operation;
the conflict-free copy object comprises a counter, a list and a text object, all operations of the conflict-free copy object can be exchanged, and any function holding the object reference can read and write the conflict-free copy object, but no write conflict occurs; the object copies of each owner will asynchronously update all operations on the same conflict-free replicated object;
the mutex is a locked floating point number and a character string, and the mutex can be read and written only after the function holds the mutex lock.
The execution method of the serverless computing application based on the application control state management comprises the following steps that a control state management client stores a calling identifier of a function of a control state management function, and a globally unique identifier is generated during each calling of the function so as to distinguish different calling of the same function;
and all functions sharing the same control state object form a full-connection network through the control state management client, and the control state object is accessed in a decentralized implementation mode.
The invention also provides a storage medium for storing a program for executing the any one of the server-less computing application execution methods based on application control state management.
The invention also provides a client used for the any server-free computing application execution system based on the application control state management.
According to the scheme, the invention has the advantages that:
1. the multiple consistency-guaranteed control state objects simplify the development of Serverless applications. The requirements for state consistency in the construction process of different types of Serverless applications are different, and manually configuring a plurality of distributed databases with different consistency guarantees is very complex and difficult to manage. The invention provides a very simple programming interface for objects with fine granularity, frequent access and delay sensitivity, and greatly simplifies the Serverless application development requiring multi-function cooperation.
2. The Serverless application performance and the elastic expansion capability are obviously improved. When the Serverless application performs multi-function cooperation in the past, all states needing to be shared or intermediate results of function execution can only be stored in an external storage service, on one hand, the external storage service is accessed and needs to cross a network layer, and the delay expense of the network layer is borne; on the other hand, the elastic expansion and contraction of the external storage service is not flexible enough, and the external storage service is easy to become a performance bottleneck of the whole application. The decentralized implementation mode realizes the business logic at one side closer to the function, so that the overall delay is reduced; the computational load of control state management can be expanded along with the automatic expansion of the function, and cannot become a performance bottleneck.
Drawings
FIG. 1 is a system architecture diagram;
FIG. 2 is a flowchart of a client initiation procedure;
FIG. 3 is a flow diagram of write conflict handling for a base data object;
FIG. 4 is a flow diagram illustrating the merging of operations of conflict-free replicated objects;
FIG. 5 is a flow diagram of concurrent modification of mutexes;
FIG. 6 is a flow chart of method usage steps.
Detailed Description
The invention provides a decentralized Serverless application control state management method, which solves the problems of diverse consistency requirements, difficult programming and performance of function cooperation in Serverless application by improving a Serverless computing platform. The invention provides the control state management capability of fine granularity, high-frequency access and low delay for the Serverless application, improves the running performance of the Serverless application with multi-function cooperation, and simplifies the development mode of the function cooperation. The key technical points of the invention comprise:
key point 1: and controlling the state underlying data model. The invention provides a control state bottom layer data model. The control state underlying data model abstracts and programmatically defines the Serverless application control states. To provide a simple and easy-to-use programming interface, the invention first defines 3 different types of objects that control the state: a base data object, a conflict free replication object, and a mutex. The three objects have different consistency guarantees and performance. When programming, a user can import a corresponding program library into the code of one function, and then create an object by using the program library and share the object to other functions. By using the control state object, the user does not need to manually manage a plurality of databases with guaranteed consistency, and the operation burden is reduced. The user does not need to pay attention to the management of the control state when developing the Serverless application.
Key point 2: a synchronization protocol that controls the state. The invention provides a synchronization protocol for controlling states. The 3 control state objects have different consistency and performance requirements and therefore need to be implemented in different ways. The synchronization protocol of control states describes the synchronization process of 3 control state objects, respectively comprising concurrent modification of basic data objects-last writer winning policy, operation merging process of conflict-free copy objects and serial modification process of mutexes. The synchronization protocol for controlling the states is implemented in a decentralized state management system.
Key point 3: decentralized control state management system. The invention provides a decentralized control state management system. The decentralized control state management system is based on a Serverless function execution environment, supports a cooperative function, and can realize the access of the control state without a central node, and does not need the function to execute explicit point-to-point communication at a service layer. All functions sharing a certain control state object form a small-sized full-connection network through a control state management client, for example, when the function A, B, C shares the same control state object, for example, a basic data object x, a needs to synchronize a new value to B, C after modifying the value of x, and the process is completed through message transmission. The client analyzes the specific operation of the user code on the control object and selects different connection modes according to the object type, such as fan-out, publish-subscribe and request-answer. The correct implementation of decentralization is much more complex than that of centralisation, but can be well extended and achieve excellent performance. And the control state management of the high-elasticity Serverless application is supported.
In order to make the aforementioned features and effects of the present invention more comprehensible, embodiments accompanied with figures are described in detail below.
The specific implementation of the invention comprises the steps of constructing a Serverless application control state management system, executing control state management and constructing a control state management client.
1. Construction of Serverless application control state management system
The architecture of the system proposed by the invention is shown in fig. 1, and the system is composed of a function execution environment, a control state management client and a global function addressing component embedded in a Serverless platform. The function execution environment comprises a daemon process and a user code part, wherein the user code realizes the service logic of the application, and the daemon process is used for executing the user code on the Serverless platform and monitoring the execution process. The user code or the daemon process performs function cooperation through a control state management client, and the control state management client comprises: 1) Control state object creation and operation API; 2) Calling API by the function; 3) The local function instance addresses the component. The addressing of the function instance needs to be completed by a local function instance addressing component of the control state management client and a global function addressing component embedded in the Serverless platform.
2. Building control state management client
In the control state access management process, the control state management client realizes differentiated management operation around the 3 types of control state objects. Further, the start-up procedure of the control state management client comprises the following steps described in fig. 2:
(1) The control state management client saves the call identifier invoke (functions) - > id of the function that needs to control the state management function. Each call of the function generates a globally unique identifier, and the identifiers corresponding to different calls of the same function are different. That is, the identifier may be generated by the caller, for example, by a client call; it is also possible that the caller is not generated and the callee's client is generated, e.g. this time the call is from an external call, such as an HTTP request; each call generates an identifier in order to distinguish between different calls of the same function.
(2) Only one control state management client is required for each function run instance. In order to reduce the cold start delay, the Serverless platform runs a daemon process on a function running instance (such as a container and a virtual machine), and the daemon process is also a small reverse proxy server and is used for executing user codes when a function call request comes. And the life cycle of the control state management client is consistent with that of the daemon process. When a new function call occurs in the running instance in which the daemon process has been started, a separate client is not started again, and the function multiplexes the existing clients.
3. Synchronization protocol for implementing control state objects
When the user needs to use, the control state object created by the program library API comprises three categories, namely a basic data object, a conflict-free copy object and a mutex. Different objects have different consistency assurance and operation interfaces for the following 3 different collaboration scenarios:
(1) The basic data objects include floating point numbers and character strings, which are the two most common and most common types of data objects. The base data object can be read and written by any function holding its references; when concurrent writing occurs, the system adopts a last writer winning strategy to process conflicts, and the object copy of each holder asynchronously updates the winning writing operation so as to achieve final consistency. Basic data objects are often used to directly save some simple shared data state. Wherein the holder is a function of holding the base data object.
By way of example, FIG. 3 presents a write conflict handling process for a base data object. The function a and the function B share the basic data object x, and cooperate with each other through respective control state management clients, i.e., the client a and the client B. The function a and the function B write the shared object x concurrently, with the written values 1 and 2, respectively, accompanied by timestamps t1 and t2. The updating is asynchronous, the function is successfully set to reply, but the client considers that the value of x is not updated completely before all the copy updating is not completed, and write conflict occurs when the updated value of another client is received in the process. The client handles the write collision by comparing the sizes of the timestamps t1 and t2. Since the timestamp contains a globally unique random number in addition to the local time information, t1 and t2 are not completely equal. The client chooses to set the value of x to the write value with the larger timestamp, in this example, t1 is larger than t2, so that finally both client a and client B update x to 1, and final consistency is achieved.
(2) The conflict-free replicated objects include counters that can be incremented or decremented, lists of elements that can be inserted or deleted at arbitrary locations, and text objects that can be inserted or deleted at arbitrary locations. All operations of a conflict-free replicated object are commutative and can be read and written by any function holding its references as well, but no write conflicts will occur. Conflict-free replication of objects also provides ultimate consistency, and the object copies of each owner will asynchronously update all operations on an object. Conflict-free replication objects are commonly used for collaborative editing of multiple clients or text synchronization of chat systems.
As an example, FIG. 4 presents an operational merging process for conflict-free replicated objects. Function a and function B share a counter object counter that can only be incremented, decremented and read. The counter has an initial value of 0. And the function A and the function B concurrently modify the counter object, respectively perform the operation of adding 1 and the operation of adding 2, and then the client A and the client B communicate with each other to transfer the updating operation of the counter object. While the increase and decrease operations are interchangeable, the order of precedence does not affect the final value of the object. Therefore, both updating operations can take effect, and both the client A and the client B update the counter to 3, so that the final consistency is realized.
(3) The mutex also includes floating point number and character string, and the difference is that the function needs to successfully acquire the mutex before the function can read and write the locked object. Mutexes guarantee linear consistency and provide the simplest capabilities of function synchronization and mutual exclusion. Mutexes are usually used in application scenarios with extremely high correctness requirements, completely avoiding concurrent modification of the same object by multiple functions.
By way of example, FIG. 5 presents a process in which two functions attempt to modify mutexes simultaneously. The mutex lock information of the mutex is only stored in one client, and in this example, the lock information of x is only stored in the client a. Function a must acquire a mutually exclusive lock before accessing x. When function A successfully acquires the mutex, any other attempt to access the mutex will fail. Therefore, only the function A can access x before the function A releases the lock, and other clients read the x all depend on the client A, so that linear consistency is realized.
4. Constructing two-level function addressing services
The operation of all control state objects relies on inter-function communication. The communication between functions firstly needs to determine the physical positions of the two communication parties, namely IP and port information, and the process is called function addressing. The Serverless platform and the control state management client form a two-stage function addressing service, and the mapping relation between functions and physical positions is maintained together:
(1) When a function calls other functions through the library, the control state management client generates a globally unique identifier for the call. The addressing service stores the corresponding relation between the identifier and the physical position of the called running instance for subsequent searching.
(2) When the function performs control state cooperation operation through the library, the control state management client communicates with other function instances according to the cooperation requirement, and the client can automatically bring function names and identifiers for communication information.
(3) And the control state management client finds the endpoint list of the function instance maintained by the Serverless platform according to the function name and finds the physical position of the function instance according to the identifier, so that the connection is established with the control state client held by the function instance and the message transmission is started.
(4) And after the function execution is finished, deleting the corresponding relation between the instance and the physical position from the control state management client of the function execution environment and an endpoint list maintained by the Serverless platform.
5. Usage control state management
The above steps implement a control state management system that uses the steps described in fig. 6:
(1) Introducing a control state management program library into a function code needing to use a control state management function, wherein the library can automatically start a client for controlling state management;
(2) The function uses API provided by program library to create control state object, and obtains the reference createObject () > ref of control state object;
(3) When the function needs to cooperate with other functions, the called function name and the parameters are transmitted through the API to start other functions, and the reference of the control state object can be transmitted as parameters, so that the called function can share the object;
(4) Repeating the steps 2 and 3 until the user code is executed;
(5) The library automatically closes the control state management client.
Taking a word count application as an example, the main function divides the input text into lines, then starts a plurality of sub-functions, each of which calculates the number of words in each line, and then updates the number of words to a globally unified counter. In this example, the global unified counter is created by the library from the master function, the reference is a globally unique string, and all sub-functions holding this reference can modify the dictionary as if they had modified the local data object. The objects created may be the 3 control state objects mentioned above: basic data objects, conflict-free replication objects, mutexes. In this example, since the number of words contains only an addition operation, it is most appropriate to use a collision-free copy object.
The following are system examples corresponding to the above method examples, and this embodiment can be implemented in cooperation with the above embodiments. The related technical details mentioned in the above embodiments are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the above-described embodiments.
The invention also provides a serverless computing application execution system based on application control state management, which comprises the following steps:
the system comprises an initial module, a control state management program library and a control state management client, wherein the initial module is used for sending a serverless computing application to a serverless computing platform, the serverless computing application comprises at least one cloud function, the cloud function realizes a control state management function by introducing the control state management program library, and the control state management program library starts the control state management client;
the creating module is used for enabling the control state management client to create a control state object by using an application programming interface provided by the control state management program library according to a function, and creating a globally unique character string for the control state object to serve as an object reference of the control state object;
the transfer module is used for enabling the control state management client to use the application programming interface to transfer a function name and the object reference, starting a target function corresponding to the function name, transferring the object reference as a parameter and enabling the target function to share the control state object;
and the execution module is used for repeating the creation module and the transmission module until the execution of the serverless computing application is finished, saving the current control state object as an execution result, and closing the control state management client by the control state management program library.
The server-free computing application execution method based on application control state management is characterized in that the server-free computing platform runs a daemon process for the running instance of the function, and the daemon process is used for executing user codes when the function reference request comes; the life cycle of the control state management client is consistent with that of the daemon process; the control state management client saves a reference to the control state object and a function call identifier.
The execution method of the serverless computing application based on the application control state management comprises the following steps that a control state object comprises a basic data object, a conflict-free copy object and a mutex;
the basic data object comprises floating point number and character string, and any function holding the object reference can read and write the basic data object; and processing write conflicts by adopting a last writer winning strategy, wherein the object copy of each holder asynchronously updates the winning write operation;
the conflict-free copy object comprises a counter, a list and a text object, all operations of the conflict-free copy object can be exchanged, and any function holding the object reference can read and write the conflict-free copy object, but no write conflict occurs; the object copies of each owner will asynchronously update all operations on the same conflict-free replicated object;
the mutex is a locked floating point number and a character string, and the mutex can be read and written only after the function holds the mutex.
The execution method of the serverless computing application based on the application control state management comprises the following steps that a control state management client stores a calling identifier of a function of a control state management function, and a globally unique identifier is generated during each calling of the function so as to distinguish different calling of the same function;
and all functions sharing the same control state object form a full-connection network through the control state management client, and the control state object is accessed in a decentralized implementation mode.
The invention also provides a storage medium for storing a program for executing the any one of the server-less computing application execution methods based on application control state management.
The invention also provides a client used for the any server-free computing application execution system based on the application control state management.

Claims (10)

1. A serverless computing application execution method based on application control state management, comprising:
step 1, a server-free computing platform acquires server-free computing application to be executed, wherein the server-free computing application comprises at least one cloud function, the cloud function realizes a control state management function by introducing a control state management program library, and the control state management program library starts a control state management client;
step 2, the control state management client uses an application programming interface provided by the control state management program library to create a control state object according to a function, and creates a globally unique character string for the control state object to be used as an object reference of the control state object;
step 3, the control state management client uses the application programming interface to transmit a function name and the object reference, starts a target function corresponding to the function name, and transmits the object reference as a parameter to enable the target function to share the control state object;
and 4, repeating the steps 2 and 3 until the execution of the serverless computing application is finished, saving the current control state object as an execution result, and closing the control state management client by the control state management program library.
2. The serverless computing application execution method based on application control state management of claim 1 wherein the serverless computing platform runs a daemon process for the running instance of the function, the daemon process executing user code when the function reference request comes; the life cycle of the control state management client is consistent with that of the daemon process; the control state management client saves a reference to the control state object and an identifier of the function call.
3. The serverless computing application execution method based on application control state management of claim 1 wherein the control state objects comprise primitive data objects, conflict-free replication objects and mutexes;
the basic data object comprises floating point number and character string, and any function holding the object reference can read and write the basic data object; and processing write conflicts by adopting a last writer winning strategy, wherein the object copy of each holder asynchronously updates the winning write operation;
the conflict-free copy object comprises a counter, a list and a text object, all operations of the conflict-free copy object can be exchanged, and any function holding the object reference can read and write the conflict-free copy object, but no write conflict occurs; the object copies of each owner will asynchronously update all operations on the same conflict-free replicated object;
the mutex is a locked floating point number and a character string, and the mutex can be read and written only after the function holds the mutex lock.
4. The serverless computing application execution method based on application control state management of claim 1 wherein the control state management client maintains call identifiers for functions controlling state management functions, each call of a function generating a globally unique identifier to distinguish different calls of the same function;
and all functions sharing the same control state object form a full-connection network through the control state management client, and the control state object is accessed in a decentralized implementation mode.
5. A serverless computing application execution system based on application control state management, comprising:
the system comprises an initial module, a control state management program library and a control state management client, wherein the initial module is used for sending a serverless computing application to a serverless computing platform, the serverless computing application comprises at least one cloud function, the cloud function realizes a control state management function by introducing the control state management program library, and the control state management program library starts the control state management client;
the creating module is used for enabling the control state management client to create a control state object by using an application programming interface provided by the control state management program library according to a function, and creating a globally unique character string for the control state object to be used as an object reference of the control state object;
the transfer module is used for enabling the control state management client to use the application programming interface to transfer a function name and the object reference, starting a target function corresponding to the function name, transferring the object reference as a parameter and enabling the target function to share the control state object;
and the execution module is used for repeating the creation module and the transmission module until the execution of the serverless computing application is finished, saving the current control state object as an execution result, and closing the control state management client by the control state management program library.
6. The serverless computing application execution method based on application control state management of claim 5 wherein the serverless computing platform runs a daemon for the running instance of the function, the daemon for executing user code when the function reference request comes in; the life cycle of the control state management client is consistent with that of the daemon process; the control state management client saves a reference to the control state object and a function call identifier.
7. The serverless computing application execution method based on application control state management of claim 5 wherein the control state objects comprise primitive data objects, conflict-free replication objects and mutexes;
the basic data object comprises floating point number and character string, and any function holding the object reference can read and write the basic data object; and processing write conflicts by adopting a last writer winning strategy, wherein the object copy of each holder asynchronously updates the winning write operation;
the conflict-free copy object comprises a counter, a list and a text object, all operations of the conflict-free copy object can be exchanged, and any function holding the object reference can read and write the conflict-free copy object, but no write conflict occurs; the object copies of each owner will asynchronously update all operations on the same conflict-free replicated object;
the mutex is a locked floating point number and a character string, and the mutex can be read and written only after the function holds the mutex lock.
8. The serverless computing application execution method based on application control state management of claim 5 wherein the control state management client stores call identifiers for functions controlling state management functions, each call of a function generating a globally unique identifier to distinguish different calls of the same function;
and all functions sharing the same control state object form a full-connection network through the control state management client, and the control state object is accessed in a decentralized implementation mode.
9. A storage medium storing a program for executing the serverless computing application execution method according to any one of claims 1 to 4 based on application control state management.
10. A client for use in the serverless computing application execution system based on application control state management of any one of claims 5 to 8.
CN202210869036.8A 2022-07-22 2022-07-22 Server-free computing application execution method and system based on application control state management Pending CN115373816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210869036.8A CN115373816A (en) 2022-07-22 2022-07-22 Server-free computing application execution method and system based on application control state management

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210869036.8A CN115373816A (en) 2022-07-22 2022-07-22 Server-free computing application execution method and system based on application control state management

Publications (1)

Publication Number Publication Date
CN115373816A true CN115373816A (en) 2022-11-22

Family

ID=84062543

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210869036.8A Pending CN115373816A (en) 2022-07-22 2022-07-22 Server-free computing application execution method and system based on application control state management

Country Status (1)

Country Link
CN (1) CN115373816A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257306A (en) * 2023-04-20 2023-06-13 天津大学 Numerical value calculation method based on Serverless technology

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116257306A (en) * 2023-04-20 2023-06-13 天津大学 Numerical value calculation method based on Serverless technology

Similar Documents

Publication Publication Date Title
CN109977171B (en) Distributed system and method for ensuring transaction consistency and linear consistency
US5872971A (en) Data processing systems and methods providing interoperability between data processing resources
US5499364A (en) System and method for optimizing message flows between agents in distributed computations
EP1459213B1 (en) System and methods for asychronous synchronization
US6009266A (en) Methods, apparatus and data structures for managing objects
US6513056B1 (en) System and method for efficiently synchronizing cache and persistant data in an object oriented transaction processing system
US7836015B1 (en) Fast synchronization of computer databases using coverage status
JP3439337B2 (en) Network management system
EP2972983B1 (en) Dynamically managing memberships in replicated state machines within a distributed computing environment
US6349342B1 (en) Methods and apparatus for managing computer processes
EP0926608A2 (en) Distributed persistent storage for intermittently connected clients
WO1997025673A1 (en) Replicated resource management system for a distributed application maintaining a relativistic view of state
WO1997025673A9 (en) Replicated resource management system for a distributed application maintaining a relativistic view of state
EP3062260B1 (en) A method for controlling access to electronic documents using locks
CN110069346B (en) Method and device for sharing resources among multiple processes and electronic equipment
WO2011146540A2 (en) Sharing and synchronization of objects
CN104615489A (en) Multi-node data interaction achieving method
US7072912B1 (en) Identifying a common point in time across multiple logs
CN115373816A (en) Server-free computing application execution method and system based on application control state management
CN113868295A (en) Data query method and device and multi-party security database
US20060200800A1 (en) Aggregation of non blocking state machines on enterprise java bean platform
EP1627301A2 (en) Non blocking persistent state machines on enterprise java bean platform
CN112083914B (en) Method and system for realizing object model embedded operation system soft bus
Kühn et al. An extensible space-based coordination approach for modeling complex patterns in large systems
US8332485B1 (en) Lock optimization and lock prediction approaches for reducing client-server messages

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