CN114663202B - Auction bidding system and method based on faas function service - Google Patents

Auction bidding system and method based on faas function service Download PDF

Info

Publication number
CN114663202B
CN114663202B CN202210541560.2A CN202210541560A CN114663202B CN 114663202 B CN114663202 B CN 114663202B CN 202210541560 A CN202210541560 A CN 202210541560A CN 114663202 B CN114663202 B CN 114663202B
Authority
CN
China
Prior art keywords
function
auction
service
module
faas
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.)
Active
Application number
CN202210541560.2A
Other languages
Chinese (zh)
Other versions
CN114663202A (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.)
Dianpai Technology Co ltd
Shandong Jialian Electronic Commerce Co ltd
Original Assignee
Dianpai Technology Co ltd
Shandong Jialian Electronic Commerce 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 Dianpai Technology Co ltd, Shandong Jialian Electronic Commerce Co ltd filed Critical Dianpai Technology Co ltd
Priority to CN202210541560.2A priority Critical patent/CN114663202B/en
Publication of CN114663202A publication Critical patent/CN114663202A/en
Application granted granted Critical
Publication of CN114663202B publication Critical patent/CN114663202B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/08Auctions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0611Request for offers or quotes

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computing Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to an auction bidding system and method based on faas function service, comprising an announcement/bidding uploading module, a bidding display module, a bidder auction bidding module, an auctioneer function module and a faas function service module; abstracting all modules into a group of function services under the scene that key auctions or key second-level domain name websites need to be guaranteed, and further comprising functions of function mirror image generation and function deployment template generation; and under the corresponding scene, the functions of function service deployment, function service calling and function service deletion are realized. Through the faas function service architecture, independent function services are provided for auction meetings and secondary domain name websites which need key guarantee, and the function services are isolated from other background services. By using the function service architecture of the invention, only newly-added function functions need to be developed independently, and newly-developed function mirror image services are deployed, thereby avoiding the problems that the micro-service architecture needs to add functions in a module, and needs to suspend and redeploy services during upgrading.

Description

Auction bidding system and method based on faas function service
Technical Field
The invention relates to an auction bidding system and method based on faas function service, which provides service for auction bidding transaction of assets of auction companies and property exchange network asset transaction platforms and belongs to the technical field of network asset transaction.
Background
At present, the mainstream asset auction website system is basically developed based on a Spring closed micro-service architecture, and has the following problems: all auction service requests share computing resources of background services, so that VIP clients, auctions needing important attention or having large social influence share the same background services, resources and operation and maintenance guarantees as ordinary auctions.
When resources are in short supply due to high concurrent bidding access and the like of an auction bidding background server based on the existing micro service architecture, auction meetings of all online auctions are influenced, and if a key-spot auction meeting and a common auction meeting are held at the same time, user experience is consistent, and experience guarantee of the key-spot auction meeting cannot be highlighted. Some auction platforms provide sub-domain auction website services, for example, a certain auction platform offers a bank. The customer of bank a can participate in the auction by logging on the sub-domain name platform. The sub-domain name system and the auction platform share the same background micro-service architecture and database. Therefore, when server resources are in shortage, the experience of the sub-domain name platform is consistent with that of other users of the auction platform, and when the sub-domain name platform has important guarantee requirements or requirements, the experience guarantee of the sub-domain name system cannot be highlighted.
The auction bidding system based on the current micro-service architecture has some main defects in solving the sub-domain name and key auction guarantee: 1. the isolation of service resources is realized by requiring that a service system can be flexibly deployed and cancelled as required, and allocated resources can be configured as required, which is a problem that a micro-service architecture cannot solve; 2. the existing micro-service architecture cannot solve the function of important guarantee for one or several auctions in a multi-auction meeting held simultaneously, namely cannot realize the guarantee of the granularity of a specific auction meeting in a system (including a sub-domain name). 3. By using the micro-service architecture, when a background service function is newly added to a certain module, the service of the module must be suspended for package upgrading, and the service increase and termination at the function level cannot be realized.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an auction bidding system based on faas function service;
the invention also provides an auction bidding method based on the faas function service.
Interpretation of terms:
1. FaaS, Function as a Service, "Function as a Service" (also translated as a "Function as a Service"), is an event-driven computational execution model that runs in a stateless container. The FaaS provides an abstract way for developers to run applications, can respond to events without a management server, and can concentrate on writing codes and realizing business values.
2. OpenFaaS, which is an open-source faas framework and can be directly run on kubernets.
3. openfaas + k8s, openfaas and k8s are used, k8s is the shorthand name of Kubernetes, and 8 letters are between Kubernetes k and s, k8s for short.
4. The openloss xml file of the function, YAML, is a language specially used for writing configuration files, is very simple and powerful, and is far more convenient than the JSON format. Here, openloss YAML file refers to syntax openloss configuration file using YAML. The resource management and the resource object arrangement and deployment in the k8s cluster can be solved through a declaration style (YAML) file, that is, the operation required on the resource object can be edited into a YAML format file, the file is called a resource list file, and the arrangement and deployment on a large number of resource objects can be realized by directly using the resource list file through a kubecect command.
5. faas-cli, which is an official command line interface tool for OpenFaaS.
6. Kubernets, K8s for short, is an open source for managing containerized applications on multiple hosts in a cloud platform.
7. faas-nets, which provides OpenFaaS support for Kubernets; the open source item addresses are: https:// github. com/openfaas/faas-nets.
8. Auction targets (targets for short) are the rights of items or properties that are legally auctioned during the auction process.
The technical scheme of the invention is as follows:
an auction bidding system based on faas function service comprises an announcement/bid uploading module, a bid display module, a bidder auction bidding module, an auctioneer function module and a faas function service module;
the announcement/target upload module is for: uploading and inputting the auction bulletin and the target information, and inputting the target service information;
the target display module is to: displaying the information for the user to inquire and check; the method specifically comprises the following steps: before shooting, displaying the target information and the shooting time; in the auction process, displaying auction state information; after the auction is finished, the auction-finished targets are displayed in the target states;
the bidder auction bidding module is used for: providing bidders to participate in auction of the bidding target, and acquiring current auction state information and bidding price in real time;
the auctioneer function module is configured to: providing an auctioneer-hosted auction functionality;
the faas function service module is used for: under the scene of a key auction meeting or a key secondary domain name website needing isolation guarantee, abstracting the functional services of the announcement/bidding uploading module, the bidding display module, the bidding auction module of bidders and the auctioneer functional module into a group of functional services, wherein the faas functional service module also comprises the functions of function mirror image generation and function deployment template generation; each function service is issued and started to operate in a docker container form finally through openfaas + k8s, and corresponding function services are provided for a front-end webpage and an APP terminal through different function service access addresses; and under the scene that the key auction meeting needs to be isolated and guaranteed, the functions of function service deployment, function service calling and function service deletion are carried out on the services related to the auction and bidding process; and under the scene that the key second-level domain name website needs to be isolated, the functions of function service deployment, function service calling and function service deletion are carried out on the whole key second-level domain name website.
According to the invention, the faas function service module preferably comprises an nginx module, an openfast API gateway module, a faas-nets module, a kubernets cluster, a message distribution module, a message queue, a redis memory database, a Rejson module, a push module and an nfs file storage module;
the nginx module is used for: receiving and returning client access requests from a PC (personal computer) end and a mobile client, and forwarding a service request to a background to an openloss API gateway module;
the openloss API gateway module is used for: when function service is to be deployed or called, the openfast API gateway module forwards the request to the faas-nets module, and the faas-nets module completes calling of a function service mirror image deployed in the kubernets cluster to achieve service function calling;
the message queue is used for storing messages, and the messages are sent to subscribers by the message distribution module to realize synchronous information processing in a concurrent scene, and synchronously and concurrently process quotation information in the auction bidding process and information of auction participants for auction starting, pausing, resuming, terminating and disclosing;
the redis memory database is used for caching information about targets or whether key guarantee is performed on the second-level domain name or not and quotation information in the auction process;
the Rejson module directly stores, updates and acquires a JSON value from a redis memory database;
the push module is used for pushing websocket information of the client, and ensures that all users participating in the same auction session can receive bids and information of auctioneers in time;
and the nfs file storage module is used for storing the yaml file deployed by the service function.
An auction bidding method based on the faas function service is operated in the auction bidding system based on the faas function service and comprises the following steps:
abstracting the functional services of the bulletin/bidding uploading module, the bidding display module, the bidder auction bidding module and the auctioneer functional module into a group of functional services, wherein the faas functional service module further comprises functions of function mirror image generation and function deployment template generation;
for services without special requirements and key guarantees, uniformly accessing default function services; for auction occasions needing key guarantee, namely services needing key auction, function service deployment, function service calling and function service deletion are carried out on services related to the auction and bidding process; and for the secondary domain name whole station service needing important guarantee, namely the service needing isolating the important secondary domain name website, performing functions of function service deployment, function service calling and function service deletion on the whole important secondary domain name website.
According to the invention, the function image generation comprises: compiling a service function based on an OpenFaaS framework, compiling and packaging by using a faas-cli tool to generate a docker mirror image, and pushing the docker mirror image to a docker mirror image warehouse;
function deployment template generation, comprising: extracting a yaml file deployed by a compiled service function into a yaml file template, extracting the yaml file according to different parameter configurations of scenes, storing the yaml file template into an NFS (network file system) server in a placeholder form, generating a file directory according to the function file name, and storing the yaml file template into the directory.
According to the invention, the function service deployment comprises:
when a key auction meeting needing isolation and a key secondary domain name website needing isolation are created, reading a yaml file template from an NFS (network file system) server for a corresponding service function, transmitting parameters, and replacing a part needing replacement in the yaml file template to form a deployed yaml file, wherein a plurality of service functions can be configured in one yaml file, and the yaml file is stored in the NFS server;
running a faas-cli default instruction, downloading a function mirror image from a docker mirror image warehouse to a kubernetes cluster according to a yaml file specified in the faas-cli default instruction, and generating a docker container; the deploy command starts the docker container.
According to the optimization of the method, OpenFaaS generates a unique URL address based on a function name for each service function; a function service call, comprising: the front-end application calls a uniform background function service address, and a target ID and a second-level domain name website system ID are written in the function service request; the function service request is transmitted to an openloss API gateway module, the openloss API gateway module transmits the function service request to a faas-nets module, the faas-nets module reads the target or the request for the ID of the secondary domain name website from a redis memory database according to the target ID and the ID of the secondary domain name website system, whether important guarantee is provided or not is provided, if yes, the corresponding function service name is read, and the corresponding function service is called.
Preferably, the redis memory database stores information about whether to isolate the important auction meeting and the important secondary domain name website, and when the auction meeting and the secondary site are created, the information is stored in the redis memory database in a json format, and the information about whether to isolate the important auction meeting and the important secondary domain name website stored in the redis memory database is cleared when the auction meeting is finished and the secondary domain name website site is cancelled.
Preferably, a cache is set in the faas-nets, when the auction or the second-level domain name website calls a background service function for the first time, and after a result in a redis memory database is read, the result is placed in the cache; and (4) cache information in the faas-nets is cleared when the auction is finished and the second-level domain name website site is withdrawn.
According to the invention, the function service deletion preferably comprises:
the Kubernetes cluster starts a Cronjob timing task and runs a resource release script in a timing mode;
scanning auction data in a redis memory database by a resource release script program, if the auction data is an auction meeting needing to isolate key points and is finished, calling a faas-cli remove command, deleting corresponding function service, and calling default function service after the auction process of the auction meeting needing to isolate key points is finished;
and scanning the secondary domain name website needing to isolate key points in the redis memory database by the resource release script program, and calling a faas-cli remove command to remove the corresponding function service if the secondary domain name website needing to isolate key points is deleted and stopped.
Preferably, the three services include a service without special requirements for key guarantee, a service requiring isolation of key auctions and a service requiring isolation of key second-level domain name websites, and are distinguished and called through different function calling addresses, the same function service code and the same mirror image version are completely the same, and only the function names are different; and setting all function images in the openloss xml file of the function to pull the image of the latest version.
Further preferably, the data of the function service is accessed from a redis memory database, specifically: inquiring and reading data from a relational database for target information which does not start or ends; for the auction subject, reading the bidding record list information from the redis memory, after the auction is finished, synchronizing the data from the redis memory to the redis memory database by the data synchronization service, releasing the part of data from the redis memory after the synchronization is finished, and deleting the function service container.
Further preferably, the bid information processing request is buffered using a message queue and processed serially.
The invention has the beneficial effects that:
1. through the faas function service architecture, independent function services are provided for the auction meeting and the secondary domain name website which need key guarantee, the function services are isolated from other background services, and the level of the single auction meeting can be guaranteed precisely to the key guarantee.
2. By the faas function service architecture, the mirror image management and automatic service expansion function of the Kubernetes cluster are utilized, and the guarantee service experience of CPU, memory resources and the like is independently set for the mirror image.
3. The invention generates a packaging and issuing script for the bidding service needing important guarantee, issues the corresponding faas service through a script program, and calls the naming convention mechanism through the front-end service. When the service is not needed any more, the revocation and resource release of the function service are realized through the script program.
4. The invention is based on the faas technical architecture, and has the advantages of resource use according to needs, cost saving, function support for multi-language development, simplification of operation and maintenance personnel, workload of management servers and the like compared with a micro-service architecture.
5. The invention discloses a method for releasing and calling service of different mirror image instances of the same function and the same version of a system. When a system increases new requirements and needs to add new background services, the function service architecture of the invention is used, only newly-added function functions need to be developed independently, and newly-developed function mirror image services are deployed, so that the problems that the micro-service architecture needs to add functions in a module, and the services need to be suspended and redeployed during upgrading are solved.
Drawings
FIG. 1 is a schematic diagram of the general structure of an auction bidding system based on the faas function service;
FIG. 2 is a schematic flow chart of function mirror generation and function deployment template generation;
FIG. 3 is a flow diagram of function service deployment;
FIG. 4 is a flow diagram of a function service call;
fig. 5 is a flow chart illustrating an auction bidding method based on the faas function service.
Detailed Description
The invention is further defined in the following, but not limited to, the figures and examples in the description.
Example 1
An auction bidding system based on faas function service comprises an announcement/bid uploading module, a bid display module, a bidder auction bidding module, an auctioneer functional module and a faas function service module;
the announcement/target upload module is for: uploading and inputting the auction bulletin and the target information, and inputting the target service information; as the information source of the target display and the public.
The fields of the subject information are shown in table 1:
TABLE 1
Figure 769741DEST_PATH_IMAGE002
The fields of the advertisement information are shown in table 2:
TABLE 2
Figure 578560DEST_PATH_IMAGE004
The target display module is to: displaying the information for the user to inquire and check; the method specifically comprises the following steps: before shooting, displaying the target information and the shooting time; in the auction process, displaying auction state information; for example, auction suspension, and real-time bid record information; after the auction is finished, the auction-finished targets are displayed in the target states; such as bargaining, streaming, and quote records.
The bidder auction bidding module is used for: providing bidders to participate in auction of the bidding target, and acquiring current auction state information and bidding price in real time;
the auctioneer function module is configured to: providing an auctioneer-hosted auction functionality; for example, the functions of checking the entry information of bidders in the auction, publishing the public information, starting/pausing the auction function, acquiring the current real-time bid information and adjusting the bid amplitude are realized.
The faas function service module is used for: according to the service requirement, under the scene that a key auction meeting or a key secondary domain name website needs to be isolated and guaranteed, the functional services of an announcement/bidding uploading module, a bidding display module, a bidder auction bidding module and an auctioneer functional module are abstracted into a group of functional services, and the faas functional service module further comprises functions of function mirror image generation and function deployment template generation;
each function service is issued and started to operate in a docker container form finally through openfaas + k8s, and corresponding function services are provided for a front-end webpage and an APP terminal through different function service access addresses; under the scene that the key auction meeting needs to be isolated and guaranteed, the auction bidding process is mainly guaranteed, and the functions of function service deployment, function service calling and function service deletion are realized for the services related to the auction and bidding process; under the condition that the key second-level domain name website needs to be isolated, the functions of function service deployment, function service calling and function service deletion of the whole key second-level domain name website are realized. Therefore, all functions of the modules are deployed and isolated by function service. Based on the faas (Function as a service) technical architecture, the auction bidding core Function logic is abstracted into a Function and a data structure suitable for Function calculation, and the bidding platform background architecture uses the Function service to replace the current micro-service architecture.
The auction and bidding process involves services, for example, the main guaranteed service contents are: auction creation, auctioneer hosting, bidder bidding, auction information query basic auction service operations.
The second-level domain name website, for example, the domain name of the click-to-click network is www.dpauc.com, the click-to-click network customizes a second-level domain name website for the customer, for example, jnns.dpauc.com, an asset trading network of a certain agricultural business, and the user can realize the auction function provided by the click-to-click network by logging in jnns.dpauc.com. The key secondary domain name website, namely the website of the secondary domain name needs key guarantee.
Based on the function service architecture, the function service requirements can cover basic auction business operation requirements such as establishment of a supporting auction, host of an auctioneer, bidding of bidders, inquiry of auction information and the like.
Example 2
The auction bidding system based on the faas function service according to embodiment 1 is different in that:
as shown in fig. 1, the faas function service module includes an nginx module, an openfast API gateway module, a faas-nets module, a kubernets cluster, a message distribution module, a message queue, a redis memory database, a Rejson module, a push module, and an nfs file storage module;
the nginx module acts as a reverse proxy to: receiving and returning client access requests from a PC (personal computer) end and a mobile client, and forwarding a service request to a background to an openloss API gateway module;
the openloss API gateway module is used as an entrance of the faas and is used for: when function service is to be deployed or called, the openfast API gateway module forwards the request to the faas-nets module, and the faas-nets module completes calling of a function service mirror image deployed in the kubernets cluster to achieve service function calling;
the message queue is used for storing messages, and the messages are sent to subscribers by the message distribution module to realize synchronous information processing in a concurrent scene, and synchronously and concurrently process quotation information in the auction bidding process and information of auction participants for auction starting, pausing, resuming, terminating and disclosing; the messages are sequenced and serially processed through the message queues, and the problem of low processing efficiency caused by using a distributed lock for synchronous data processing is solved.
The redis memory database is used for caching information about targets or whether key guarantee is performed on the second-level domain name or not and quotation information in the auction process; the data access speed is accelerated, and frequent access to the relational database is avoided.
The Rejson module is a Redis module, completely supports the JSON standard, and can directly store, update and acquire JSON values from a Redis memory database;
the push module has the main functions of pushing websocket information of the client, and ensuring that all users participating in the same auction session can receive bids and information of auctioneers in time;
the main function of the nfs file storage module is to store yaml files for service function deployment.
Example 3
An auction bidding method based on the faas function service, which is operated in the auction bidding system based on the faas function service described in any one of embodiments 1-3, comprises:
abstracting the functional services of an announcement/bidding uploading module, a bidding display module, a bidder auction bidding module and an auctioneer functional module into a group of functional services, wherein the faas functional service module also comprises functions of function mirror image generation and function deployment template generation;
for services without special requirements and key guarantees, uniformly accessing default function services; for auction occasions needing key guarantee, namely services needing isolation of key auction parties, the auction bidding process is mainly guaranteed, and therefore functions of function service deployment, function service calling and function service deletion for services related to the auction and bidding process are achieved; for the second-level domain name whole station service needing important guarantee, namely the service needing isolating important second-level domain name websites, the functions of function service deployment, function service calling and function service deletion of the whole important second-level domain name websites are achieved.
Also illustrated by FIG. 5 is the principle of function scheduling, Bid 910001 being a guarantee auction, bidders bid to invoke the auctioneering bid-910001 function service; bid 910002 is an unprotect common auction, with bidders bidding to invoke the auctibid default function service.
Example 4
The auction bidding method based on the faas function service according to the embodiment 3 is characterized in that:
a function image generation and deployment template flow diagram is shown in fig. 2. Function image generation, comprising: compiling a service function based on an OpenFaaS framework, compiling and packaging by using a faas-cli tool to generate a docker mirror image, and pushing the docker mirror image into a docker mirror image warehouse; the Docker mirror warehouse may use the public mirror warehouse Docker hub, or may use a private mirror warehouse. The method packs the functions into container mirror images through openfaas, and deploys the container mirror images to Kubernets, and the Kubernets manage the starting, the withdrawing and the like of the containers. The sub-domain name platform and each key auction which need key guarantee can be served by a special container, and the containers are isolated from each other. Resources such as a server CPU, a memory and the like of the container can be configured independently, so that the service quality is ensured.
The auction creates the function auctioncreate and creates a piece of information of the target to be auctioned. The auction logic abstraction, data structure and flow adapting the functional service architecture based on the invention are as follows:
on the basis of the basic information field of the target service, adding field information to the target information is shown in table 3:
TABLE 3
Figure DEST_PATH_IMAGE006
The auction bid creating function is for creating a bid, each bid is created only once, there is no problem of concurrency synchronization, and multiple instances can be deployed in a mirror image, so that the auto-scaling part com.
And the target creating function stores the target data into the redis in the JOSN format. Using a globally unique json key of the target name-target ID as a key of the json data of the target, taking creating an auction of a vehicle target requiring important guarantee as an example, the format of the saved json data is as follows:
{
"tagt_id": 910001,
"tag _ name": a vehicle,
"tagt_start_value": 200000,
"tagt_inc_value": 1000,
"tagt_keep_value": 200000,
"tagt_deal_value": 0,
"tagt_bid_secs": 3600,
"tagt_secs_delay": 60,
"tagt_start": "2021-12-25 9:00:00",
"tagt_end": "",
"tagt_class": 3,
"tagt_satus": 0,
"ct_date": "2021-12-23 9:52:05",
"support_level": 1
}
the target creation function may read and write the target attribute data in redis using json.get/json.set target-910001.
And the bidding function auctionbid of the auction bid processes the bid request of the user for the bid in auction, feeds back the result, stores the result into a redis memory database for reading according to the bidding condition, and pushes the result to the auctioneer and other bidders. A flow chart of a bid processing function for adapting an auction bid based on the functional service architecture of the present invention is shown in fig. 5.
Subject 1 is auctioned simultaneously with subject 2, with a different number of participants for each subject, and each subject is held by the auctioneer. The bid 1 and bid 2 users offer prices and submit to the message distribution module, and the message distribution module stores the received request message into the message queue. Target 1 user 2 bid 1100 element, message data structure contains target ID, user bid information example: { "tagjd": 910001, "user _ id": id2, "price": 1100 }.
The message processing module subscribes quotation information, the quotation information is serially processed by the message processing module through a message queue, and the message subscribing module calls a URL address http:// gatewayIP corresponding to a quotation function: the method comprises the steps of port/function/interactive bid, calling a request with user quotation information, wherein { "tag _ ID": 910001, "user _ ID": ID2, "price": 1100}, referring to fig. 4, the ID tag _ ID field of a target in an openface gateway analysis request is 910001, splicing into a redis rejoss instruction "json. get target-910001" instruction, and obtaining that the value of the key guarantee field of the target is 1, namely the key guarantee is needed. The gateway splices the function name 'autocontid-object id', acquires the function name 'autocontid-910001' which should be accessed, completes the call of the function, and returns the result to the message processing module;
step 1: updating target bid record data in redis using a format of "tag _ bid _ recs-target id" as key for target redis json data access, value part is stored in an array of [ { "user _ id": id2, "price":1000, "rec _ date": 2021-12-249: 15:08"}, {" user _ id ": id2," price ": 1100," rec _ date ": 2021-12-249: 22:18" } ] json for displaying target bid record information.
Step 2: and calling a push module websocket push function, pushing the user bids to the users and the auctioneers participating in the 910001 bidding, and displaying the quotation information of the user 2 on the terminals of the participating users and the auctioneers.
An auctioneer hosts an 910001 auction of the target, modifies an auctionbidstep of the target, adjusts the adding amplitude from 1000 to 1500, modifies a corresponding 'tag _ inc _ value' attribute in the redis of the target to 1500, and calls a websocket pushing function of a pushing module to push the updated adding amplitude to a user taking a picture.
Inquiring an auctioning bidding information function auctioning bididrecs, acquiring a tagt _ satus attribute from reids, and reading record data with key of tagt _ bid _ recs-910001 from redis for the auction target with the tagt _ satus value of 1, 2; if the value of tagt _ satus is 0, the auction is not started for the target, no data is recorded for the bid, and the return value is null. For targets with a tagt _ satus value of 3,4, which have finished auctioning, data is read from the relational database.
Example 5
The auction bidding method based on the faas function service according to the embodiment 3 is characterized in that:
function deployment template generation, comprising: because the same function needs to be deployed in different scenes, the yaml file deployed by the written service function is extracted to be a yaml file template, the yaml file is extracted according to different parameter configurations of the scenes, the yaml file template is stored in the NFS server in a placeholder mode, a file directory is generated according to the function file name, and the yaml file template is stored in the directory.
The function deployment flow diagram is shown in fig. 3. A function service deployment comprising:
when an important auction meeting needing isolation and an important secondary domain name website needing isolation are created, whether important guarantee is needed or not is selected, if yes, a yaml file template is read from the NFS server, parameters are input, and parts needing replacement in the yaml file template, such as new function names, are replaced to form a yaml file for deployment, multiple service functions can be configured in one yaml file, and each service function in the yaml file is essentially a single function mirror image deployment operation. Saving the yaml file to the NFS server;
running a faas-cli default instruction, downloading a function mirror image from a docker mirror image warehouse to a kubernetes cluster according to a yaml file specified in the faas-cli default instruction, and generating a docker container; the deploy command starts the docker container. And after the docker container is started, service calling is carried out through a function service address provided by OpenFaaS.
After function deployment is completed and a container is started, OpenFaaS generates a unique URL address based on a function name for each service function; for a certain function, since a function service with consistent function but inconsistent name is issued, a specific function service call includes: the front-end application calls a unified function service address of the background, and a target ID and the ID of the second-level domain name website system where the target ID is located are written in the function service request; because the function service addresses have uniform/function/path, the function service request is transmitted to an openloss API gateway module, the openloss API gateway module transmits the function service request to a faas-nets module, the faas-nets module reads the target or the request for the ID of the second-level domain name website from a redis memory database according to the target ID and the ID of the second-level domain name website system, whether the key guarantee exists or not is determined, if so, the corresponding function service name is read, and the corresponding function service is called. The auction system, for example, the auction system, establishes second-level domain name websites, for example, jnns.dpauc.com, dmns.dpauc.com, etc., for the uniform numbering of the targets, corresponding to the ID of the targets, for the websites of these second-level domain names, a number, that is, a second-level domain name ID, is also needed. More specifically, the ID of the bidding system corresponding to the subordinate secondary domain name of the click net is used.
Taking bidder bids as an example, as shown in fig. 4, the principle of the functional service scheduling method is as follows:
the bidding function of bidders, the system calls http:// gateway IP (port/function/autocontionalized address) in a unified way, and after an openloss API gateway module receives the request, the system analyzes the ID of the target and the ID parameter of the site from the URL request of the target or the site; inquiring whether important guarantee is required or not from a redis memory database according to the parameters, if so, generating a function name which is required to be actually called finally according to a function name-target ID of a function naming rule, wherein the target ID is 910001 auction meeting, inquiring the important guarantee required by the redis memory database, defaulting a function bid by a bidder to be auctionbid, wherein the function which is required to be actually called is auctionbid-910001, and after obtaining the actual function name, a faas-nets module finally calls a function mirror image service which is called as auctionbid-910001.
The function calling logic is realized by using the faas-nets module as the implementation of openfaas on Kubernets and calling specific services according to function names through the proxy in the faas-nets module, and a specific flow is shown in fig. 4.
The information of whether to isolate the important auction meeting and the information of the secondary domain name website which needs to isolate the important are stored in a redis memory database, and stored in the redis memory database in a json format when the auction meeting and the secondary site are created, and the information of whether to isolate the important auction meeting and the information of the secondary domain name website which needs to isolate the important are cleared when the auction meeting is finished and the secondary domain name website site is cancelled.
In order to prevent the function from inquiring redis every time when calling, a cache is set in the faas-nets, when the auction or the second-level domain name website site calls a background service function for the first time, and after a result in a redis memory database is read, the result is placed in the cache; like the related information stored in the redis, the cache information in the faas-nets is cleared when the auction is finished and the second-level domain name website is withdrawn.
Generating a mirror image for processing auction user bid function service auctionbid and the function deployment, comprising the following steps:
step 1: creating an empty directory, initializing by using a faas-cli new auction bid-lang python command under the empty directory, generating an auctionenbid folder containing a handle.
And 2, step: generating a template of the user bid function service auctionbid, generating a function service yaml file in step 1,
the main format of the function definition part is as follows:
functions:
auctionbid:
lang: python
handler: ./auctionbid
image: dkkd2021/auctionbid:latest
replacing the function name "autocondid" in the functions part of the file with "{ site # site- } autocondid { - # tagtid }", wherein # site identifies a secondary domain name site ID which is mainly guaranteed by the function service, namely the site service calls a related function of which site { # site } is a starting identifier; wherein # tagtid identifies the ID of the auction bid which is served by the function as key guarantee. This yaml template is stored in nfs, and a file directory authobid is generated by the function file name and stored in this directory.
And step 3: and compiling an autoconbid function by using a faas-cli tool build instruction, packaging to generate a docker mirror image, and pushing the mirror image to a docker mirror image warehouse.
And 4, step 4: when object 910001 is created or modified, choose "Key guarantee", get yaml template from nfs autoconbid directory, replace "{ site # site id- }" in it to be null, replace "{ - # tag id } in it to be 910001, new function service name is autoconbid-910001.
And 5: and (3) running a faas-cli deploy instruction, downloading the function mirror image generated in the step (3) from a docker mirror image warehouse to the kubernets cluster according to the yaml file generated in the step (4) specified in the instruction, and generating a docker container. The default command starts the function container and starts the function service.
Example 6
The auction bidding method based on the faas function service according to the embodiment 5 is characterized in that:
generating a mirror image of a secondary domain name website function service of key guarantee and the function deployment, comprising the following steps:
based on function compiling and mirror image generation in embodiment 5, relevant function service images such as bid bidding exist in the docker mirror warehouse.
And a secondary domain name website, bank.dpauc.com, wherein the site id is 1001, when creating or modifying, selecting ' important guarantee ', acquiring function yaml templates such as auctionbid and the like from nfs, replacing { site # site- } ' in the function yaml templates into 1001, replacing { - # site id } into null, and generating a new yaml deployment file by using the new function service name of the bidding function as site 1001-auctionbid. And (5) running a faas-cli deployment instruction, and specifying a newly generated yaml file in the instruction to complete deployment.
Example 7
The auction bidding method based on the faas function service according to the embodiment 3 is characterized in that:
function service deletion, including:
starting a Cronjob timing task by the Kubernetes cluster, and running a resource release script at regular time (every 10 minutes);
the resource release script program scans auction data in a redis memory database, if the auction data is a major auction meeting which needs to be isolated and is finished, a faas-cli remove command is called, the corresponding function service is deleted, and after the auction process of the major auction meeting which needs to be isolated is finished, data query and other operations call default function services;
and scanning a secondary domain name website needing to isolate important points in a redis memory database by a resource release script program, and calling a faas-cli remove command to remove the corresponding function service if the secondary domain name website needing to isolate important points is deleted and stopped. After the second-level domain name website is stopped, the front-end page cannot be accessed, and the problems of calling function service to inquire data and the like do not exist.
The three services comprise a service without special requirement of key guarantee, a service needing to isolate key auction and a service needing to isolate key second-level domain name websites, the services are distinguished and called through different function calling addresses, the same function service code and the same mirror image version are completely the same, and only the function names are different; therefore, all function images are set in the openloss xml file of the function to pull the image of the latest version.
The function service considers efficiency, only high-efficiency calculation service is carried out, and time-consuming operations such as database access, database synchronization, information pushing and the like are carried out by special service. In order to improve the function response speed, the data of the function service are all accessed from a redis memory database, specifically: inquiring and reading data from a relational database for target information which does not start or ends; for the auction bid, reading bidding record list information from a redis memory for displaying scenes such as a public onlooker page and the like; after the auction is finished, the data synchronization service synchronizes the data from the redis memory to the redis memory database, and after the synchronization is finished, the partial data is released from the redis memory, and the function service container is deleted.
The bidding record list refers to a record of successful bidding of bidders in the auction, and the specific information is shown in table 4:
TABLE 4
Figure DEST_PATH_IMAGE008
Because the function is stateless and unordered, and the function cannot store and check the order of bid information requests, the system architecture caches and serially processes bid information processing requests by using the message queue. The function does not need to introduce a less efficient synchronization lock mechanism for handling concurrent contention. Because information such as auction bidding and the like is independently and serially processed by the function service, the com.
The function does not store the information state of the service, the system stores the information in the bidding process of the targets through a global redis memory database, the invention stores the object information related to the auction by using JOSN, and the access of JOSN data is carried out by using a redis rejson module. JSON is used for accessing auction data information to facilitate data access among the database, the background and the redis, data in the relational database is mapped into java objects through ORM, the java objects can be serialized/deserialized into JSON data, and data format conversion among the database, the background and the redis is simplified; the json data can be directly operated in the redis by using the redis rejson, so that the processing of the auction data stored in the redis is simplified, and the system response is accelerated.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (9)

1. An auction bidding system based on faas function service is characterized by comprising an announcement/bid uploading module, a bid display module, a bidder auction bidding module, an auctioneer function module and a faas function service module;
the announcement/target upload module is for: uploading and inputting auction bulletins and target information, and inputting target service information;
the target display module is to: displaying the information for the user to inquire and check; specifically, the method comprises the following steps: before shooting, displaying the target information and the shooting time; in the auction process, displaying auction state information; after the auction is finished, the auction-finished targets are displayed in the target states;
the bidder auction bidding module is used for: providing bidders to participate in auction of the bidding target, and acquiring current auction state information and bidding price in real time;
the auctioneer function module is configured to: providing an auctioneer-hosted auction functionality;
the faas function service module is used for: under the scene of a key auction meeting or a key secondary domain name website needing isolation guarantee, abstracting the functional services of the announcement/bidding uploading module, the bidding display module, the bidding auction module of bidders and the auctioneer functional module into a group of functional services, wherein the faas functional service module also comprises the functions of function mirror image generation and function deployment template generation; each function service is finally issued and started to operate in a docker container mode through openfaas + k8s, and corresponding function services are provided for front-end webpages and APP terminals through different function service access addresses; and under the scene that the key auction meeting needs to be isolated and guaranteed, the functions of function service deployment, function service calling and function service deletion are carried out on the services related to the auction and bidding process; under the scene that the key secondary domain name website needs to be isolated, the functions of function service deployment, function service calling and function service deletion are carried out on the whole key secondary domain name website;
the faas function service module comprises an nginx module, an openloss API gateway module, a faas-nets module, a kubernets cluster, a message distribution module, a message queue, a redis memory database, a Rejson module, a push module and an nfs file storage module;
the nginx module is used for: receiving and returning client access requests from a PC (personal computer) end and a mobile client, and forwarding a service request to a background to an openloss API gateway module;
the openloss API gateway module is used for: when function service is to be deployed or called, the openfast API gateway module forwards the request to the faas-nets module, and the faas-nets module completes calling of a function service mirror image deployed in the kubernets cluster to achieve service function calling;
the message queue is used for storing messages, and the messages are sent to subscribers by the message distribution module to realize synchronous information processing in a concurrent scene, and synchronously and concurrently process quotation information in the auction bidding process and information of auction participants for auction starting, pausing, resuming, terminating and disclosing;
the redis memory database is used for caching information about targets or whether key guarantee is performed on the second-level domain name or not and quotation information in the auction process;
the Rejson module directly stores, updates and acquires a JSON value from a redis memory database;
the push module is used for pushing websocket information of the client, and ensures that all users participating in the same auction session can receive bids and information of auctioneers in time;
and the nfs file storage module is used for storing the yaml file deployed by the service function.
2. An auction bidding method based on the faas function service, operating in the auction bidding system based on the faas function service of claim 1, comprising:
abstracting the functional services of the bulletin/bidding uploading module, the bidding display module, the bidder auction bidding module and the auctioneer functional module into a group of functional services, wherein the faas functional service module further comprises functions of function mirror image generation and function deployment template generation; for services without special requirements and key guarantees, accessing default function services in a unified manner; for auction occasions needing key guarantee, namely services needing key auction, function service deployment, function service calling and function service deletion are carried out on services related to the auction and bidding process; and for the secondary domain name whole station service needing important guarantee, namely the service needing isolating the important secondary domain name website, the functions of function service deployment, function service calling and function service deletion are carried out on the whole important secondary domain name website.
3. The auction bidding method of claim 2, wherein the function mirror generation comprises: compiling a service function based on an OpenFaaS framework, compiling and packaging by using a faas-cli tool to generate a docker mirror image, and pushing the docker mirror image to a docker mirror image warehouse;
function deployment template generation, comprising: extracting a yaml file deployed by a compiled service function into a yaml file template, extracting the yaml file according to different parameter configurations of scenes, storing the yaml file template into an NFS (network file system) server in a placeholder form, generating a file directory according to the function file name, and storing the yaml file template into the directory.
4. The auction bidding method of claim 2, wherein the deployment of the function service comprises:
when a key auction meeting needing isolation and a key secondary domain name website needing isolation are created, reading a yaml file template from an NFS (network file system) server for a corresponding service function, transmitting parameters, and replacing a part needing replacement in the yaml file template to form a deployed yaml file, wherein a plurality of service functions can be configured in one yaml file, and the yaml file is stored in the NFS server;
running a faas-cli default instruction, downloading a function mirror image from a docker mirror image warehouse to a kubernetes cluster according to a yaml file specified in the faas-cli default instruction, and generating a docker container; the deploy command starts the docker container.
5. The auction bidding method based on the faas function service of claim 2, wherein OpenFaaS generates a unique URL address based on a function name for each service function; a function service call comprising: the front-end application calls a uniform background function service address, and a target ID and a second-level domain name website system ID are written in the function service request; the function service request is transmitted to an openfast API gateway module, the openfast API gateway module transmits the function service request to a faas-nets module, the faas-nets module reads the target or the request for the secondary domain name site ID from a redis memory database according to the target ID and the secondary domain name website system ID, whether important guarantee is provided or not, if yes, the corresponding function service name is read, and the corresponding function service is called.
6. The auction bidding method based on the faas function service according to claim 5, wherein the information on whether to isolate the important auctions and the important secondary domain name websites is stored in the redis memory database, and when creating the auctions and the secondary sites, the information on whether to isolate the important auctions and the important secondary domain name websites is stored in the redis memory database in a json format, and when the auctions are finished and the secondary domain name websites are withdrawn, the information on whether to isolate the important auctions and the important secondary domain name websites is stored in the redis memory database.
7. The auction bidding method based on faas function service according to claim 5, wherein a cache is set in faas-nets, when an auction party or a second-level domain website site calls a background service function for the first time, a result in a redis memory database is read, and then the result is placed in the cache; and (4) the cache information in the faas-nets is cleared when the auction is finished and the second-level domain name website is withdrawn.
8. The auction bidding method of claim 2, wherein the deletion of the function service comprises:
the kubernets cluster starts a Cronjob timing task and runs a resource release script in a timing mode;
scanning auction data in a redis memory database by a resource release script program, calling a faas-cli remove command if the auction data is the auction meeting needing to isolate key points and is finished, deleting corresponding function services, and calling default function services after the auction process of the auction meeting needing to isolate key points is finished;
and scanning a secondary domain name website needing to isolate important points in a redis memory database by a resource release script program, and calling a faas-cli remove command to remove the corresponding function service if the secondary domain name website needing to isolate important points is deleted and stopped.
9. The auction bidding method based on the faas function service according to any one of claims 2 to 8, wherein the data of the function service is accessed from a redis memory database, specifically: inquiring and reading data from a relational database for target information which does not start or ends; for the auction bid, reading the bidding record list information from the redis memory, after the auction is finished, synchronizing the data from the redis memory to the redis memory database by the data synchronization service, releasing the data from the redis memory after the synchronization is finished, and deleting the function service container.
CN202210541560.2A 2022-05-19 2022-05-19 Auction bidding system and method based on faas function service Active CN114663202B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210541560.2A CN114663202B (en) 2022-05-19 2022-05-19 Auction bidding system and method based on faas function service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210541560.2A CN114663202B (en) 2022-05-19 2022-05-19 Auction bidding system and method based on faas function service

Publications (2)

Publication Number Publication Date
CN114663202A CN114663202A (en) 2022-06-24
CN114663202B true CN114663202B (en) 2022-09-02

Family

ID=82038077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210541560.2A Active CN114663202B (en) 2022-05-19 2022-05-19 Auction bidding system and method based on faas function service

Country Status (1)

Country Link
CN (1) CN114663202B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610310B (en) * 2023-05-31 2023-11-14 天津大学 FaaS function management method based on Serverless architecture

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10467686B2 (en) * 2007-02-09 2019-11-05 Xcira, Inc. Integrated auctioning environment platform
CN107807859A (en) * 2017-10-24 2018-03-16 郑州云海信息技术有限公司 A kind of FaaS frameworks and its method of work, the system of exploitation O&M FaaS frameworks
CN108491191A (en) * 2018-03-29 2018-09-04 安徽航天信息有限公司 A kind of serverless backup FaaS frameworks tax big data system
CN111383084A (en) * 2018-12-28 2020-07-07 优信拍(北京)信息科技有限公司 Auction method and system
CN110716765B (en) * 2019-09-29 2023-04-07 浙江网新恒天软件有限公司 Method for applying Faas to monomer
CN111752688A (en) * 2020-06-03 2020-10-09 五八有限公司 Data acquisition method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GOFS: Geo-distributed Scheduling in OpenFaaS;Fabiana Rossi;《2021 IEEE Symposium on Computers and Communications (ISCC)》;20211215;全文 *
移动社交网络中基于拍卖模型的数据转发激励机制;刘浩等;《通信学报》;20171125(第11期);全文 *

Also Published As

Publication number Publication date
CN114663202A (en) 2022-06-24

Similar Documents

Publication Publication Date Title
CN108365971A (en) Daily record analytic method, equipment and computer-readable medium
WO2017181970A1 (en) Advertisement idea processing method, advertisement idea processing device, and storage medium
US20200410031A1 (en) Systems and methods for cloud computing
CN102868726B (en) Method and system for publishing Internet information
CN102124439B (en) Method and system for clustering
CN110363542A (en) Construction method, device, storage medium and the electronic equipment of customer service system
CN114663202B (en) Auction bidding system and method based on faas function service
US20130166675A1 (en) Computer System and Computer Method for Coarse-Grained Data Access
Shu-Qing et al. The improvement of PaaS platform
WO2018137588A1 (en) Medium content casting method, device, system, and data storage medium
Li et al. Model-based services convergence and multi-clouds integration
US20110289041A1 (en) Systems and methods for managing assignment templates
CN113128197A (en) Method and device for managing application production versions
US20120271779A1 (en) Unifying domain model for internet business systems
AU2021246978B2 (en) Multi-level cache-mesh-system for multi-tenant serverless environments
CA2633783C (en) Messaging interface system
CN111988368A (en) Data interaction system and interaction method
CN113741888A (en) Service processing method and device
CN112835606A (en) Gradation issuing method, gradation issuing apparatus, electronic device, gradation issuing medium, and program product
CN110750316A (en) Method for processing internal task or input event and application program architecture system
CN114169949A (en) Invoice processing method, device and system
KR20120061150A (en) Cloud computing flatform IaaS Open API
CA2775172C (en) System and method for search engine campaign management
US20220350680A1 (en) Central Event Catalog
Al-Thuhli et al. A framework to interface enterprise social network into running business process

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