WO2012142854A1 - Application service platform system and implementation method thereof - Google Patents

Application service platform system and implementation method thereof Download PDF

Info

Publication number
WO2012142854A1
WO2012142854A1 PCT/CN2011/085194 CN2011085194W WO2012142854A1 WO 2012142854 A1 WO2012142854 A1 WO 2012142854A1 CN 2011085194 W CN2011085194 W CN 2011085194W WO 2012142854 A1 WO2012142854 A1 WO 2012142854A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
server
configuration information
central server
request message
Prior art date
Application number
PCT/CN2011/085194
Other languages
French (fr)
Chinese (zh)
Inventor
高磊
赵博然
黄湘龙
杨虎
李春雷
陈春松
吴炳锡
刘丹
刘玎
唐峤木
Original Assignee
北京新媒传信科技有限公司
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
Priority claimed from CN 201110097156 external-priority patent/CN102185900B/en
Priority claimed from CN201110170620.6A external-priority patent/CN102340415B/en
Priority claimed from CN201110171926.3A external-priority patent/CN102394901B/en
Priority claimed from CN201110171673.XA external-priority patent/CN102333029B/en
Priority claimed from CN201110182506.5A external-priority patent/CN102255752B/en
Application filed by 北京新媒传信科技有限公司 filed Critical 北京新媒传信科技有限公司
Priority to CN201180062570.8A priority Critical patent/CN103283209B/en
Publication of WO2012142854A1 publication Critical patent/WO2012142854A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/60Subscription-based services using application servers or record carriers, e.g. SIM application toolkits

Definitions

  • the present invention relates to the field of Internet, and in particular to an application service platform system and an implementation method thereof.
  • the present invention is directed to reducing application development difficulty, increasing deployment flexibility and reducing deployment difficulty.
  • the invention provides an application service platform system and an implementation method thereof.
  • the technical solution of the invention can reduce application development difficulty, improve deployment flexibility and reduce deployment difficulty.
  • the invention discloses a method for implementing an application service platform system, which sets a proxy server and a cloud computing application service system in an application service platform system, and saves description information of the application and between the application and the application server in the cloud computing application service system.
  • the method includes:
  • the proxy server receives the client request message, parses the client request message, determines the corresponding application, creates an application context according to the description information of the application, and adds an application context to the client request message, according to the application and the application.
  • the correspondence between the servers distributes the client request message to the application server where the corresponding application is located;
  • the application server in the cloud computing application service system hands the client request message to the corresponding application for processing
  • the corresponding application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result;
  • the application server returns the processing result to the client via the proxy server.
  • the invention also discloses an application service platform system, the system comprising: a proxy server and a cloud computing application service system, wherein the application server cluster in the cloud computing application service system bears and runs the application, and the cloud computing application service system The description information of the application and the correspondence between the application and the application server are saved;
  • a proxy server configured to receive a client request message, parse the client request message, determine a corresponding application, create an application context according to the description information of the application, and add an application context to the client request message, according to the application Distributing the client request message to the application server where the corresponding application is located; receiving the processing result returned by the application server, and returning the result to the client;
  • the application server in the application server cluster is configured to: when receiving the client request message sent by the proxy server, handing the client request message to the corresponding application for processing, and returning the processing result to the proxy server;
  • the application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result.
  • the present invention builds a platform-as-a-service software platform.
  • the general existing back-end software solution is split according to the service role, and the application splitting is performed at a fine-grained signaling level, and the application development and deployment is simple, which reduces development and deployment.
  • Complexity In addition, the present invention isolates complex resource location and application-to-application routing from a developer perspective by introducing the concept of application context, which supports a simple development method and enables the platform to be applied to a very large-scale server. Cluster.
  • FIG. 1 is a schematic diagram showing the logical structure of an application service platform system in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an actual networking of an application service platform system in an embodiment of the present invention
  • FIG. 3 is a hierarchical structure diagram of related application development in an embodiment of the present invention.
  • FIG. 4 is a schematic diagram showing the internal structure of a single application server and the connection with the outside in the embodiment of the present invention
  • FIG. 5 is a flowchart of an application process startup process in an embodiment of the present invention.
  • FIG. 6 is a flowchart of an application process stopping process in an embodiment of the present invention.
  • FIG. 8 is a flowchart of a hot update of an application process in an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a global configuration system in an embodiment of the present invention.
  • Figure 10 is a schematic diagram of a monitoring system in an embodiment of the present invention.
  • FIG. 11 is a schematic diagram showing an implementation manner of a program embedded counter in the embodiment of the present invention.
  • Figure 12 is a schematic view of an injection type debugging system in an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of multiple application service platform systems in an embodiment of the present invention. Mode for carrying out the invention
  • the present invention is an application service development platform based on a cluster PC server environment.
  • the application can be based on a Java runtime environment but is not limited to the Java language.
  • the present invention logically integrates distributed server resources into a unified application.
  • the platform, the application based on the platform for development.
  • the invention splits the application development to a single signaling level, and designs the concept of the application context, and binds the resource access in the application and the application routing to the application context, which further simplifies the development of the application platform.
  • the invention conducts routing through the proxy server Proxys, and performs application loading through the application server AppServer, and constructs a server cluster platform which can be operated and maintained as a whole and can be monitored.
  • FIG. 1 is a schematic diagram showing the logical structure of an application service platform system in an embodiment of the present invention.
  • the proxy server and the cloud computing application service system are set in the application service platform system, wherein the proxy logic part is set in the proxy server, and the logic server part, the basic service, the resource, the center and the like are set in the cloud computing application service system.
  • the description of each logical part is as follows:
  • client state such as long connections
  • SIP Proxy maintains a long SIP connection with the client
  • HTTP Proxy responsible for distributing Http applications
  • SMS Proxy responsible for distributing SMS upstream applications
  • the entire system's control center is used to monitor system management operations such as deployment, distribution, and update of application services used.
  • FIG. 2 is a schematic diagram of an actual networking of an application service platform system in an embodiment of the present invention.
  • the application service platform system includes: a proxy server and a cloud computing application service system, where an application server cluster in the cloud computing application service system loads and runs an application, and the cloud computing application service system stores Description information of the application and the correspondence between the application and the application server;
  • a proxy server configured to receive a client request message, parse the client request message, determine a corresponding application, create an application context according to the description information of the application, and add an application context to the client request message, according to the The application and the application server distribute the client request message to the application server where the corresponding application is located; receive the processing result returned by the application server, and return the result to the client;
  • the application server in the cloud computing application service system is configured to: when receiving the client request message sent by the proxy server, handing the client request message to the corresponding application for processing, and returning the processing result to the proxy a server; the corresponding application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result.
  • the application server returns the processing result to the client via the proxy server.
  • the correspondence between the application and the application server saved in the cloud computing application service system is saved in a table, where the application process name and the application service path are recorded, that is, the correspondence between the application and the application server.
  • the cloud computing application service system includes: a central server, a resource server, and a server cluster composed of multiple application servers, where:
  • the central server is configured to receive the externally uploaded application, save the description information of the application to the application configuration information list, create a correspondence between the application and the application server, and deploy the application on the corresponding application server, and save the application. a list of application running information for saving a correspondence between the application and the application server;
  • Each application server is configured to upload running information of the loaded application to a list of application running information for saving a correspondence between the application and the application server on the central server;
  • the application configuration information list includes the following information: an application ID, an application name, an application service type, an application process name, and an application service metadata annotation; the application operation information list includes the following information: an application process name, an application service address;
  • the resource server is configured to save a data resource that needs to be accessed when each application on the application server processes the task requested by the client request message.
  • the resource server includes: a database server, a file server, and a memory object buffer server.
  • the proxy server is configured to receive the client request message, identify the application corresponding to the client request message by querying the application configuration information list on the central server, and then obtain the corresponding information by querying the application configuration information list and the application running information list on the central server.
  • the service address of the application, the client request message is distributed to the application server where the corresponding application is located according to the obtained service address; the processing result returned by the application server is received, and returned to the client;
  • the proxy server comprises: a hypertext transfer protocol, an HTTP proxy server, an initial session SIP proxy server, and a short message system SMS proxy server.
  • the HTTP proxy server is responsible for distributing the HTTP application
  • the SIP proxy server is responsible for the long-term connection with the client's SIP
  • the SMS proxy server is responsible for distributing the SMS uplink application.
  • the cloud computing application service system further includes a basic service server (not shown in Figure 2) connected to the application server cluster, and some core applications or independent applications for providing internal requirements of the platform.
  • the proxy server is configured to: when receiving a client request message, extract a request parameter from a client request message, query a list of application configuration information in the central server, and find out The application configuration information list item corresponding to the metadata tag field is requested, and the corresponding application is identified.
  • the configuration information list item identifies the application corresponding to the client request message according to the application name in the found application configuration information list item;
  • the proxy server when receiving the remote call procedure protocol Rpc request corresponding to the remote calling application component RemoteAppBean, finds the application name (AppName) field on the central server according to the remote calling service name (Remote AppName) in the request message.
  • the application configuration information list item with the same service name is remotely invoked, and the application corresponding to the request message is identified according to the application name field in the searched application configuration information list item;
  • the proxy server is configured to: according to the application process name in the searched application configuration information list item, find an application operation information list item that is in the application process name field on the central server and that has the same information as the application process name, The service address information of the application service is obtained from the found application running information list item. And distributing the client request message to the application server where the corresponding application is located according to the service address information of the application.
  • the proxy server creates an application service context according to the context information about the patch application service in the metadata label field in the found application configuration information list item.
  • the central server is further configured to save a resource list;
  • the resource list includes the following information: a resource name, a resource type, an application service context type, a positioning algorithm name, and a positioning algorithm parameter;
  • the application After receiving the client request message, the application performs resource location according to the application context and the corresponding information in the resource list in the process of completing the task requested by the client request message.
  • the application service platform system composed of the above proxy server, application server cluster, central server and resource server integrates the distributed server resources logically, which greatly reduces the development difficulty of the application and improves the development. The flexibility of deployment and the difficulty of deployment.
  • FIG. 3 is a hierarchical structure diagram of related application development in an embodiment of the present invention.
  • the application service platform system is developed based on the following hierarchical structure.
  • the proxy server, the iftli service, and the applications running on the application server cluster on the proxy server are developed based on the following hierarchy:
  • the base framework class library provides basic core functions and extension interfaces for customization in specific business areas; defines and implements multiple application component AppBean base types in the base ftH framework class library, and the basis
  • the framework class library predefines the implementation of the application context interface and the basic application context type to provide the basic core functions; wherein different AppBean iftli types correspond to different types of applications for different types of signaling processing; the basic framework class library provides The extension interface is specifically used to extend the new AppBean base ftH type and the new application context in the business framework class library BizLibrary.
  • a business framework class library (Biz Library) customized for the business is developed based on the basic framework class library.
  • the business framework library also provides service-related extension interfaces for extending new applications;
  • the underlying services rely on the Framework and Biz Library to provide the underlying services.
  • the proxy server relies on the Framework and Biz Library to implement business-based routing and load-bearing functions.
  • an application development mode based on an application component is provided.
  • the minimum development and load granularity defined here is AppBean, which is defined as an application that implements a tiny granularity.
  • the application is defined to the signaling level.
  • the specific expression of the application defined to the signaling level may be different depending on the service, such as a specific Http request (such as GET /default.do ), or a specific upstream message (FROM: 13800138000; TO: 10658000032; TEXT: HELLO), or a specific SIP instruction, or an RPC instruction (a method, Not an interface) and so on.
  • an application for processing one or more instructions is defined as an AppBean
  • the minimum unit that can be developed and deployed by the application is AppBean, which can develop an AppBean for one signaling or multiple signaling, and deploy it to the platform system.
  • the request may come from the user's client software, browser, internal reference, or external signaling call.
  • an application is implemented as an interface based on Java, and all specific AppBeans are derived from the interface to implement specific methods, such as self-installation mechanism, configuration initialization, and service processing. And service unloading, etc.
  • An AppBean is an abstract interface, but application development must be derived from the AppBean base type (BaseAppBeanTypes ) designed for a particular signaling process.
  • the implemented AppBean basic types include: HttpAppB ean for processing HTTP requests, RemoteAppBean for processing RPC requests, and JobAppBean for processing scheduled tasks.
  • Each specific AppBean base type handles specific forms of signaling, and application developers need to choose the appropriate AppBean base type to implement their own application.
  • the AppBean base types are not limited to the above.
  • App Context About the application context is called App Context
  • the application context is the key to application calling and resource location.
  • the application call includes the proxy server calling the application service, and the application service calling other application services. Both applications require the AppContext to achieve the target application service positioning.
  • the AppContext can be understood as follows:
  • the AppContext is bound to the identity of the environment in which the current application is running, such as the current user.
  • the developer is developing based on the AppContext (current user) at the development time, and accessing resources (database, file, cache) must be
  • the current AppContext developers can eliminate the problem of splitting the database, files, caches, etc., and even the cross-machine room problem of user data. It can only be developed based on the current user, greatly simplifying the development mode, and the system.
  • the deployment structure is isolated from the development process to achieve an efficient and convenient PaaS platform.
  • the AppContext is divided into two parts from the data composition.
  • the AppContext is serializable and deserializable: (1)
  • the URI Context Uri
  • the URI is a string format, including the user's index information, which is responsible for subsequent positioning. Such as id: 230302023; session: 13910000001.
  • ContextData is a predefined strong type data structure, which may include multiple fields; it includes attribute information of the application; the attribute information of the application includes: session parameters, authorization information, and the like;
  • AppContext is an abstract base class, and the following AppContext subclasses are predefined in the Framework:
  • NullContext A predefined empty context, used when no context is needed;
  • S es sionContext A predefined context that only holds the session Id.
  • a specific AppContext is generally extended in the Biz Library, such as an IM system.
  • the user's Session is saved. Then we can extend the UserContext, so each application will receive the Proxy. Saved session information.
  • AppContext In addition to the standard AppContext, when using the application service system platform of the present invention for extension development, it is necessary to customize some basic foundations of the service, and the AppContext is one of them.
  • the following is a specific example of an AppContext.
  • the AppContex of the IM system can be customized according to the following manner, derived from the AppContext, Named UserContext:
  • Uri part: "id : 230302023" which represents the user's id , then the user's id can be used to locate the user's application service location and database storage location;
  • IM system uses an integer to identify groups, derives from AppContext, and is named GroupContext.
  • the structure of GroupContext is as follows: :
  • Uri part: "group : 123 123" identifies the group id , which represents the user's id, then through the id of this group, we can locate the application service location of the group and the database storage location;
  • the application metadata and the operation mode and the like are marked by the Java metadata annotation (Annotation).
  • the data can be loaded at the runtime, or compiled.
  • the data is extracted from the reflection in the subsequent binary package.
  • AppName (app name and category name)
  • HttpPrefix (HTTP prefix, only for Http AppB ean )
  • CookieParser indicates that the Context is processed by a program called CookieParser
  • the -CookieParser program is built into the Proxy and handles user-related information by processing the cookie field in the Http Request.
  • An AppBeanBaseType includes the following components and features:
  • AppBeanBaseType is an abstract base class
  • AppBeanBaseType must add the @AppBeanBaseType to be recognized by AppLoader
  • AppBeanBaseType must provide an abstraction method for processing the business, which is provided to the application subclass to implement
  • AppBeanBaseType is a single piece.
  • the business process abstraction method will pass all the request parameters of this business run, and the transaction abstract class of the response method, we call it AppTx
  • AppTx is generally bound to an AppContext
  • AppHost class must be implemented.
  • the AppHost class will actually trigger the AppBean business processing method.
  • AppHost will be derived with AppBeanBaseType.
  • AppB ean that the application can use is not limited to the following types, and can be extended at the Biz Library level.
  • the HttpAppBean is used to process a specific Http request.
  • the Http request may come from a direct request from the user's client browser or program, and the request will be forwarded to the application process through the intelligent layer 7 of the Http Proxy.
  • Http requests may also originate from requests from other servers.
  • HttpAppBean ⁇ C extends AppContext> is a generic class, where the generic parameters are interpreted as follows:
  • HttpAppBean indicates the UrlPrefix (prefix) that the request is being processed by the annotation, for example, develop one for the simplest HttpAppBean The steps are as follows:
  • @HttpPrefix annotation represents the request to process the address sent to the @HttpPrefix annotation
  • the process() method is an abstract method defined in the HttpAppBean. After reading the HttpRequest, after processing, it returns HttpResponse to the client.
  • the process for developing an application for user unified login authentication is:
  • RemoteAppBean remote call application component
  • RemoteAppBean is derived from AppBean and is used to process a specific Rpc request.
  • Rpc requests may originate from the following scenarios.
  • RemoteAppBean is a generic class, where the generic parameters are explained as follows:
  • response parameter strong type definition, serializable
  • GetOption is the serializable class, save the user id and option parameters
  • response parameter type ⁇ R> is UserInfo
  • UserInfo is a serializable class, and save user information
  • process() method is used to process the business logic, inheriting the load() method and initializing, inheriting the unload() method, unloading, and inheriting the setup() method to implement self-installation.
  • Request parameter ⁇ A > is GetOption , to get some option parameters of the user
  • the response parameter ⁇ R > is UserInfo , a collection of user information
  • the application context ⁇ C > is UserContext , which is the user information of the current context, and the UserContext is used to identify the user ID
  • JobAppBean ⁇ AppBean derivation used to process a timed task, and can ensure that the scheduled task runs exclusively on a resource in the global.
  • the application after defining and implementing an application having a certain business function, the application necessarily accesses various resources such as a database, a file server, a memory object buffer server, or other provided services.
  • the application service platform system in the present invention is a large distributed system, so these resources are not single-point services, that is, there may be multiple instances of vertical sharding in the same type of database.
  • a resource accessible by an application is bound to its application context AppContext.
  • an application that retrieves user information named GetUserlnfoApp, reads the user database (UserDB) in the implementation of the application and returns the result.
  • the UserDB has multiple instances of vertical splitting after moduloing by user id.
  • Proxy server Http Proxy receives an Http request from the client;
  • Http Proxy judges the application corresponding to the request through the URL of the Http request; specifically, the Http Proxy finds the application of the @HttpPrefix and the URL of the Http request in the metadata annotation Annotations field by accessing the application configuration information list on the central server.
  • the configuration information item, the application corresponding to the entry is the application corresponding to the Http request;
  • Http Proxy identifies in step 2 that the request is a request for GetUserlnfoAp and requires UserContext as the context parameter;
  • the Http Prorxy creates a UserContext according to the @ContextLoader in the Annotations field in the application configuration information table and the information extracted from the Http request message.
  • Http Proxy forwards the Htt request to the application server where GetUserInfoApp is located after adding the UserContext data from the Http request from the client; here, the service address of GetUserlnfoAPP is obtained by querying the application running information list.
  • the application process running on the application service GetUserlnfoApp receives the Http request, extracts the UserContext, and hands it to GetUserlnfoAp for processing;
  • GetUserInfoAp reads the UserDB.
  • the UserDB is located through the id information in the UserContext.
  • Http Proxy will return the message back to the client.
  • step 7 of the above process positioning is performed through a resource table.
  • a resource table in an embodiment of the present invention such as Table 1 shows:
  • the ModDatabaseLocator will take out 1001 and divide 1001 by 5, taking the remainder as 1 and returning the database instance named UserDB.l.
  • IM instant messaging
  • Users in this IM system use an integer id to locate the application.
  • the AppContext of the IM system can be customized from the AppContext and named UserContext.
  • the Data section includes: Group session parameters, group authorization, etc.
  • an extension interface provided by the framework of the base framework class library extends the AppBean base type corresponding to the new type application in the business framework class library BizLibrary, and the business framework class library BizLibrary Extend the application context for this new type of application. Then you can develop a corresponding proxy server based on Framework and BizLibrary, and finally you can develop new applications on this basis.
  • SMSBean based basic type of SMS type based on SMS SmsAppBean
  • SmsAppBean SmsAppBean
  • Sms Proxy Sms Proxy for distributing SMS
  • UserContext UserContext based on SMS users.
  • the platform application can be developed based on the user and SMS instructions.
  • the extension points are as follows:
  • SipAppBean for processing from Client's SIP request. Then the steps to implement a SipAppBean are as follows:
  • SipTx transaction class which encapsulates the request, response, and context
  • SipcAppHost generates SipTx and forwards it to the abstract method of SipAppBean.
  • ContextUri as id: 332132132, which represents the user's id
  • Definition ContextData includes the following data: NickName nickname, Age age, ClientType client type, Client Version client version number, ClientCaps client capability, Region user region.
  • SIP PROXY will extract the information from the session saved by the user and send it to the corresponding application process of the application, so that the application process will get the UserContext from the request information and distribute it to the actual application. In this way, the application can actually get the UserContext and perform resource access and other processing.
  • a plurality of application servers in a server cluster are divided into a plurality of different groups, each group including one to more servers.
  • the central server deploys the application to a single application server according to external instructions, or deploys to multiple servers belonging to the same group.
  • an application can be selectively hosted in a group, that is, the core application can be used separately to ensure the resource usage and stability of the core application; and the unstable application of the online application is used.
  • Group separate servers to strip the effects and reduce the risk of the entire system. This approach facilitates the allocation of overall resources and the adjustment of network strategies.
  • an application server capable of running an application needs to be configured in a global unified manner, specifically, a global application server list and an application server grouping list are configured and saved on the central service.
  • the application server list includes the following information: application server name, group name to which the application server belongs, and application server address.
  • the application server grouping list is shown in Table 4: Field Name Field Type Primary Key Description
  • the application server grouping list includes: an application server group name, and application server description information in the group.
  • multiple application servers can be divided into different groups for running different application services.
  • the benefits of application server grouping are as follows: 1. Specify the application server group for the core application to ensure the resource usage of the core application. And stability; 2. Specifying a separate application server group for some new unstable applications can reduce the risk of the entire system; 3. Conducive to the overall resource allocation and network policy adjustment.
  • the central server deploys the application to the application server in the application server cluster, including:
  • a daemon is deployed on each application server; a list of application processes is saved on the central server; the application process list includes: an application process identifier, a dynamic port tag, an application server name, an application server group name, a deployment package interface, and a service port;
  • the central server determines, according to the information in the application server list, the application server grouping list, and the application process list, a list of application process deployment information that should be started on each application server;
  • the application process deployment information list includes: an application process identifier, a dynamic port identifier, Deploy the package interface and service port;
  • Each launched application process establishes a connection with the central server and maintains a heartbeat
  • the central server records its connection information in the daemon status information list for each daemon that establishes the connection, and saves the connection information in the application operation information list for each application process that establishes the connection.
  • the daemon (Master) is a background monitoring process deployed on each application server, responsible for the running and deployment of application services.
  • a daemon is deployed on each application server.
  • the daemon establishes a long connection with the central server, and through this long connection, it accepts system instructions such as deployment, update, and monitoring.
  • system instructions such as deployment, update, and monitoring.
  • application process Worker
  • the developed application is deployed to an application server in the server cluster, and the proxy server's routing for the application is customized to the application server hosting the application.
  • jar package for deployment, also known as a deployment package.
  • a possible jar package is distributed as follows: Framework.jar, BizLibrary.jar, Appl.jar, App2.jar.
  • the Appl and App2 jar packages include the actual AppBeans that can be run, and the BaseAppBeanType is stored in the Framework and BizLibrary, and the META-INF/appbean.properties configuration exists in the resource files of the jar package.
  • the above jar package will be labeled as a tar.gz package, as a deployment release package.
  • AppApper will extract all the AppBeans implemented by the developer through the java reflection mechanism.
  • the extraction steps are as follows:
  • the base class can be found when the annotation: When ⁇ AppBeanBaseType; kg by the step P £ P obtained according to the list of components and applications stored application package list. ''' In the embodiment of the present invention, the application component list and the application package list are respectively shown in Table 5 and Table 6,
  • a list of application configuration information is generated based on the information in the application component list and the application package list.
  • the application configuration information list (also known as the Application table) is shown in Table 7:
  • AppLoader analyzes the metadata annotations contained in the Java application classes and application classes, and extracts the type information and metadata annotation information of each AppBean, and uses JSON (JavaScript Object Notation) format.
  • JSON JavaScript Object Notation
  • the string is saved in the Annotations field of the Application table.
  • the specific format is as follows:
  • the Annotations field contains a classlnfo subfield and a classAnnotations subfield;
  • the classlnfo field contains the current type, the base type, and the generic parameters of the base ftH type;
  • the classAnnotations field contains each metadata tag contained in the AppBean. Each parameter of the metadata tag is stored by "key”, "value”.
  • the operation and maintenance personnel select the application service deployment package name, the application server group, and whether the option is enabled, and update the Application table.
  • the application process running the application is also uniformly configured globally, specifically, the application process list is also configured and saved on the central service, also referred to as the worker table, as shown in Table 8:
  • the central server determines the application process deployment information list to be started on each application server according to the information in the application server list (Table 3), the application server grouping list (Table 4), and the application process list (Table 8), and the specific rules are as follows: :
  • Each item of the application process deployment information list contains the following information: Application Process ID (WorkerID), Dynamic Port Tag (IsDynamicPor), Deployment Package Interface (PackageUrl), Service Port (ServicePorts).
  • Application Process ID WorkerID
  • Dynamic Port Tag IsDynamicPor
  • Deployment Package Interface PackageUrl
  • Service Port ServicePorts
  • each application server After the daemon of each application server is started, a connection is established with the central server and the heartbeat is maintained.
  • the application server deployment information list of the application server is obtained from the central server, and the application server is downloaded and started according to the application process deployment information list.
  • each launched application process establishes a connection with the central server and maintains a heartbeat;
  • the central server records its connection information in the daemon status information list for each daemon that establishes the connection, and for each application process that establishes the connection
  • the connection information is saved in the application running information list.
  • a daemon Master is responsible for managing all application processes on this application server.
  • the startup registration steps of the Master are as follows:
  • the Master establishes a TCP long connection with the central server and listens for commands from the central server;
  • the central server maintains an entry for the master on each connection in the list of daemon status information in the database to record its connection information.
  • the entries for this record are shown in Table 9:
  • Word ⁇ g called field class 3 ⁇ 4 primary key field description and description
  • UsedMem Bigint uses memory
  • the master port pool management process is as follows:
  • the Master will test the port number in the port pool range that has not been turned on, and mark it as available;
  • the daemon When the worker exits, the daemon returns the port number occupied by the application process to the port pool.
  • Each launched Worker will establish a long connection with the central server and maintain the heartbeat.
  • the central server will record the connection information in the application running information list for each connected worker in the application running information list to record the connection information.
  • a heartbeat such as 15 seconds
  • the self-starting application process In addition to the design of the self-starting application process at the moment the daemon starts, it can also manage the running of the application process while the daemon is running.
  • the control terminal sends a request to the central server to start the specified application process, the central server sends the request to the corresponding daemon, and the daemon starts the specified application process, and the application process connects to the daemon,
  • the daemon sends the request to the application process, and the application process invokes a startup method of the service;
  • the control terminal sends a request to the central server to stop the specified application process, and the central server sends the request to the corresponding daemon, and the daemon processes the request.
  • the request is sent to the specified application process, the application process calls the stop method of the service, and the daemon stops the application process.
  • FIG. 5 is a flowchart of an application process startup process in an embodiment of the present invention.
  • the method includes: the control terminal sends a request for starting a specified application process to the central server through the Http, and the central server selects the TCP connection by using the selected TCP connection, and sends a request for starting the specified application process to the corresponding daemon through the selected TCP connection.
  • the daemon starts the application process, and the application process connects to the daemon through the Namepipe; the daemon sends the request to the application process through the Namepipe, and the application process invokes the service's Start method.
  • the method includes: the control terminal sends a request to the central server to stop the specified application process through the Http, and the central server selects a TCP connection according to the request, and sends the request to the corresponding daemon through the TCP connection;
  • the request is sent to the application process through the Namepipe, and the application process invokes the stop (Stop) method of the service by reflection; the daemon stops the application process.
  • FIG. 7 is a flowchart of an application process update process in an embodiment of the present invention.
  • the control terminal sends a request for updating A to A' to the central server through the Http, and the central server selects a TCP connection according to the request, and connects through the TCP connection.
  • the request is sent to the corresponding daemon; the daemon obtains the address of the new application process and overwrites the current application process for application process update.
  • stop application process A first, then download A from the central server, and overwrite A with A, and start a new application process A.
  • FIG. 8 is a flowchart of a hot update of an application process in an embodiment of the present invention.
  • the control terminal uploads the deployment package of A' to the central server, and sends a request updated by A' to the central server, and the central server requests the request.
  • Sent to the corresponding daemon the daemon downloads the A' deployment package from the central server, and starts the application process ⁇ , the application process is started, and then registers with the central server after startup; then, the control terminal sends an update A to the central server.
  • the hot update shown in Fig. 8 can be used without stopping the business of the application process with respect to the update shown in Fig. 7.
  • the above solution implements the monitoring of the running state of the application process, and can conveniently view the running status of the application process, which greatly simplifies the operation and maintenance deployment cost and realizes rapid deployment.
  • the monitoring of the application process is isolated from the actual application process, which effectively improves the security of the application process.
  • the client is connected to the central server to provide the central server with the application process identification information to be accessed; the central server reads the application process list and the application running information list, which is consistent with the client's provided information.
  • the record of the application process identification information is returned to the client; the client parses the received content, and selects a record for routing.
  • the central server notifies the client that the client re-acquires records from the central server that match the application process identification information that it is to access.
  • the client accesses the central server, establishes a TCP long connection with the central server, and listens to the commands of the central server;
  • the client accesses the central server through a TCP long connection, providing the name of the application process that he wants to access;
  • the central server reads the application process list, and the application running information list, and returns the record of the application process name to the client, and records the information of the connection in the memory, and registers the callback;
  • the client parses the record, and obtains the address corresponding to the application process name according to the following rules;
  • Random access will randomly select one from a fixed address
  • the central server responsible for the client receives the change notification, and sends the change information to the client;
  • step 3 After the client receives the change, it will repeat step 3 again to re-acquire and establish the routing table.
  • the hot update process of the application is as follows: The central server traverses all affected application servers, sends update instructions to the corresponding application server daemon; the daemon processes a new application package, starts a new The application process listens to the new port; the new application process establishes a connection with the central server, the central server saves a record for the new application process (specifically, updates the application process name in the application configuration information list), and synchronizes the change to all The client that is listening. At this point, the request starts routing to The new application process, the old application process no longer receives the application request after a period of time, exit.
  • the proxy server needs to call an application, or an application needs to call another application, it is through the application configuration information list (Application table, Table 7) and the application operation information list. (Running Worker table, Table 10) is routed.
  • the basic routing strategy is as follows:
  • the process of finding the address of an Http application is as follows:
  • the proxy server receives an Http request from the client or browser
  • the proxy server accesses the central server. From the Annotations field of the application (application metadata annotation field), find a record that @HttpPrefix (a type of metadata annotation information) matches the request URL in the Http request;
  • the proxy server generates an AppContext according to the information of the Annotations field (application service metadata label field) in a record determined in step 2;
  • the proxy server finds the record corresponding to the WorkerName field (the running application process name) from the Running Worker table according to the WorkerName field (application process name segment) in a record determined in step 2; The record is consistent with it.
  • the proxy server makes the following selection according to the @Stateful configuration in the Annotations field in a record determined in step 2:
  • a consistent hash is used to select a record from multiple Running Workers through the AppContext information; here, the consistency hash is calculated by the Uri string of the AppContext, and the hash value is selected.
  • the specific hash algorithm can adopt the KETAMA algorithm;
  • the proxy server receives the request for the HttpAppBean, so find the corresponding HttpPrefix in the Application table according to the URL in the request to find the corresponding application service.
  • the RemoteAppBean will route based on @AppName. For example, if the proxy server receives the Rpc request corresponding to the RemoteAppBean, then: according to the remote call service name (RemoAppName) in the Rpc request, find the application service name (AppName) field and its consistent Application table, the Application table is To deploy the table generated when the Rpc requests the corresponding RemoteAppBean, then perform the same steps as 3-6 above.
  • RemoAppName remote call service name
  • AppName application service name
  • Grayscale publishing is a process in which applications are opened to all users in a user-wide or heuristic manner. Grayscale publishing can reduce the risk of application updates.
  • the grayscale publishing factor (GrayFactor) is included in the list of application configuration information mentioned earlier. In the present invention. For applications that do not use grayscale publishing, the grayscale publishing factor in the corresponding application configuration information list item is empty; and for applications that use grayscale publishing, the grayscale publishing factor is configured in the application configuration information list item.
  • the grayscale publishing factor is a conditional expression, which is defined in the following format:
  • field and condition are separated by ., field.condition can be logically operated, for example:
  • condition2 Field indicates the value point, condition indicates the value condition, and the application published by this gray level is used when this value condition is met.
  • the proxy server after receiving the client request message, the proxy server identifies the application corresponding to the client request message by querying the application configuration information list on the central server, and if multiple applications are found, press Choose as follows;
  • the proxy server first matches its grayscale publishing factor in an application whose grayscale publishing factor is not empty. If the matching hits, the selected application is selected. If there is no matching hit, the application whose grayscale publishing factor is empty is selected (ie, the default is application).
  • the grayscale is published based on the AppContext, that is, the field value is a condition pre-defined in the AppContext, which is obtained by AppContext.getNamedValue("fieldr).
  • getNamed Value () method In grayscale publishing, getNamedValuedO is evaluated as the field parameter for grayscale publishing.
  • the proxy server first matches the grayscale publishing factor in the application that the grayscale publishing factor is not empty, including: the proxy server parses the client request message, and determines the correspondence in the application configuration information list on the central server. a list item, creating an application context according to the information in the corresponding list item, matching the grayscale publishing factor according to the grayscale publishing factor matching condition information in the created application context, and hitting if the condition expressed by the grayscale publishing factor is met.
  • the matching is based on the client version number information in the application context to see if it is V2.0, and then it is hit.
  • NamedValued is defined as follows:
  • the available fields for grayscale publishing include: user-owned area (user_region), user client type (client_type), client-side ip address-associated area (client-region), and client version number (client-version).
  • step 2 may find multiple application configuration information list items (one application corresponds to one application configuration information list row), wherein only one grayscale publishing factor GrayFactors is allowed, other GrayFactors Data that is not empty is published in grayscale.
  • Priority judgment GrayFactors is not empty application configuration information list item data
  • UserContext is calculated according to the order of configuration acquisition GrayFactors
  • the routing algorithm after the application configuration list item is found is consistent with the foregoing description, that is, the application operation information list is queried according to the application process name in the found application configuration information list item, and the application operation information list item with the same application process name is found. If there are multiple, it is determined according to the metadata label whether the application process is random or consistent Hash, and the exact target application server address is found by the random load algorithm or the consistent hash algorithm, and the target application server is called. And append the App Name in the application configuration information list item to the request.
  • Application A provides services to users, but application A calls application B; application A upgrades to application ⁇ ', but at the same time needs to upgrade applications ⁇ ', we will gray out application A' Released, but hope that A' calls B' instead of ⁇ ⁇ and ⁇ version number is 1.0, A' and B' version number is 2.0
  • the solution given in the present invention is as follows: After the application B of the application B and the call B is released, the corresponding upgrade versions B' and A' are grayscale-released, and the grayscale factor of B' is set. To match the version number of A', the process of routing the client request message to A' is as follows:
  • A' find the application to be called in the application configuration information list, find B and ⁇ '; where B' is configured for grayscale publishing, and the grayscale publishing factor is version matching, and the grayscale publishing factor is configured as follows: app_version. Equals("2.0")
  • FIG. 9 is a schematic diagram of a global configuration system in an embodiment of the present invention.
  • the system adds a global configuration database connected to the central server for saving configuration information of the application based on the system shown in FIG. 2.
  • Application server to central server Sending a configuration information request message; after receiving the configuration information request message sent by the application server, the central server retrieves corresponding configuration information from the global configuration database and returns it to the application server.
  • the application server also registers its own address to the configuration server. After the configuration information of the application server in the configuration database is updated, the configuration server delivers the updated configuration information to the corresponding application server according to the registered address of the application server.
  • Text is text, can be any format, such as .properties format, or xml format
  • Table is a data table, similar to the table in the database, the interface provides access to the table interface, you can directly access the table.
  • the application server can also obtain configuration information locally, so the configuration has two modes of operation: local configuration and global configuration:
  • Text will use the current running directory as the root directory to read the text file.
  • Table will directly read the table structure in the database by running the configuration information of the global configuration database in the root directory.
  • Text and Table are read through the central server.
  • the central server reads the Text configuration and Table configuration stored in the global configuration database, and implements specialization features and PUSH update features.
  • the application server switches between the global configuration mode for obtaining configuration information from the central server and the local configuration mode for obtaining configuration information from the local device by switching the remote loading module and the local loading module.
  • the remote loading module is configured to send a configuration information request message to the central server, and receive configuration information returned by the central server.
  • the local loading module is configured to obtain configuration information locally from the application server.
  • the application when unit testing, and running directly from the development environment, the application runs in the local configuration mode; when the actual deployment to the environment, the application will run in the global configuration mode, running in the global configuration mode can support specialization, And PUSH update.
  • the specialization requirement is described as the requirement when a configuration is configured as A for the global, but needs to be configured as a B for a server or an application.
  • default configuration information and special configuration information are saved in the global configuration database.
  • the central server After receiving the configuration information request message sent by the application server, the central server matches the matching parameters in the configuration information request message according to the maximum matching principle, and returns the matching default configuration information or special configuration information to the application server.
  • the configuration information is saved according to the correspondence between the configuration information key value, the application name, and the application server name; the application server sends the configuration information key value, the application name, and the application server name to the central server.
  • the configuration information request message of the three parameters after receiving the request message, the central server first retrieves the configuration information from the configuration database according to the three parameters of the configuration information key value, the application name, and the application server name; If the matching item is retrieved, the configuration information is retrieved from the configuration database according to the configuration information key value and the application name; if the matching item is still not retrieved, the configuration information key value is used to retrieve the configuration data from the configuration database.
  • Configuration information is used to retrieve the configuration data from the configuration database.
  • the system shown in Figure 9 supports two configuration text configurations and table configurations in the global configuration mode.
  • the configuration is read from the central server through the rpc mode.
  • the configuration table is consistent for all applications, and the configuration text can be used for different applications. Specialization.
  • the central server will adopt the principle of maximum matching when selecting the configuration. Judging the equality with the most key values. If there are the same number of key-value pairs, the order of the key-value pairs appearing in the request is judged, and the first satisfaction will be returned;
  • the central server updates the configuration information in the global configuration database, and finds the application that uses the configuration information, and sends the updated configuration information to the application server where the application that uses the configuration information is located. Specifically: 1.
  • the terminal initiates a configuration update request to the central server (specifically, the operation and maintenance personnel issue a configuration update request through the operation and maintenance tool, and the operation and maintenance tool submits the update request to the central server);
  • the central server updates the configuration information in the global configuration database, and finds the connection of the corresponding application process, and sends a configuration update request through the connection;
  • the corresponding application process re-acquires the configuration information from the central server, refreshes the configuration information, and returns the result to the central server;
  • the central server returns the result to the terminal.
  • FIG. 10 is a schematic illustration of a monitoring system in accordance with an embodiment of the present invention.
  • the system adds a global monitoring database connected to the central server, a monitoring server connected to the global monitoring database, and a local log in each application server based on the system shown in FIG. 2. database. Due to space limitations, only the central server and an application server in Fig. 2 are schematically illustrated in Fig. 10.
  • different monitoring policies are stored in the global monitoring database.
  • the daemon process and the application process in the application server obtain the corresponding monitoring policy from the global monitoring database through the central server, monitor according to the acquired monitoring policy, save the monitoring result data to the local log database, and correspondingly according to the monitoring policy.
  • the monitoring result data is uploaded to the global monitoring database through the central server, and an alarm flag is attached when the acquired data exceeds the threshold.
  • the monitoring server displays the monitoring result data in the global monitoring database and prompts the alarm.
  • the monitoring server updates the monitoring policy in the global monitoring database, and then sends a monitoring policy update notification to the daemon and/or the application process in the specified application server; the protection process in the specified application server and/or After receiving the monitoring policy update notification, the application process obtains the corresponding updated monitoring policy from the global configuration server.
  • the monitoring server sends an update monitoring policy command to the global monitoring database, and the global monitoring database updates the monitoring policy to return an response response message;
  • the monitoring machine sends a monitoring policy update to the daemon and/or application process on the specified server.
  • the daemon and/or the application process on the specified server obtains the corresponding updated monitoring policy from the global monitoring database, which is to compare the version number of the existing monitoring policy with the global monitoring.
  • the version number of the corresponding monitoring policy on the database is the same. If the information is inconsistent, the monitoring policy is obtained from the global monitoring database and the existing monitoring policy is updated with the obtained monitoring policy, and the update success message is returned to the monitoring server.
  • the global report server periodically obtains data from the local log database of each application server, summarizes it, saves it to the global report database, and displays the data in the global report database to the user.
  • the daemon in the application server deletes data in the native log database for more than a certain amount of time (such as 7 days), which ensures that the data in the native log database does not exceed the limit.
  • System resource counter including CPU, memory, disk, 10, network traffic, etc., which can be directly retrieved from the operating system, usually a floating point number
  • Program embedded counter which is a system-specific internal report-based, dynamic specification report counter
  • the system resource counter is monitored by the daemon master, and the program inline counter is monitored by the application process worker.
  • the monitoring configuration of all counters ie, the acquisition policy
  • the Master and Worker After reading the monitoring configuration, the Master and Worker will periodically store the data in the local log database according to the monitoring configuration, or upload it to the central server. Whether to upload depends on the configuration of the monitoring policy.
  • the system resource counters are monitored by the daemon in the application server; the monitored indicators include: CPU metrics, memory metrics, disk metrics, NIC traffic metrics, and MySQL metrics.
  • the daemon obtains the monitoring configuration from the central server, and executes the script according to the content in the monitoring configuration to obtain the data, save the data to the local log database, and perform the following operations according to the monitoring configuration: 1) The threshold alarm is configured, and the obtained value exceeds the threshold, the data packet is uploaded to the central server, and the alarm flag is attached; 2) If the scheduled upload is configured, the data is directly packaged and uploaded to the central server. The central server saves the uploaded data to the global monitoring database.
  • performance counters are key indicators that reflect the health of a service.
  • the latest version of Linux kernel is also supported with performance counters.
  • the type of the counter is limited to several types (number, frequency, average, hit rate), etc., and it is not possible to record information such as text, which is difficult to expand;
  • FIG. 11 is a schematic diagram of an implementation manner of a program embedded counter in the embodiment of the present invention.
  • the business code will output the relevant count to the embedded counter, and the client agent will acquire the counter collection strategy through the central server at the startup time, and periodically collect the data collection work of the program embedded counter, upload to The central server, or logging to the local log database, and alerting based on the threshold.
  • a program embedded counter is required to embed a built-in counter of the designed program in the application process; the application process in the application server monitors the embedded counter of the program according to the acquired monitoring policy.
  • the data structure of the program embedded counter is as follows:
  • the program inline counter contains multiple categories with unique names ( Category );
  • Each category contains multiple instances with unique names (also known as rows).
  • Methods for generating a category include: determining the name of the category, setting an output column for the category, a set of atomic counters and atomic counter operations for the category, a data format for the snapshot of the category, and an output based on the snapshot data for the category The method of the instance.
  • a category is defined by:
  • the type of the column can be an integer, a floating point number, and a string;
  • a method of customizing a hit rate counter ie, a class that implements hit rate calculation
  • a hit rate counter ie, a class that implements hit rate calculation
  • the raw data of the hit rate counter contains two integer atomic counters, the first atomic counter hitted and the second atomic counter missed;
  • the hit code is incremented by one when the business code record hits
  • the data format of the snapshot defining the category is: save the count value of the first atomic counter at the time of generating the snapshot, the count value of the second atomic counter, and the system time;
  • the method for calculating the output instance based on the snapshot data of the category that is, calculate the output line of the report according to the two snapshots as follows: Calculate the total number of accesses, the number of hits, and the interval between the two snapshots according to the data of the two snapshots, and then Obtaining the number of visits per second according to the ratio of the total number of visits and the interval between the two snapshots, and obtaining the hit ratio according to the ratio of the number of hits to the total number of visits;
  • the output line is calculated from two snapshots with interval T.
  • time we get snapshot snapshotl.
  • snapshot snapshot2 is obtained here.
  • the output calculation formula is
  • the output line shows the data as
  • the summary method for defining the output instance of this category is as follows: The total number of accesses of each instance is summed to obtain the total number of accesses after the summation, and the number of hits of each instance is summed to obtain the number of hits after the summary, after summarizing The interval between two snapshots is equal to the interval between snapshots of the instance. The interval between snapshots of each instance is equal. Such as:
  • the sum ( ) operation represents the summation, and the summed data of each row is consistent.
  • the service code in the application process finds the category calculated by the hit rate according to the category name, and finds the corresponding instance of the category calculated by the hit rate according to the instance name, and adds the first atom counter in the corresponding instance when the service hits 1. Add 1 to the second atomic counter in the corresponding instance when the service is missing.
  • the application process establishes a long connection with the central server
  • the application process obtains the monitoring configuration of the machine
  • the central server returns a monitoring configuration suitable for the application server according to the name of the application server;
  • the application server starts the monitoring thread and runs at a fixed time
  • the application process will take a snapshot of the program embedded counter. If there is a snapshot acquired last time, the last result will be calculated with two snapshots, otherwise the current snapshot will be counted to the last time. In the result;
  • an extension plug-in system (Eclipse) is generated based on the existing plug-in system (Eclipse), and the extension plug-in connection development management server implements the following functions:
  • Version 1.0, dependent libraries include: Framework-1.0.jar; BizLibrary- 1.0.jar;
  • Version 2.0, dependent libraries include: Frame work- 1.1. jar; BizLibrary-2.0.jar.
  • This version information is created by the development administrator. Each time you upgrade the version, you need to add this configuration information to the configuration management server's configuration repository.
  • the plugin reads the dependent library information of the 2.0 version to the version management system
  • the plug-in downloads the dependency plug-in for the development management system configuration
  • RemoteAppBean is the core concept of implementing application access and application hierarchy in this system. When RemoteAppBean is implemented and uploaded to the central server via AppLoader, any application that wants to access this RemoteAppBean needs to generate a proxy class for this RemoteAppBean call.
  • the extension When developing an application that needs to access RemoteAppBean, the extension gets all the exposed RemoteAppBeans from the development management server and displays its information to the developer, and the developer selects the RemoteAppBean to be called; the extension's reflection from the selected RemoteAppBean The information obtains the following information: application name and type information; the extension generates a request and response type entity class based on the obtained information; the extension creates a proxy class according to the request and response entity type, and inserts the proxy class into the Need to access the application of RemoteAppBean.
  • the plugin accesses the development management platform and obtains all current public RemoteAppBeans, and returns and displays the information to the developer;
  • the plugin gets the following information from the reflection information of the RemoteAppBean:
  • type information including: request, response, and context type
  • the plugin generates a request based on the above information, and responds to the type entity class.
  • the process is as follows:
  • AppLoader saves the request and response type as reflected intermediate data and saves it in the management platform library
  • the proxy class will use the context type obtained in step 4;
  • the dependency information between the created applications is displayed, and the dependency information is detected during the update process of the application to determine whether or not to perform the update of the application.
  • the deployment program uploads the application ⁇ ', and initiates an update instruction
  • the deployment program finds that the application depends on ⁇ . In this case, there are two possibilities for comparing the request and response parameters of A' and ⁇ to ::
  • A' request and response parameters are compatible (equal, or backward compatible) with A's request and response parameters, the system allows updates, and both A and B are marked as update programs;
  • A's request and response parameters are not compatible with A's request and response parameters, and the system will not allow updates unless B updates are also submitted, or B is taken offline.
  • the system when a version of the application is developed, the system records the update records at all points in time, so that when the system administrator determines the online version, it can extract the time from a certain point in time.
  • debugging an application requires deploying the program to the actual running environment (test environment or production environment), but the application deployed to the test environment is difficult to debug.
  • the system invents an injection solution. Solve developer debugging issues for the runtime environment.
  • the extension plugin launches the application locally; the launched application creates a connection with the proxy server, and sends a configuration parameter to the proxy server to debug the application; the configuration parameter of the application to be debugged defines the user within the specified range; the proxy After receiving the client request message, the server first matches the configuration parameter of the application to be debugged, and if the matching succeeds, sends a client request message to the activated application process, and returns the processing result of the started application. Send to the client, if the match is unsuccessful, distribute the client request to the application server where the corresponding application is located.
  • FIG 12 is a schematic illustration of an injection type debugging system in accordance with an embodiment of the present invention.
  • the plug-in is connected to the proxy server in the system shown in Figure 2, and only the proxy server and application server clusters in the system shown in Figure 2 are illustrated.
  • the client's request is sent directly to the proxy server, which then sends the specific application server based on the application configuration, as described in the previous section.
  • An application launched through a plugin creates a long connection with a specific type of proxy server (each created) and listens for requests;
  • the application sends an injection request to the proxy server, and sends the configuration parameters of the debugged application to the proxy server, wherein the configuration parameter of the plug-in restriction application must include a grayscale parameter (that is, it can only affect users in a fixed range);
  • the proxy server will add an injection item to the local routing table
  • the proxy server listens for a request from the client, it will judge whether the request satisfies the current injection condition; the request that does not satisfy the injection condition will be routed according to the original routing logic.
  • the request that satisfies the injection condition forwards the request to the application launched by the plugin through a long connection established by the plugin with the proxy server;
  • the application will convert the request from the connection into a normal request, pass it to the application for processing, and send the response back to the proxy server, and downlink to the client through the proxy server;
  • each IDC room has an application service platform system as shown in Figure 2.
  • each IDC is called a Site.
  • FIG. 13 is a schematic structural diagram of multiple application service platform systems in an embodiment of the present invention. As shown in Figure 13, each IDC has an application service platform system as shown in Figure 2. A gateway is added to each application service platform system, and each application service platform system communicates through the gateway. Private line communication can be used between gateways, or compressed and encrypted public network communication.
  • the gateway communicates with the gateways in other application service platform systems to implement application cross-application service platform system access.
  • each application service platform system :
  • a central server configured to find an application configuration information list item corresponding to an application that needs to be accessed across platforms in the application service platform system, and send the information to the gateway of the application service platform system;
  • a gateway configured to send the received corresponding application configuration information list item information to a gateway in another application service platform system; and configured to receive an application configuration information list item sent by a gateway in another application service platform system, and on the local server
  • the list of local application configuration information is processed as follows:
  • the local application configuration information list is updated by using the received application configuration information list item, and the remote system field is added in the updated application configuration information list item, and the value of the field is added.
  • the gateway first obtains the corresponding application configuration information list item from the central server of the application service platform system, and checks whether the application metadata label in the corresponding application configuration information list item includes the peer system label; if the peer system label is included, Determining a target application service platform system according to an application context of the application; if the peer system annotation is not included, determining a target application service platform system by using a remote system field in the corresponding application configuration information list item; and applying the service according to the determined target application
  • the platform system knows the address of the gateway of the target application service platform system, and forwards the application access request to the gateway of the target application service platform system;
  • the gateway is further configured to forward the request to the corresponding application configuration information list and the application running information list on the central server in the application service platform system after receiving the application access request sent by the gateway of the other application service platform system.
  • an application service platform system that only supports data and applications related to users in the application service platform system is defined as a peer-to-peer system (PeerSite); users and other users within the application service platform system will be hosted.
  • the application service platform system for the data and application of the application service platform system user is defined as a non-peer system (Non-PeerSite);
  • there is an additional GetSiteName() method in the AppContext which can obtain the cross-site (that is, cross-application service platform system) access of the PeerSite RemoteApp Bean to which the context belongs.
  • RemoteAppBean has an additional annotation @PeerSite; where @PeerSite is defined as follows: If the application is user-dependent and must be part of the user's PeerSite, then the annotation @PeerSite must be added; if the RemoetAppBean is in multiple sites The deployment is not user-dependent, so you don't need to label @PeerSite
  • the gateway is responsible for the routing of RemoteAppBeans between different sites. Because the routing of AppBeans in this system is dynamic (application configuration information list and application running information list), routing synchronization is dynamically performed among multiple sites.
  • Synchronizing the routing information of each RemoteAppBean that is not related to the user in a specific PeerSite through the gateway between the application service platform systems includes:
  • the central server in each application service platform system finds the RemoteAppBean that does not include the peer system annotation @PeerSite in the application metadata annotation deployed in the application service platform system, and the RemoteAppBean that needs to be synchronized (the RemoteAppBean labeled @PeerSite does not. Synchronization), and the corresponding application configuration information list item of the RemoteAppBean that needs to be synchronized is sent to the gateway of the application service platform system, and the gateway of the application service platform system sends the received corresponding application configuration information list item information to other application services.
  • a gateway in the platform system
  • the gateway that receives the corresponding application configuration information list item is processed as follows: For each application configuration information list item received, if there is a corresponding item in the local application configuration information list, and the application process name is not the gateway Ignore, if there is no corresponding item in the local application configuration information list or exists but the application process name is the gateway, the local application configuration information list is updated with the received application configuration information list item, and is updated.
  • the remote system RemoteSite field is added to the application configuration information list item, and the value of the field is set to the source system of the received application configuration information list item.
  • the gateway synchronizes the routing data of the non- PeerSite type RemoteAppBean deployed in each site between the sites.
  • the routing address of the RemoteAppBean the corresponding gateway of the RemoteAppBean can be found.
  • Access to the cross-application service platform system of RemoteAppBeans that are not related to users in a particular peer system PeerSit based on the synchronized routing information includes:
  • the target application service platform system is determined by the application context of the RemoteAppBean;
  • the target application service platform system is determined by the remote system RemoteSite field in the corresponding application configuration information list item;
  • the gateway of the target application service platform system forwards the request to the corresponding RemoteAppBean according to the application configuration information list and the application operation information list on the central server in the system.
  • the application service platform system consisting of the above proxy server, application server cluster, central server and resource server integrates the distributed server resources logically and is developed for a single signaling application.
  • the development method based on the basic framework class library and the business framework class library greatly reduces the development difficulty of the application, improves the flexibility of deployment and reduces the difficulty of deployment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Stored Programmes (AREA)

Abstract

Disclosed are an application service platform system and an implementation method thereof. Proxy servers and a cloud computing application service system are disposed in the application service platform system. Applications are loaded and run on an application server cluster in the cloud computing application service system, and description information of the applications and correspondence between the applications and the application servers are stored in the cloud computing application service system. The proxy server receives a client request message, creates application context according to the description information of the application, adds the application context into the client request message, and then distributes, according to the correspondence between the application and the application server, the client request message to the application server where the corresponding application is located. The application server delivers the client request message to the corresponding application for processing, and the corresponding application locates data resources according to the application context. The technical solution of the present invention decreases the difficulty of application development, improves flexibility of the deployment and reduces difficulty of the deployment.

Description

一种应用服务平台系统及其实现方法  Application service platform system and implementation method thereof
技术领域 Technical field
本发明涉及互联网领域, 具体涉及一种应用服务平台系统及其实现方法。  The present invention relates to the field of Internet, and in particular to an application service platform system and an implementation method thereof.
发明背景 Background of the invention
在后台服务开发领域, 大部分互联网应用和企业应用都会遇到系统规模变得日益 复杂, 并且系统规模日益增大后, 开发成本和运维成本都急剧增高。  In the field of background service development, most Internet applications and enterprise applications will become increasingly complex when the system scale becomes more and more, and the system scale will increase, the development cost and operation and maintenance cost will increase sharply.
本发明致力于降低应用开发难度, 提高部署的灵活性并降低部署的难度。  The present invention is directed to reducing application development difficulty, increasing deployment flexibility and reducing deployment difficulty.
发明内容 Summary of the invention
本发明提供了一种应用服务平台系统及其实现方法,本发明的技术方案能降低应用开发难度,提高 部署的灵活性并降低部署的难度。  The invention provides an application service platform system and an implementation method thereof. The technical solution of the invention can reduce application development difficulty, improve deployment flexibility and reduce deployment difficulty.
为解决上述技术问题, 本发明的技术方案是这样实现的:  In order to solve the above technical problem, the technical solution of the present invention is implemented as follows:
本发明公开了一种实现应用服务平台系统的方法,在应用服务平台系统中设置代理服务器和云计算 应用服务系统, 且在云计算应用服务系统中保存应用的描述信息以及应用与应用服务器之间的对应关 系; 该方法包括:  The invention discloses a method for implementing an application service platform system, which sets a proxy server and a cloud computing application service system in an application service platform system, and saves description information of the application and between the application and the application server in the cloud computing application service system. Correspondence; the method includes:
代理服务器接收客户端请求消息,对客户端请求消息进行解析, 确定对应的应用,根据该应用的描 述信息创建应用上下文,在所述客户端请求消息中添加应用上下文后,根据所述应用与应用服务器之间 的对应关系将客户端请求消息分发给对应的应用所在的应用服务器;  The proxy server receives the client request message, parses the client request message, determines the corresponding application, creates an application context according to the description information of the application, and adds an application context to the client request message, according to the application and the application. The correspondence between the servers distributes the client request message to the application server where the corresponding application is located;
所述云计算应用服务系统中的所述应用服务器在接收到代理服务器发送的客户端请求消息时,将该 客户端请求消息交给对应的应用进行处理;  When receiving the client request message sent by the proxy server, the application server in the cloud computing application service system hands the client request message to the corresponding application for processing;
所述对应的应用处理该客户端请求消息所请求的任务,根据所述应用上下文进行数据资源定位,得 出处理结果;  The corresponding application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result;
应用服务器将所述处理结果经代理服务器返回给客户端。  The application server returns the processing result to the client via the proxy server.
本发明还公开了一种应用服务平台系统, 该系统包括: 代理服务器和云计算应用服务系统, 其中, 云计算应用服务系统中的应用服务器集群上负栽并运行应用,并且云计算应用服务系统中保存有应用的 描述信息以及应用与应用服务器之间的对应关系;  The invention also discloses an application service platform system, the system comprising: a proxy server and a cloud computing application service system, wherein the application server cluster in the cloud computing application service system bears and runs the application, and the cloud computing application service system The description information of the application and the correspondence between the application and the application server are saved;
代理服务器, 用于接收客户端请求消息, 对客户端请求消息进行解析, 确定对应的应用, 根据应用 的描述信息创建应用上下文,在所述客户端请求消息中添加应用上下文后,根据所述应用与应用服务器 之间的对应关系将客户端请求消息分发给对应的应用所在的应用服务器;接收应用服务器端返回的处理 结果, 并返回给客户端;  a proxy server, configured to receive a client request message, parse the client request message, determine a corresponding application, create an application context according to the description information of the application, and add an application context to the client request message, according to the application Distributing the client request message to the application server where the corresponding application is located; receiving the processing result returned by the application server, and returning the result to the client;
应用服务器集群中的应用服务器,用于在接收到代理服务器发送的客户端请求消息时,将该客户端 请求消息交给对应的应用进行处理,并将处理结果返回给代理服务器; 所述对应的应用处理该客户端请 求消息所请求的任务, 根据所述应用上下文进行数据资源定位, 得出处理结果。  The application server in the application server cluster is configured to: when receiving the client request message sent by the proxy server, handing the client request message to the corresponding application for processing, and returning the processing result to the proxy server; The application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result.
由上述可见,针对大部分互联网应用和企业应用都会遇到系统规模变得日益复杂,并且规模日益增 大后, 开发成本和运维成本急剧增高的问题, 本发明通过构建平台即服务的软件平台, 将普遍的现有后 台软件解决方案中按照服务角色进行拆分的方式, 改为以细粒度的信令级别进行应用拆分,并且进行应 用开发与部署的简单方式, 降低了开发与部署的复杂度; 另外, 本发明通过引入应用上下文的概念, 将 复杂的资源定位与应用间的路由从开发者视角上隔离开, 即支持了简洁的开发方式,又能够使平台适用 于超大规模的服务器集群。  It can be seen from the above that for most Internet applications and enterprise applications, the problem that the system scale becomes increasingly complicated and the scale is increased, and the development cost and the operation and maintenance cost increase sharply, the present invention builds a platform-as-a-service software platform. The general existing back-end software solution is split according to the service role, and the application splitting is performed at a fine-grained signaling level, and the application development and deployment is simple, which reduces development and deployment. Complexity; In addition, the present invention isolates complex resource location and application-to-application routing from a developer perspective by introducing the concept of application context, which supports a simple development method and enables the platform to be applied to a very large-scale server. Cluster.
附图简要说明 BRIEF DESCRIPTION OF THE DRAWINGS
图 1是本发明实施例中的应用服务平台系统的逻辑结构示意图;  1 is a schematic diagram showing the logical structure of an application service platform system in an embodiment of the present invention;
图 2是本发明实施例中的应用服务平台系统的一个实际组网示意图;  2 is a schematic diagram of an actual networking of an application service platform system in an embodiment of the present invention;
图 3是本发明实施例中的相关应用开发的层次结构图;  3 is a hierarchical structure diagram of related application development in an embodiment of the present invention;
图 4是本发明实施例中的单个应用服务器的内部结构以及与外部的连接示意图;  4 is a schematic diagram showing the internal structure of a single application server and the connection with the outside in the embodiment of the present invention;
图 5是本发明实施例中的应用进程启动过程的流程图;  FIG. 5 is a flowchart of an application process startup process in an embodiment of the present invention; FIG.
图 6是本发明实施例中的应用进程停止过程的流程图;  6 is a flowchart of an application process stopping process in an embodiment of the present invention;
图 7是本发明实施例中的应用进程更新过程的流程图;  7 is a flowchart of an application process update process in an embodiment of the present invention;
图 8是本发明实施例中的应用进程热更新的流程图;  8 is a flowchart of a hot update of an application process in an embodiment of the present invention;
图 9是本发明实施例中的全局配置系统的示意图;  9 is a schematic diagram of a global configuration system in an embodiment of the present invention;
图 10是本发明实施例中的监控系统的示意图;  Figure 10 is a schematic diagram of a monitoring system in an embodiment of the present invention;
图 11是本发明实施例中的程序内嵌计数器的实现方式示意 图;  11 is a schematic diagram showing an implementation manner of a program embedded counter in the embodiment of the present invention;
图 12是本发明实施例中的注入式调试系统的示意图;  Figure 12 is a schematic view of an injection type debugging system in an embodiment of the present invention;
图 13是本发明实施例中的多个应用服务平台系统的结构示意图。 实施本发明的方式 FIG. 13 is a schematic structural diagram of multiple application service platform systems in an embodiment of the present invention. Mode for carrying out the invention
本发明是一套基于集群 PC服务器环境的应用服务开发平台, 具体实现中, 应用可以基于 Java运 行环境但是并不局限于 Java语言, 本发明将分散的服务器资源在逻辑上整合为一个整体的应用平台, 负栽基于平台进行开发的应用。  The present invention is an application service development platform based on a cluster PC server environment. In a specific implementation, the application can be based on a Java runtime environment but is not limited to the Java language. The present invention logically integrates distributed server resources into a unified application. The platform, the application based on the platform for development.
本发明将应用开发拆分到单个信令的级别,并且设计出应用上下文的概念,将应用中的资源访问及 应用的路由绑定在应用上下文上, 进一步简化了应用平台开发的难度。  The invention splits the application development to a single signaling level, and designs the concept of the application context, and binds the resource access in the application and the application routing to the application context, which further simplifies the development of the application platform.
本发明通过代理服务器 Proxys进行路由, 并通过应用服务器 AppServer进行应用负栽, 并且构建 了一套整体可运维, 可监控的服务器集群平台。  The invention conducts routing through the proxy server Proxys, and performs application loading through the application server AppServer, and constructs a server cluster platform which can be operated and maintained as a whole and can be monitored.
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描 述。  The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
一、 整体概述  I. Overall overview
图 1是本发明实施例中的应用服务平台系统的逻辑结构示意图。在应用服务平台系统中设置代理服 务器和云计算应用服务系统, 其中, 代理服务器中设置代理逻辑部分, 云计算应用服务系统中设置应用 服务器集群、 基础服务、 资源、 中心等逻辑部分。 在图 1中, 各逻辑部分的描述如下:  FIG. 1 is a schematic diagram showing the logical structure of an application service platform system in an embodiment of the present invention. The proxy server and the cloud computing application service system are set in the application service platform system, wherein the proxy logic part is set in the proxy server, and the logic server part, the basic service, the resource, the center and the like are set in the cloud computing application service system. In Figure 1, the description of each logical part is as follows:
※代理 ( Proxy )  ※Proxy (Proxy)
-用于分发客户端的消息, 并维护客户端状态 (如长连接);  - used to distribute client messages and maintain client state (such as long connections);
-代理服务:  - Agency services:
•SIP Proxy : 维护与客户端的 SIP长连接;  • SIP Proxy: maintains a long SIP connection with the client;
•HTTP Proxy : 负责分发 Http应用;  • HTTP Proxy: Responsible for distributing Http applications;
•SMS Proxy : 负责分发短信上行应用;  • SMS Proxy: Responsible for distributing SMS upstream applications;
※应用服务器集群 ( AppEngine Hosts )  ※Application Server Clusters (AppEngine Hosts)
-负栽实际的应用服务运行, 可进行服务器分组;  - The actual application service runs, and the server can be grouped;
※基础服务 ( B asic Service )  ※Basic Service (B asic Service)
-平台内部需求的一些核心应用或独立应用;  - some core applications or stand-alone applications for internal requirements of the platform;
>¾资源 ( Resource )  >3⁄4 Resources ( Resource )
-提供给平台使用的系统资源, 如:  - System resources provided to the platform, such as:
.数据库( Database ) .文件( File ) .内存对象緩冲服务器( Memcache ) . Database ( File ) . Memory Object Buffer Server ( Memcache )
※中心 ( Center ) ※ Center ( Center )
-整个系统的管控中心, 用于看管所用应用服务的部署、 分发、 更新等系统管理操 作。  - The entire system's control center is used to monitor system management operations such as deployment, distribution, and update of application services used.
图 2是本发明实施例中的应用服务平台系统的一个实际组网示意图。如图 2所示,该应用服务平台 系统包括: 代理服务器和云计算应用服务系统, 其中, 云计算应用服务系统中的应用服务器集群上负栽 并运行应用, 并且云计算应用服务系统中保存有应用的描述信息以及应用与应用服务器之间的对应关 系;  FIG. 2 is a schematic diagram of an actual networking of an application service platform system in an embodiment of the present invention. As shown in FIG. 2, the application service platform system includes: a proxy server and a cloud computing application service system, where an application server cluster in the cloud computing application service system loads and runs an application, and the cloud computing application service system stores Description information of the application and the correspondence between the application and the application server;
代理服务器, 用于接收客户端请求消息, 对客户端请求消息进行解析, 确定对应的应用, 根据该应 用的描述信息创建应用上下文,在所述客户端请求消息中添加应用上下文后,根据所述应用与应用服务 器之间的对应关系将客户端请求消息分发给对应的应用所在的应用服务器;接收应用服务器端返回的处 理结果, 并返回给客户端;  a proxy server, configured to receive a client request message, parse the client request message, determine a corresponding application, create an application context according to the description information of the application, and add an application context to the client request message, according to the The application and the application server distribute the client request message to the application server where the corresponding application is located; receive the processing result returned by the application server, and return the result to the client;
所述云计算应用服务系统中的所述应用服务器, 用于在接收到代理服务器发送的客户端请求消息 时, 将该客户端请求消息交给对应的应用进行处理, 并将处理结果返回给代理服务器; 所述对应的应用 处理该客户端请求消息所请求的任务, 根据所述应用上下文进行数据资源定位, 得出处理结果。  The application server in the cloud computing application service system is configured to: when receiving the client request message sent by the proxy server, handing the client request message to the corresponding application for processing, and returning the processing result to the proxy a server; the corresponding application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result.
应用服务器将所述处理结果经代理服务器返回给客户端。  The application server returns the processing result to the client via the proxy server.
上述云计算应用服务系统中保存的应用与应用服务器之间的对应关系,采用表格保存,其中记录有 应用进程名称和应用服务路径, 即应用与应用服务器之间的对应关系。  The correspondence between the application and the application server saved in the cloud computing application service system is saved in a table, where the application process name and the application service path are recorded, that is, the correspondence between the application and the application server.
针对上述图 1所示逻辑架构, 本发明实施例中, 云计算应用服务系统包括: 中心服务器、 资源服务 器和由多个应用服务器组成的服务器集群, 其中:  For the logical architecture shown in FIG. 1 above, in the embodiment of the present invention, the cloud computing application service system includes: a central server, a resource server, and a server cluster composed of multiple application servers, where:
中心服务器, 用于接收外部上传的应用, 将应用的描述信息保存到应用配置信息列表中, 创建所述 应用与应用服务器之间的对应关系,并在对应的应用服务器上部署该应用,保存用于保存应用与应用服 务器之间的对应关系的应用运行信息列表;  The central server is configured to receive the externally uploaded application, save the description information of the application to the application configuration information list, create a correspondence between the application and the application server, and deploy the application on the corresponding application server, and save the application. a list of application running information for saving a correspondence between the application and the application server;
每个应用服务器,用于将所负栽的应用的运行信息上传到中心服务器上的用于保存应用与应用服务 器之间对应关系的应用运行信息列表中;  Each application server is configured to upload running information of the loaded application to a list of application running information for saving a correspondence between the application and the application server on the central server;
其中, 应用配置信息列表包括如下信息: 应用 ID、 应用名称、 应用服务类型、 应用进程名、 应用 服务元数据标注; 应用运行信息列表包括如下信息: 应用进程名称、 应用的服务地址; 资源服务器,用于保存应用服务器上的各应用处理客户端请求消息所请求的任务时需要访问的数据 资源; 在本实施例中, 资源服务器包括: 数据库服务器、 文件服务器和内存对象緩冲服务器。 The application configuration information list includes the following information: an application ID, an application name, an application service type, an application process name, and an application service metadata annotation; the application operation information list includes the following information: an application process name, an application service address; The resource server is configured to save a data resource that needs to be accessed when each application on the application server processes the task requested by the client request message. In this embodiment, the resource server includes: a database server, a file server, and a memory object buffer server.
代理服务器,用于接收客户端请求消息,通过查询中心服务器上的应用配置信息列表识别该客户端 请求消息所对应的应用,然后通过查询中心服务器上的应用配置信息列表和应用运行信息列表获得对应 的应用的服务地址,根据所获得的服务地址将客户端请求消息分发给对应的应用所在的应用服务器;接 收应用服务器端返回的处理结果, 并返回给客户端;  The proxy server is configured to receive the client request message, identify the application corresponding to the client request message by querying the application configuration information list on the central server, and then obtain the corresponding information by querying the application configuration information list and the application running information list on the central server. The service address of the application, the client request message is distributed to the application server where the corresponding application is located according to the obtained service address; the processing result returned by the application server is received, and returned to the client;
在本发明的一个实施例中, 代理服务器包括: 超文本传输协议 HTTP代理服务器、初始会话 SIP代 理服务器和短信系统 SMS代理服务器。 其中, HTTP代理服务器负责分发 HTTP应用, SIP代理服务器 负责与客户端的 SIP长连接, SMS代理服务器负责分发短信上行应用。  In one embodiment of the invention, the proxy server comprises: a hypertext transfer protocol, an HTTP proxy server, an initial session SIP proxy server, and a short message system SMS proxy server. Among them, the HTTP proxy server is responsible for distributing the HTTP application, the SIP proxy server is responsible for the long-term connection with the client's SIP, and the SMS proxy server is responsible for distributing the SMS uplink application.
此外,云计算应用服务系统还包括与应用服务器集群连接的基础服务服务器(在图 2中未画出该基 础服务服务器), 用于提供平台内部需求的一些核心应用或独立应用。  In addition, the cloud computing application service system further includes a basic service server (not shown in Figure 2) connected to the application server cluster, and some core applications or independent applications for providing internal requirements of the platform.
在图 2所示的应用服务平台系统中, 所述代理服务器, 用于在接收到客户端请求消息时, 从客户端 请求消息中提取请求参数,查询中心服务器中的应用配置信息列表,查找出请求参数与元数据标注字段 符合的应用配置信息列表项, 进而识别出对应的应用。  In the application service platform system shown in FIG. 2, the proxy server is configured to: when receiving a client request message, extract a request parameter from a client request message, query a list of application configuration information in the central server, and find out The application configuration information list item corresponding to the metadata tag field is requested, and the corresponding application is identified.
例如: 当接收到 HTTP请求消息时, 根据该请求消息中的统一资源定位符 URL, 查询中心服务器 上的应用配置信息列表, 查找出应用元数据标注字段包含有与所述 URL—致信息的应用配置信息列表 项, 根据所查找出的应用配置信息列表项中的应用名称识别出该客户端请求消息所对应的应用;  For example, when receiving the HTTP request message, querying the application configuration information list on the central server according to the uniform resource locator URL in the request message, and finding that the application metadata label field includes the application with the URL information. The configuration information list item identifies the application corresponding to the client request message according to the application name in the found application configuration information list item;
或者, 代理服务器在接收到与远程调用应用组件 RemoteAppBean对应的远程调用过程协议 Rpc请 求时, 根据该请求消息中的远程调用服务名称 ( Remote AppName ), 查找出中心服务器上应用名称 ( AppName )字段与所述远程调用服务名称一致的应用配置信息列表项, 根据所查找出的应用配置信 息列表项中的应用名称字段识别出该请求消息所对应的应用;  Alternatively, when receiving the remote call procedure protocol Rpc request corresponding to the remote calling application component RemoteAppBean, the proxy server finds the application name (AppName) field on the central server according to the remote calling service name (Remote AppName) in the request message. The application configuration information list item with the same service name is remotely invoked, and the application corresponding to the request message is identified according to the application name field in the searched application configuration information list item;
所述代理服务器,用于根据所查找出的应用配置信息列表项中的应用进程名,查找出中心服务器上 的应用进程名称字段包含与所述应用进程名一致信息的应用运行信息列表项,从所查找出的应用运行信 息列表项中获取应用服务的服务地址信息。并根据所述应用的服务地址信息将客户端请求消息分发给对 应的应用所在的应用服务器。  The proxy server is configured to: according to the application process name in the searched application configuration information list item, find an application operation information list item that is in the application process name field on the central server and that has the same information as the application process name, The service address information of the application service is obtained from the found application running information list item. And distributing the client request message to the application server where the corresponding application is located according to the service address information of the application.
所述代理服务器,根据所查找出的应用配置信息列表项中的元数据标注字段中的关于加栽应用服务 上下文信息, 创建应用服务上下文。  The proxy server creates an application service context according to the context information about the patch application service in the metadata label field in the found application configuration information list item.
在图 2所示的应用服务平台系统中, 中心服务器, 进一步用于保存资源列表; 资源列表包括如下信 息: 资源名称、 资源类型、 应用服务上下文类型、 定位算法名称和定位算法参数;  In the application service platform system shown in FIG. 2, the central server is further configured to save a resource list; the resource list includes the following information: a resource name, a resource type, an application service context type, a positioning algorithm name, and a positioning algorithm parameter;
应用在接收到客户端请求消息后,在完成该客户端请求消息所请求的任务的过程中根据应用上下文 以及资源列表中的对应信息进行资源定位。  After receiving the client request message, the application performs resource location according to the application context and the corresponding information in the resource list in the process of completing the task requested by the client request message.
可见, 本发明这种由上述代理服务器、应用服务器集群、 中心服务器和资源服务器构成的应用服务 平台系统, 将分散的服务器资源在逻辑上整合到一起, 极大降低了应用的开发难度,提高了部署的灵活 性并降低了部署的难度。  It can be seen that the application service platform system composed of the above proxy server, application server cluster, central server and resource server integrates the distributed server resources logically, which greatly reduces the development difficulty of the application and improves the development. The flexibility of deployment and the difficulty of deployment.
图 3是本发明实施例中的相关应用开发的层次结构图。如图 3所示,应用服务平台系统基于如下层 次结构进行开发,具体来说代理服务器上代理服务器、 iftli服务及负栽运行于应用服务器集群上的应用 都基于如下层次结构进行开发:  3 is a hierarchical structure diagram of related application development in an embodiment of the present invention. As shown in Figure 3, the application service platform system is developed based on the following hierarchical structure. Specifically, the proxy server, the iftli service, and the applications running on the application server cluster on the proxy server are developed based on the following hierarchy:
开发基础框架类库( Framework ): 基础框架类库提供基础核心功能与用于在特定业务领域进行定 制的扩展接口; 在基 ftH框架类库中定义并实现多种应用组件 AppBean基础类型, 并且基础框架类库中 预定义了应用上下文接口及基本应用上下文类型的实现, 以提供基础核心功能; 其中不同的 AppBean iftli类型对应不同类型的应用,用于不同类型信令的处理;基础框架类库提供的扩展接口具体用来在业 务框架类库 BizLibrary中扩展的新的 AppBean基 ftH类型和新的应用上下文。  Develop a basic framework class library ( Framework): The base framework class library provides basic core functions and extension interfaces for customization in specific business areas; defines and implements multiple application component AppBean base types in the base ftH framework class library, and the basis The framework class library predefines the implementation of the application context interface and the basic application context type to provide the basic core functions; wherein different AppBean iftli types correspond to different types of applications for different types of signaling processing; the basic framework class library provides The extension interface is specifically used to extend the new AppBean base ftH type and the new application context in the business framework class library BizLibrary.
根据业务特性, 在基础框架类库的基础上开发为业务定制的业务框架类库(Biz Library )。 业务框 架类库还提供业务相关的扩展接口, 用于扩展新的应用;  Based on the business characteristics, a business framework class library (Biz Library) customized for the business is developed based on the basic framework class library. The business framework library also provides service-related extension interfaces for extending new applications;
基于^ ftH框架类库和业务框架类库, 开发实现业务需求的应用、 基础服务以及代理服务器。  Based on the ^ ftH framework class library and business framework class library, develop applications, basic services, and proxy servers that implement business requirements.
应用依赖于 Framework和 Biz Library, 实现业务需求。  Applications rely on the Framework and Biz Library to achieve business needs.
基础服务依赖于 Framework和 Biz Library, 提供基础服务。  The underlying services rely on the Framework and Biz Library to provide the underlying services.
代理服务器依赖于 Framework和 Biz Library, 实现基于业务的路由与负栽功能。  The proxy server relies on the Framework and Biz Library to implement business-based routing and load-bearing functions.
在本发明实施例中, 提供了基于应用组件(AppBean )的应用开发模式。 这里定义最小的开发及负 栽的粒度为 AppBean, —个 AppBean定义为实现一个微小粒度功能的应用程序。  In the embodiment of the present invention, an application development mode based on an application component (AppBean) is provided. The minimum development and load granularity defined here is AppBean, which is defined as an application that implements a tiny granularity.
一般情况下将应用定义到信令级别,定义到信令级别的应用的具体表现形式根据业务的不同,可以 有多种, 比如可以是一个特定的 Http请求(如 GET /default.do ), 或一条特定的上行短信 (FROM: 13800138000;TO: 10658000032;TEXT: HELLO ), 或一条特定的 SIP指令, 或一条 RPC指令(一个方法, 不是一个接口)等等。 Generally, the application is defined to the signaling level. The specific expression of the application defined to the signaling level may be different depending on the service, such as a specific Http request (such as GET /default.do ), or a specific upstream message (FROM: 13800138000; TO: 10658000032; TEXT: HELLO), or a specific SIP instruction, or an RPC instruction (a method, Not an interface) and so on.
本发明实施例中, 处理一条或者多条指令的应用, 定义为 AppBean, 应用能够开发和部署的最小单 位为 AppBean, 能够针对一条信令或多条信令开发 AppBean, 并将其部署到平台系统中, 接受用户的 请求, 请求可能来自用户的客户端软件, 浏览器, 内部引用, 或外部信令调用。  In the embodiment of the present invention, an application for processing one or more instructions is defined as an AppBean, and the minimum unit that can be developed and deployed by the application is AppBean, which can develop an AppBean for one signaling or multiple signaling, and deploy it to the platform system. In accepting the user's request, the request may come from the user's client software, browser, internal reference, or external signaling call.
本发明实施例中, 基于 Java实现部分应用, AppBean被描述为一个接口 (interface ), 所有特定的 AppBean都会从本接口派生, 用以实现特定的方法, 比如自安装机制、 配置初始化、 服务加栽及服务卸 栽等。  In the embodiment of the present invention, an application is implemented as an interface based on Java, and all specific AppBeans are derived from the interface to implement specific methods, such as self-installation mechanism, configuration initialization, and service processing. And service unloading, etc.
AppBean 是一个抽象接口, 但应用开发时, 必须从为特定信令处理设计的 AppBean 基础类型 ( BaseAppBeanTypes )进行派生。  An AppBean is an abstract interface, but application development must be derived from the AppBean base type (BaseAppBeanTypes ) designed for a particular signaling process.
在本发明实施例中, 已实现的 AppBean基础类型包括: 处理 HTTP请求的 HttpAppB ean、处理 RPC 请求的 RemoteAppBean和处理定时任务的 JobAppBean等。  In the embodiment of the present invention, the implemented AppBean basic types include: HttpAppB ean for processing HTTP requests, RemoteAppBean for processing RPC requests, and JobAppBean for processing scheduled tasks.
每个特定的 AppBean基础类型会处理特定形式的信令, 应用开发人员需要选择合适的 AppBean基 础类型去实现自己的应用。 AppBean基础类型不局限于上述的几种, 在 Biz Library的层面上可以扩展 特定类型的 BaseAppBeanType, 并且实现特定类型处理的 Proxy。  Each specific AppBean base type handles specific forms of signaling, and application developers need to choose the appropriate AppBean base type to implement their own application. The AppBean base types are not limited to the above. At the Biz Library level, you can extend a specific type of BaseAppBeanType and implement a Proxy for a specific type of processing.
关于应用上下文称为 App Context  About the application context is called App Context
本发明中不仅将开发模式拆分为面向单独信令,并且将信令与应用上下文绑定在一起,应用上下文 称为 AppContext。 在本发明的应用服务平台系统中, 应用服务上下文( AppContext )是应用调用及资源 定位的关键。 这里应用调用包括代理服务器调用应用服务, 以及应用服务内调用其他的应用服务, 这两 种应用都需要 AppContext来实现目标应用服务的定位。  In the present invention, not only is the development mode split into individual signaling, but the signaling is bound to the application context, and the application context is called AppContext. In the application service platform system of the present invention, the application service context (AppContext) is the key to application calling and resource location. Here, the application call includes the proxy server calling the application service, and the application service calling other application services. Both applications require the AppContext to achieve the target application service positioning.
AppContext可以这样理解: AppContext绑定一个当前应用运行的所在环境身份, 比如当前用户, 这 样做, 开发人员在开发时刻是基于 AppContext (当前用户)进行开发, 访问资源 (数据库, 文件, 緩 存)都必须通过当前的 AppContext, 这样开发者可以不用管理数据库, 文件, 緩存等的拆分问题, 甚 至用户数据的跨机房问题, 只关基于当前用户进行开发即可, 极大的简化了开发模式, 将系统部署结构 与开发过程隔离开来, 实现高效, 便捷的 PaaS平台。  The AppContext can be understood as follows: The AppContext is bound to the identity of the environment in which the current application is running, such as the current user. In this way, the developer is developing based on the AppContext (current user) at the development time, and accessing resources (database, file, cache) must be Through the current AppContext, developers can eliminate the problem of splitting the database, files, caches, etc., and even the cross-machine room problem of user data. It can only be developed based on the current user, greatly simplifying the development mode, and the system. The deployment structure is isolated from the development process to achieve an efficient and convenient PaaS platform.
AppContext从数据构成上分为两部分, AppContext是可序列化与反序列化的: ( 1 )通用资源标志符 URI( Context Uri ) : 为字符串格式, 包括用户的索引信息, 负 责后续的定位, 如 id : 230302023 ;session : 13910000001。  The AppContext is divided into two parts from the data composition. The AppContext is serializable and deserializable: (1) The URI ( Context Uri ) is a string format, including the user's index information, which is responsible for subsequent positioning. Such as id: 230302023; session: 13910000001.
( 2 ) 附加数据 ( ContextData ) : 是预定义好的强类型数据结构, 可以包含多个字 段; 其包括该应用的属性信息; 应用的属性信息包括: 会话参数、 授权信息等;  (2) Additional data ( ContextData ): is a predefined strong type data structure, which may include multiple fields; it includes attribute information of the application; the attribute information of the application includes: session parameters, authorization information, and the like;
在某些场合,附加数据会由 Proxy产生提供给后面应用, 在长连接的 Proxy服务器场 景 (参见 Proxys章节)。  In some cases, additional data will be generated by the Proxy for subsequent applications, in a long-connected Proxy server scenario (see the Proxys section).
支持 getNamedValue(String fieldName)方法, 可以获取到一个特定字段名的数据, 此方法被用于灰度发布场合 (见后文)。  Support for the getNamedValue(String fieldName) method, which can get the data of a specific field name. This method is used for grayscale publishing (see below).
AppContext是抽象基类, 在 Framework中预定义了以下的 AppContext子类:  AppContext is an abstract base class, and the following AppContext subclasses are predefined in the Framework:
NullContext : 预定义的空上下文, 用在不需要上下文的场合;  NullContext : A predefined empty context, used when no context is needed;
S es sionContext : 预定义的只保存会话 Id的上下文。  S es sionContext : A predefined context that only holds the session Id.
在复杂应用中, 一般会在 B iz Library中扩展特定的 AppContext , 比如一个 IM系统, 在 SIP Proxy上会保存用户的 Session , 那么我们可以扩展 UserContext , 那么每个应用处 理的时候都会接收到 Proxy上保存的 Session信息。  In complex applications, a specific AppContext is generally extended in the Biz Library, such as an IM system. On the SIP Proxy, the user's Session is saved. Then we can extend the UserContext, so each application will receive the Proxy. Saved session information.
除标准 AppContext, 在使用本发明的应用服务系统平台进行扩展开发的时候, 需 要先定制业务相关的一些基础, AppContext就是其中之一 。 下面例举一个关于 AppContext的具体实施例。  In addition to the standard AppContext, when using the application service system platform of the present invention for extension development, it is necessary to customize some basic foundations of the service, and the AppContext is one of them. The following is a specific example of an AppContext.
例如: 使用本发明的应用服务平台系统开个一个即时消息 ( IM ) 系统, 这个 IM系 统中的用户都采用一个整数 id进行定位, 那么可以根据如下方式定制这个 IM系统的 AppContex , 从 AppContext派生, 命名为 UserContext:  For example: using the application service platform system of the present invention to open an instant messaging (IM) system, where users in the IM system use an integer id for positioning, then the AppContex of the IM system can be customized according to the following manner, derived from the AppContext, Named UserContext:
. Uri部分: "id : 230302023" , 表示用户的 id , 那么通过这个用户的 id , 可以定位用 户的应用服务位置与数据库存储位置;  Uri part: "id : 230302023" , which represents the user's id , then the user's id can be used to locate the user's application service location and database storage location;
. Data部分:  . Data section:
-用户的登录网络地址; -客户端类型等;  - the user's login network address; - client type, etc.;
当定制了用户的 UserContext , 所有该系统内基于用户进行操作的 AppBean都会用 UserContext作为 AppBean的 < C > 参数, 如:  When the user's UserContext is customized, all AppBeans based on the user's operation in the system will use the UserContext as the <C> parameter of the AppBean, such as:
-获取用户资料; -设置用户资料; -获取好友列表等;  - Get user profile; - Set user profile; - Get friend list, etc.;
此外, 在本发明的应用服务平台系统中, 除了提供基于单个用户的 AppContext外, 还提供了基于群组的业务类型, 开发基于群组的应用服务, 也需要定制基于群组的 AppContext , IM系 统使用 一个整数用 于标识群组, 从 AppContext派生 , 命名 为 GroupContext , GroupContext的结构如下: In addition, in the application service platform system of the present invention, in addition to providing an AppContext based on a single user, It also provides group-based business types, develops group-based application services, and also needs to customize group-based AppContext. IM system uses an integer to identify groups, derives from AppContext, and is named GroupContext. The structure of GroupContext is as follows: :
. Uri部分: "group : 123 123" , 标识群组 id , 表示用户的 id, 那么通过这个群组的 id, 我们可以定位群组的应用服务位置,与数据库存储位置;  Uri part: "group : 123 123" , identifies the group id , which represents the user's id, then through the id of this group, we can locate the application service location of the group and the database storage location;
. Data部分:  . Data section:
-群组的会话参数; -群组的授权等;  - the session parameters of the group; - the authorization of the group, etc.;
当定制了基于群组的 GroupContext后, 该系统内基于群组进行操作的所有 AppB ean 都会用 GroupContext作为 AppBean的 < C > 参数, 如:  When a group-based GroupContext is customized, all AppB eans that operate on the group based on the group will use GroupContext as the < C > parameter of the AppBean, such as:
-设置群组名称; -更新群组权限; -获取群离线消息等。  - Set the group name; - Update group permissions; - Get group offline messages, etc.
应用的元数据标注 ( Ann otation s ) 信息  Application metadata annotation ( Ann otation s ) information
在发明中 , 开发一个应用 AppBean及扩展 AppB ean时, 会通过 Java元数据标注 (Annotation)标注应用的负栽方式, 运行方式等数据, 此数据编译后, 可以在运行期加 栽, 或从编译后的二进制包中将数据从反射中提取出来。  In the invention, when an application AppBean is developed and the AppB ean is extended, the application metadata and the operation mode and the like are marked by the Java metadata annotation (Annotation). After the data is compiled, the data can be loaded at the runtime, or compiled. The data is extracted from the reflection in the subsequent binary package.
在本发明的实施例中, 一些预定义的 Annotations如下文描述, 扩展的 AppB ean都会 定义自 己特定的 Annotation。  In an embodiment of the invention, some predefined Annotations are described below, and the extended AppB ean defines its own specific Annotation.
1 . © AppName (应用的名字和分类名 )  1 . © AppName (app name and category name)
• 声明 AppBean的名字以及分类名;  • Declare the name of the AppBean and the name of the category;
- @ AppName(category="Core" , name="GetUserInfo");  - @AppName(category="Core" , name="GetUserInfo");
这里 @xxx为 Java语言对程序元数据的标注。  Here @xxx is the annotation of the program metadata in the Java language.
• Category:name全局唯一;  • Category: name is globally unique;
• category可以用于 AppBean的分类;  • category can be used for classification of AppBeans;
- 方便运维人员进行配置与分类;  - Convenient for operation and maintenance personnel to configure and classify;
- 在一个 Category中, 如果允许一个 AppBean能够被其他 Category中的 AppBean访问, 必 须将这个 AppBean声明成为公开, 或友好;  - In a Category, if an AppBean is allowed to be accessed by an AppBean in another Category, the AppBean declaration must be made public, or friendly;
• @Public() :允许所有的 AppBean访问;  • @Public() : Allows access to all AppBeans;
• @ Friendlly ("Core") :只允许指定 Category访问;  • @ Friendlly ("Core") : Only allowed to specify Category access;
• ©Friendlly ("Core:AddBuddy"):只允许指定应用访问。  • ©Friendlly ("Core:AddBuddy"): Allows only specified application access.
2. ©Stateful (应用的状态信息 )  2. ©Stateful (application status information)
.当声明一个 AppBean为有状态的, 则此个 AppBean可以将状态保存在本机内存中;  When an AppBean is declared stateful, this AppBean can save the state in native memory;
.没有标注@81&16&1的应用均视为无状态应用, 禁止使用本机内存进行状态的保存;  Applications that are not labeled @81&16&1 are considered stateless applications, and the use of local memory is prohibited for state saving;
.如果一个 Category中的多个 AppBean声明的 Stateful参数一样 ("Presence"), 则这个几个 AppBean 启动到一个进程中, 并且不允许单独热更新 ;  If multiple AppBeans in a Category have the same Stateful parameter ("Presence"), then these AppBeans are launched into a process and do not allow separate hot updates;
. @Stateful的应用在热更新的时候会丢失状态, 所以尽量用 memcache方式去代替,建议仅在某些 性能要求很高的领域启动;  @Stateful's application will lose state when it is hot-updated, so try to use memcache instead, it is recommended to start only in some areas with high performance requirements;
.当某个 AppBean被声明为 Stateful时,针对这个 AppBean的访问会采用这个 AppBean的  When an AppBean is declared as Stateful, access to the AppBean will be taken from the AppBean.
AppContext绑定的一致性 Hash的方式进行路由。  AppContext binding consistency Hash way to route.
3. @ Http Pr efix  3. @ Http Pr efix
HttpPrefix ( HTTP前缀, 只针对 Http AppB ean )  HttpPrefix (HTTP prefix, only for Http AppB ean )
.用于标注一个 Http AppB ean处理的 Http请求范围;  Used to mark the scope of an Http request processed by an Http AppB ean;
.如: @ HttpPrefix( '71ogin.do',);  Such as: @ HttpPrefix( '71ogin.do',);
-表示该 HttpAppBean处理以 login . do为起始的 http请求。  - Indicates that the HttpAppBean handles http requests starting with login . do .
Message Name (事件名称, 只针对 MessageAppB ean )  Message Name (Event name, only for MessageAppB ean)
.用于标注一个 MessageAppBean的名称;  Used to label the name of a MessageAppBean;
•如: @ Mess age Name  • For example: @ Mess age Name
4. © C ontextL oader (加栽应用服务上下文信息 )  4. © C ontextL oader (adding application service context information)
.用于标注一个 AppBean:¾。何力口栽 AppContext  Used to label an AppBean: 3⁄4. He Li mouth planting AppContext
-如: @ ContextLoader(name = " CookieParser" )  - such as: @ ContextLoader(name = " CookieParser" )
-表示通过名为 CookieParser的程序去处理处理 Context;  - indicates that the Context is processed by a program called CookieParser;
-CookieParser程序内置在 Proxy当中, 通过处理 Http Request中的 Cookie字段去 加栽用户相关信息。  The -CookieParser program is built into the Proxy and handles user-related information by processing the cookie field in the Http Request.
在本发明的实施例中, 一些预定义的 Annotations不限于如上的几种, 可以才艮据实 际业务需求增加其他的标注, 如后文中会提到的 @ Peer s Site。 基石出 Ap p B e an类型 ( AppB e anB aseType ) In the embodiment of the present invention, some predefined Annotations are not limited to the above, and other annotations may be added according to actual business requirements, such as @ Peer s Site mentioned later. The cornerstone is Ap p B e an type ( AppB e anB aseType )
在 Framework中, 实现一个 AppBeanBaseType的步骤如下描述:  In the Framework, the steps to implement an AppBeanBaseType are as follows:
一个 AppBeanBaseType包括以下组件及特性:  An AppBeanBaseType includes the following components and features:
• AppBeanBaseType是一个抽象基类  • AppBeanBaseType is an abstract base class
• AppBeanBaseType必须添力口标 @AppBeanBaseType, 这样才能被 AppLoader识别到 • AppBeanBaseType must add the @AppBeanBaseType to be recognized by AppLoader
• 在 AppBean中并没有定义处理业务的方法,但是 ^ AppBeanBaseType中必须提供处理业务的抽 象方法, 提供给应用子类去实现 • There is no way to define the business in the AppBean, but ^ AppBeanBaseType must provide an abstraction method for processing the business, which is provided to the application subclass to implement
• 应用时刻, AppBeanBaseType是单件, 业务处理抽象方法中会传入本次业务运行的全部请求参 数, 与应答方法的事务抽象类, 我们称之为 AppTx  • At the moment of application, AppBeanBaseType is a single piece. The business process abstraction method will pass all the request parameters of this business run, and the transaction abstract class of the response method, we call it AppTx
• AppTx一般情况下会绑定在一个 AppContext上  • AppTx is generally bound to an AppContext
• 必须实现相应的 AppHost类, AppHost类会实际触发 AppBean的业务处理方法, AppHost会与 AppBeanBaseType一起派生  • The AppHost class must be implemented. The AppHost class will actually trigger the AppBean business processing method. AppHost will be derived with AppBeanBaseType.
• 一般情况下需要实现负责分发此请求的 AppBeanRouteManager以及处理应用的 Proxy (独立代 理服务)  • In general, you need to implement the AppBeanRouteManager responsible for distributing this request and the Proxy (independent proxy service) that handles the application.
在 Framework中实现了几个基 的 AppBeanBaseType,但是应用可使用的 AppB ean并不限于下面 的几个类型, 还可以在 Biz Library层次上进行扩展。  Several basic AppBeanBaseTypes are implemented in the Framework, but the AppB ean that the application can use is not limited to the following types, and can be extended at the Biz Library level.
1. Http AppBean (超文本传输协议应用组件)  1. Http AppBean (Hypertext Transfer Protocol Application Component)
HttpAppBean用于处理一条特定的 Http请求, Http请求可能来自于来自用户客户端浏览器或程序 的直接请求,请求会通过 Http Proxy的智能 7层负栽转发到应用进程上。 Http请求也可能来源于其他服 务器的请求。  The HttpAppBean is used to process a specific Http request. The Http request may come from a direct request from the user's client browser or program, and the request will be forwarded to the application process through the intelligent layer 7 of the Http Proxy. Http requests may also originate from requests from other servers.
HttpAppBean<C extends AppContext>是一个泛型类, 其中泛型参数解释如下:  HttpAppBean<C extends AppContext> is a generic class, where the generic parameters are interpreted as follows:
.上下文 <C>: 特定类型的上下文  .Context <C>: a specific type of context
. Context来源: 从何处获取上下文 < C > ;  Context source: Where to get the context < C > ;
. URL前缀: 此应用处理的 URL前缀( URL前缀通过@ 11« ?^^ 元数据标注处理 ) HttpAppBean通过标注来指明自己所处理的请求 UrlPrefix (前缀), 例如, 开发一个用于最简单的 HttpAppBean的步骤大致如下:  URL prefix: The URL prefix processed by this application (the URL prefix is processed by @11« ?^^ metadata annotation) HttpAppBean indicates the UrlPrefix (prefix) that the request is being processed by the annotation, for example, develop one for the simplest HttpAppBean The steps are as follows:
1.从 HttpAppBean的基类派生  1. Derived from the base class of HttpAppBean
@HttpPrefix("/Hello ")  @HttpPrefix("/Hello ")
@AppName( category: "example " name= "hello ")  @AppName( category: "example " name= "hello ")
class HelloWorldAppBean extends HttpAppBean<NullContext>()  Class HelloWorldAppBean extends HttpAppBean<NullContext>()
2.指定上下文类型<0, 为 NullContext, 即不需要上下文;  2. Specify the context type <0, which is NullContext, ie no context is required;
3.通过 @HttpPrefix标注, 表示用于处理发到 @HttpPrefix标注的地址的请求;  3. By @HttpPrefix annotation, represents the request to process the address sent to the @HttpPrefix annotation;
4.通过 @AppName标注, 表示本应用的目录为 example, 名称为 hello;  4. By @AppName, the directory of the application is example, and the name is hello;
5.实现 process()方法, process()方法为 HttpAppBean中定义的抽象方法, 读取上 HttpRequest, 处 理后,返回 HttpResponse给客户端。  5. Implement the process() method. The process() method is an abstract method defined in the HttpAppBean. After reading the HttpRequest, after processing, it returns HttpResponse to the client.
例如: 开发一个用于用户统一登录认证的应用的流程为:  For example: The process for developing an application for user unified login authentication is:
1 .从 HttpAppB ean的基类派生;  1. Derived from the base class of HttpAppB ean;
2.指定应用服务上下文类型 < C > 为 S e s sionContext ;  2. Specify the application service context type < C > as S e ssionContext ;
3 .指定 Context来源为 cookie中的 s sic字段;  3. Specify the Context source as the s sic field in the cookie;
4.实现 proce s s方法, 读取 HttpReque st , 处理后返回 HttpRe spons e给客户端。  4. Implement the proce s s method, read HttpReque st, and return HttpRe spons e to the client after processing.
2. RemoteAppBean (远程调用应用组件)  2. RemoteAppBean (remote call application component)
RemoteAppBean从 AppBean派生, 用来处理一个特定的 Rpc请求, Rpc请求可能来源于下列几个 场景  RemoteAppBean is derived from AppBean and is used to process a specific Rpc request. Rpc requests may originate from the following scenarios.
-来源于其他 AppBean的调用, 可能是任意来源类型;  - Calls from other AppBeans, possibly any source type;
.来源于其 roxy;  From its roxy;
-来源于其他外部服务调用。  - From other external service calls.
RemoteAppBean是一个泛型类, 其中泛型参数解释如下:  RemoteAppBean is a generic class, where the generic parameters are explained as follows:
- <A>: 请求参数, 强类型定义, 可序列化;  - <A>: request parameters, strong type definitions, serializable;
- <R>: 应答参数, 强类型定义, 可序列化;  - <R>: response parameter, strong type definition, serializable;
- <C >: 特定类型的应用上下文。  - <C >: A specific type of application context.
实现一个 RemoteAppBean 必须提供确定的下述类型, 例如开发一个处理获取用户资料的 RemoteAppBean的步骤如下:  Implementing a RemoteAppBean must provide certain types of determinants, such as developing a RemoteAppBean that handles getting user data as follows:
1.从 RemoteAppBean的基类派生 @AppName( category: "example ", name= "GetUserlnfo ") 1. Derived from the base class of RemoteAppBean @AppName( category: "example ", name= "GetUserlnfo ")
class GetUserlnfo extends RemoteAppBean<GetOption, Userlnfo, NullContext>  Class GetUserlnfo extends RemoteAppBean<GetOption, UserInfo, NullContext>
2.定义请求参数类型 <A>为 GetOption, GetOption为可序列化类,保存获取用户的 id及选项参数; 2. Define the request parameter type <A> is GetOption, GetOption is the serializable class, save the user id and option parameters;
3.定义应答参数类型 <R>为 Userlnfo, Userlnfo为可序列化类, 保存用户信息; 3. Define the response parameter type <R> is UserInfo, UserInfo is a serializable class, and save user information;
4.定义上下文 <C>为 NullContext, 本案例中不需要上下文;  4. Define the context <C> is NullContext, no context is needed in this case;
5.继承后实现 process()方法用于处理业务逻辑, 继承 load()方法用与初始化, 继承 unload()方法 卸栽, 继承 setup()方法实现自安装。  5. After inheritance, the process() method is used to process the business logic, inheriting the load() method and initializing, inheriting the unload() method, unloading, and inheriting the setup() method to implement self-installation.
当调用一个 RemoteAppBean时必须提供这个 RemoteAppBean在实现时所声明的特定类型的应用上 下文 (AppContext )。  When calling a RemoteAppBean, you must provide a specific type of application context (AppContext) that this RemoteAppBean declares at implementation time.
一个获取用户信息的应用会如下声明:  An application that gets user information will declare it as follows:
1 .从 RemoteAppB ean < GetOption , Userlnfo , UserContext > 中派生;  1. Derived from RemoteAppB ean < GetOption , UserInfo , UserContext >;
a.请求参数 < A > 为 GetOption , 为获取用户的一些选项参数  a. Request parameter < A > is GetOption , to get some option parameters of the user
b .应答参数 < R > 为 Userlnfo , 为用户信息的集合  b. The response parameter < R > is UserInfo , a collection of user information
c .应用上下文 < C > 为 UserContext , 为当前上下文的用户信息, UserContext用于 标识用户 ID  c. The application context < C > is UserContext , which is the user information of the current context, and the UserContext is used to identify the user ID
2.实现 proce s s方法处理业务逻辑  2. Implement proce s s method to handle business logic
3JobAppBean (任务应用组件)  3JobAppBean (Task Application Component)
JobAppBean λ AppBean派生, 用来处理一个定时任务, 并且可以在全局中保证定时任务在某个资 源上独占运行。  JobAppBean λ AppBean derivation, used to process a timed task, and can ensure that the scheduled task runs exclusively on a resource in the global.
实现一个 JobAppBean的步骤如下  The steps to implement a JobAppBean are as follows
1.从 JobAppBean的基类派生  1. Derived from the base class of JobAppBean
@JobSchedule( cron= " */5 * * * *")  @JobSchedule( cron= " */5 * * * *")
@JobResource( resource= "USERDB ", parallel=true)  @JobResource( resource= "USERDB ", parallel=true)
@AppName( category: "example ", name= "GetUserlnfo ")  @AppName( category: "example ", name= "GetUserlnfo ")
class GetUserJobApp extends JobAppBean  Class GetUserJobApp extends JobAppBean
2.定义 Job的运行时间, 其中 Job的运行时间按照 Com表达式中表述的时间运行 2. Define the running time of the Job, where the running time of the Job runs according to the time expressed in the Com expression.
3.定义 Job将要独占的资源, 关于资源的定义请见下一节, 绑定资源后, 平台系统中的 JobAppBean在针对此资源时将不会重复运行。 3. Define the resources that the Job will monopolize. For the definition of resources, see the next section. After the resources are bound, the JobAppBean in the platform system will not be run repeatedly for this resource.
基于 Ap p C ont ext的资源访问定位  Resource access location based on Ap p C ont ext
在本发明中, 定义并实现一个具有某种业务功能的应用后, 这个应用势必要访问各种资源, 如数据 库、 文件服务器、 内存对象緩冲服务器或其他提供的服务等。 本发明中的应用服务平台系统是大型分布 式系统, 所以这些资源都不是单点服务, 也就是同一个类型的数据库可能存在多个纵向拆分 (Sharding) 的实例。 本发明中将一个应用能够访问的资源绑定在了其应用上下文 AppContext上。  In the present invention, after defining and implementing an application having a certain business function, the application necessarily accesses various resources such as a database, a file server, a memory object buffer server, or other provided services. The application service platform system in the present invention is a large distributed system, so these resources are not single-point services, that is, there may be multiple instances of vertical sharding in the same type of database. In the present invention, a resource accessible by an application is bound to its application context AppContext.
比如, 声明一个获取用户信息的应用, 名为 GetUserlnfoApp, 在应用的实现环节读取用户数据库 ( UserDB ) ,将结果返回。 其中 UserDB存在多个通过用户 id进行取模后进行纵向拆分的实例。  For example, an application that retrieves user information, named GetUserlnfoApp, reads the user database (UserDB) in the implementation of the application and returns the result. The UserDB has multiple instances of vertical splitting after moduloing by user id.
那么具体过程如下:  Then the specific process is as follows:
1.代理服务器 Http Proxy接收到来自于客户端的 Http请求;  1. Proxy server Http Proxy receives an Http request from the client;
2. Http Proxy通过 Http请求的 URL判断该请求对应的应用; 具体为 Http Proxy通过访问中心服务 器上的应用配置信息列表, 找到元数据标注 Annotations字段中的 @HttpPrefix与 Http请求的 URL—致 的应用配置信息列表项, 该表项对应的应用即为该 Http请求所对应的应用;  2. Http Proxy judges the application corresponding to the request through the URL of the Http request; specifically, the Http Proxy finds the application of the @HttpPrefix and the URL of the Http request in the metadata annotation Annotations field by accessing the application configuration information list on the central server. The configuration information item, the application corresponding to the entry is the application corresponding to the Http request;
3. Http Proxy通过步骤 2识别该请求是 GetUserlnfoAp 的请求, 并需要 UserContext作为上下文参 数;  3. Http Proxy identifies in step 2 that the request is a request for GetUserlnfoAp and requires UserContext as the context parameter;
4. Http Prorxy根据应用配置信息表项中的 Annotations字段中的 @ContextLoader,以及 Http请求报文 中提取的 目关信息创建 UserContext;  4. The Http Prorxy creates a UserContext according to the @ContextLoader in the Annotations field in the application configuration information table and the information extracted from the Http request message.
5. Http Proxy 在来自客户端的 Http 请求中添加了 UserContext 数据后将 Htt 请求转发到 GetUserlnfoApp所在的应用服务器;这里通过查询应用运行信息列表获得 GetUserlnfoAPP的服务地址。  5. Http Proxy forwards the Htt request to the application server where GetUserInfoApp is located after adding the UserContext data from the Http request from the client; here, the service address of GetUserlnfoAPP is obtained by querying the application running information list.
6.应用服 ^器上的运行 GetUserlnfoApp 的应用进程接收到 Http请求,提取 UserContext, 并交给 GetUserlnfoAp 处理;  6. The application process running on the application service GetUserlnfoApp receives the Http request, extracts the UserContext, and hands it to GetUserlnfoAp for processing;
7. GetUserInfoAp 读取 UserDB, 在读取 UserDB的时候,通过 UserContext中的 id信息,进行 UserDB 的定位;  7. GetUserInfoAp reads the UserDB. When reading the UserDB, the UserDB is located through the id information in the UserContext.
8. GetUserlnfoAp 组织返回 艮文, 并返回给 Http Proxy;  8. The GetUserlnfoAp organization returns the text and returns it to the Http Proxy;
9. Http Proxy将返回报文返回给客户端。  9. Http Proxy will return the message back to the client.
在上述过程的步骤 7中, 通过资源 (Resource )表进行定位。 在本发明的一个实施例中的资源表如 表 1所示: In step 7 of the above process, positioning is performed through a resource table. A resource table in an embodiment of the present invention, such as Table 1 shows:
Figure imgf000010_0001
Figure imgf000010_0001
表 1  Table 1
可以通过实现不同的定位函数( Locator ) , 来实现针对不同资源的不同定位方式。 例如在上例中, 资源表的具体配置如表 2所示:  Different positioning methods for different resources can be implemented by implementing different positioning functions (Locator). For example, in the above example, the specific configuration of the resource table is shown in Table 2:
Figure imgf000010_0002
Figure imgf000010_0002
表 2  Table 2
则在步骤 7中使用 id: 1001定位 UserDB时, ModDatabaseLocator会取出 1001 , 并将 1001除 5 , 取余数为 1 , 返回名为 UserDB.l的数据库实例。  Then, when you use the id: 1001 to locate the UserDB in step 7, the ModDatabaseLocator will take out 1001 and divide 1001 by 5, taking the remainder as 1 and returning the database instance named UserDB.l.
又例如:  Another example:
开发一个即时消息(简写为 IM)系统,这个 IM系统中的用户都采用一个整数的 id进行定位,那么可 以如下方案定制这个 IM系统的 AppContext,从 AppContext派生,命名为 UserContext,  Develop an instant messaging (IM) system. Users in this IM system use an integer id to locate the application. The AppContext of the IM system can be customized from the AppContext and named UserContext.
- Uri部分: " Id:230302023",表示用户的 id,那么通过这个用户的 id,我们可以定位用户 的应用位置, 与数据库存储位置  - Uri part: " Id:230302023", which represents the user's id, then through this user's id, we can locate the user's application location, and the database storage location
- Data部分:  - Data section:
• 用户的登录网络地址、  • The user's login network address,
• 客户端类型  • Client type
• 等…  • Wait…
当定制了基于用户的 UserContext, 所有该系统内基于用户进行操作的 AppBean都会用 UserContext 作为 AppBean的 <C>参数  When customizing the user-based UserContext, all AppBeans based on user actions in the system will use UserContext as the <C> parameter of the AppBean.
如: 获取用户资料、 设置用户资料、 获取好友列表、 ...  Such as: Get user data, set user profiles, get friends list, ...
但在一个 IM平台中, 除了提供基于用户的 AppContext以外,还存在基于群组的业务类型, 开发基 于群组的应用, 也需要定制基于群组的 AppContext, IM 系统使用一个整数用于标识群组, 那么 GroupContext结构如下  However, in an IM platform, in addition to providing a user-based AppContext, there are group-based service types. To develop a group-based application, a group-based AppContext is also required. The IM system uses an integer to identify the group. , then the GroupContext structure is as follows
- Uri部分: "group: 123123",标识群组 id,表示用户的 id, 那么通过这个群组的 id,我们可 以定位群组的应用位置, 与数据库存储位置  - Uri part: "group: 123123", which identifies the group id, which represents the user's id. Then, by the id of this group, we can locate the application location of the group, and the database storage location.
- Data部分包括: 群组的会话参数、 群组的授权等  - The Data section includes: Group session parameters, group authorization, etc.
当定制了基于群组的 GroupContext 后, 所有该系统内基于群组进行操作的 AppBean 都会用 GroupContext作为 AppBean的 <C>参数  When a group-based GroupContext is customized, all Group-based AppBeans in that system will use GroupContext as the <C> parameter of the AppBean.
如:设置群组名称、 更新群组权限、 获取群离线消息、 ...  Such as: set group name, update group permissions, get group offline messages, ...
AppB ean基于业务框架类库 BizL ibr ar y的扩展方法  AppB ean based on the business framework class library BizL ibr ar y extension method
在本发明中, 当需要开发新类型的应用时: 通过基础框架类库 Framework提供的扩展接口在业务 框架类库 BizLibrary中扩展与该新类型应用对应的 AppBean基础类型, 以及在业务框架类库 BizLibrary 中扩展针对该新类型应用的应用上下文。然后可以基于基于 Framework和 BizLibrary开发出相应的代理 服务器, 最后就可以在此基础上进行新应用的开发。 In the present invention, when a new type of application needs to be developed: an extension interface provided by the framework of the base framework class library extends the AppBean base type corresponding to the new type application in the business framework class library BizLibrary, and the business framework class library BizLibrary Extend the application context for this new type of application. Then you can develop a corresponding proxy server based on Framework and BizLibrary, and finally you can develop new applications on this basis.
例如: 当开发一个短信服务系统时, 我们可以单独基于短信扩展出短信类型的 AppBean基础类型: SmsAppBean, 并相应的开发出用于分发短信的 Sms Proxy, 并且开发出基于短信用户的 UserContext, 当完成这三项后, 平台的应用可以基于用户及短信指令的方式进行开发, 其中拓展点如下所述:  For example: When developing a short message service system, we can extend the SMSBean based basic type of SMS type based on SMS: SmsAppBean, and develop the Sms Proxy for distributing SMS, and develop the UserContext based on SMS users. After these three items, the platform application can be developed based on the user and SMS instructions. The extension points are as follows:
• 拓展 AppBean及 Proxy可以让平台获取支持任意信令的能力;  • Extending AppBeans and Proxy allows the platform to gain the ability to support arbitrary signaling;
• 拓展 AppContext可以让平台支持几乎任意数据类型的业务系统。  • Extending the AppContext allows the platform to support business systems of virtually any data type.
AppBean的扩展示例: Sip AppBean  An extended example of AppBean: Sip AppBean
如果在一个基于 SIP的 IM平台中,考虑应用本系统,把 SIP信令的 PROTOCOL, METHOD , EVENT 作为一个区分 SIP信令的标示, 那么在此基础上, 我们可以设计一个 SipAppBean, 用于处理来自客户 端的 SIP请求。 那么实现一个 SipAppBean的步骤如下:  If in a SIP-based IM platform, consider applying the system, using PROTOCOL, METHOD, and EVENT of SIP signaling as a distinguishing SIP signaling identifier, then based on this, we can design a SipAppBean for processing from Client's SIP request. Then the steps to implement a SipAppBean are as follows:
1. 派生自 AppBean;  1. Derived from AppBean;
2. 设计标识@81 1\^&0(1(《«0(;01=''¥1'', method="SERVICE", event="GetUserInfo")标示此  2. Design logo @81 1\^&0(1("«0(;01=''¥1'', method="SERVICE", event="GetUserInfo") indicates this
SipAppBean处理的信令类型;  The type of signaling handled by the SipAppBean;
3. 设计标识@81 1\^&0(18(81 ^\^^10(1[] methods)允许一个 SipAppBean处理多个请求;  3. Design identifier @81 1\^&0(18(81 ^\^^10(1[] methods)) allows a SipAppBean to handle multiple requests;
4. 设计 SipAppHost类,打开 SIP端口,监听所有的 SIP请求, 并分发到具体的应用的 SipAppBean 上, 分发的依据是 @AppName, 为 PROXY层面添加;  4. Design the SipAppHost class, open the SIP port, listen to all SIP requests, and distribute them to the SipAppBean of the specific application. The distribution is based on @AppName, which is added for the PROXY layer.
5. 实际 SipTx事务类, 将请求, 应答, 上下文包装在其中;  5. The actual SipTx transaction class, which encapsulates the request, response, and context;
6. 在 SipAppBean上设计通用的处理信令的抽象方法;  6. Design a generic abstraction of processing signaling on SipAppBean;
7. SipcAppHost产生 SipTx, 并转发到 SipAppBean的抽象方法上。  7. SipcAppHost generates SipTx and forwards it to the abstract method of SipAppBean.
这样,我们就可以为每一个 SIP信令开发应用了,同时我们会实现一个 SIP PROXY客户端会与 SIP PROXY保持一个长连接, 并且登录有 SIP PROXY会保持用户的一些基本状态, 并在后续的应用中传 给后续的应用, 其中每个应用需要的上下文, 可以通过扩展 AppContext实现。  In this way, we can develop applications for each SIP signaling, and we will implement a SIP PROXY client that will maintain a long connection with SIP PROXY, and login with SIP PROXY will maintain some basic state of the user, and in subsequent The application is passed to subsequent applications, and the context required by each application can be implemented by extending the AppContext.
AppC ontext的扩展示例: User C ontext Extension example of AppC ontext: User C ontext
在上文的描述中, 我们针对每个 IM用户扩展一个 AppContext, 称为 UserContext, 根据前文, 我 们需要实现 UserContext的两个部分:  In the above description, we extend an AppContext for each IM user, called UserContext. According to the previous article, we need to implement two parts of the UserContext:
1. ContextUri:  1. ContextUri:
我们定义 ContextUri为 id:332132132, 表示用户的 id  We define ContextUri as id: 332132132, which represents the user's id
2. ContextData:  2. ContextData:
定义 ContextData包括如下数据: NickName昵称、 Age年龄、 ClientType客户端类型、 Client Version 客户端版本号、 ClientCaps客户端能力、 Region用户所属地区。  Definition ContextData includes the following data: NickName nickname, Age age, ClientType client type, Client Version client version number, ClientCaps client capability, Region user region.
基于上面的设计, SIP PROXY会将从用户保存的会话中将信息提取出来, 并发送到的应用的对应 应用进程上, 这样应用进程会从请求信息中拿到 UserContext并分发到实际的应用上, 这样应用就能实 际的拿到 UserContext并进行资源访问等处理。  Based on the above design, SIP PROXY will extract the information from the session saved by the user and send it to the corresponding application process of the application, so that the application process will get the UserContext from the request information and distribute it to the actual application. In this way, the application can actually get the UserContext and perform resource access and other processing.
二、 应用的部署、 运维和路由  Second, application deployment, operation and maintenance and routing
在图 2所示的应用服务平台系统中,服务器集群中的多个应用服务器被分为多个不同的组,每组包 括一台到多台服务器。 中心服务器在接收到外部上传的应用时,根据外部指令将该应用部署到单个应用 服务器上, 或者部署到属于同一组的多个服务器上。 这样, 一个应用可以选择性地负栽在某个组当中, 也就是可以将核心的应用单独使用一组服务器,保证核心应用的资源使用及稳定性; 而对刚上线的不稳 定的应用使用一组单独的服务器, 以剥离其中的影响, 降低整个系统的风险。 这种做法有利于进行整体 资源的分配及网络策略的调整。  In the application service platform system shown in FIG. 2, a plurality of application servers in a server cluster are divided into a plurality of different groups, each group including one to more servers. When receiving the externally uploaded application, the central server deploys the application to a single application server according to external instructions, or deploys to multiple servers belonging to the same group. In this way, an application can be selectively hosted in a group, that is, the core application can be used separately to ensure the resource usage and stability of the core application; and the unstable application of the online application is used. Group separate servers to strip the effects and reduce the risk of the entire system. This approach facilitates the allocation of overall resources and the adjustment of network strategies.
在本发明中,能够运行应用的应用服务器需要在全局统一配置,具体来说在中心服务上配置并保存 全局的应用服务器列表和应用服务器分组列表。  In the present invention, an application server capable of running an application needs to be configured in a global unified manner, specifically, a global application server list and an application server grouping list are configured and saved on the central service.
应用服务器列表如表 3所示:  The list of application servers is shown in Table 3:
Figure imgf000011_0001
Figure imgf000011_0001
表 3  table 3
由表 3可见, 应用服务器列表包括如下信息: 应用服务器名称、 应用服务器所属的分组名称、 应用 服务器地址。  As can be seen from Table 3, the application server list includes the following information: application server name, group name to which the application server belongs, and application server address.
应用服务器分组列表如表 4所示: 字段名称 字段类型 主键 描述 The application server grouping list is shown in Table 4: Field Name Field Type Primary Key Description
GroupName varchar Y 应用 务器分组名称  GroupName varchar Y application group name
GroupDesc Varchar 应用服务器描述信息  GroupDesc Varchar Application Server Description
表 4  Table 4
由表 4可见, 应用服务器分组列表包括: 应用服务器分组名称、 分组中的应用服务器描述信息。 在实际应用中, 多台应用服务器可以被分为不同的组, 用于运行不同的应用服务, 应用服务器分组 的好处如下: 1.将核心应用专门指定应用服务器组, 可以保证核心应用的资源使用及稳定性; 2.给一些 新增的不稳定的应用指定单独的应用服务器组, 可以降低整个系统的风险; 3.有利于进行整体资源的分 配及网络策略的调整。  As can be seen from Table 4, the application server grouping list includes: an application server group name, and application server description information in the group. In practical applications, multiple application servers can be divided into different groups for running different application services. The benefits of application server grouping are as follows: 1. Specify the application server group for the core application to ensure the resource usage of the core application. And stability; 2. Specifying a separate application server group for some new unstable applications can reduce the risk of the entire system; 3. Conducive to the overall resource allocation and network policy adjustment.
图 4是本发明实施例中的单个应用服务器的内部结构以及与外部的连接示意图。其中, 中心服务器 将应用部署到应用服务器集群中的应用服务器上包括:  4 is a schematic diagram showing the internal structure of a single application server and the connection with the outside in the embodiment of the present invention. The central server deploys the application to the application server in the application server cluster, including:
在每个应用服务器上部署一个守护进程;在中心服务器上保存应用进程列表;该应用进程列表包括: 应用进程标识、 动态端口标记、 应用服务器名称、 应用服务器分组名称、 部署包接口和服务端口; 中心服务器根据应用服务器列表、应用服务器分组列表和应用进程列表中的信息,确定每个应用服 务器上应启动的应用进程部署信息列表;该应用进程部署信息列表包括:应用进程标识、动态端口标记、 部署包接口和服务端口;  A daemon is deployed on each application server; a list of application processes is saved on the central server; the application process list includes: an application process identifier, a dynamic port tag, an application server name, an application server group name, a deployment package interface, and a service port; The central server determines, according to the information in the application server list, the application server grouping list, and the application process list, a list of application process deployment information that should be started on each application server; the application process deployment information list includes: an application process identifier, a dynamic port identifier, Deploy the package interface and service port;
每个应用服务器上的守护进程启动后,与中心服务器建立连接并保持心跳,从中心服务器获取本应 用服务器的应用进程部署信息列表, 根据该应用进程部署信息列表下栽并启动本应用服务器的应用进 程;  After the daemon of each application server is started, a connection is established with the central server and the heartbeat is maintained. The application process deployment information list of the application server is obtained from the central server, and the application server of the application server is downloaded and started according to the application process deployment information list. Process
每个启动的应用进程都与中心服务器建立连接并保持心跳;  Each launched application process establishes a connection with the central server and maintains a heartbeat;
中心服务器为每个建立连接的守护进程在守护进程状态信息列表中记录其连接信息,以及为每个建 立连接的应用进程在应用运行信息列表中保存记录其连接信息。  The central server records its connection information in the daemon status information list for each daemon that establishes the connection, and saves the connection information in the application operation information list for each application process that establishes the connection.
如图 4所示, 守护进程(Master )是部署在每台应用服务器上的后台监控进程, 负责进行应用服务 的下栽运行与部署。 每个应用服务器上部署一个守护进程, 守护进程会与中心服务器建立一个长连接, 通过这个长连接接受部署、 更新、监控等系统指令。 在一个应用服务器中几个应用服务可以运行在一个 应用进程(Worker ) 中, 该应用进程也可以称为服务外壳。 一个应用服务器上可以有多个应用进程。  As shown in Figure 4, the daemon (Master) is a background monitoring process deployed on each application server, responsible for the running and deployment of application services. A daemon is deployed on each application server. The daemon establishes a long connection with the central server, and through this long connection, it accepts system instructions such as deployment, update, and monitoring. In an application server, several application services can run in an application process (Worker), which can also be called a service shell. There can be multiple application processes on an application server.
应用的部署  Application deployment
在本发明中,开发完成的应用会部署到服务器集群中的应用服务器上运行,并将代理服务器针对此 应用的路由定制到负栽该应用的应用服务器上。  In the present invention, the developed application is deployed to an application server in the server cluster, and the proxy server's routing for the application is customized to the application server hosting the application.
开发人员将开发完成的应用的代码进行编译, 生成用于部署的 JAVA应用发布(jar包), 也称为部 署包。在本发明的一个实施例中,一种可能的 jar包的分布如下: Framework.jar, BizLibrary.jar, Appl.jar, App2.jar。 其中 Appl , App2的 jar包中包括实际能运行的 AppBean, 而在 Framework及 BizLibrary中 存 ^ BaseAppBeanType, 并且在 jar包的资源文件中有存在 META-INF/appbean.properties配置。 以上的 jar包会打为一个 tar.gz包, 作为部署的发布包。  The developer compiles the code of the developed application to generate a JAVA application release (jar package) for deployment, also known as a deployment package. In one embodiment of the invention, a possible jar package is distributed as follows: Framework.jar, BizLibrary.jar, Appl.jar, App2.jar. The Appl and App2 jar packages include the actual AppBeans that can be run, and the BaseAppBeanType is stored in the Framework and BizLibrary, and the META-INF/appbean.properties configuration exists in the resource files of the jar package. The above jar package will be labeled as a tar.gz package, as a deployment release package.
运维人员使用加栽工具, 一般为 AppLoader, AppLoader会通过 java的反射机制提取所有开发者实 现的 AppBean, 提取步骤如下:  The operation and maintenance personnel use the processing tool, which is generally AppLoader. AppApper will extract all the AppBeans implemented by the developer through the java reflection mechanism. The extraction steps are as follows:
1.遍历压缩包中的所有的 jar包;  1. Traverse all the jar packages in the compressed package;
2.通过寻找资源文件中的配置, 跳过非应用 jar包;  2. Skip the non-application jar package by looking for the configuration in the resource file;
3.遍历应用 jar包中的所有 class;  3. Traverse all the classes in the application jar package;
4.跳过未实现 AppBean接口的类;  4. Skip the class that does not implement the AppBean interface;
5.跳过 abstract class递归遍历 class的基类, 当基类上能够找到 annotation: ©AppBeanBaseType时; 通过上 P£步骤 斤得到的 P据 存 应用组件列表和应用包列表中。 ' '' 在本发明的实施例中应用组件列表和应用包列表分别如表 5和表 6所示, 5. Skip abstract class recursive traversal class of the base class, the base class can be found when the annotation: When © AppBeanBaseType; kg by the step P £ P obtained according to the list of components and applications stored application package list. ''' In the embodiment of the present invention, the application component list and the application package list are respectively shown in Table 5 and Table 6,
Figure imgf000012_0001
ArgsTyp e Text 输入参数类 ¾
Figure imgf000012_0001
ArgsTyp e Text input parameter class 3⁄4
ResultTyp e Text 输出参数类 ¾  ResultTyp e Text output parameter class 3⁄4
Dep endencies B oolean 是否与其他的应用存在依赖关系 Dep endencies B oolean Whether there is a dependency on other applications
Packageld Int 包标识 (包 ID ) Packageld Int package identifier (package ID)
表 5  table 5
Figure imgf000013_0001
Figure imgf000013_0001
表 6  Table 6
根据应用组件列表和应用包列表中的信息生成应用配置信息列表。 应用配置信息列表(又称为 Application表 )如表 7所示:  A list of application configuration information is generated based on the information in the application component list and the application package list. The application configuration information list (also known as the Application table) is shown in Table 7:
Figure imgf000013_0002
Figure imgf000013_0002
表 7  Table 7
在表 3中, 关于 Annotations字段: AppLoader会通过分析 Java应用类与应用类包含的元数据标注, 并提取出每个 AppBean的类型信息与元数据标注信息, 并通过 JSON(JavaScript Object Notation)格式的 字符串保存在 Application表的 Annotations字段, 具体格式如下:  In Table 3, about the Annotations field: AppLoader analyzes the metadata annotations contained in the Java application classes and application classes, and extracts the type information and metadata annotation information of each AppBean, and uses JSON (JavaScript Object Notation) format. The string is saved in the Annotations field of the Application table. The specific format is as follows:
Annotations字段包含 classlnfo子字段与 classAnnotations子字段;  The Annotations field contains a classlnfo subfield and a classAnnotations subfield;
classlnfo字段中包含,当前类型,基础类型,及基 ftH类型的泛型参数;  The classlnfo field contains the current type, the base type, and the generic parameters of the base ftH type;
classAnnotations 字段包含该 AppBean 包含的每一个元数据标注, 元数据标注的每个参数, 通 过" key", "value"方式存储。  The classAnnotations field contains each metadata tag contained in the AppBean. Each parameter of the metadata tag is stored by "key", "value".
表 3中, 除了 WorkerPackage (应用服务部署包名称)、 ServerGroup (应用服务器组)及 Enabled (是否启用)字段, 其余的字段的数据均由加栽工具自动写入中心服务器中的应用配置信息列表中。 这 避免了人工写入的麻烦及错误风险。  In Table 3, in addition to the WorkerPackage (Application Service Deployment Package Name), ServerGroup (Application Server Group), and Enabled (Enable) fields, the data of the remaining fields are automatically written into the application configuration information list in the central server by the tooling tool. . This avoids the hassle of manual writing and the risk of errors.
运维人员选择应用服务部署包名称、 应用服务器组以及是否启用的选项, 更新 Application表。 在本发明中,运行应用的应用进程也在全局统一配置,具体来说在中心服务上配置并保存应用进程 列表, 又称 worker表, 如表 8所示:  The operation and maintenance personnel select the application service deployment package name, the application server group, and whether the option is enabled, and update the Application table. In the present invention, the application process running the application is also uniformly configured globally, specifically, the application process list is also configured and saved on the central service, also referred to as the worker table, as shown in Table 8:
Figure imgf000013_0003
服务端口; 需要的服务协议名, 分号分隔
Figure imgf000013_0003
Service port; required service agreement name, semicolon separated
ServicePor s Varchar  ServicePor s Varchar
http,rpc:,  Http,rpc:,
表 8  Table 8
由中心服务器根据应用服务器列表(表 3 )、 应用服务器分组列表(表 4 )和应用进程列表(表 8 ) 中的信息, 确定每个应用服务器上应启动的应用进程部署信息列表, 具体规则如下:  The central server determines the application process deployment information list to be started on each application server according to the information in the application server list (Table 3), the application server grouping list (Table 4), and the application process list (Table 8), and the specific rules are as follows: :
1.获取当前应用服务器的名称, 以及其应用服务器分组名称;  1. Get the name of the current application server and its application server group name;
2.在应用进程列表(表 8 ) 中, 如果其应用服务器分组名称字段不为空, 则在应用进程列表中寻找 应用服务器分组名称字段包含当前应用服务器的应用服务器分组名称的记录;  2. In the application process list (Table 8), if its application server group name field is not empty, look in the application process list for the application server group name field containing the record of the application server group name of the current application server;
3. 在应用进程列表(表 8 )中, 如果其应用服务器名称字段不为空, 则在应用进程列表中寻找应用 服务器名称字段包含当前应用服务器名称的记录;  3. In the application process list (Table 8), if its application server name field is not empty, look in the application process list for the application server name field containing the current application server name record;
4.将 2、 3步骤中的记录组合起来得到当前服务器上应该启动的应用进程的部署信息列表。  4. Combine the records in steps 2 and 3 to get a list of deployment information for the application process that should be started on the current server.
应用进程部署信息列表的每项包含如下信息: 应用进程标识 (WorkerID )、 动态端口标记 ( IsDynamicPor ), 部署包接口 ( PackageUrl )、 服务端口 ( ServicePorts )。  Each item of the application process deployment information list contains the following information: Application Process ID (WorkerID), Dynamic Port Tag (IsDynamicPor), Deployment Package Interface (PackageUrl), Service Port (ServicePorts).
每个应用服务器上的守护进程启动后,与中心服务器建立连接并保持心跳,从中心服务器获取 本应用服务器的应用进程部署信息列表 ,根据该应用进程部署信息列表下栽并启动本应用服务器的应用 进程;每个启动的应用进程都与中心服务器建立连接并保持心跳; 中心服务器为每个建立连接的守护进 程在守护进程状态信息列表中记录其连接信息,及为每个建立连接的应用进程在应用运行信息列表中保 存记录其连接信息。  After the daemon of each application server is started, a connection is established with the central server and the heartbeat is maintained. The application server deployment information list of the application server is obtained from the central server, and the application server is downloaded and started according to the application process deployment information list. Process; each launched application process establishes a connection with the central server and maintains a heartbeat; the central server records its connection information in the daemon status information list for each daemon that establishes the connection, and for each application process that establishes the connection The connection information is saved in the application running information list.
守护进程 ( M aster ) 的启动和注册  Launch and registration of the daemon (M aster )
一个守护进程 Master负责管理本应用服务器上的所有应用进程 Worker, Master的启动注册步骤如 下:  A daemon Master is responsible for managing all application processes on this application server. The startup registration steps of the Master are as follows:
1.启动 Master;  1. Start the Master;
2. Master建立与中心服务器的 TCP长连接, 并监听来自中心服务器的命令;  2. The Master establishes a TCP long connection with the central server and listens for commands from the central server;
3.不断与中心服务器保持心跳, 上传应用服务器的运行状态;  3. Keep heartbeat with the central server and upload the running status of the application server;
4.通过 TCP长连接从中心服务器获取本应用服务器的应用进程部署信息列表, 启动相应的应用进 程。  4. Obtain the application process deployment information list of the application server from the central server through the TCP long connection, and start the corresponding application process.
Master获取应用进程部署信息列表后, 启动应用进程的过程如下:  After the Master obtains the application process deployment information list, the process of starting the application process is as follows:
1.通过应用进程部署信息列表中的 PackageUrl下栽应用进程运行包;  1. Download the application process running package through the PackageUrl in the application process deployment information list;
2.创建目录名为 Workerld+PackageN ame, 将下栽的应用进程运行包解压缩到 Workerld中; 2. Create a directory named Workerld+PackageN ame, and extract the downloaded application process package to Workerld;
3.从本地端口池中选择能用的端口选择能用的端口, 从目录中的 Workerld 中启动应用进程, 将端 口池中的端口传给应用进程。 3. Select the available ports from the local port pool and select the available ports. Start the application process from the workerld in the directory and transfer the ports in the port pool to the application process.
中心服务器会为每个连接上的 Master在数据库中的守护进程状态信息列表中保存一条记录其连接 信息的条目, 该记录的条目如表 9所示:  The central server maintains an entry for the master on each connection in the list of daemon status information in the database to record its connection information. The entries for this record are shown in Table 9:
字^ g称 字段类 ¾ 主键 字段说明及描述  Word ^ g called field class 3⁄4 primary key field description and description
ComputerName Varchar Y 主机名称  ComputerName Varchar Y host name
C ornp uterAddre ΞΞ Varchar 主机地址  C ornp uterAddre ΞΞ Varchar host address
CenterUrl Varchar Center地址  CenterUrl Varchar Center Address
HostVersian Varchar Host版本  HostVersian Varchar Host version
Re isterTirne D atetime ;主册时间  Re isterTirne D atetime ;
Last eepTime D atetime 上次心 时间  Last eepTime DateTime Last Heart Time
HostStartTime D atetime Host启动时间  HostStartTime Datetime Host startup time
Last equestTime D atetime 最后^求时间  Last equestTime Datetime Last request time
MachineCpu Float 主机 C J利用率  MachineCpu Float host C J utilization
UsedMem Bigint 使用内存  UsedMem Bigint uses memory
FreeMern Bigint 空 ¾内存  FreeMern Bigint empty 3⁄4 memory
Buffers Bigint 使用 Buffer  Buffers Bigint uses Buffer
Cached Bigint 使用 Cached  Cached Bigint uses Cached
UsedSwap Bigint 使用交换内存  UsedSwap Bigint uses swap memory
FreeSwap Bigint 未使用交換内存 Status Varchar 状悉 FreeSwap Bigint does not use swap memory Status Varchar
StatusEx Nvarchar 状态信息  StatusEx Nvarchar status information
表 9  Table 9
M aster的端口池管理  Porter pool management
Master的端口池管理流程如下:  The master port pool management process is as follows:
1. Master 启动后, 从中心服务器上的应用服务器列表获取本应用服务器的端口池范围, 如 "8001-8099";  1. After the Master starts, obtain the port pool range of the application server from the application server list on the central server, such as "8001-8099";
2. Master会测试该端口池范围中的尚未开启监听的端口号, 将其标记为可用;  2. The Master will test the port number in the port pool range that has not been turned on, and mark it as available;
3.当启动一个 Worker时, 如果其对应的应用进程部署信息列表项中的动态端口标记为动态端口, 则 Master根据对应的应用进程部署信息列表项中的服务端口获知该 Worker所需的端口号数量, 否则不 做处理。 如" http;rpc"表示应用需要 http与 rpc两个端口;  3. When a worker is started, if the dynamic port in the corresponding application process deployment information list is marked as a dynamic port, the master knows the port number required by the worker according to the service port in the corresponding application process deployment information list item. Quantity, otherwise it will not be processed. For example, "http;rpc" means that the application needs two ports, http and rpc;
4.从本应用服务器的端口池范围中取出相应数量的端口号分配给该 Worker,并将所分配的端口号标 记为已占用; 如采用如下格式传输: http = 8001 ; rpc = 8002;  4. Take the corresponding number of port numbers from the port pool range of the application server and assign it to the worker, and mark the assigned port number as occupied; if it is transmitted in the following format: http = 8001; rpc = 8002;
5.当 Worker启动需要的端口是, 使用 Master传输过来的端口号组合, 如: 当应用监听 http端口时, 选择 8001端口, 当应用监听 rpc端口是监听 8002;  5. When the worker needs to start the port, use the port number combination transmitted by the Master, such as: When the application listens to the http port, select the port 8001, when the application listens to the rpc port is the monitor 8002;
6.当该 Worker退出时, 守护进程将该应用进程所占用的端口号返回给端口池。  6. When the worker exits, the daemon returns the port number occupied by the application process to the port pool.
应用进程 ( Wor ker ) 的启动和注册  Application process (Wor ker) startup and registration
由 Master控制的 Worker启动步骤如下:  The worker startup steps controlled by the Master are as follows:
1.接受来自于 Master的参数, 其中包含端口池的配置;  1. Accept the parameters from the Master, including the configuration of the port pool;
2.实现服务启动的逻辑, 包含配置读取, 资源初始化等;  2. Implement the logic of service startup, including configuration read, resource initialization, etc.
3.当配置为动态端口时按照端口池配置启动监听端口, 否则按照服务的配置进行监听;  3. When configured as a dynamic port, start the listening port according to the port pool configuration, otherwise it will listen according to the configuration of the service;
3.与中心服务器建立一条长连接, 并监听来自于中心服务器的命令;  3. Establish a long connection with the central server and listen for commands from the central server;
4.通过这条长连接在中心服务器中注册自己;  4. Register yourself in the central server via this long connection;
5.通过这条长连接维持与中心服务器的心跳。  5. Maintain a heartbeat with the central server through this long connection.
每个启动的 Worker都会与中心服务器建立一条长连接并保持心跳, 中心服务器会针对每一个建立 连接的 Worker在应用运行信息列表中保存如表 10所示的记录来记录其连接信息, 表 10即为应用运行 信息列表, 又称 Running Worker表:  Each launched Worker will establish a long connection with the central server and maintain the heartbeat. The central server will record the connection information in the application running information list for each connected worker in the application running information list to record the connection information. Table 10 For the application to run the information list, also known as the Running Worker table:
Figure imgf000015_0001
Figure imgf000015_0001
表 10  Table 10
在表10中,应用服务地址的格式可以为:^^= :〃192.168.1.100:8000;1« =1« :〃192.168.1.100:8080 根据前面的描述, Worker与中心服务器建立一个长连接后, 并定期发送心跳(如 15秒), 其中以 下的情况出现会导致中心服务器将可用的 Worker从应用运行信息列表中踢出: 1.连接断开; 2.超过预设 时间 (如 45秒) 未接收到心跳。  In Table 10, the format of the application service address can be: ^^= :〃192.168.1.100:8000;1« =1« :〃192.168.1.100:8080 According to the previous description, after the worker establishes a long connection with the central server And periodically send a heartbeat (such as 15 seconds), where the following situation will cause the central server to use the available Worker from the application running information list: 1. The connection is disconnected; 2. The preset time (such as 45 seconds) No heartbeat was received.
应用进程 ( Worker ) 的管理  Application process (Worker) management
除了守护进程启动的时刻自启动应用进程的设计,在守护进程运行时,也可以管理应用进程的运行。 增加一个与中心服务器连接的控制终端;控制终端向中心服务器发送启动指定应用进程的请求, 中 心服务器将该请求发送给对应的守护进程, 守护进程启动该指定应用进程, 该应用进程连接守护进程 , 守护进程将该请求发送给该应用进程,该应用进程调用服务的启动方法;控制终端向中心服务器发送停 止指定应用进程的请求, 中心服务器将该请求发送给对应的守护进程, 守护进程再将该请求发送给该指 定应用进程, 该应用进程调用服务的停止方法, 守护进程停止该应用进程。  In addition to the design of the self-starting application process at the moment the daemon starts, it can also manage the running of the application process while the daemon is running. Adding a control terminal connected to the central server; the control terminal sends a request to the central server to start the specified application process, the central server sends the request to the corresponding daemon, and the daemon starts the specified application process, and the application process connects to the daemon, The daemon sends the request to the application process, and the application process invokes a startup method of the service; the control terminal sends a request to the central server to stop the specified application process, and the central server sends the request to the corresponding daemon, and the daemon processes the request. The request is sent to the specified application process, the application process calls the stop method of the service, and the daemon stops the application process.
关于控制终端如何找到合适的中心服务器地址: 因为中心服务器会采用负栽均衡的方式进行部署, 但是 HADB是单点结构, 那么当控制终端想要操作一台中心服务器的时候, 会采用如下步骤: 1.控制 终端通过负栽地址访问中心服务器的 GetEndpoint接口; 2.控制终端在通过中心服务器返回的 Endpoint 连接到具体负责连接的那一台中心服务器上。 About how to control the terminal to find the appropriate central server address: Because the central server will be deployed in a balanced manner, but HADB is a single-point structure, when the control terminal wants to operate a central server, the following steps are taken: 1. The control terminal accesses the GetEndpoint interface of the central server through the bearer address; 2. controls the Endpoint returned by the terminal through the central server Connect to the central server that is responsible for the connection.
图 5是本发明实施例中的应用进程启动过程的流程图。 如图 5所示, 包括: 控制终端通过 Http向 中心服务器发送启动指定应用进程的请求, 中心服务器将该请求选择 TCP连接, 通过所选择的 TCP连 接发送启动指定应用进程的请求给对应的守护进程; 守护进程启动应用进程, 应用进程通过 Namepipe 连接上守护进程; 守护进程通过 Namepipe将该请求发送给应用进程, 应用进程调用服务的启动(Start ) 方法。  FIG. 5 is a flowchart of an application process startup process in an embodiment of the present invention. As shown in FIG. 5, the method includes: the control terminal sends a request for starting a specified application process to the central server through the Http, and the central server selects the TCP connection by using the selected TCP connection, and sends a request for starting the specified application process to the corresponding daemon through the selected TCP connection. The daemon starts the application process, and the application process connects to the daemon through the Namepipe; the daemon sends the request to the application process through the Namepipe, and the application process invokes the service's Start method.
图 6是本发明实施例中的应用进程停止过程的流程图。 如图 6所示, 包括: 控制终端通过 Http向 中心服务器发送停止指定应用进程的请求, 中心服务器根据请求选择 TCP连接, 通过该 TCP连接将该 请求发送给对应的守护进程将; 守护进行守护进程通过 Namepipe将该请求发送给应用进程, 应用进程 通过反射调用服务的停止(Stop )方法; 守护进程停止应用进程。  6 is a flow chart of an application process stop process in an embodiment of the present invention. As shown in FIG. 6, the method includes: the control terminal sends a request to the central server to stop the specified application process through the Http, and the central server selects a TCP connection according to the request, and sends the request to the corresponding daemon through the TCP connection; The request is sent to the application process through the Namepipe, and the application process invokes the stop (Stop) method of the service by reflection; the daemon stops the application process.
图 7是本发明实施例中的应用进程更新过程的流程图。 如图 7所示, 当用应用进程 A'更新指定应 用进程 A时, 包括: 控制终端通过 Http向中心服务器发送将 A更新为 A'的请求, 中心服务器根据请求 选择 TCP连接, 通过该 TCP连接将该请求发送给对应的守护进程; 守护进程获取新应用进程的地址, 并覆盖当前的应用进程, 以进行应用进程更新。 具体来说, 先停止应用进程 A, 然后从中心服务器下栽 A,并用 A,覆盖 A, 启动新的应用进程 A,。  FIG. 7 is a flowchart of an application process update process in an embodiment of the present invention. As shown in FIG. 7, when the specified application process A is updated by the application process A', the control terminal sends a request for updating A to A' to the central server through the Http, and the central server selects a TCP connection according to the request, and connects through the TCP connection. The request is sent to the corresponding daemon; the daemon obtains the address of the new application process and overwrites the current application process for application process update. Specifically, stop application process A first, then download A from the central server, and overwrite A with A, and start a new application process A.
图 8是本发明实施例中的应用进程热更新的流程图。 如图 8所示, 当用应用进程 A'更新指定应用 进程 A时, 包括: 控制终端将 A'的部署包上传到中心服务器, 向中心服务器发送用 A'更新的请求, 中 心服务器将该请求发送给对应的守护进程, 守护进程从中心服务器下栽 A'的部署包, 并启动应用进程 Α' , 该应用进程 Α,启动后向中心服务器进行注册; 然后, 控制终端向中心服务器发送更新 A的请求, 中心服务器将该请求发送给对应的守护进程, 守护进程再将该请求发给应用进程 A, 应用进程 A删除 自身在中心服务器上的注册信息, 该应用进程 A停止。  FIG. 8 is a flowchart of a hot update of an application process in an embodiment of the present invention. As shown in FIG. 8, when the specified application process A is updated by the application process A', the control terminal uploads the deployment package of A' to the central server, and sends a request updated by A' to the central server, and the central server requests the request. Sent to the corresponding daemon, the daemon downloads the A' deployment package from the central server, and starts the application processΑ, the application process is started, and then registers with the central server after startup; then, the control terminal sends an update A to the central server. The request, the central server sends the request to the corresponding daemon, and the daemon sends the request to the application process A, and the application process A deletes its own registration information on the central server, and the application process A stops.
图 8所示的热更新相对于图 7所示的更新, 可以不用停止应用进程的业务。  The hot update shown in Fig. 8 can be used without stopping the business of the application process with respect to the update shown in Fig. 7.
上述方案实现了应用进程运行状态的监控,可以方便地查看应用进程的运行状况, 大大简化了运维 部署成本, 实现了快速部署。 并且应用进程的监控和实际应用进程进行隔离, 有效提高了应用进程运行 的安全性。  The above solution implements the monitoring of the running state of the application process, and can conveniently view the running status of the application process, which greatly simplifies the operation and maintenance deployment cost and realizes rapid deployment. The monitoring of the application process is isolated from the actual application process, which effectively improves the security of the application process.
当应用进程启动后,我们的核心需求为通过一个应用进程名称找到该应用进程启动的应用服务器地 址。 在本步骤中通过如下方式实现: 客户端与中心服务器建立连接, 向中心服务器提供自己要访问的应 用进程标识信息; 中心服务器读取应用进程列表和应用运行信息列表,将符合客户端所提供的应用进程 标识信息的记录返回给客户端; 客户端解析所接收内容, 从中选择一个记录进行路由。 此外, 当应用进 程列表或应用运行信息列表发生变化时, 中心服务器通知客户端,客户端重新从中心服务器获取符合自 己要访问的应用进程标识信息的记录。 具体描述如下:  When the application process starts, our core requirement is to find the application server address that is started by the application process through an application process name. In this step, the client is connected to the central server to provide the central server with the application process identification information to be accessed; the central server reads the application process list and the application running information list, which is consistent with the client's provided information. The record of the application process identification information is returned to the client; the client parses the received content, and selects a record for routing. In addition, when the application process list or the application operation information list changes, the central server notifies the client that the client re-acquires records from the central server that match the application process identification information that it is to access. The specific description is as follows:
1.客户端访问中心服务器, 与中心服务器建立一条 TCP长连接, 并监听中心服务器的命令; 1. The client accesses the central server, establishes a TCP long connection with the central server, and listens to the commands of the central server;
2.客户端通过 TCP长连接访问中心服务器, 提供自己想要访问的应用进程名称; 2. The client accesses the central server through a TCP long connection, providing the name of the application process that he wants to access;
3.中心服务器读取应用进程列表, 以及应用运行信息列表, 并将应用进程名称符合的记录返回给客 户端, 并且在内存中记录下本连接的信息, 注册回调;  3. The central server reads the application process list, and the application running information list, and returns the record of the application process name to the client, and records the information of the connection in the memory, and registers the callback;
4.客户端解析记录, 按照如下规则获取应用进程名称所对应的地址;  4. The client parses the record, and obtains the address corresponding to the application process name according to the following rules;
a)拿到应用进程名称符合的记录;  a) get the record of the application process name;
b)拿到应用进程列表符合的记录, 拆解 ServiceUrls中符合的记录;  b) Get the records that match the list of application processes, and disassemble the records in the ServiceUrls;
如: http=http:〃192.168.1. 100: 8800;rpc=tcp:〃192.168.1.100: 8801 从中获取到 rpc的地址;  Such as: http=http:〃192.168.1. 100: 8800;rpc=tcp:〃192.168.1.100: 8801 Get the address of rpc from it;
c)从一系列符合的记录中按照访问规则返回给调用方, 比如:  c) Return to the caller from a series of matching records according to the access rules, such as:
i. 随机访问会从固定地址中随机选取一个;  i. Random access will randomly select one from a fixed address;
ii .如果是一致性 hash会按照一致性 hash算法选择取;  Ii. If the consistency hash is selected according to the consistency hash algorithm;
5.当以下变化触发时, 所有的中心服务器都会受到通知;  5. All central servers will be notified when the following changes are triggered;
a)当应用进程列表变化时;  a) when the application process list changes;
b)当应用运行信息列表变化时;  b) when the application operation information list changes;
6.由于客户端保持了与中心服务器的长连接并监听了来自于中心服务器的命令, 负责此客户端的中 心服务器收到变化通知时, 会将变化信息发送到客户端;  6. Since the client maintains a long connection with the central server and listens for commands from the central server, the central server responsible for the client receives the change notification, and sends the change information to the client;
7.客户端接收到变化后, 会重新重复步骤 3, 重新获取并建立路由表。  7. After the client receives the change, it will repeat step 3 again to re-acquire and establish the routing table.
在本发明中, 应用 (App Bean )的热更新过程如下: 中心服务器遍历所有受影响的应用服务器, 向 对应的应用服务器的守护进程发送更新指令; 守护进程下栽新的应用包, 启动一个新应用进程,监听新 的端口; 该新应用进程与中心服务器建立连接, 中心服务器为该新应用进程保存一条记录(具体是更新 应用配置信息列表中的应用进程名称), 并将该变化同步到所有监听的客户端。 此时, 请求开始路由到 新的应用进程, 老的应用进程不再接收到应用请求一段时间后, 退出。 In the present invention, the hot update process of the application (App Bean) is as follows: The central server traverses all affected application servers, sends update instructions to the corresponding application server daemon; the daemon processes a new application package, starts a new The application process listens to the new port; the new application process establishes a connection with the central server, the central server saves a record for the new application process (specifically, updates the application process name in the application configuration information list), and synchronizes the change to all The client that is listening. At this point, the request starts routing to The new application process, the old application process no longer receives the application request after a period of time, exit.
应用的路由  Applied routing
则在图 2所示的系统中, 代理服务器(proxy )需要调用某个应用, 或者一个应用需要调用另一个 应用时, 正是通过应用配置信息列表 ( Application表, 表 7 )和应用运行信息列表( Running Worker表, 表 10 )进行路由的。  In the system shown in Figure 2, the proxy server (proxy) needs to call an application, or an application needs to call another application, it is through the application configuration information list (Application table, Table 7) and the application operation information list. (Running Worker table, Table 10) is routed.
基本的路由策略如下:  The basic routing strategy is as follows:
1.通过请求中的参数, 在所有该类请求对应的应用配置信息列表中, 寻找对应应用的应用元数据标 注(这一步根据不同类型的 AppBean有不同的执行方法);  1. Searching for the application metadata of the corresponding application in the list of application configuration information corresponding to the request through the parameters in the request (this step has different execution methods according to different types of AppBeans);
2.通过应用配置信息列表中元数据标注找到对应的应用进程名称;  2. Find the corresponding application process name by using the metadata annotation in the application configuration information list;
3.通过应用进程名称在应用运行信息列表中,找到与应用进行名称相等的一个或多个应用服务器地 址;  3. In the application running information list by using the application process name, find one or more application server addresses with the same name as the application;
4.通过应用配置信息列表中的元数据标注判断此应用进程名称是随机负栽还是一致性 Hash负栽 4. Determine whether the application process name is random or consistent by the metadata annotation in the application configuration information list.
5.通过随机负栽算法或者一致性 Hash算法,找到确切的目标应用服务器地址; 5. Find the exact target application server address through a random bearer algorithm or a consistent hash algorithm;
6.调用到目标应用服务器, 并将应用配置信息列表项中的应用名称(App Name ) 附加在请求上, 这使得目标应用服务器上的守护进程可以根据该应用分类名称直接定位对应的应用,而不再需要再重复 步骤 1和 2的过程了。  6. Calling to the target application server, and appending the application name (App Name ) in the application configuration information list item to the request, so that the daemon on the target application server can directly locate the corresponding application according to the application classification name, and It is no longer necessary to repeat the steps 1 and 2 again.
例如, 在本发明的一个实施例中, 查找一个 Http应用的地址的流程如下:  For example, in one embodiment of the invention, the process of finding the address of an Http application is as follows:
1.代理服务器接收到客户端或浏览器发出的 Http请求;  1. The proxy server receives an Http request from the client or browser;
2.代理服务器访问中心服务器, 从 Application 的 Annotations字段(应用元数据标注字段 ) 中, 找到 @HttpPrefix (一种元数据标注信息 )与 Http请求中请求 URL相符的一条记录;  2. The proxy server accesses the central server. From the Annotations field of the application (application metadata annotation field), find a record that @HttpPrefix (a type of metadata annotation information) matches the request URL in the Http request;
具体 ^说, 枚举所有 Application表中的记 ,找到 Annotations中的 @HttpPrefix元数据标注, 并判 断请求的 URL是否与 HttpPrefix的值为起始;  Specifically, say, enumerate all the records in the Application table, find the @HttpPrefix metadata annotation in Annotations, and determine whether the requested URL starts with the value of HttpPrefix;
3.代理服务器根据步骤 2中所确定的一条记录中的 Annotations字段(应用服务元数据标注字段) 的信息生成 AppContext;  3. The proxy server generates an AppContext according to the information of the Annotations field (application service metadata label field) in a record determined in step 2;
具体来说, 找到 Annotations字段的 @ContextLoader信息, 找到符合 ContextLoader取值的赋值函 数,从 Http请求报文的 Cookie字段中提取信息作为函数的输入, 运行函数,得到 AppContext;  Specifically, find the @ContextLoader information of the Annotations field, find the assignment function that matches the value of the ContextLoader, extract the information from the cookie field of the Http request message as the input of the function, and run the function to get the AppContext;
4.代理服务器根据步骤 2中所确定的一条记录中的 WorkerName字段(应用进程名段), 从 Running Worker表的中找出 WorkerName字段(运行的应用进程名称)与之相符的记录; 可以有多条记录与之 相符。  4. The proxy server finds the record corresponding to the WorkerName field (the running application process name) from the Running Worker table according to the WorkerName field (application process name segment) in a record determined in step 2; The record is consistent with it.
5.代理服务器根据步骤 2中所确定的一条记录中的 Annotations字段中的 @Stateful配置进行如下选 择:  5. The proxy server makes the following selection according to the @Stateful configuration in the Annotations field in a record determined in step 2:
如果为 'true' , 则使用一致性哈希的方式从多条 Running Worker中通过 AppContext信息选出一条记 录; 这里, 一致性哈希是通过 AppContext的 Uri字符串计算哈希值, 选择哈希值所对应的一条记录; 具体的哈希算法可采用 KETAMA算法;  If it is 'true', a consistent hash is used to select a record from multiple Running Workers through the AppContext information; here, the consistency hash is calculated by the Uri string of the AppContext, and the hash value is selected. Corresponding one record; the specific hash algorithm can adopt the KETAMA algorithm;
如果为 'false' , 则随机选出一条 RuningWorker记录;  If it is 'false', randomly select a RuningWorker record;
6.提取所选出的 RuningWorker记录中的 ServiceURLs字段(应用服务地址字段) 中的地址信息, 根据给地址信息实现应用的调用。  6. Extract the address information in the ServiceURLs field (application service address field) in the selected RuningWorker record, and implement the application call according to the address information.
在上面的例子中, 代理服务器接收到的是针对 HttpAppBean的请求, 因此根据该请求中的 URL找 Application表中的对应的 HttpPrefix, 以找到对应的应用服务。  In the above example, the proxy server receives the request for the HttpAppBean, so find the corresponding HttpPrefix in the Application table according to the URL in the request to find the corresponding application service.
而 RemoteAppBean 会基于 @AppName 进行路由。 例如, 如果代理服务器接收到的是与 RemoteAppBean对应的 Rpc请求, 则:£接根据该 Rpc请求中的远程调用服务名称( RemoteAppName ) 查找应用服务名称(AppName )字段与其一致 Application表, 该 Application表即为部署该 Rpc请求对 应的 RemoteAppBean时所生成的表, 然后执行与上述 3-6相同的步骤。  The RemoteAppBean will route based on @AppName. For example, if the proxy server receives the Rpc request corresponding to the RemoteAppBean, then: according to the remote call service name (RemoAppName) in the Rpc request, find the application service name (AppName) field and its consistent Application table, the Application table is To deploy the table generated when the Rpc requests the corresponding RemoteAppBean, then perform the same steps as 3-6 above.
应用的灰度发布  Applied grayscale release
灰度发布,就是应用按用户范围或启发方式分部开放给所有用户的过程,灰度发布可以降低应用更 新造成的风险。  Grayscale publishing is a process in which applications are opened to all users in a user-wide or heuristic manner. Grayscale publishing can reduce the risk of application updates.
前面提到应用配置信息列表中包含灰度发布因子 (GrayFactor )。 在本发明中。 对于没有采用灰度 发布的应用, 其对应的应用配置信息列表项中灰度发布因子为空; 而对于采用灰度发布的应用, 其应用 配置信息列表项中配置有灰度发布因子。  The grayscale publishing factor (GrayFactor) is included in the list of application configuration information mentioned earlier. In the present invention. For applications that do not use grayscale publishing, the grayscale publishing factor in the corresponding application configuration information list item is empty; and for applications that use grayscale publishing, the grayscale publishing factor is configured in the application configuration information list item.
在本发明中, 灰度发布因子是条件表达式, 按照如下格式定义:  In the present invention, the grayscale publishing factor is a conditional expression, which is defined in the following format:
field. condition  Field. condition
其中: field和 condition以.分隔开, field.condition间可以做逻辑运算, 例如:  Where: field and condition are separated by ., field.condition can be logically operated, for example:
fieldl.conditionl and lor f ield2. condition2 field表示取值点, condition表示取值条件, 当满足此取值条件时使用此灰度发布的应用。 Fieldl.conditionl and lor f ield2. condition2 Field indicates the value point, condition indicates the value condition, and the application published by this gray level is used when this value condition is met.
在图 2所示的系统中,代理服务器接收到客户端请求消息后,通过查询中心服务器上的应用配置信 息列表识别所述客户端请求消息所对应的应用时, 如果找到多个应用, 则按如下方式选择;  In the system shown in FIG. 2, after receiving the client request message, the proxy server identifies the application corresponding to the client request message by querying the application configuration information list on the central server, and if multiple applications are found, press Choose as follows;
代理服务器先在灰度发布因子不为空的应用中对其灰度发布因子进行匹配,如果匹配命中则选择所 命中的应用, 如果没有匹配命中则选择灰度发布因子为空的应用 (即默认应用)。  The proxy server first matches its grayscale publishing factor in an application whose grayscale publishing factor is not empty. If the matching hits, the selected application is selected. If there is no matching hit, the application whose grayscale publishing factor is empty is selected (ie, the default is application).
在本发明的一个实施例中, 基于 AppContext进行灰度发布, 即 field取值点为预定义在 AppContext 中的条件, 通过 AppContext.getNamedValue("fieldr)取得。  In one embodiment of the present invention, the grayscale is published based on the AppContext, that is, the field value is a condition pre-defined in the AppContext, which is obtained by AppContext.getNamedValue("fieldr).
在前面的章节中提到了 AppContext 存在一个 getNamed Value ()方法的扩展, 在灰度发布中 getNamedValuedO会作为灰度发布的 field参数进行计算。  In the previous section, there was an extension to the AppContext with a getNamed Value () method. In grayscale publishing, getNamedValuedO is evaluated as the field parameter for grayscale publishing.
则所述的代理服务器先在灰度发布因子不为空的应用中对其灰度发布因子进行匹配包括:代理服务 器对客户端请求消息进行解析,确定中心服务器上的应用配置信息列表中的对应列表项,根据该对应列 表项中的信息创建应用上下文,根据所创建的应用上下文中的灰度发布因子匹配条件信息匹配灰度发布 因子, 如果符合灰度发布因子所表达的条件, 则命中。 例如当灰度发布因子为: 客户端版本号 = V2.0, 则根据应用上下文中的客户端版本号信息进行匹配, 看其是否为 V2.0, 是则命中。  Then, the proxy server first matches the grayscale publishing factor in the application that the grayscale publishing factor is not empty, including: the proxy server parses the client request message, and determines the correspondence in the application configuration information list on the central server. a list item, creating an application context according to the information in the corresponding list item, matching the grayscale publishing factor according to the grayscale publishing factor matching condition information in the created application context, and hitting if the condition expressed by the grayscale publishing factor is met. For example, when the grayscale publishing factor is: client version number = V2.0, the matching is based on the client version number information in the application context to see if it is V2.0, and then it is hit.
例如在前述章节中的 UserContext扩展例子中, NamedValued定义如下:  For example, in the UserContext extension example in the previous section, NamedValued is defined as follows:
灰度发布可用字段包括: 用户所属区域(user_region )、 用户客户端类型 ( client_type )、 用户端 ip 地址所属区域 ( client—region )和客户端版本号 ( client—version )。  The available fields for grayscale publishing include: user-owned area (user_region), user client type (client_type), client-side ip address-associated area (client-region), and client version number (client-version).
那么在 SIP Proxy中实现的带灰度发布的应用路由步骤如下:  Then the application routing steps with grayscale publishing implemented in the SIP Proxy are as follows:
1.接收到请求后, 获取用户的会话信息, 创建 UserContext;  1. After receiving the request, obtain the session information of the user, and create a UserContext;
2.通过请求的参数, 在所有该类请求对应的应用配置信息列表中, 寻找对应应用的应用配置信息列 表项及对应的元数据标注(这一步根据不同类型的 AppBean有不同的执行方法);  2. Through the requested parameters, in the application configuration information list corresponding to all the types of requests, search for the application configuration information list item corresponding to the application and the corresponding metadata annotation (this step has different execution methods according to different types of AppBeans);
3.在灰度发布的场合, 步骤 2可能寻找到多个应用配置信息列表项(一个应用对应一个应用配置信 息列表行), 其中灰度发布因子 GrayFactors为空的只允许有 1个, 其他 GrayFactors不为空的数据为灰 度发布。  3. In the case of grayscale publishing, step 2 may find multiple application configuration information list items (one application corresponds to one application configuration information list row), wherein only one grayscale publishing factor GrayFactors is allowed, other GrayFactors Data that is not empty is published in grayscale.
4.优先判断 GrayFactors不为空的应用配置信息列表项数据,按照配置获取的顺序将 UserContext对 GrayFactors进行计算,  4. Priority judgment GrayFactors is not empty application configuration information list item data, UserContext is calculated according to the order of configuration acquisition GrayFactors,
a) 如果计算不符合, 则 自动计算下一个, 只到找到一个符合的为止  a) If the calculation does not match, the next one is automatically calculated, until only one match is found
b) 如果找到 GrayFactors不为空的数据, 则使用此应用配置信息列表项进行后 续的路由计算;  b) If you find data that GrayFactors is not empty, use this application configuration information list item for subsequent route calculations;
c) 如果找不到符合的 GrayFactors不为空的应用配置信息列表项, 则使用默认 的应用配置信息列表项 ( GrayFactors为空的 ) 信息进行后续的路由计算; c) If no matching configuration list items are found that are not GrayFactors, the default application configuration information list item (GrayFactors is empty) is used for subsequent route calculation;
5.找到一个应用配置列表项后的路由算法与前述描述一致, 即根据所找到的应用配置信息列表项中 的应用进程名称查询应用运行信息列表, 找到应用进程名称一致的应用运行信息列表项, 如果为多个, 则根据元数据标注判断此应用进程是随机负栽还是一致性 Hash 负栽, 通过随机负栽算法或者一致性 Hash 算法,找到确切的目标应用服务器地址, 调用到目标应用服务器, 并将应用配置信息列表项中的 App Name附力口在请求上。 5. The routing algorithm after the application configuration list item is found is consistent with the foregoing description, that is, the application operation information list is queried according to the application process name in the found application configuration information list item, and the application operation information list item with the same application process name is found. If there are multiple, it is determined according to the metadata label whether the application process is random or consistent Hash, and the exact target application server address is found by the random load algorithm or the consistent hash algorithm, and the target application server is called. And append the App Name in the application configuration information list item to the request.
版本号级联灰度  Version number gradation grayscale
在本系统中, 可能存在如下情况: 应用 A提供服务给用户, 但是应用 A调用应用 B; 应用 A升级 为应用 Α' , 但是同时需要升级应用 Β为 Β' , 我们会对应用 A'进行灰度发布, 但是希望 A'调用 B'而不 是 Β Α和 Β的版本号为 1.0, A'和 B'的版本号为 2.0  In this system, there may be the following situations: Application A provides services to users, but application A calls application B; application A upgrades to application Α', but at the same time needs to upgrade applications Β', we will gray out application A' Released, but hope that A' calls B' instead of Β Α and Β version number is 1.0, A' and B' version number is 2.0
本发明中给出的解决方案如下: 当发布了应用 B和调用 B的应用 A后, 又对相应的升级版本 B' 和 A'进行了灰度发布, 并将 B'的灰度因子设定为匹配 A'的版本号, 则客户端请求消息路由到 A'后的过 程如下:  The solution given in the present invention is as follows: After the application B of the application B and the call B is released, the corresponding upgrade versions B' and A' are grayscale-released, and the grayscale factor of B' is set. To match the version number of A', the process of routing the client request message to A' is as follows:
1. A'在应用配置信息列表中寻找要调用的应用, 找到 B和 Β'; 其中 B'配置为灰度发布, 且灰度发 布因子中为版本匹配, 灰度发布因子配置如下: app_version.equals("2.0")  1. A' find the application to be called in the application configuration information list, find B and Β'; where B' is configured for grayscale publishing, and the grayscale publishing factor is version matching, and the grayscale publishing factor is configured as follows: app_version. Equals("2.0")
2.由于 B'的灰度发布因子不为空, 因此先进行匹配; A'获取自身的版本号后匹配 B'的灰度发布因 子, 命中; A'选择 B'作为调用的应用。  2. Since the grayscale publishing factor of B' is not empty, the matching is performed first; A' obtains its own version number and matches B's grayscale publishing factor, hits; A' selects B' as the called application.
3.选择 B'后的路由过程与前述描述一致, 这里不再赘述。  3. The routing process after selecting B' is consistent with the foregoing description, and details are not described herein again.
三、 配置系统  Third, the configuration system
在大型集群系统开发中,应用服务的配置信息一向是混乱及难以管理的,本发明中使用了一种基于 中心的配置方式, 在保留灵活性的^ ftH上, 实现了配置的全局可管理性, 便捷, 特例化, 更新等特性。  In the development of large-scale cluster systems, the configuration information of application services has always been confusing and difficult to manage. In the present invention, a central-based configuration method is used, and the global manageability of the configuration is realized on the flexible ftH. , convenience, specialization, update and other features.
图 9是本发明实施例中的全局配置系统的示意图。如图 9所示,该系统在图 2所示的系统的基础上, 增加了一个与中心服务器连接的用于保存应用的配置信息的全局配置数据库。应用服务器向中心服务器 发送配置信息请求消息; 中心服务器在接收到应用服务器发送的配置信息请求消息后,从全局配置数据 库检索出相应的配置信息并返回给应用服务器。 FIG. 9 is a schematic diagram of a global configuration system in an embodiment of the present invention. As shown in FIG. 9, the system adds a global configuration database connected to the central server for saving configuration information of the application based on the system shown in FIG. 2. Application server to central server Sending a configuration information request message; after receiving the configuration information request message sent by the application server, the central server retrieves corresponding configuration information from the global configuration database and returns it to the application server.
应用服务器还将自身的地址注册到配置服务器;配置服务器用于在对配置数据库中的应用服务器的 配置信息进行更新后, 根据应用服务器的注册地址向相应的应用服务器下发更新后的配置信息。  The application server also registers its own address to the configuration server. After the configuration information of the application server in the configuration database is updated, the configuration server delivers the updated configuration information to the corresponding application server according to the registered address of the application server.
在本系统中, 配置信息被分为文本配置 Text和表配置 Table两种。 其中: Text为文本, 可以为任意 格式, 如. properties格式, 或 xml格式等; Table为数据表, 与数据库中的表类似, Framework中提供了 存取表的接口, 可以直接针对表进行访问。  In this system, the configuration information is divided into two types: text configuration text and table configuration table. Among them: Text is text, can be any format, such as .properties format, or xml format; Table is a data table, similar to the table in the database, the interface provides access to the table interface, you can directly access the table.
本地 /全局配置模式  Local/global configuration mode
在本发明中,应用服务器还可以从本地获取配置信息, 因此配置存在本地配置和全局配置两种运行 模式:  In the present invention, the application server can also obtain configuration information locally, so the configuration has two modes of operation: local configuration and global configuration:
在本地配置模式中, Text会以当前运行目录为根目录, 读取文本文件, Table会以运行根目录中的 全局配置数据库的配置信息, 直接读取数据库中的表结构;  In the local configuration mode, Text will use the current running directory as the root directory to read the text file. Table will directly read the table structure in the database by running the configuration information of the global configuration database in the root directory.
在全局配置模式中, Text和 Table的读取都会通过中心服务器进行, 中心服务器会读取保存在全局 配置数据库中的 Text配置和 Table配置, 并且会实现特例化特性, 及 PUSH更新特性。  In the global configuration mode, Text and Table are read through the central server. The central server reads the Text configuration and Table configuration stored in the global configuration database, and implements specialization features and PUSH update features.
其中,应用服务器通过切换远程加栽模块和本地加栽模块,来实现远程从中心服务器获取配置信息 的全局配置模式以及从本地获取配置信息的本地配置模式之间的切换。所述远程加栽模块,用于向中心 服务器发送配置信息请求消息, 并接收中心服务器返回的配置信息; 所述本地加栽模块, 用于从应用服 务器的本地获取配置信息。  The application server switches between the global configuration mode for obtaining configuration information from the central server and the local configuration mode for obtaining configuration information from the local device by switching the remote loading module and the local loading module. The remote loading module is configured to send a configuration information request message to the central server, and receive configuration information returned by the central server. The local loading module is configured to obtain configuration information locally from the application server.
一般情况下当单元测试, 和直接从开发环境运行时, 应用运行在本地配置模式; 当实际部署到环境 中运行时, 应用都会运行在全局配置模式下, 运行在全局配置模式可以支持特例化, 及 PUSH更新。  In general, when unit testing, and running directly from the development environment, the application runs in the local configuration mode; when the actual deployment to the environment, the application will run in the global configuration mode, running in the global configuration mode can support specialization, And PUSH update.
特例化配置  Special configuration
特例化的需求描述为, 当某个配置针对全局配置为 A,但是又需要将某台服务器或某个应用读到的 配置为 B时的需求。  The specialization requirement is described as the requirement when a configuration is configured as A for the global, but needs to be configured as a B for a server or an application.
本发明中,在全局配置数据库中保存了默认配置信息和特例化配置信息。 中心服务器在接收到应用 服务器发送的配置信息请求消息后,根据最大匹配原则对配置信息请求消息中匹配参数进行匹配,将匹 配到的默认配置信息或特例化配置信息返回给应用服务器。  In the present invention, default configuration information and special configuration information are saved in the global configuration database. After receiving the configuration information request message sent by the application server, the central server matches the matching parameters in the configuration information request message according to the maximum matching principle, and returns the matching default configuration information or special configuration information to the application server.
例如, 在本发明的一个实施例中: 按照配置信息键值、应用名称和应用服务器名称之间的对应关系 保存配置信息;应用服务器向中心服务器发送包含配置信息键值、应用名称和应用服务器名称这三个参 数的配置信息请求消息; 中心服务器在接收到该请求消息后, 先根据其中的配置信息键值、应用名称和 应用服务器名称这三个参数去从配置数据库中检索配置信息; 如果没有检索到匹配项,则根据配置信息 键值和应用名称这两个参数去从配置数据库中检索配置信息; 如果仍没有检索到匹配项,则根据配置信 息键值这一个参数去从配置数据库中检索配置信息。  For example, in an embodiment of the present invention: the configuration information is saved according to the correspondence between the configuration information key value, the application name, and the application server name; the application server sends the configuration information key value, the application name, and the application server name to the central server. The configuration information request message of the three parameters; after receiving the request message, the central server first retrieves the configuration information from the configuration database according to the three parameters of the configuration information key value, the application name, and the application server name; If the matching item is retrieved, the configuration information is retrieved from the configuration database according to the configuration information key value and the application name; if the matching item is still not retrieved, the configuration information key value is used to retrieve the configuration data from the configuration database. Configuration information.
图 9所示的系统在全局配置模式下支持两种配置文本配置和表配置, 其中配置都通过 rpc方式从中 心服务器读取,配置表对所有应用均为一致, 配置文本可以针对不同的应用进行特例化。  The system shown in Figure 9 supports two configuration text configurations and table configurations in the global configuration mode. The configuration is read from the central server through the rpc mode. The configuration table is consistent for all applications, and the configuration text can be used for different applications. Specialization.
配置特例化的方式如下文描述:  The way to configure specialization is as follows:
1.应用 A获取配置时,会提交 loadText参数如下,  1. When applying A to get the configuration, the loadText parameter will be submitted as follows.
a. Path="Tracing" 示读耳又 Tracing的 S己置  a. Path="Tracing" shows the ear and Tracing's S set
b. Args = "Application=A;S erver=SERVER-A;",¾引号内的字段有不同的键值 对组成  b. Args = "Application=A;S erver=SERVER-A;", the fields in the 3⁄4 quotation marks have different key values.
2.中心服务器接受到配置请求以后会通过 Args字段对比自己满足 Path="Tracing"的配置,如果存在 以下两条记录  2. After receiving the configuration request, the central server will compare the configuration of Path="Tracing" with the Args field, if the following two records exist.
c Args = "", Value = " Warn"  c Args = "", Value = " Warn"
d . Args = "Application=A", Value="Info"  d. Args = "Application=A", Value="Info"
3.中心服务器在选取配置的时候会采取最大匹配原则。 以最多的键值对相等进行判断, 如果存在 相同键值对相等的次数, 则以出现在请求中的键值对顺序进行判断, 先满足的会返回;  3. The central server will adopt the principle of maximum matching when selecting the configuration. Judging the equality with the most key values. If there are the same number of key-value pairs, the order of the key-value pairs appearing in the request is judged, and the first satisfaction will be returned;
4.按照上述判别规则, 中心服务器会返回 Value="Info"给应用。  4. According to the above discriminating rules, the central server will return Value="Info" to the application.
特例化的可选参数包含:  Specialized optional parameters include:
group=服务器组名  Group=server group name
server= H务器名  Server= H server name
npp=0.用名称 App Name  Npp=0. by name App Name
配置的 PUSH更新  Configured PUSH update
中心服务器对全局配置数据库中的配置信息进行更新,并找到使用该配置信息的应用,向使用该配 置信息的应用所在的应用服务器发送更新后的配置信息。 具体来说: 1.终端向中心服务器发起配置更新请求(具体来说, 运维人员通过运维工具发布配置更新请求, 运 维工具将更新请求提交给中心服务器); The central server updates the configuration information in the global configuration database, and finds the application that uses the configuration information, and sends the updated configuration information to the application server where the application that uses the configuration information is located. Specifically: 1. The terminal initiates a configuration update request to the central server (specifically, the operation and maintenance personnel issue a configuration update request through the operation and maintenance tool, and the operation and maintenance tool submits the update request to the central server);
2. 中心服务器对全局配置数据库中的配置信息进行更新, 并找到对应的应用进程的连接, 通过该 连接下发配置更新请求;  2. The central server updates the configuration information in the global configuration database, and finds the connection of the corresponding application process, and sends a configuration update request through the connection;
3.对应的应用进程重新从中心服务器获取配置信息, 刷新配置信息并返回结果给中心服务器; 3. The corresponding application process re-acquires the configuration information from the central server, refreshes the configuration information, and returns the result to the central server;
4.中心服务器将结果返回给终端。 4. The central server returns the result to the terminal.
四、 监控系统  Fourth, the monitoring system
图 10是本发明实施例中的监控系统的示意图。 如图 10所示, 该系统在图 2所示系统的基础上, 增 加了与中心服务器连接的全局监控数据库,与全局监控数据库连接的监控服务器, 以及在每个应用服务 器中增加一个本机日志数据库。 由于篇幅所限, 在图 10中只示意性的画出了图 2中的中心服务器和一 个应用服务器。  Figure 10 is a schematic illustration of a monitoring system in accordance with an embodiment of the present invention. As shown in FIG. 10, the system adds a global monitoring database connected to the central server, a monitoring server connected to the global monitoring database, and a local log in each application server based on the system shown in FIG. 2. database. Due to space limitations, only the central server and an application server in Fig. 2 are schematically illustrated in Fig. 10.
在图 10中, 在全局监控数据库中保存不同监控策略。 应用服务器中的守护进程以及应用进程, 通 过中心服务器从全局监控数据库获取对应的监控策略,根据所获取的监控策略进行监控,将监控结果数 据保存到本机日志数据库中,以及根据监控策略将相应的监控结果数据通过中心服务器上传到全局监控 数据库中,并在获取到的数据超过阀值时附加报警标记。监控服务器展示全局监控数据库中的监控结果 数据, 并提示报警。  In Figure 10, different monitoring policies are stored in the global monitoring database. The daemon process and the application process in the application server obtain the corresponding monitoring policy from the global monitoring database through the central server, monitor according to the acquired monitoring policy, save the monitoring result data to the local log database, and correspondingly according to the monitoring policy. The monitoring result data is uploaded to the global monitoring database through the central server, and an alarm flag is attached when the acquired data exceeds the threshold. The monitoring server displays the monitoring result data in the global monitoring database and prompts the alarm.
在图 10中, 监控服务器对全局监控数据库中的监控策略进行更新, 然后向指定应用服务器中的守 护进程和 /或应用进程发送监控策略更新通知; 所述指定应用服务器中的护进程和 /或应用进程收到所述 监控策略更新通知后, 从全局配置服务器获取对应的更新后的监控策略。  In FIG. 10, the monitoring server updates the monitoring policy in the global monitoring database, and then sends a monitoring policy update notification to the daemon and/or the application process in the specified application server; the protection process in the specified application server and/or After receiving the monitoring policy update notification, the application process obtains the corresponding updated monitoring policy from the global configuration server.
具体来说: 具体为监控服务器向全局监控数据库发送更新监控策略指令,全局监控数据库对监控策 略进行更新后返回应答响应消息; 监控机向指定服务器上的守护进程和 /或应用进程发送监控策略更新 通知; 指定服务器上的守护进程和 /或应用进程收到监控策略更新通知后, 从全局监控数据库获取对应 的更新后的监控策略,具体为对比自身已有的监控策略的版本号是否与全局监控数据库上的对应监控策 略的版本号一致,如不一致,则从全局监控数据库获取监控策略并用所获取的监控策略对已有的监控策 略进行更新, 并向监控服务器返回更新成功消息。  Specifically, the monitoring server sends an update monitoring policy command to the global monitoring database, and the global monitoring database updates the monitoring policy to return an response response message; the monitoring machine sends a monitoring policy update to the daemon and/or application process on the specified server. After the notification process is updated, the daemon and/or the application process on the specified server obtains the corresponding updated monitoring policy from the global monitoring database, which is to compare the version number of the existing monitoring policy with the global monitoring. The version number of the corresponding monitoring policy on the database is the same. If the information is inconsistent, the monitoring policy is obtained from the global monitoring database and the existing monitoring policy is updated with the obtained monitoring policy, and the update success message is returned to the monitoring server.
全局报表服务器定期从各应用服务器的本机日志数据库中获取数据,进行汇总后保存到全局报表数 据库中,将全局报表数据库中的数据展示给用户。应用服务器中的守护进程删除本机日志数据库中的超 过一定时间 (如 7天) 的数据, 这保证本机日志数据库中的数据不至于超过限制大小。  The global report server periodically obtains data from the local log database of each application server, summarizes it, saves it to the global report database, and displays the data in the global report database to the user. The daemon in the application server deletes data in the native log database for more than a certain amount of time (such as 7 days), which ensures that the data in the native log database does not exceed the limit.
在图 10所示的系统中, 监控与报警系统的数据来源分为两个类型:  In the system shown in Figure 10, the data sources for the monitoring and alarm system are divided into two types:
1.系统资源计数器(包含 CPU, 内存,磁盘, 10, 网络流量等能够直接从操作系统中取出来的数据, 一般为一个浮点数);  1. System resource counter (including CPU, memory, disk, 10, network traffic, etc., which can be directly retrieved from the operating system, usually a floating point number);
2.程序内嵌计数器, 为本系统特有的基于程序内部技术的, 动态规格的报表计数器;  2. Program embedded counter, which is a system-specific internal report-based, dynamic specification report counter;
在本系统中系统资源计数器由守护进程 Master监控, 而程序内嵌计数器由应用进程 Worker进行监 控。 所有的计数器的监控配置(即采集策略)都由 Master和 Worker通过中心服务器从全局监控数据库 中读取。 读取到监控配置以后 Master和 Worker会按照监控配置定期将数据存储到本机日志数据库中, 或上传到中心服务器, 是否上传取决于监控策略的配置。  In this system, the system resource counter is monitored by the daemon master, and the program inline counter is monitored by the application process worker. The monitoring configuration of all counters (ie, the acquisition policy) is read by the Master and Worker from the global monitoring database through the central server. After reading the monitoring configuration, the Master and Worker will periodically store the data in the local log database according to the monitoring configuration, or upload it to the central server. Whether to upload depends on the configuration of the monitoring policy.
应用服务器中的守护进程对系统资源计数器进行监控; 监控的指标包括: CPU指标、 内存指标、 磁盘指标、 网卡流量指标和 MySQL指标等。  The system resource counters are monitored by the daemon in the application server; the monitored indicators include: CPU metrics, memory metrics, disk metrics, NIC traffic metrics, and MySQL metrics.
具体来说, 守护进程从中心服务器获取监控配置,根据监控配置中的内容定时执行脚本获取该项数 据, 将该项数据保存到本机日志数据库中, 并根据监控配置进行如下操作: 1 )如果配置了阀值报警, 并且获取到的值超过了阀值, 将数据包上传到中心服务器, 并附加报警标记; 2 )如果配置了定时上传, 则直接将数据打包上传到中心服务器。 中心服务器将上传数据保存到全局监控数据库中。  Specifically, the daemon obtains the monitoring configuration from the central server, and executes the script according to the content in the monitoring configuration to obtain the data, save the data to the local log database, and perform the following operations according to the monitoring configuration: 1) The threshold alarm is configured, and the obtained value exceeds the threshold, the data packet is uploaded to the central server, and the alarm flag is attached; 2) If the scheduled upload is configured, the data is directly packaged and uploaded to the central server. The central server saves the uploaded data to the global monitoring database.
下面重点描述本发明中特有的程序内嵌计数器。  The program embedded counter unique to the present invention will be mainly described below.
在服务器端开发领域, 性能计数器是反映一个服务运行状况的关键指标, 在 windows平台下, 有 perfmon程序可以用于监控系统的关键资源, 而应用程序也能够对扩展 perfmon的类型并进行记录, 并 且通过 perfmon工具查看实时数据, 或者存储, linux最新版本的内核也随性能计数器进行了支持。  In the field of server-side development, performance counters are key indicators that reflect the health of a service. Under Windows, there are perfmon programs that can be used to monitor critical resources of the system, and applications can also record and extend the type of perfmon, and View real-time data through the perfmon tool, or store it. The latest version of Linux kernel is also supported with performance counters.
但是上述操作系统相关的计数器对业务层面的计数需求较难满足。 例如:  However, the counters related to the above operating systems are more difficult to meet the counting requirements at the service level. E.g:
1.数据的记录往往是几条, 对几千条的数据很难做到监控和展示;  1. The records of data are often several, and it is difficult to monitor and display thousands of data;
2.计数器的类型局限于几种类型 (数字, 频率, 平均值, 命中率)等, 且不能记录文字等的信息, 扩展起来较为困难;  2. The type of the counter is limited to several types (number, frequency, average, hit rate), etc., and it is not possible to record information such as text, which is difficult to expand;
3.功能更多的关注在实时监控上, 对大规模数据日常的记录操作并不友好。  3. More attention to functions In real-time monitoring, it is not friendly to the daily recording operation of large-scale data.
基于以上的考虑,本发明设计了进程内的程序内嵌计数器,使其能够更好的支持业务类数据的记录 与监控。 图 11是本发明实施例中的程序内嵌计数器的实现方式示意图。 参见图 11 , 业务代码会将相关的计 数输出到内嵌计数器中, 而客户端代理会在启动时刻, 通过中心服务器获取计数器的采集策略, 并且定 时进行程序内嵌计数器的数据采集工作, 上传到中心服务器, 或记录到本机日志数据库中, 并根据阀值 进行告警。 Based on the above considerations, the present invention designs in-process program embedded counters to better support the recording and monitoring of business class data. FIG. 11 is a schematic diagram of an implementation manner of a program embedded counter in the embodiment of the present invention. Referring to Figure 11, the business code will output the relevant count to the embedded counter, and the client agent will acquire the counter collection strategy through the central server at the startup time, and periodically collect the data collection work of the program embedded counter, upload to The central server, or logging to the local log database, and alerting based on the threshold.
可见, 在本发明中, 需要设计程序内嵌计数器, 在应用进程中嵌入所设计程序内嵌计数器; 应用服 务器中的应用进程根据所获取的监控策略对程序内嵌计数器进行监控。  It can be seen that in the present invention, a program embedded counter is required to embed a built-in counter of the designed program in the application process; the application process in the application server monitors the embedded counter of the program according to the acquired monitoring policy.
在本发明中, 程序内嵌计数器的数据结构如下:  In the present invention, the data structure of the program embedded counter is as follows:
- 程序内嵌计数器中包含多个名字唯一的类别 ( Category );  - The program inline counter contains multiple categories with unique names ( Category );
- 每个类别中可以包含多个固定的列;  - Multiple fixed columns can be included in each category;
- 每个类别中包含多个名字唯一的实例 ( instance ) , 也可以理解为行。  - Each category contains multiple instances with unique names (also known as rows).
根据以上的定义, 一个定义好的程序内嵌计数器的输出如表 11所示:  According to the above definition, the output of a defined program inline counter is shown in Table 11:
Cate or : "r c-client
Figure imgf000021_0001
Cate or : "r c-client
Figure imgf000021_0001
表 1 1  Table 1 1
其中, 列是固定的, 而行与请求的方法名一样, 可能随着请求的增加而增加。  Where the column is fixed and the row is the same as the method name of the request, it may increase as the request increases.
生成一个类别的方法包括: 确定该类别的名字,设置该类别的输出列、该类别的一组原子计数器和 原子计数器的操作方法、 该类别的快照的数据格式以及该类别的根据快照数据计算输出实例的方法。  Methods for generating a category include: determining the name of the category, setting an output column for the category, a set of atomic counters and atomic counter operations for the category, a data format for the snapshot of the category, and an output based on the snapshot data for the category The method of the instance.
具体来说, 在本发明的实施例中, 通过以下手段定义一个类别 (Category ):  Specifically, in an embodiment of the present invention, a category (Category) is defined by:
1.定义唯一的名字, 即指定该类别的名字;  1. Define a unique name, that is, specify the name of the category;
2.定义该类别的输出列; 列的类型可以为整数、 浮点数和字符串;  2. Define the output column of the category; the type of the column can be an integer, a floating point number, and a string;
3. 定义原始的数据类型及操作方法: 定义该类别的一组原子计数器和原子计数器的操作方法; 3. Define the original data type and method of operation: Define a set of atomic counters and atomic counters for that class;
4.定义该类别的快照的数据格式; 包含从原子计数器中取出来的直接结构; 4. Define the data format of the snapshot of the category; include the direct structure taken from the atomic counter;
5.定义该类别的根据快照数据计算输出实例的方法; 即定义从两次快照计算报表输出行的方法; 5. Define a method for calculating an output instance based on the snapshot data of the category; that is, defining a method for calculating a report output line from two snapshots;
6.定义该类别的输出实例的汇总方法, 即定义报表行的汇总方法。 6. Define the summary method for the output instance of this category, which is the summary method for defining the report row.
根据以上描述, 定制一个命中率计数器(即一个实现命中率计算的类别) 的方法如下:  According to the above description, a method of customizing a hit rate counter (ie, a class that implements hit rate calculation) is as follows:
1.指定该类别的唯一名字; 这里为 "cached-hit-ratio";  1. Specify a unique name for the category; here is "cached-hit-ratio";
2.定义该类别的输出列为: 每秒访问次数(/sec ), 命中率(ratio ); 这里有两个列;  2. Define the output columns for this category as: Visits per second (/sec), Hit ratio (ratio); There are two columns here;
3.定义原子计数器及操作方法: 命中率计数器的原始数据包含两个整数型原子计数器, 第一原子计 数器 hitted和第二原子计数器 missed;  3. Define the atomic counter and the method of operation: The raw data of the hit rate counter contains two integer atomic counters, the first atomic counter hitted and the second atomic counter missed;
业务代码记录命中时会将 hitted加一;  The hit code is incremented by one when the business code record hits;
业务代码记录未命中时会将 missed减一;  Missed one by one when the business code record misses;
4.定义该类别的快照的数据格式为: 保存生成快照时刻的第一原子计数器的计数值、 第二原子计数 器的计数值、 系统时间;  4. The data format of the snapshot defining the category is: save the count value of the first atomic counter at the time of generating the snapshot, the count value of the second atomic counter, and the system time;
5.定义该类别的根据快照数据计算输出实例的方法, 即根据两次快照计算报表输出行的方法为: 根 据两次快照的数据计算总访问次数、命中次数和两次快照的间隔时间, 然后根据总访问次数和两次快照 的间隔时间的比值获得每秒访问次数, 根据命中次数和总访问次数的比值获得命中率;  5. Define the method for calculating the output instance based on the snapshot data of the category, that is, calculate the output line of the report according to the two snapshots as follows: Calculate the total number of accesses, the number of hits, and the interval between the two snapshots according to the data of the two snapshots, and then Obtaining the number of visits per second according to the ratio of the total number of visits and the interval between the two snapshots, and obtaining the hit ratio according to the ratio of the number of hits to the total number of visits;
例如, 输出行从两次间隔时间为 T的快照中计算出来, 我们定义时间 0时获取到快照 snapshotl , 当再次经过时间 T后, 在此获取快照 snapshot2, 输出计算公式为  For example, the output line is calculated from two snapshots with interval T. When we define time 0, we get snapshot snapshotl. When time T is passed again, snapshot snapshot2 is obtained here. The output calculation formula is
report. total = (sna shot2.hitted+ shapshot2. missed) - (snapshot l .hitted + snapshot l . missed)  Report. total = (sna shot2.hitted+ shapshot2. missed) - (snapshot l .hitted + snapshot l . missed)
report. hitted = (snapshot2. hitted - snapshot l .hitted)  Report. hitted = (snapshot2. hitted - snapshot l .hitted)
report. interval = (snapshot2.time - snapshot l .time)  Report. interval = (snapshot2.time - snapshot l .time)
输出行展现数据为  The output line shows the data as
(call ./sec) : total I interval  (call ./sec) : total I interval
(hit ratio) : hitted I total  (hit ratio) : hitted I total
6.定义该类别的输出实例的汇总方法为: 对各实例的总访问次数进行求和得到汇总后的总访问次 数,对各实例的命中次数进行求和得到汇总后的命中次数, 汇总后的两次快照时间间隔等于实例的两次 快照时间间隔, 各实例的两次快照时间间隔相等。 如:  6. The summary method for defining the output instance of this category is as follows: The total number of accesses of each instance is summed to obtain the total number of accesses after the summation, and the number of hits of each instance is summed to obtain the number of hits after the summary, after summarizing The interval between two snapshots is equal to the interval between snapshots of the instance. The interval between snapshots of each instance is equal. Such as:
summary. total = sum(report. total)  Summary. total = sum(report. total)
summary. hitted = sum(report. hitted) summary, interval = report. interval; Summary. hitted = sum(report. hitted) Summary, interval = report. interval;
sum ( ) 运算表示求和, 汇总的各行数据时间一致  The sum ( ) operation represents the summation, and the summed data of each row is consistent.
应用进程中的业务代码根据类别名查找到该实现命中率计算的类别,并根据实例名查找到该实现命 中率计算的类别的相应实例, 在业务命中时将相应实例中的第一原子计数器加 1 , 在业务未命中时将相 应实例中的第二原子计数器加 1。  The service code in the application process finds the category calculated by the hit rate according to the category name, and finds the corresponding instance of the category calculated by the hit rate according to the instance name, and adds the first atom counter in the corresponding instance when the service hits 1. Add 1 to the second atomic counter in the corresponding instance when the service is missing.
程序内嵌计数器设计好之后, 每次代码触发后, 数据都会存储在应用进程的内存中, 应用进程启动 后, 监控的步骤如下:  After the program inline counter is designed, each time the code is triggered, the data is stored in the memory of the application process. After the application process is started, the monitoring steps are as follows:
1.应用进程与中心服务器建立长连接;  1. The application process establishes a long connection with the central server;
2.应用进程获取本机的监控配置;  2. The application process obtains the monitoring configuration of the machine;
3.中心服务器按照应用服务器的名称, 返回适合于应用服务器的监控配置;  3. The central server returns a monitoring configuration suitable for the application server according to the name of the application server;
4.应用服务器启动监控线程, 固定时刻运行;  4. The application server starts the monitoring thread and runs at a fixed time;
5.固定时刻后, 应用进程会获取程序内嵌计数器的快照 snapshot, 如果有上一次获取到的 snapshot, 则将用两次 snapshot计算出最后的结果, 否则将本次 snapshot计入到上次的结果中;  5. After the fixed time, the application process will take a snapshot of the program embedded counter. If there is a snapshot acquired last time, the last result will be calculated with two snapshots, otherwise the current snapshot will be counted to the last time. In the result;
6.如果有计算结果, 根据记录模式执行如下操作:  6. If there is a calculation result, perform the following operations according to the recording mode:
a) N0NE, 不记录;  a) N0NE, not recorded;
b) ALL: 将所有 instance的记录存储到本机日志数据库中;  b) ALL: store all instance records in the local log database;
c) SUMMARY: 将所有 instance的记录执行汇总, 并存到本机日志数据库中;  c) SUMMARY: The records of all instances are summarized and stored in the local log database;
7.如果有计算结果, 根据上传模式执行如下操作;  7. If there is a calculation result, perform the following operations according to the upload mode;
a) N0NE, 不记录;  a) N0NE, not recorded;
b) ALL: 将所有 instance的记录打包上传到中心服务器当中  b) ALL: Upload all the records of the instance to the central server.
c) SUMMARY: 将所有 instance的记录执行汇总, 并打包上传至中心服务器;  c) SUMMARY: The records of all instances are summarized and packaged and uploaded to the central server;
8.判断计算结果是否突破阈值, 如果突破阈值, 将计算结果附加报警记录, 上传至中心服务器。 五、 开发辅助系统  8. Determine whether the calculation result exceeds the threshold. If the threshold is exceeded, the calculation result is attached to the alarm record and uploaded to the central server. Fifth, the development of auxiliary systems
基于插件的开发方式  Plug-in based development
在本发明的基于 Java的应用开发中, 基于现有的插件系统( Eclipse )生成了扩展插件, 该扩展插 件连接开发管理服务器实现以下功能:  In the Java-based application development of the present invention, an extension plug-in system (Eclipse) is generated based on the existing plug-in system (Eclipse), and the extension plug-in connection development management server implements the following functions:
创建并管理工程组件、 实现基于版本的升级系统;  Create and manage engineering components and implement a version-based upgrade system;
创建应用的框架代码;  Create the application's framework code;
实现对 RemoteAppBean调用代码的生成, 并协助管理依赖信息;  Implement the generation of code for the RemoteAppBean call and assist in managing dependency information;
实现对应用的注入式调试。  Enable injection debugging of the application.
组件的版本管理  Version management of components
在本系统中, 开发中需要进行不同版本组件的依赖, 对于 iftH库的版本依赖的方式如下, 例如: 开发 Appsl.O时, 依赖为 Framework- l.O.jar, BizLibrary-1.0-jar;  In this system, the dependencies of different versions of components need to be developed. The way to rely on the version of the iftH library is as follows: For example, when developing Appsl.O, the dependency is Framework- l.O.jar, BizLibrary-1.0-jar;
开发 Apps2.0时, 依赖为 Framework- 1.1. jar, BizLibrary-2.0-jar。  When developing Apps 2.0, the dependencies are Framework- 1.1.jar, BizLibrary-2.0-jar.
本系统这样解决这个问题, 将版本的定义如下:  The system solves this problem in this way, and defines the version as follows:
1.0版本, 依赖库包含: Framework-1.0.jar; BizLibrary- 1.0.jar;  Version 1.0, dependent libraries include: Framework-1.0.jar; BizLibrary- 1.0.jar;
2.0版本, 依赖库包含: Frame work- 1.1. jar; BizLibrary-2.0.jar。  Version 2.0, dependent libraries include: Frame work- 1.1. jar; BizLibrary-2.0.jar.
此项版本信息由开发管理员进行创建,每次升级版本,都需要在开发管理服务器的配置库中新增此 配置信息。  This version information is created by the development administrator. Each time you upgrade the version, you need to add this configuration information to the configuration management server's configuration repository.
新建工程时的依赖配置建立  Dependency configuration establishment when creating a new project
创建 App工程时, 开发需要选择一个当前的版本, 当开发人员选择版本后, 插件进行的步骤如下: When creating an App project, development needs to select a current version. When the developer selects the version, the plugin performs the following steps:
1.通过开发管理服务器获取依赖的包的信息; 1. Obtain information about the dependent package through the development management server;
2.获取特定版本的包;  2. Get a specific version of the package;
3.将依赖关系加入到当前的 App工程环境中;  3. Add dependencies to the current App project environment;
4.将版本号写到 META-INF/AppBean.properties版本中 (此项版本也会后续影响到程序上线, 以及 灰度发布)  4. Write the version number to the META-INF/AppBean.properties version (this version will also affect the program's online, as well as grayscale release)
旧有工程的依赖配置升级  Dependent configuration upgrade of old projects
当我们需要根据新发布的基础库进行旧有应用的升级时, 比如, 当 出库升级至 2.0版本, 我们将 1.0版本的应用升级至 2.0版本时的步骤如下:  When we need to upgrade the old application based on the newly released base library, for example, when upgrading the library to version 2.0, the steps to upgrade the version 1.0 application to version 2.0 are as follows:
1.开发人员将当前版本选择至 2.0;  1. The developer selects the current version to 2.0;
2.插件向版本管理系统读取 2.0版本的依赖库信息;  2. The plugin reads the dependent library information of the 2.0 version to the version management system;
3.插件下栽开发管理系统配置的依赖插件;  3. The plug-in downloads the dependency plug-in for the development management system configuration;
4.替换本地的依赖关系; 5.升级成功。 4. Replace local dependencies; 5. The upgrade was successful.
对 RemoteApp Bean的调用代码的生成  Generation of calling code for RemoteApp Beans
RemoteAppBean是本系统内实现应用互访及应用层次的核心概念, 当实现了 RemoteAppBean并经 过 AppLoader上传到中心服务器后, 任何一个希望访问这个 RemoteAppBean的应用需要生 ^针对这个 RemoteAppBean调用的代理类。  RemoteAppBean is the core concept of implementing application access and application hierarchy in this system. When RemoteAppBean is implemented and uploaded to the central server via AppLoader, any application that wants to access this RemoteAppBean needs to generate a proxy class for this RemoteAppBean call.
在开发一个需要访问 RemoteAppBean 的应用时, 扩展插件从开发管理服务器获取已公开的所有 RemoteAppBean, 并将其信息显示给开发者, 又开发者选择要调用的 RemoteAppBean; 扩展插件从所选 择的 RemoteAppBean的反射信息中获取如下信息: 应用名称和类型信息; 扩展插件根据所获取的信息 生成请求和应答类型实体类;扩展插件根据所述请求和应答实体类型创建代理类,并将该代理类插入到 所述需要访问 RemoteAppBean的应用中。  When developing an application that needs to access RemoteAppBean, the extension gets all the exposed RemoteAppBeans from the development management server and displays its information to the developer, and the developer selects the RemoteAppBean to be called; the extension's reflection from the selected RemoteAppBean The information obtains the following information: application name and type information; the extension generates a request and response type entity class based on the obtained information; the extension creates a proxy class according to the request and response entity type, and inserts the proxy class into the Need to access the application of RemoteAppBean.
具体步骤如下:  Specific steps are as follows:
1.开发者开始进行 RemoteAppBean依赖;  1. The developer starts the RemoteAppBean dependency;
2.插件访问开发管理平台并获到当前所有公开的 RemoteAppBean, 并将其信息返回并显示给开发 者;  2. The plugin accesses the development management platform and obtains all current public RemoteAppBeans, and returns and displays the information to the developer;
3.开发者选择要调用的 RemoteAppBean;  3. The developer selects the RemoteAppBean to be called;
4.插件从 RemoteAppBean的反射信息中, 获取如下信息:  4. The plugin gets the following information from the reflection information of the RemoteAppBean:
a) @AppName: 应用名称;  a) @AppName: application name;
b)类型信息, 包括: 请求, 应答, 及上下文类型;  b) type information, including: request, response, and context type;
5.插件根据上面的信息生成请求, 应答类型实体类, 此过程如下:  5. The plugin generates a request based on the above information, and responds to the type entity class. The process is as follows:
a) AppLoader会将请求与应答类型, 保存为反射的中间数据, 保存管理平台库中;  a) AppLoader saves the request and response type as reflected intermediate data and saves it in the management platform library;
b)如果此类型在本工程的引用中存在, 则直接引用该类;  b) if this type exists in the reference of the project, directly refer to the class;
c)否则插件根据中间数据, 重新生成请求与应答类型的类的代码;  c) otherwise the plugin regenerates the code of the class of the request and response type based on the intermediate data;
6.使用上一步获得的请求, 与应答类型, 创建代理类, 代理类会使用步骤 4中获得的上下文类型; 6. Using the request obtained in the previous step, and the response type, create a proxy class, the proxy class will use the context type obtained in step 4;
7.将代理类的初始化插入到调用的 AppBean中。 7. Insert the initialization of the proxy class into the called AppBean.
依赖检测  Dependency detection
在大规模的复杂平台中, 不同服务间的依赖是一个非常难以管理的问题。  In large-scale complex platforms, the dependency between different services is a very difficult problem to manage.
在本发明中, 显示创建应用之间的依赖信息, 并在应用的更新过程中检测依赖信息, 以确定是否进 行应用的更新。  In the present invention, the dependency information between the created applications is displayed, and the dependency information is detected during the update process of the application to determine whether or not to perform the update of the application.
当 AppLoader加栽一个存在依赖的 App工程时, 会将依赖信息保存为如下的数据:  When AppLoader adds an existing App project, it will save the dependency information as follows:
调用者;  Caller
被调用者;  Callee
依赖的请求参数类型信息;  Dependent request parameter type information;
依赖的应答参数类型信息。  Dependent response parameter type information.
例如, 当应用 B依赖应用 A时, 系统会创建依赖信息:  For example, when application B depends on application A, the system creates dependency information:
调用者: B  Caller: B
被调用者: A  Called by: A
依赖的请求参数类型信息: A.RequestArgs  Dependent request parameter type information: A.RequestArgs
依赖的应答参数类型信息: A.ResponseArgs  Dependent parameter type information: A.ResponseArgs
应用的更新过程中的依赖检测  Dependency detection during the application's update process
B对 A存在依赖, 但是当 A升级为 A'的时候, 依赖检测的步骤如下:  B has a dependency on A, but when A is upgraded to A', the steps for dependency detection are as follows:
1.部署程序上传应用程序 Α', 并发起更新指令;  1. The deployment program uploads the application Α', and initiates an update instruction;
2.部署程序发现应用程序 Β依赖于 Α, 这时会对 A'和 Β对 Α的依赖的请求及应答参数进行对比, 有两种可能:  2. The deployment program finds that the application depends on Α. In this case, there are two possibilities for comparing the request and response parameters of A' and Β to ::
a) A'的请求和应答参数与 A的请求和应答参数兼容(相等, 或向下兼容), 系统允许更新, 并将 A 与 B都标记为更新程序;  a) A' request and response parameters are compatible (equal, or backward compatible) with A's request and response parameters, the system allows updates, and both A and B are marked as update programs;
b) A'的请求和应答参数与 A的请求和应答参数不兼容, 系统将不允许更新, 除非将 B的更新也一 并提交, 或先将 B下线。  b) A's request and response parameters are not compatible with A's request and response parameters, and the system will not allow updates unless B updates are also submitted, or B is taken offline.
版本测试范围预估  Version test scope estimate
通过上一节场景的描述,当某个版本的应用开发时, 系统会记录所有时间点的更新记录, 这样当系 统管理员确定上线版本时,可以从某个时间点上提取出在某个时间点后可能会影响到的应用范围列表。  According to the description of the previous scenario, when a version of the application is developed, the system records the update records at all points in time, so that when the system administrator determines the online version, it can extract the time from a certain point in time. A list of application scopes that may be affected after the point.
这个列表可以进行自动的测试范围判断, 提取的步骤如下:  This list can be used for automatic test range judgment. The extraction steps are as follows:
1.找出所有在时间点后更新的应用; 2.找出依赖这些应用的应用; 3.递归找出步骤 2中的应用, 直 到没有引用位置; 4.将所有找出的应用纳入测试范围。 注入式调试 1. Identify all applications that are updated after the point in time; 2. Identify applications that depend on these applications; 3. Recursively find the application in step 2 until there is no reference location; 4. Incorporate all identified applications into the test scope . Injection debugging
一般情况下调试一个应用程序需要将程序部署到实际运行环境当中去 (测试环境或是生产环境), 但是部署到测试环境中的应用很难调试,本系统发明了一种注入式的解决方案可以解决开发人员针对运 行环境的调试问题。  In general, debugging an application requires deploying the program to the actual running environment (test environment or production environment), but the application deployed to the test environment is difficult to debug. The system invents an injection solution. Solve developer debugging issues for the runtime environment.
解决方案为: 扩展插件在本地启动应用; 所述启动的应用与代理服务器创建连接, 并向代理服务器 发送要调试应用的配置参数; 所述要调试应用的配置参数限定指定范围内的用户;代理服务器在接收到 客户端请求消息后,首先匹配所述要调试应用的配置参数,如果匹配成功则将客户端请求消息发送给所 述启动的应用处理, 并将所述启动的应用返回的处理结果发送给客户端, 如果匹配不成功, 则将客户端 请求分发给对应的应用所在的应用服务器。  The solution is: the extension plugin launches the application locally; the launched application creates a connection with the proxy server, and sends a configuration parameter to the proxy server to debug the application; the configuration parameter of the application to be debugged defines the user within the specified range; the proxy After receiving the client request message, the server first matches the configuration parameter of the application to be debugged, and if the matching succeeds, sends a client request message to the activated application process, and returns the processing result of the started application. Send to the client, if the match is unsuccessful, distribute the client request to the application server where the corresponding application is located.
图 12是本发明实施例中的注入式调试系统的示意图。 参见图 12, 插件与图 2所示系统中的代理服 务器连接, 这里只示意出了图 2所示系统中的代理服务器和应用服务器集群。  Figure 12 is a schematic illustration of an injection type debugging system in accordance with an embodiment of the present invention. Referring to Figure 12, the plug-in is connected to the proxy server in the system shown in Figure 2, and only the proxy server and application server clusters in the system shown in Figure 2 are illustrated.
如图 12所示, 在正常运行的环境中, 客户端的请求会直接发给代理服务器, 然后代理服务器根据 应用配置发送特定的应用服务器, 参见前面的章节的描述。  As shown in Figure 12, in a normal operating environment, the client's request is sent directly to the proxy server, which then sends the specific application server based on the application configuration, as described in the previous section.
注入调试的步骤如下:  The steps to inject debugging are as follows:
1.通过插件启动的应用会与特定类型的代理服务器(每一台都要创建)创建长连接, 并监听请求; 1. An application launched through a plugin creates a long connection with a specific type of proxy server (each created) and listens for requests;
2.应用向代理服务器发送注入请求, 将调试的应用的配置参数发送给代理服务器, 其中插件限制应 用的配置参数必须包含灰度参数 (也就是只能影响固定范围内的用户); 2. The application sends an injection request to the proxy server, and sends the configuration parameters of the debugged application to the proxy server, wherein the configuration parameter of the plug-in restriction application must include a grayscale parameter (that is, it can only affect users in a fixed range);
3.代理服务器会在本地的路由表中添加注入项;  3. The proxy server will add an injection item to the local routing table;
4.当代理服务器监听到来自客户端的请求后, 会判断请求是否满足当前的注入条件; 不满足注入条 件的请求会按照原有路由逻辑进行路由。  4. When the proxy server listens for a request from the client, it will judge whether the request satisfies the current injection condition; the request that does not satisfy the injection condition will be routed according to the original routing logic.
5.满足注入条件的请求会通过插件与代理服务器建立的长连接将请求转发给插件启动的应用; 5. The request that satisfies the injection condition forwards the request to the application launched by the plugin through a long connection established by the plugin with the proxy server;
6.应用会将来自连接的请求转换为正常情况下的请求, 传给应用进行处理, 并将应答返回发送给代 理服务器, 并通过代理服务器下行给客户端; 6. The application will convert the request from the connection into a normal request, pass it to the application for processing, and send the response back to the proxy server, and downlink to the client through the proxy server;
7.应用退出后, 与代理服务器的连接会中断, 这时代理服务器会自动将注入项移除。  7. After the application exits, the connection to the proxy server will be interrupted, and the proxy server will automatically remove the injection.
这样就实现了在开发机上进行环境的注入调试。  This enables the injection and debugging of the environment on the development machine.
六、 跨应用服务平台系统的应用访问  Application access across the application service platform system
在跨 IDC机房的环境下, 每个机房中的部署结构均与前述的图 2所示的结构一致。 即每个 IDC机 房中都有一个图 2所示的应用服务平台系统。 这里每个 IDC称为一个 Site  In the environment across the IDC equipment room, the deployment structure in each equipment room is consistent with the structure shown in Figure 2 above. That is, each IDC room has an application service platform system as shown in Figure 2. Here each IDC is called a Site.
图 13是本发明实施例中的多个应用服务平台系统的结构示意图。 如图 13所示, 每个 IDC中都有 一个图 2所示的应用服务平台系统,在每个应用服务平台系统中增加一个网关,各应用服务平台系统之 间通过网关进行通信。 网关之间可以采用专线通讯, 或者采用压缩、 加密后的公网通信。  FIG. 13 is a schematic structural diagram of multiple application service platform systems in an embodiment of the present invention. As shown in Figure 13, each IDC has an application service platform system as shown in Figure 2. A gateway is added to each application service platform system, and each application service platform system communicates through the gateway. Private line communication can be used between gateways, or compressed and encrypted public network communication.
可见网关与其他应用服务平台系统中的网关进行通信, 实现应用的跨应用服务平台系统访问。具体 来说, 在每个应用服务平台系统中:  It can be seen that the gateway communicates with the gateways in other application service platform systems to implement application cross-application service platform system access. Specifically, in each application service platform system:
中心服务器,用于查找出本应用服务平台系统中部署的需要跨平台访问的应用所对应的应用配置信 息列表项, 并发送给本应用服务平台系统的网关;  a central server, configured to find an application configuration information list item corresponding to an application that needs to be accessed across platforms in the application service platform system, and send the information to the gateway of the application service platform system;
网关,用于将所接收的对应应用配置信息列表项信息发送给其他应用服务平台系统中的网关; 用于 接收其他应用服务平台系统中的网关发送的应用配置信息列表项,并对本中心服务器上的本地应用配置 信息列表做如下处理:  a gateway, configured to send the received corresponding application configuration information list item information to a gateway in another application service platform system; and configured to receive an application configuration information list item sent by a gateway in another application service platform system, and on the local server The list of local application configuration information is processed as follows:
对于所接收的每个应用配置信息列表项,如果本地的应用配置信息列表中存在对应的项,且其中的 应用进程名称不为网关,则忽略,如果本地的应用配置信息列表中不存在对应的项或者存在但其中的应 用进程名为网关,则用接收的应用配置信息列表项更新本地的应用配置信息列表,并在更新后的应用配 置信息列表项中增加远程系统字段, 将该字段的值设置为所接收应用配置信息列表项的来源系统。  For each application configuration information list item received, if there is a corresponding item in the local application configuration information list, and the application process name is not the gateway, it is ignored, if there is no corresponding corresponding in the local application configuration information list If the item or the existing application process name is a gateway, the local application configuration information list is updated by using the received application configuration information list item, and the remote system field is added in the updated application configuration information list item, and the value of the field is added. Set to the source system of the received application configuration information list item.
当要跨应用服务平台系统访问应用时:  When accessing an application across an application service platform system:
网关首先从本应用服务平台系统的中心服务器获取对应的应用配置信息列表项,查看对应的应用配 置信息列表项中的应用元数据标注中是否包含对等系统标注; 如果包含对等系统标注,则根据该应用的 应用上下文确定目标应用服务平台系统; 如果不包含对等系统标注,则通过该对应的应用配置信息列表 项中的远程系统字段确定目标应用服务平台系统;根据所确定的目标应用服务平台系统获知该目标应用 服务平台系统的网关的地址, 并将应用访问请求转发到目标应用服务平台系统的网关;  The gateway first obtains the corresponding application configuration information list item from the central server of the application service platform system, and checks whether the application metadata label in the corresponding application configuration information list item includes the peer system label; if the peer system label is included, Determining a target application service platform system according to an application context of the application; if the peer system annotation is not included, determining a target application service platform system by using a remote system field in the corresponding application configuration information list item; and applying the service according to the determined target application The platform system knows the address of the gateway of the target application service platform system, and forwards the application access request to the gateway of the target application service platform system;
所述网关还用于在接收到其他应用服务平台系统的网关发送的应用访问请求后,根据本应用服务平 台系统内的中心服务器上的应用配置信息列表和应用运行信息列表, 将请求转发到相应的应用。  The gateway is further configured to forward the request to the corresponding application configuration information list and the application running information list on the central server in the application service platform system after receiving the application access request sent by the gateway of the other application service platform system. Applications.
在本发明中,将只承栽与本应用服务平台系统内的用户相关的数据和应用的应用服务平台系统定义 为对等系统( PeerSite ); 将承栽本应用服务平台系统内的用户以及其他应用服务平台系统用户的数据和 应用的应用服务平台系统定义为非对等系统( NonPeerSite ); 根据前面的定义, AppContext中额外存在一个 GetSiteName( )方法,可以获取上下文所属的 PeerSite RemoteApp Bean的跨 S ite (即跨应用服务平台系统) 访问 In the present invention, an application service platform system that only supports data and applications related to users in the application service platform system is defined as a peer-to-peer system (PeerSite); users and other users within the application service platform system will be hosted. The application service platform system for the data and application of the application service platform system user is defined as a non-peer system (Non-PeerSite); According to the previous definition, there is an additional GetSiteName() method in the AppContext, which can obtain the cross-site (that is, cross-application service platform system) access of the PeerSite RemoteApp Bean to which the context belongs.
在本发明的实施例中, 在 Framework层面上只有 RemoteAppBean可以透过网关进行访问, 其他的 Bean均只能在本 Site内进行访问, 其中 RemoteAppB ean访问的方法 ^口下:  In the embodiment of the present invention, only the RemoteAppBean can be accessed through the gateway at the framework level, and other beans can only be accessed in the Site, and the method of the RemoteAppB ean access is as follows:
1.如果一个 RemoteAppBean只与一个 PeerSite中的用户相关, 则在该 RemoteAppBean的应用元数 据标注中增加对等系统标注; 如果一个 RemoteAppBean 不与特定 PeerSite 中的用户相关, 则该 RemoteAppBean的应用元数据标注中不增加对等系统标注;  1. If a RemoteAppBean is only related to a user in a PeerSite, add a peer system annotation in the application metadata annotation of the RemoteAppBean; if a RemoteAppBean is not associated with a user in a specific PeerSite, the application metadata annotation of the RemoteAppBean No equivalent system annotations are added;
即 RemoteAppBean存在一个额外的标注 @PeerSite; 其中 @PeerSite的定义如下: 如果该应用是用 户相关的,必须部 到用户所属的 PeerSite当中去,那么必须增加标注 @PeerSite;如果该 RemoetAppBean 在多个 Site中的部署不是用户相关的, 则不需要标注 @PeerSite  That is, RemoteAppBean has an additional annotation @PeerSite; where @PeerSite is defined as follows: If the application is user-dependent and must be part of the user's PeerSite, then the annotation @PeerSite must be added; if the RemoetAppBean is in multiple sites The deployment is not user-dependent, so you don't need to label @PeerSite
2.通过网关将不与特定对等系统中的用户相关的各 RemoteAppBean的路由信息在各个应用服务平 台系统间进行同步;  2. Synchronizing the routing information of each RemoteAppBean that is not related to the user in the specific peer system through the gateway between the application service platform systems;
3.根据所同步的路由信息实现不与特定对等系统中的用户相关的 RemoteAppB ean的跨应用服务平 台系统的访问。  3. Implementing access to the RemoteAppBean cross-application service platform system that is not associated with users in a particular peer system based on the synchronized routing information.
多个 Site之间的路由表的同步方式  Synchronization of routing tables between multiple sites
网关负责不同 Site间的 RemoteAppBean的路由, 因为本系统中 AppBean的路由是动态的(应用配 置信息列表以及应用运行信息列表), 所以在多个 Site间, 路由的同步是动态执行的。  The gateway is responsible for the routing of RemoteAppBeans between different sites. Because the routing of AppBeans in this system is dynamic (application configuration information list and application running information list), routing synchronization is dynamically performed among multiple sites.
通过网关将不与特定 PeerSite中的用户相关的各 RemoteAppBean的路由信息在各个应用服务平台 系统间进行同步包括:  Synchronizing the routing information of each RemoteAppBean that is not related to the user in a specific PeerSite through the gateway between the application service platform systems includes:
每个应用服务平台系统中的中心服务器查找出本应用服务平台系统中部署的应用元数据标注中不 包含对等系统标注 @PeerSite的 RemoteAppBean, 作为需要同步的 RemoteAppBean (标注为 @PeerSite 的 RemoteAppBean不进行同步), 并将需要同步的 RemoteAppBean的对应应用配置信息列表项发送给 本应用服务平台系统的网关,本应用服务平台系统的网关将所接收的对应应用配置信息列表项信息发送 给其他各应用服务平台系统中的网关;  The central server in each application service platform system finds the RemoteAppBean that does not include the peer system annotation @PeerSite in the application metadata annotation deployed in the application service platform system, and the RemoteAppBean that needs to be synchronized (the RemoteAppBean labeled @PeerSite does not. Synchronization), and the corresponding application configuration information list item of the RemoteAppBean that needs to be synchronized is sent to the gateway of the application service platform system, and the gateway of the application service platform system sends the received corresponding application configuration information list item information to other application services. a gateway in the platform system;
接收到所述对应应用配置信息列表项的网关做如下处理: 对于所接收的每个应用配置信息列表项, 如果本地的应用配置信息列表中存在对应的项, 且其中的应用进程名称不为网关, 则忽略, 如果本地的 应用配置信息列表中不存在对应的项或者存在但其中的应用进程名为网关,则用接收的应用配置信息列 表项更新本地的应用配置信息列表, 并在更新后的应用配置信息列表项中增加远程系统 RemoteSite字 段, 将该字段的值设置为所接收应用配置信息列表项的来源系统。  The gateway that receives the corresponding application configuration information list item is processed as follows: For each application configuration information list item received, if there is a corresponding item in the local application configuration information list, and the application process name is not the gateway Ignore, if there is no corresponding item in the local application configuration information list or exists but the application process name is the gateway, the local application configuration information list is updated with the received application configuration information list item, and is updated. The remote system RemoteSite field is added to the application configuration information list item, and the value of the field is set to the source system of the received application configuration information list item.
可见, 网关会在各个 Site间同步各个 Site中部署的非 PeerSite类型的 RemoteAppBean的路由数据, 当寻找 RemoteAppBean的路由地址时, 可以找到 RemoteAppBean的对应网关。  It can be seen that the gateway synchronizes the routing data of the non- PeerSite type RemoteAppBean deployed in each site between the sites. When looking for the routing address of the RemoteAppBean, the corresponding gateway of the RemoteAppBean can be found.
RemoteApp Bean的路由步撒  Routing step of RemoteApp Bean
根据所同步的路由信息实现不与特定对等系统 PeerSit中的用户相关的 RemoteAppBean的跨应用服 务平台系统的访问包括:  Access to the cross-application service platform system of RemoteAppBeans that are not related to users in a particular peer system PeerSit based on the synchronized routing information includes:
1.当要访问不与特定对等系统中的用户相关的 RemoteAppBean 时, 首先从本应用服务平台系统的 中心服务器获取对应的应用配置信息列表项;  1. When accessing a RemoteAppBean that is not related to a user in a specific peer system, first obtain a corresponding application configuration information list item from the central server of the application service platform system;
2.查看对应的应用配置信息列表项中的应用元数据标注中是否包含对等系统标注 @PeerSite;  2. Check whether the application metadata annotation in the corresponding application configuration information list item includes the peer system annotation @PeerSite;
如果包含对等系统标注@?66 , 则通过该 RemoteAppBean的应用上下文确定目标应用服务平台 系统;  If the peer system annotation @?66 is included, the target application service platform system is determined by the application context of the RemoteAppBean;
如果不包含对等系统标注 @PeerSite , 则通过该对应的应用配置信息列表项中的远程系统 RemoteSite字段确定目标应用服务平台系统;  If the peer system annotation @PeerSite is not included, the target application service platform system is determined by the remote system RemoteSite field in the corresponding application configuration information list item;
3.根据所确定的目标应用服务平台系统获知该目标应用服务平台系统的网关的地址, 并将访问请求 通过本应用服务平台系统的网关转发到目标应用服务平台系统的网关;  3. Learning, according to the determined target application service platform system, the address of the gateway of the target application service platform system, and forwarding the access request to the gateway of the target application service platform system through the gateway of the application service platform system;
4.目标应用服务平台系统的网关接收到所述访问请求后,根据本系统内的中心服务器上的应用配置 信息列表和应用运行信息列表, 将请求转发到相应的 RemoteAppBean  4. After receiving the access request, the gateway of the target application service platform system forwards the request to the corresponding RemoteAppBean according to the application configuration information list and the application operation information list on the central server in the system.
由上述可见, 本发明这种由上述代理服务器、应用服务器集群、 中心服务器和资源服务器构成的应 用服务平台系统, 将分散的服务器资源在逻辑上整合到一起, 并且面向单个信令的应用开发, 以及基于 基础框架类库和业务框架类库的开发方式极大降低了应用的开发难度,提高了部署的灵活性并降低了部 署的难度。  It can be seen from the above that the application service platform system consisting of the above proxy server, application server cluster, central server and resource server integrates the distributed server resources logically and is developed for a single signaling application. And the development method based on the basic framework class library and the business framework class library greatly reduces the development difficulty of the application, improves the flexibility of deployment and reduces the difficulty of deployment.
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本发明的精神和原则之内, 所 做的任何修改、 等同替换、 改进等, 均应包含在本发明保护的范围之内。  The above is only the preferred embodiment of the present invention, and is not intended to limit the present invention. Any modifications, equivalents, improvements, etc., which are made within the spirit and principles of the present invention, should be included in the present invention. Within the scope of protection.

Claims

权利要求书 Claim
1、 一种实现应用服务平台系统的方法, 其特征在于, 在应用服务平台系统中设置代理服务器和云 计算应用服务系统,且在云计算应用服务系统中保存应用的描述信息以及应用与应用服务器之间的对应 关系; 该方法包括:  A method for implementing an application service platform system, characterized in that a proxy server and a cloud computing application service system are set in an application service platform system, and the description information of the application and the application and the application server are saved in the cloud computing application service system. Correspondence between the two; the method includes:
代理服务器接收客户端请求消息, 对客户端请求消息进行解析, 确定对应的应用,根据该应用的描 述信息创建应用上下文,在所述客户端请求消息中添加应用上下文后,根据所述应用与应用服务器之间 的对应关系将客户端请求消息分发给对应的应用所在的应用服务器;  The proxy server receives the client request message, parses the client request message, determines the corresponding application, creates an application context according to the description information of the application, and adds an application context to the client request message, according to the application and the application. The correspondence between the servers distributes the client request message to the application server where the corresponding application is located;
所述云计算应用服务系统中的所述应用服务器在接收到代理服务器发送的客户端请求消息时,将该 客户端请求消息交给对应的应用进行处理;  When receiving the client request message sent by the proxy server, the application server in the cloud computing application service system hands the client request message to the corresponding application for processing;
所述对应的应用处理该客户端请求消息所请求的任务,根据所述应用上下文进行数据资源定位,得 出处理结果;  The corresponding application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result;
应用服务器将所述处理结果经代理服务器返回给客户端。  The application server returns the processing result to the client via the proxy server.
2、根据权利要求 1所述的方法, 其特征在于, 所述应用服务平台系统基于如下层次结构进行开发: 开发! 框架类库, 所述基础框架类库中定义多种应用组件 AppBean基础类型、 应用上下文接口 及基本应用上下文类型的实现, 以提供基础核心功能; 其中不同的 AppBean基础类型对应不同类型的 应用, 用于处理不同类型的信令;  2. The method according to claim 1, wherein the application service platform system is developed based on the following hierarchical structure: development! a framework class library, wherein the basic framework class library defines implementations of multiple application component AppBean foundation types, application context interfaces, and basic application context types to provide basic core functions; wherein different AppBean base types correspond to different types of applications, For processing different types of signaling;
根据业务特性, 在基础框架类库的基础上开发为业务定制的业务框架类库;  According to the business characteristics, develop a business framework class library customized for the business based on the basic framework class library;
基于 ^ftli框架类库和业务框架类库, 开发实现业务需求的应用; 以及, 基于基础框架类库和业务框 架类库, 实现代理服务器基于业务的路由与负栽功能。  Based on the ^ftli framework class library and business framework class library, develop applications that implement business requirements; and, based on the base framework class library and the business framework class library, implement the service-based routing and load-bearing functions of the proxy server.
3、 根据权利要求 2所述的方法, 其特征在于, 所述 AppBean基础类型包括: 处理超文本传输协议 HTTP请求的超文本传输协议应用组件 HttpAppBean、处理远程过程调用协议 RPC请求的远程调用应用 组件 RemoteAppBean、 和处理定时任务的任 应用组件 JobAppBean;  3. The method according to claim 2, wherein the AppBean base type comprises: a hypertext transfer protocol application component HttpAppBean that processes a hypertext transfer protocol HTTP request, and a remote call application component that processes a remote procedure call protocol RPC request. RemoteAppBean, and any application component JobAppBean that handles timed tasks;
当需要开发新类型应用时,该方法还包括:在业务框架类库中扩展与该新类型应用对应的 AppBean 基础类型, 以及在业务框架类库中扩展针对该新类型应用的应用上下文。  When a new type of application needs to be developed, the method further includes: extending an AppBean base type corresponding to the new type of application in the business framework class library, and extending an application context for the new type of application in the business framework class library.
4、 根据权利要求 1所述的方法, 其特征在于, 所述应用上下文在数据构成上包括两部分: 通用资源标志符 URI: 包括用户的索引信息, 负责后续的资源定位;  The method according to claim 1, wherein the application context comprises two parts in data composition: a universal resource identifier URI: including index information of the user, and is responsible for subsequent resource positioning;
附加数据: 包括该应用的属性信息。  Additional data: Includes attribute information for the app.
5、 根据权利要求 1-4任一项所述的方法, 其特征在于,  5. A method according to any one of claims 1-4, characterized in that
所述云计算应用服务系统包括: 中心服务器、资源服务器和由多个应用服务器组成的应用服务器集 群; 其中,在资源服务器上保存应用服务器上的各应用处理客户端请求消息所请求的任务时需要访问的 数据资源;  The cloud computing application service system includes: a central server, a resource server, and an application server cluster composed of a plurality of application servers; wherein, the resource server needs to save the tasks requested by each application on the application server to process the client request message. Access to data resources;
所述应用服务器集群上负栽并运行应用;  Hosting and running the application on the application server cluster;
所述在云计算应用服务系统中保存应用的描述信息以及应用与应用服务器之间的对应关系包括:中 心服务器接收外部上传的应用,将应用的描述信息保存到应用配置信息列表中,并将应用部署到应用服 务器集群中的应用服务器上;应用服务器集群中的应用服务器将所负栽的应用的运行信息上传到中心服 务器上的用于保存应用与应用服务器之间对应关系的应用运行信息列表中;  The saving the description information of the application and the correspondence between the application and the application server in the cloud computing application service system include: the central server receives the externally uploaded application, saves the description information of the application to the application configuration information list, and applies the application Deployed to the application server in the application server cluster; the application server in the application server cluster uploads the running information of the loaded application to the application running information list on the central server for saving the correspondence between the application and the application server. ;
其中, 应用配置信息列表包括如下信息: 应用 ID、 应用名称、 应用类型、 应用进程名和应用元数 据标注; 应用运行信息列表包括如下信息: 应用进程名称和应用的服务地址;  The application configuration information list includes the following information: an application ID, an application name, an application type, an application process name, and an application metadata identifier; the application operation information list includes the following information: an application process name and an application service address;
所述代理服务器接收客户端请求消息, 对客户端请求消息进行解析, 确定对应的应用, 以及所述根 据应用与应用服务器之间的对应关系将客户端请求消息分发给对应的应用所在的应用服务器包括:代理 服务器在接收到客户端请求消息时,对客户端请求消息进行解析,通过查询中心服务器上的应用配置信 息列表识别所述客户端请求消息所对应的应用,通过查询中心服务器上的应用配置信息列表和应用运行 信息列表获得对应的应用的服务地址,根据所获得的服务地址将客户端请求消息分发给对应的应用服务 所在的应用服务器。  The proxy server receives the client request message, parses the client request message, determines the corresponding application, and distributes the client request message to the application server where the corresponding application is located according to the correspondence between the application and the application server. The proxy server parses the client request message when receiving the client request message, and identifies the application corresponding to the client request message by querying the application configuration information list on the central server, and queries the application on the central server. The configuration information list and the application running information list obtain the service address of the corresponding application, and distribute the client request message to the application server where the corresponding application service is located according to the obtained service address.
6、 根据权利要求 5所述的方法, 其特征在于, 所述代理服务器根据应用的描述信息创建应用上下 文包括:  The method according to claim 5, wherein the proxy server creates an application context according to the description information of the application, including:
代理服务器在接收到客户端请求消息时,从客户端请求消息中提取请求参数,查询中心服务器中的 应用配置信息列表,查找出请求参数与元数据标注字段符合的应用配置信息列表项,然后根据该应用配 置信息列表项中的元数据标注字段中的关于加栽应用上下文的信息, 创建应用上下文。  When receiving the client request message, the proxy server extracts the request parameter from the client request message, queries the application configuration information list in the central server, and searches for the application configuration information list item that meets the request parameter and the metadata label field, and then according to the application configuration information list item. The information about the processing application context in the metadata label field in the application configuration information list item creates an application context.
7、 根据权利要求 5所述的方法, 其特征在于, 所述中心服务器上还保存资源列表; 资源列表包括 如下信息: 资源名称、 资源类型、 应用上下文类型、 定位算法名称和定位算法参数; 所述应用处理客户端请求消息所请求的任务,根据所述应用上下文进行数据资源定位包括:应用在 接收到客户端请求消息后,在完成该客户端请求消息所请求的任务的过程中根据应用上下文以及资源列 表中的对应信息进行资源定位。 The method according to claim 5, wherein the central server further saves a resource list; the resource list includes the following information: a resource name, a resource type, an application context type, a positioning algorithm name, and a positioning algorithm parameter; The application processes the task requested by the client request message, and the data resource location according to the application context includes: after receiving the client request message, the application according to the application in completing the task requested by the client request message The resource and the corresponding information in the resource list are used for resource location.
8、 根据权利要求 5所述的方法, 其特征在于, 所述代理服务器在接收到客户端请求消息时, 对客 户端请求消息进行解析,通过查询中心服务器上的应用配置信息列表识别所述客户端请求消息所对应的 应用包括:  The method according to claim 5, wherein the proxy server parses the client request message when receiving the client request message, and identifies the client by querying the application configuration information list on the central server. The application corresponding to the end request message includes:
代理服务器在接收到 HTTP请求消息时, 根据该请求消息中的统一资源定位符 URL, 查找出中心 服务器上的应用元数据标注字段包括有与所述 URL—致信息的应用配置信息列表项, 根据所查找出的 应用配置信息列表项中的应用名称识别出该客户端请求消息所对应的应用;  When receiving the HTTP request message, the proxy server searches for the application metadata tag field on the central server according to the uniform resource locator URL in the request message, and includes an application configuration information list item with the URL-based information, according to The application name in the found application configuration information list item identifies the application corresponding to the client request message;
或者,  Or,
代理服务器在接收到 Rpc请求消息时, 根据该请求消息中的远程调用服务名称, 查找出中心服务 器上应用名称字段与所述远程调用服务名称一致的应用配置信息列表项,根据所查找出的应用配置信息 列表项中应用名称字段识别出该请求消息所对应的应用;  When receiving the Rpc request message, the proxy server searches for the application configuration information list item whose application name field is consistent with the remote calling service name on the central server according to the remote calling service name in the request message, according to the found application. The application name field in the configuration information list item identifies the application corresponding to the request message;
所述通过查询中心服务器上的应用配置信息列表和应用运行信息列表获得对应的应用的服务地址 包括:代理服务器根据所查找出的应用配置信息列表项中的应用进程名,查找出中心服务器上的应用进 程名称字段包含与所述应用进程名一致信息的应用运行信息列表项,从所查找出的应用运行信息列表项 中获取应用的服务地址信息。  The obtaining, by the application configuration information list and the application running information list on the query center server, the service address of the corresponding application includes: searching, by the proxy server, the application process name in the searched application configuration information list item, The application process name field includes an application running information list item that is consistent with the application process name, and obtains the service address information of the application from the found application running information list item.
9、 根据权利要求 5所述的方法, 其特征在于, 该方法进一步包括:  The method according to claim 5, wherein the method further comprises:
将所述应用服务器集群中的多个应用服务器分为多个不同组;  Dividing a plurality of application servers in the application server cluster into a plurality of different groups;
在所述中心服务器上保存应用服务器列表和应用服务器分组列表; 其中,应用服务器列表包括如下 信息: 应用服务器名称、 应用服务器所属的分组名称和应用服务器地址; 应用服务器分组列表包括: 应 用服务器分组名称和分组中的应用服务器描述信息;  Saving an application server list and an application server grouping list on the central server; wherein the application server list includes the following information: an application server name, a group name to which the application server belongs, and an application server address; the application server grouping list includes: an application server group name And application server description information in the group;
中心服务器在接收到外部上传的应用时,根据外部指令将该应用部署到单个应用服务器上,或者部 署到属于同一组的多个服务器上。  When receiving the externally uploaded application, the central server deploys the application to a single application server according to external instructions, or deploys to multiple servers belonging to the same group.
10、根据权利要求 9所述的方法, 其特征在于, 所述中心服务器将应用部署到应用服务器集群中的 应用服务器上包括:  The method according to claim 9, wherein the deploying the application to the application server in the application server cluster by the central server comprises:
在每个应用服务器上部署一个守护进程;在中心服务器上保存应用进程列表;该应用进程列表包括: 应用进程标识、 动态端口标记、 应用服务器名称、 应用服务器分组名称、 部署包接口和服务端口; 中心服务器根据应用服务器列表、应用服务器分组列表和应用进程列表中的信息,确定每个应用服 务器上应启动的应用进程部署信息列表;该应用进程部署信息列表包括:应用进程标识、动态端口标记、 部署包接口和服务端口;  A daemon is deployed on each application server; a list of application processes is saved on the central server; the application process list includes: an application process identifier, a dynamic port tag, an application server name, an application server group name, a deployment package interface, and a service port; The central server determines, according to the information in the application server list, the application server grouping list, and the application process list, a list of application process deployment information that should be started on each application server; the application process deployment information list includes: an application process identifier, a dynamic port identifier, Deploy the package interface and service port;
每个应用服务器上的守护进程启动后,与中心服务器建立连接并保持心跳,从中心服务器获取本应 用服务器的应用进程部署信息列表, 根据该应用进程部署信息列表下栽并启动本应用服务器的应用进 程;  After the daemon of each application server is started, a connection is established with the central server and the heartbeat is maintained. The application process deployment information list of the application server is obtained from the central server, and the application server of the application server is downloaded and started according to the application process deployment information list. Process
每个启动的应用进程都与中心服务器建立连接并保持心跳;  Each launched application process establishes a connection with the central server and maintains a heartbeat;
中心服务器为每个建立连接的守护进程在守护进程状态信息列表中记录其连接信息,以及为每个建 立连接的应用进程在应用运行信息列表中保存记录其连接信息。  The central server records its connection information in the daemon status information list for each daemon that establishes the connection, and saves the connection information in the application operation information list for each application process that establishes the connection.
11、 根据权利要求 10所述的方法, 其特征在于, 所述中心服务器上的应用服务器列表还包括: 服 务器端口池范围;  The method according to claim 10, wherein the application server list on the central server further comprises: a server port pool range;
该方法还包括:  The method also includes:
每个应用服务器上的守护进程启动后,从中心服务器上的应用服务器列表获取本应用服务器的端口 池范围, 测试该端口池范围中的尚未开启监听的端口号, 将其标记为可用;  After the daemon on each application server is started, obtain the port pool range of the application server from the application server list on the central server, test the port number in the port pool range that has not been turned on, and mark it as available;
当启动一个应用进程,如果其对应的应用进程部署信息列表项中的动态端口标记为动态端口,则守 护进程根据对应的应用进程部署信息列表项中的服务端口获知该应用进程所需的端口号数量,并从本应 用服务器的端口池范围中取出相应数量的端口号分配给该应用进程, 并将所分配的端口号标记为已占 用;  When an application process is started, if the dynamic port in the corresponding application process deployment information list item is marked as a dynamic port, the daemon process learns the port number required by the application process according to the service port in the corresponding application process deployment information list item. Quantity, and extract the corresponding number of port numbers from the port pool range of the application server to the application process, and mark the assigned port number as occupied;
当该应用进程退出时, 守护进程将该应用进程所占用的端口号返回给端口池。  When the application process exits, the daemon returns the port number occupied by the application process to the port pool.
12、 根据权利要求 10所述的方法, 其特征在于, 该方法还包括:  12. The method according to claim 10, wherein the method further comprises:
客户端与中心服务器建立连接,向中心服务器提供自己要访问的应用进程标识信息; 中心服务器读 取应用进程列表和应用运行信息列表, 将符合客户端所提供的应用进程标识信息的记录返回给客户端; 客户端解析所接收内容, 从中选择一个记录进行路由;  The client establishes a connection with the central server, and provides the central server with the application process identification information to be accessed by the central server; the central server reads the application process list and the application operation information list, and returns a record matching the application process identification information provided by the client to the client. The client parses the received content, and selects a record for routing;
当应用进程列表或应用运行信息列表发生变化时, 中心服务器通知客户端,客户端重新从中心服务 器获取符合自己要访问的应用进程标识信息的记录。 When the application process list or the application running information list changes, the central server notifies the client that the client re-acquires the record from the central server that matches the application process identification information that it wants to access.
13、 根据权利要求 10所述的方法, 其特征在于, 该方法还包括: 13. The method according to claim 10, wherein the method further comprises:
增加一个与中心服务器连接的控制终端;  Add a control terminal connected to the central server;
控制终端向中心服务器发送启动指定应用进程的请求, 中心服务器将该请求发送给对应的守护进 程, 守护进程启动该指定应用进程, 该应用进程连接守护进程, 守护进程将该请求发送给该应用进程, 该应用进程调用服务的启动方法;  The control terminal sends a request to the central server to start the specified application process, and the central server sends the request to the corresponding daemon, and the daemon starts the specified application process, and the application process connects to the daemon, and the daemon sends the request to the application process. , the application process invokes a service startup method;
控制终端向中心服务器发送停止指定应用进程的请求, 中心服务器将该请求发送给对应的守护进 程, 守护进程再将该请求发送给该指定应用进程, 该应用进程调用服务的停止方法, 守护进程停止该应 用进程。  The control terminal sends a request to the central server to stop the specified application process, and the central server sends the request to the corresponding daemon, and the daemon sends the request to the specified application process, and the application process invokes the stop method of the service, and the daemon stops. The application process.
14、 根据权利要求 10所述的方法, 其特征在于, 增加一个与中心服务器连接的控制终端, 该方法 还包括更新应用进程的过程, 将指定应用进程 A更新为应用进程 A'具体包括:  The method according to claim 10, wherein a control terminal connected to the central server is added, the method further comprising the process of updating the application process, and updating the specified application process A to the application process A' specifically includes:
控制终端向中心服务器发送将 A更新为 A'的请求, 中心服务器将该请求发送给对应的守护进程, 守护进程先停止应用进程 A, 然后下栽 Α' , 并用 A'覆盖 Α, 启动新的应用进程 Α' ;  The control terminal sends a request to update the A to A' to the central server, and the central server sends the request to the corresponding daemon. The daemon stops the application process A first, then slams ', and overwrites with A' to start a new one. Application processΑ';
或者,  Or,
控制终端向中心服务器发送用 A'更新的请求, 中心服务器将该请求发送给对应的守护进程, 守护 进程下栽 Α,的部署包, 并启动应用进程 A,, 应用进程 A,启动后向中心服务器进行注册; 然后, 控制 终端向中心服务器发送更新 A的请求, 中心服务器将该请求发送给对应的守护进程, 守护进程再将该 请求发给应用进程 A, 应用进程 A删除自身在中心服务器上的注册信息, 该应用进程 A停止。  The control terminal sends a request for updating with the A' to the central server, and the central server sends the request to the corresponding daemon, the deployment package of the daemon, and the application process A, the application process A, and the start to the center The server registers; then, the control terminal sends a request for updating A to the central server, and the central server sends the request to the corresponding daemon, and the daemon sends the request to the application process A, and the application process A deletes itself on the central server. Registration information, the application process A stops.
15、 根据权利要求 10所述的方法, 其特征在于, 该方法还包括对应用的热更新过程, 具体包括: 中心服务器向对应的应用服务器的守护进程发送更新指令; 守护进程下栽新的应用,启动一个新应 用进程,该新应用进程与中心服务器建立连接, 中心服务器为该新应用进程在应用运行信息列表中记录 其连接信息;中心服务器更新应用配置信息列表中的应用进程名,并将该变化同步到所有监听的客户端。  The method according to claim 10, further comprising: performing a hot update process on the application, specifically: the central server sends an update instruction to a daemon of the corresponding application server; the daemon processes the new application. , starting a new application process, the new application process establishes a connection with the central server, the central server records the connection information in the application running information list for the new application process; the central server updates the application process name in the application configuration information list, and This change is synchronized to all listening clients.
16、 根据权利要求 10所述的方法, 其特征在于, 所述方法还包括在中心服务器上配置应用配置信 息列表的过程, 具体包括:  The method of claim 10, further comprising: configuring the application configuration information list on the central server, specifically:
解析应用的 JAVA应用发布 jar包, 将解析后的数据保存在应用组件列表和应用包列表中; 其中, 应用组件列表包括: 应用类型、 应用版本、 应用名称、 应用元数据标注、 输入参数类型、 输 出参数类型、 依赖关系和包标识; 应用包列表包括: 包标识、 包版本和包所在服务地址;  Parsing the application's JAVA application release jar package, and saving the parsed data in the application component list and the application package list; wherein, the application component list includes: an application type, an application version, an application name, an application metadata annotation, an input parameter type, Output parameter types, dependencies, and package identifiers; the application package list includes: the package identifier, the package version, and the service address where the package is located;
根据应用组件列表和应用包列表生成应用配置信息列表。  A list of application configuration information is generated based on the application component list and the application package list.
17、根据权利要求 5所述的方法, 其特征在于, 该方法还包括: 在所述应用服务平台系统中对应用 进行灰度发布, 则所述应用配置信息列表还包括: 灰度发布因子; 对于不采用灰度发布的应用, 将其对 应的灰度发布因子设置为空;  The method according to claim 5, wherein the method further comprises: performing grayscale publishing on the application in the application service platform system, wherein the application configuration information list further comprises: a grayscale publishing factor; For applications that do not use grayscale publishing, set their corresponding grayscale publishing factor to null;
代理服务器接收到客户端请求消息后,通过查询中心服务器上的应用配置信息列表识别所述客户端 请求消息所对应的应用, 如果找到多个应用, 则按如下方式选择;  After receiving the client request message, the proxy server identifies the application corresponding to the client request message by using the application configuration information list on the query center server. If multiple applications are found, the proxy server selects the following manner;
代理服务器先在灰度发布因子不为空的应用中对其灰度发布因子进行匹配,如果匹配命中则选择所 命中的应用, 如果没有匹配命中则选择灰度发布因子为空的应用。  The proxy server first matches its grayscale publishing factor in an application whose grayscale publishing factor is not empty. If the matching hits, the selected application is selected. If there is no matching hit, the application whose grayscale publishing factor is empty is selected.
18、 根据权利要求 17所述的方法, 其特征在于, 所述灰度发布因子为条件表达式;  The method according to claim 17, wherein the grayscale publishing factor is a conditional expression;
所述代理服务器先在灰度发布因子不为空的应用中对其灰度发布因子进行匹配包括:  The proxy server first matches its grayscale publishing factor in an application whose grayscale publishing factor is not empty, including:
代理服务器对客户端请求消息进行解析, 确定中心服务器上的应用配置信息列表中的对应列表项, 根据该对应列表项中的信息创建应用上下文,根据所创建的应用上下文中的灰度发布因子匹配条件信息 匹配灰度发布因子, 如果符合灰度发布因子所表达的条件, 则命中。  The proxy server parses the client request message, determines a corresponding list item in the application configuration information list on the central server, creates an application context according to the information in the corresponding list item, and matches the grayscale publishing factor according to the created application context. The condition information matches the grayscale release factor, and if it meets the condition expressed by the grayscale release factor, it hits.
19、 根据权利要求 17或 18所述的方法, 其特征在于, 当发布了应用 B和调用 B的应用 A后, 又 对相应的升级版本 B'和 A'进行了灰度发布, 并将 B'的灰度因子设定为匹配 A'的版本号, 则客户端请求 消息路由到 A'后的过程如下:  The method according to claim 17 or 18, wherein, after the application B of the application B and the call B is issued, the corresponding upgrade versions B' and A' are gray-scaled, and B is 'The gray factor is set to match the version number of A', then the process after the client requests the message to route to A' is as follows:
A,在应用配置信息列表中寻找要调用的应用, 找到 B和 B,; 由于 B,的灰度发布因子不为空, 因此 先进行匹配; A,获取自身的版本号后匹配 B,的灰度发布因子, 命中; A,选择 B,作为调用的应用。  A, in the application configuration information list, look for the application to be called, find B and B,; because B, the grayscale publishing factor is not empty, so first match; A, get the version number of itself and match B, the gray Degree release factor, hit; A, select B, as the application to call.
20、 根据权利要求 5所述的方法, 其特征在于, 该方法进一步包括:  The method according to claim 5, wherein the method further comprises:
增加一个与中心服务器连接的用于保存应用的配置信息的全局配置数据库;  Add a global configuration database that is connected to the central server to hold the configuration information of the application;
应用服务器向中心服务器发送配置信息请求消息;  The application server sends a configuration information request message to the central server;
中心服务器在接收到应用服务器发送的配置信息请求消息后,从全局配置数据库检索出相应的配置 信息并返回给应用服务器 。  After receiving the configuration information request message sent by the application server, the central server retrieves the corresponding configuration information from the global configuration database and returns it to the application server.
21、 根据权利要求 20所述的方法, 其特征在于, 所述全局配置数据库中保存了默认配置信息和特 例化配置信息;  The method according to claim 20, wherein the default configuration information and the special configuration information are saved in the global configuration database;
所述中心服务器在接收到应用服务器发送的配置信息请求消息后,从全局配置数据库检索出相应的 配置信息并返回给应用服务器包括: 中心服务器在接收到应用服务器发送的配置信息请求消息后,根据 最大匹配原则对配置信息请求消息中匹配参数进行匹配,将匹配到的默认配置信息或特例化配置信息返 回给应用服务器。 After receiving the configuration information request message sent by the application server, the central server retrieves the corresponding configuration information from the global configuration database and returns the information to the application server. The central server receives the configuration information request message sent by the application server, according to the The maximum matching principle matches the matching parameters in the configuration information request message, and returns the matched default configuration information or special configuration information to the application server.
22、 根据权利要求 20所述的方法, 其特征在于, 该方法还包括:  22. The method according to claim 20, wherein the method further comprises:
终端向中心服务器发起配置更新请求;  The terminal initiates a configuration update request to the central server;
中心服务器对全局配置数据库中的配置信息进行更新,并找到对应的应用进程的连接,通过该连接 下发配置更新请求;  The central server updates the configuration information in the global configuration database, and finds the connection of the corresponding application process, and sends a configuration update request through the connection;
对应的应用进程重新从中心服务器获取配置信息, 刷新配置信息并返回结果给中心服务器; 中心服务器将结果返回给终端。  The corresponding application process re-acquires the configuration information from the central server, refreshes the configuration information, and returns the result to the central server; the central server returns the result to the terminal.
23、 根据权利要求 20所述的方法, 其特征在于, 该方法还包括: 应用服务器从本应用服务器的本 地获取配置信息;  The method according to claim 20, further comprising: the application server acquiring the configuration information from the local location of the application server;
其中,应用服务器通过切换远程加栽模块和本地加栽模块,来实现远程从中心服务器获取配置信息 的模式以及从本地获取配置信息的模式之间的切换;  The application server switches between the mode of obtaining the configuration information from the central server remotely and the mode of obtaining the configuration information from the local device by switching the remote loading module and the local loading module.
所述远程加栽模块,用于向中心服务器发送配置信息请求消息,并接收中心服务器返回的配置信息; 所述本地加栽模块, 用于从应用服务器的本地获取配置信息。  The remote loading module is configured to send a configuration information request message to the central server, and receive configuration information returned by the central server. The local loading module is configured to obtain configuration information locally from the application server.
24、 根据权利要求 10所述的方法, 其特征在于, 该方法进一步包括:  The method according to claim 10, wherein the method further comprises:
增加与中心服务器连接的全局监控数据库,与全局监控数据库连接的监控服务器; 以及每个应用服 务器中增加一个本机日志数据库;  Add a global monitoring database connected to the central server, a monitoring server connected to the global monitoring database; and add a native log database to each application server;
在全局监控数据库中保存不同监控策略;  Save different monitoring policies in the global monitoring database;
应用服务器中的守护进程以及应用进程, 通过中心服务器从全局监控数据库获取对应的监控策略, 根据所获取的监控策略进行监控,将监控结果数据保存到本机日志数据库中, 以及根据监控策略将相应 的监控结果数据通过中心服务器上传到全局监控数据库中, 并在获取到的数据超过阀值时附加报警标 记;  The daemon process and the application process in the application server obtain the corresponding monitoring policy from the global monitoring database through the central server, monitor according to the acquired monitoring policy, save the monitoring result data to the local log database, and correspondingly according to the monitoring policy The monitoring result data is uploaded to the global monitoring database through the central server, and an alarm flag is attached when the acquired data exceeds the threshold;
监控服务器展示全局监控数据库中的监控结果数据, 并提示报警。  The monitoring server displays the monitoring result data in the global monitoring database and prompts the alarm.
25、 根据权利要求 24所述的方法, 其特征在于, 应用服务器中的守护进程, 根据所获取的监控策 略进行监控包括:  The method according to claim 24, wherein the monitoring process in the application server is performed according to the acquired monitoring policy, including:
应用服务器中的守护进程对系统资源计数器进行监控; 监控的指标包括: CPU指标、 内存指标、 磁盘指标、 网卡流量指标或 MySQL指标。  The system resource counters are monitored by the daemon in the application server; the monitored indicators include: CPU metrics, memory metrics, disk metrics, NIC traffic metrics, or MySQL metrics.
26、 根据权利要求 24所述的方法, 其特征在于, 应用服务器中的应用进程, 根据所获取的监控策 略进行监控包括:  The method according to claim 24, wherein the application process in the application server performs monitoring according to the acquired monitoring policy, including:
设计程序内嵌计数器, 在应用进程中嵌入所设计程序内嵌计数器;  The design program embeds the counter, embedding the embedded counter of the designed program in the application process;
应用服务器中的应用进程根据所获取的监控策略对程序内嵌计数器进行监控。  The application process in the application server monitors the program embedded counter according to the acquired monitoring policy.
27、 根据权利要求 26所述的方法, 其特征在于, 所述设计程序内嵌计数器包括: 设计程序内嵌计 数器包含多个名字唯一的类别; 每个类别包含多个固定的列和多个名字唯一的实例;  27. The method according to claim 26, wherein the design program inline counter comprises: the design program inline counter comprises a plurality of categories with unique names; each category comprises a plurality of fixed columns and multiple names The only instance;
生成一个类别的方法包括: 确定该类别的名字,设置该类别的输出列、该类别的一组原子计数器和 原子计数器的操作方法、 该类别的快照的数据格式以及该类别的根据快照数据计算输出实例的方法。  Methods for generating a category include: determining the name of the category, setting an output column for the category, a set of atomic counters and atomic counter operations for the category, a data format for the snapshot of the category, and an output based on the snapshot data for the category The method of the instance.
28、 根据权利要求 24至 27中任一项所述的方法, 其特征在于, 该方法进一步包括:  The method according to any one of claims 24 to 27, wherein the method further comprises:
监控服务器对全局监控数据库中的监控策略进行更新, 然后向指定应用服务器中的守护进程和 /或 应用进程发送监控策略更新通知;  The monitoring server updates the monitoring policy in the global monitoring database, and then sends a monitoring policy update notification to the daemon and/or application process in the specified application server;
所述指定应用服务器中的守护进程和 /或应用进程收到所述监控策略更新通知后, 从全局配置服务 器获取对应的更新后的监控策略。  After receiving the monitoring policy update notification, the daemon and/or the application process in the specified application server obtains the corresponding updated monitoring policy from the global configuration server.
29、 根据权利要求 5所述的方法, 其特征在于, 在所述应用的开发中, 该方法还包括: 基于插件系统 Eclipse生成扩展插件,该扩展插件创建并管理工程组件、 实现基于版本的升级系统、 创建应用的框架代码、 实现对 RemoteAppBean调用代码的生成、 协助管理依赖信息以及实现对应用的 注入式调试。  The method according to claim 5, wherein in the development of the application, the method further comprises: generating an extension based on the plug-in system Eclipse, the extension creating and managing engineering components, implementing a version-based upgrade System, create application framework code, implement generation of RemoteAppBean calling code, assist in managing dependency information, and implement injection debugging of the application.
30、根据权利要求 29所述的方法, 其特征在于, 所述扩展插件实现对 RemoteAppBean调用代码的 生成包括:  30. The method of claim 29, wherein the generating of the RemoteAppBean calling code by the extension comprises:
在开发一个需要访问 RemoteAppBean 的应用时, 扩展插件从开发管理服务器获取已公开的所有 RemoteAppBean, 并将其信息显示给开发者, 又开发者选择要调用的 RemoteAppBean;  When developing an application that needs to access RemoteAppBean, the extension gets all the exposed RemoteAppBeans from the development management server and displays its information to the developer, and the developer selects the RemoteAppBean to be called.
扩展插件从所选择的 RemoteAppBean的反射信息中获取如下信息: 应用名称和类型信息; 所述类 型信息包括请求、 应答和上下文的类型信息;  The extension plugin obtains the following information from the reflection information of the selected RemoteAppBean: application name and type information; the type information includes type information of the request, the response, and the context;
扩展插件根据所获取的信息生成请求和应答类型实体类;  The extension generates a request and response type entity class based on the obtained information;
扩展插件根据所述请求和应答实体类型创建代理类, 并将该代理类插入到所述需要访问 RemoteAppBean的应用中。 The extension creates a proxy class based on the request and response entity type and inserts the proxy class into the application that needs to access the RemoteAppBean.
31、 根据权利要求 30所述的方法, 其特征在于, 该方法还包括: 显示创建应用之间的依赖信息, 并在应用的更新过程中检测依赖信息, 以确定是否进行应用的更新。 31. The method according to claim 30, wherein the method further comprises: displaying dependency information between the created applications, and detecting the dependency information during the update process of the application to determine whether to update the application.
32、 根据权利要求 31所述的方法, 其特征在于, 所述在应用的更新过程中检测依赖信息, 以确定 是否进行应用的更新包括:  The method according to claim 31, wherein the detecting the dependency information in the update process of the application to determine whether to perform the update of the application comprises:
用升级后的应用 A'更新应用 A时, 判断是否存在依赖于应用 A的应用 B;  When the application A is updated with the upgraded application A', it is determined whether there is an application B that depends on the application A;
如果存在, 则判断应用 A'的请求和应答参数是否与应用 A的请求和应答参数兼容,是则允许更新, 否则不允许更新。  If it exists, it is judged whether the request and response parameters of the application A' are compatible with the request and response parameters of the application A, and the update is allowed, otherwise the update is not allowed.
33、 根据权利要求 29所述的方法, 其特征在于, 所述扩展插件实现对应用的注入式调试包括: 扩展插件在本地启动应用;  33. The method according to claim 29, wherein the implementing the injecting debugging of the application by the extension comprises: the extension plugin launching the application locally;
所述启动的应用与代理服务器创建连接,并向代理服务器发送要调试应用的配置参数; 所述要调试 应用的配置参数限定指定范围内的用户;  The launched application creates a connection with the proxy server, and sends a configuration parameter to the proxy server to debug the application; the configuration parameter of the application to be debugged defines a user within the specified range;
代理服务器在接收到客户端请求消息后,首先匹配所述要调试应用的配置参数,如果匹配成功则将 客户端请求消息发送给所述启动的应用处理,并将所述启动的应用返回的处理结果发送给客户端,如果 匹配不成功, 则将客户端请求分发给对应的应用所在的应用服务器。  After receiving the client request message, the proxy server first matches the configuration parameter of the application to be debugged, and if the matching succeeds, sends a client request message to the initiated application processing, and returns the processed application. The result is sent to the client. If the match is unsuccessful, the client request is distributed to the application server where the corresponding application is located.
34、 根据权利要求 5所述的方法, 其特征在于, 该方法进一步包括:  The method according to claim 5, wherein the method further comprises:
实现多个所述的应用服务平台系统,在每个应用服务平台系统中增加一个网关,各应用服务平台系 统之间通过网关进行通信;  Implementing a plurality of said application service platform systems, adding a gateway in each application service platform system, and communicating between the application service platform systems through the gateway;
将只承栽与本应用服务平台系统内的用户相关的数据和应用的应用服务平台系统定义为对等系统; 将承栽本应用服务平台系统内的用户以及其他用户的数据和应用的应用服务平台系统定义为非对等系 统;  An application service platform system that only supports data and applications related to users in the application service platform system is defined as a peer-to-peer system; data and application applications of users and other users within the application service platform system will be hosted. The platform system is defined as a non-peer system;
通过网关对远程调用应用组件 RemoteAppBean进行跨应用服务平台系统的访问。  The application component RemoteAppBean is remotely invoked through the gateway to access the application service platform system.
35、根据权利要求 34所述的方法, 其特征在于, 所述通过网关对 RemoteAppBean进行跨应用服务 平台系统的访问包括:  35. The method according to claim 34, wherein the accessing the RemoteAppBean to the application service platform system by using the gateway comprises:
如果一个 RemoteAppBean只与一个对等系统中的用户相关,则在该 RemoteAppBean的应用元数据 标注中增加对等系统标注; 如果一个 RemoteAppBean 不与特定对等系统中的用户相关, 则该 RemoteAppBean的应用元数据标注中不增加对等系统标注;  If a RemoteAppBean is only associated with a user in a peer system, add a peer system annotation to the application metadata annotation of the RemoteAppBean; if a RemoteAppBean is not associated with a user in a particular peer system, the application element of the RemoteAppBean No equivalent system labeling is added to the data annotation;
通过网关将不与特定对等系统中的用户相关的各 RemoteAppBean的路由信息在各个应用服务平台 系统间进行同步;  Routing information of each RemoteAppBean that is not related to a user in a specific peer system is synchronized by the gateway between the application service platform systems;
根据所同步的路由信息实现不与特定对等系统中的用户相关的 RemoteAppBean的跨应用服务平台 系统的访问。  Access to a cross-application service platform system of RemoteAppBeans that are not associated with users in a particular peer system is implemented based on the synchronized routing information.
36、 根据权利要求 35所述的方法, 其特征在于, 所述通过网关将不与特定对等系统中的用户相关 的各 RemoteAppBean的路由信息在各个应用服务平台系统间进行同步包括:  36. The method according to claim 35, wherein the synchronizing the routing information of each RemoteAppBean that is not related to the user in the specific peer system by the gateway between the application service platform systems comprises:
每个应用服务平台系统中的中心服务器查找出本应用服务平台系统中部署的应用元数据标注中不 包括对等系统标注的 RemoteAppBean , 作为需要同步的 RemoteAppBean , 并将需要同步的 RemoteAppBean 的对应应用配置信息列表项发送给本应用服务平台系统的网关, 本应用服务平台系统 的网关将所接收的对应应用配置信息列表项信息发送给其他各应用服务平台系统中的网关;  The central server in each application service platform system finds the RemoteAppBean that does not include the peer system annotation in the application metadata annotation deployed in the application service platform system, as the RemoteAppBean that needs to be synchronized, and configures the corresponding application of the RemoteAppBean that needs to be synchronized. The information list item is sent to the gateway of the application service platform system, and the gateway of the application service platform system sends the received corresponding application configuration information list item information to the gateway in the other application service platform systems;
接收到所述对应应用配置信息列表项的网关做如下处理: 对于所接收的每个应用配置信息列表项, 如果本地的应用配置信息列表中存在对应的项, 且其中的应用进程名称不为网关, 则忽略, 如果本地的 应用配置信息列表中不存在对应的项或者存在但其中的应用进程名为网关,则用接收的应用配置信息列 表项更新本地的应用配置信息列表,并在更新后的应用配置信息列表项中增加远程系统字段,将该字段 的值设置为所接收应用配置信息列表项的来源系统。  The gateway that receives the corresponding application configuration information list item is processed as follows: For each application configuration information list item received, if there is a corresponding item in the local application configuration information list, and the application process name is not the gateway Ignore, if there is no corresponding item or exists in the local application configuration information list but the application process name is the gateway, the local application configuration information list is updated with the received application configuration information list item, and is updated. The remote system field is added to the application configuration information list item, and the value of the field is set to the source system of the received application configuration information list item.
37、 根据权利要求 36所述的方法, 其特征在于, 所述根据所同步的路由信息实现不与特定对等系 统中的用户相关的 RemoteAppBean的跨应用服务平台系统的访问包括:  37. The method according to claim 36, wherein the implementing, by the synchronized routing information, access to a cross-application service platform system of a RemoteAppBean that is not related to a user in a specific peer system comprises:
当要访问不与特定对等系统中的用户相关的 RemoteAppBean时, 首先从本应用服务平台系统的中 心服务器获取对应的应用配置信息列表项;  When accessing a RemoteAppBean that is not related to a user in a specific peer system, first obtaining a corresponding application configuration information list item from a central server of the application service platform system;
查看对应的应用配置信息列表项中的应用元数据标注中是否包含对等系统标注;  Check whether the application metadata annotation in the corresponding application configuration information list item includes the peer system annotation;
如果包含对等系统标注,则通过根据该 RemoteAppBean的应用上下文确定目标应用服务平台系统; 如果不包含对等系统标注,则通过该对应的应用配置信息列表项中的远程系统字段确定目标应用服 务平台系统;  If the peer system annotation is included, the target application service platform system is determined according to the application context of the RemoteAppBean; if the peer system annotation is not included, the target application service platform is determined by the remote system field in the corresponding application configuration information list item. System
根据所确定的目标应用服务平台系统获知该目标应用服务平台系统的网关的地址,并将访问请求通 过本应用服务平台系统的网关转发到目标应用服务平台系统的网关;  Obtaining, according to the determined target application service platform system, the address of the gateway of the target application service platform system, and forwarding the access request to the gateway of the target application service platform system through the gateway of the application service platform system;
目标应用服务平台系统的网关接收到所述访问请求后根据本系统内的中心服务器上的应用配置信 息列表和应用运行信息列表, 将请求转发到相应的 RemoteAppBean。 After receiving the access request, the gateway of the target application service platform system forwards the request to the corresponding RemoteAppBean according to the application configuration information list and the application operation information list on the central server in the system.
38、一种应用服务平台系统,其特征在于,该系统包括: 代理服务器和云计算应用服务系统,其中, 云计算应用服务系统中的应用服务器集群上负栽并运行应用,并且云计算应用服务系统中保存有应用的 描述信息以及应用与应用服务器之间的对应关系; 38. An application service platform system, the system comprising: a proxy server and a cloud computing application service system, wherein an application server cluster in the cloud computing application service system is loaded and runs an application, and the cloud computing application service The description information of the application and the correspondence between the application and the application server are saved in the system;
代理服务器, 用于接收客户端请求消息, 对客户端请求消息进行解析, 确定对应的应用, 根据该应 用的描述信息创建应用上下文,在所述客户端请求消息中添加应用上下文后,根据所述应用与应用服务 器之间的对应关系将客户端请求消息分发给对应的应用所在的应用服务器;接收应用服务器端返回的处 理结果, 并返回给客户端;  a proxy server, configured to receive a client request message, parse the client request message, determine a corresponding application, create an application context according to the description information of the application, and add an application context to the client request message, according to the The application and the application server distribute the client request message to the application server where the corresponding application is located; receive the processing result returned by the application server, and return the result to the client;
应用服务器集群中的应用服务器,用于在接收到代理服务器发送的客户端请求消息时,将该客户端 请求消息交给对应的应用进行处理,并将处理结果返回给代理服务器; 所述对应的应用处理该客户端请 求消息所请求的任务, 根据所述应用上下文进行数据资源定位, 得出处理结果。  The application server in the application server cluster is configured to: when receiving the client request message sent by the proxy server, handing the client request message to the corresponding application for processing, and returning the processing result to the proxy server; The application processes the task requested by the client request message, performs data resource positioning according to the application context, and obtains a processing result.
39、 根据权利要求 38所述的系统, 其特征在于, 所述应用服务平台系统中部署有: 基础框架类库 和业务框架类库;  39. The system according to claim 38, wherein: the application service platform system is configured with: a basic framework class library and a business framework class library;
基础框架类库, 其中定义并实现有多种 AppBean基 ftH类型、 应用上下文接口及基本应用上下文类 型的实现, 以提供 iftH核心功能; 其中不同的 AppBean基础类型对应不同类型的应用, 用于处理不同 类型的信令;  The underlying framework class library, which defines and implements implementations of various AppBean-based ftH types, application context interfaces, and basic application context types to provide iftH core functionality; wherein different AppBean base types correspond to different types of applications for handling different Type of signaling;
业务框架类库, 用于艮据业务的特性, 定制业务的相关功能;  A business framework library for customizing the functions of the business according to the characteristics of the business;
所述云计算应用服务系统中部署的应用,基于所述^ ftH框架类库和业务框架类库,负栽并运行应用, 实现业务需求功能;  The application deployed in the cloud computing application service system is based on the ^ftH framework class library and the business framework class library, and loads and runs an application to implement a service requirement function;
所述代理服务器,用于接收客户端请求消息,基于所述基础框架类库和业务框架类库对所接收的客 户端请求消息进行路由。  The proxy server is configured to receive a client request message, and route the received client request message based on the basic framework class library and the service framework class library.
40、 根据权利要求 39所述的系统, 其特征在于,  40. The system of claim 39, wherein:
所述在业务框架类库, 还提供扩展新类型应用对应的 AppBean基础类型的接口, 以及提供扩展针 对新类型应用的应用上下文的接口;  The service framework class library also provides an interface for extending the AppBean base type corresponding to the new type application, and an interface for extending the application context for the new type application;
所述应用上下文在数据构成上包括两部分:  The application context consists of two parts in the data composition:
通用资源标志符 URI: 包括用户的索引信息, 负责后续的资源定位;  Universal resource identifier URI: includes the user's index information, responsible for subsequent resource location;
附加数据: 包括该应用的属性信息。  Additional data: Includes attribute information for the app.
41、根据权利要求 38至 40中任一项所述的系统, 其特征在于, 所述云计算应用服务系统包括: 中 心服务器、 资源服务器和由多个应用服务器组成的应用服务器集群;  The system according to any one of claims 38 to 40, wherein the cloud computing application service system comprises: a central server, a resource server, and an application server cluster composed of a plurality of application servers;
中心服务器, 用于接收外部上传的应用, 将应用的描述信息保存到应用配置信息列表中, 创建所述 应用与应用服务器之间的对应关系,并在对应的应用服务器上部署该应用,保存用于保存应用与应用服 务器之间的对应关系的应用运行信息列表;  The central server is configured to receive the externally uploaded application, save the description information of the application to the application configuration information list, create a correspondence between the application and the application server, and deploy the application on the corresponding application server, and save the application. a list of application running information for saving a correspondence between the application and the application server;
每个应用服务器,用于将所负栽的应用的运行信息上传到中心服务器上的用于保存应用与应用服务 器之间对应关系的应用运行信息列表中;  Each application server is configured to upload running information of the loaded application to a list of application running information for saving a correspondence between the application and the application server on the central server;
其中, 应用配置信息列表包括如下信息: 应用 ID、 应用名称、 应用服务类型、 应用进程名和应用 元数据标注; 应用运行信息列表包括如下信息: 应用进程名称和应用的服务地址;  The application configuration information list includes the following information: an application ID, an application name, an application service type, an application process name, and an application metadata annotation; the application operation information list includes the following information: an application process name and an application service address;
资源服务器,用于保存应用服务器上的各应用处理客户端请求消息所请求的任务时需要访问的数据 资源;  a resource server, configured to save a data resource that needs to be accessed when each application on the application server processes the task requested by the client request message;
代理服务器,在接收到客户端请求消息时,用于通过查询中心服务器上的应用配置信息列表识别所 述客户端请求消息所对应的应用服务,然后通过查询中心服务器上的应用配置信息列表和应用运行信息 列表获得对应的应用的服务地址,根据所获得的服务地址将客户端请求消息分发给对应的应用服务所在 的应用服务器;  The proxy server, when receiving the client request message, is configured to identify an application service corresponding to the client request message by using an application configuration information list on the query center server, and then query the application configuration information list and application on the central server. The service information list obtains the service address of the corresponding application, and distributes the client request message to the application server where the corresponding application service is located according to the obtained service address;
所述中心服务器, 进一步用于保存资源列表; 资源列表包括如下信息: 资源名称、 资源类型、 应用 上下文类型、 定位算法名称和定位算法参数;  The central server is further configured to save a resource list; the resource list includes the following information: a resource name, a resource type, an application context type, a positioning algorithm name, and a positioning algorithm parameter;
应用在接收到客户端请求消息后,在完成该客户端请求消息所请求的任务的过程中根据应用上下文 以及资源列表中的对应信息进行资源定位。  After receiving the client request message, the application performs resource location according to the application context and the corresponding information in the resource list in the process of completing the task requested by the client request message.
42、 根据权利要求 41所述的系统, 其特征在于,  42. The system of claim 41, wherein:
所述代理服务器, 用于在接收到 HTTP请求消息时, 根据该请求消息中的统一资源定位符 URL, 查找出中心服务器上的应用元数据标注字段包括有与所述 URL—致信息的应用配置信息列表项, 根据 所查找出的应用配置信息列表项中的应用名称识别出该客户端请求消息所对应的应用; 或者,  The proxy server is configured to: when the HTTP request message is received, find, according to the uniform resource locator URL in the request message, that the application metadata label field on the central server includes an application configuration that is related to the URL information. The information list item identifies the application corresponding to the client request message according to the application name in the searched application configuration information list item; or
所述代理服务器, 用于在接收到 Rpc请求消息时, 根据该请求消息中的远程调用服务名称, 查找 出中心服务器上应用名称字段与所述远程调用服务名称一致的应用配置信息列表项,根据所查找出的应 用配置信息列表项中的应用名称字段识别出该请求消息所对应的应用;  The proxy server is configured to: when the Rpc request message is received, find an application configuration information list item that is consistent with the remote calling service name on the central server according to the remote calling service name in the request message, according to The application name field in the found application configuration information list item identifies the application corresponding to the request message;
所述代理服务器,用于根据所查找出的应用配置信息列表项中的应用进程名,查找出中心服务器上 的应用进程名称字段包含与所述应用进程名一致信息的应用运行信息列表项,从所查找出的应用运行信 息列表项中获取应用的服务地址信息,并根据所述应用的服务地址信息将客户端请求消息分发给对应的 应用所在的应用服务器; The proxy server is configured to search for the central server according to the name of the application process in the searched application configuration information list item. The application process name field includes an application operation information list item that is consistent with the application process name information, obtains the service service address information of the application from the found application operation information list item, and uses the service address information of the application to serve the client. The end request message is distributed to the application server where the corresponding application is located;
所述代理服务器,用于根据所查找出的应用配置信息列表项中的应用元数据标注字段中的关于加栽 应用上下文的信息, 创建应用上下文。  The proxy server is configured to create an application context according to the information about the processing application context in the application metadata label field in the found application configuration information list item.
43、 根据权利要求 41所述的系统, 其特征在于, 所述应用服务器集群中的多个应用服务器被分为 多个不同组;  43. The system according to claim 41, wherein a plurality of application servers in the application server cluster are divided into a plurality of different groups;
所述中心服务器上保存有应用服务器列表和应用服务器分组列表;  The application server list and the application server grouping list are saved on the central server;
应用服务器列表包括如下信息: 应用服务器名称、 应用服务器所属的分组名称和应用服务器地址; 应用服务器分组列表包括: 应用服务器分组名称和分组中的应用服务器描述信息;  The application server list includes the following information: an application server name, a group name to which the application server belongs, and an application server address; the application server grouping list includes: an application server group name and an application server description information in the group;
中心服务器, 用于在接收到外部上传的应用时, 根据外部指令将该应用部署到单个应用服务器上, 或者部署到属于同一组的多个服务器上。  The central server is configured to deploy the application to a single application server according to an external instruction when receiving the externally uploaded application, or deploy to multiple servers belonging to the same group.
44、 根据权利要求 43所述的系统, 其特征在于,  44. The system of claim 43 wherein:
每个应用服务器上部署有一个守护进程;  A daemon is deployed on each application server;
所述中心服务器上还保存有应用进程列表; 该应用进程列表包括: 应用进程标识、 动态端口标记、 应用服务器名称、 应用服务器分组名称、 部署包接口和服务端口;  The application server list is also saved on the central server; the application process list includes: an application process identifier, a dynamic port identifier, an application server name, an application server group name, a deployment package interface, and a service port;
中心服务器, 用于根据应用服务器列表、应用服务器分组列表和应用进程列表中的信息, 确定每个 应用服务器上应启动的应用进程部署信息列表; 该应用进程部署信息列表中的每一项包括:应用进程标 识、 动态端口标记、 部署包接口和服务端口;  a central server, configured to determine, according to information in the application server list, the application server grouping list, and the application process list, a list of application process deployment information that should be started on each application server; each item in the application process deployment information list includes: Application process ID, dynamic port tag, deployment package interface, and service port;
每个应用服务器上的守护进程启动后,与中心服务器建立连接并保持心跳,从中心服务器获取本应 用服务器的应用进程部署信息列表, 根据该应用进程部署信息列表下栽并启动本应用服务器的应用进 程;  After the daemon of each application server is started, a connection is established with the central server and the heartbeat is maintained. The application process deployment information list of the application server is obtained from the central server, and the application server of the application server is downloaded and started according to the application process deployment information list. Process
每个启动的应用进程都与中心服务器建立连接并保持心跳;  Each launched application process establishes a connection with the central server and maintains a heartbeat;
中心服务器为每个建立连接的守护在守护进程状态信息列表中记录其连接信息,以及为每个建立连 接的应用进程在应用运行信息列表中记录其连接信息。  The central server records its connection information in the daemon status information list for each daemon that establishes the connection, and records its connection information in the application operation information list for each application process that establishes the connection.
45、 根据权利要求 44所述的系统, 其特征在于, 该系统还包括: 与中心服务器连接的控制终端; 控制终端向中心服务器发送启动指定应用的请求, 中心服务器将该请求发送给对应的守护进程将, 守护进程启动应用进程, 应用进程连接上守护进程, 守护进程将该请求发送给应用进程, 由应用进程启 动所述指定应用;  The system according to claim 44, wherein the system further comprises: a control terminal connected to the central server; the control terminal sends a request to the central server to start the specified application, and the central server sends the request to the corresponding guardian The process starts, the daemon starts the application process, and the application process connects to the daemon, and the daemon sends the request to the application process, and the application process starts the specified application;
控制终端向中心服务器发送停止指定应用的请求, 中心服务器将该请求发送给对应的守护进程将, 守护进程再将该请求发送给应用进程, 由应用进程停止所述指定应用, 守护进程停止应用进程。  The control terminal sends a request to the central server to stop the specified application, and the central server sends the request to the corresponding daemon, and the daemon sends the request to the application process, and the application process stops the specified application, and the daemon stops the application process. .
46、 根据权利要求 41所述的系统, 其特征在于, 在该系统中对应用进行灰度发布, 则所述应用配 置信息列表还包括: 灰度发布因子; 对于不采用灰度发布的应用, 其对应的灰度发布因子为空;  46. The system according to claim 41, wherein, in the system, grayscale is issued to the application, the application configuration information list further includes: a grayscale publishing factor; and for an application that does not use grayscale publishing, The corresponding grayscale publishing factor is empty;
代理服务器接收到客户端请求消息后,通过查询中心服务器上的应用配置信息列表识别所述客户端 请求消息所对应的应用, 如果找到多个应用, 则按如下方式选择;  After receiving the client request message, the proxy server identifies the application corresponding to the client request message by using the application configuration information list on the query center server. If multiple applications are found, the proxy server selects the following manner;
代理服务器先在灰度发布因子不为空的应用中对其灰度发布因子进行匹配,如果匹配命中则选择所 命中的应用, 如果没有匹配命中则选择灰度发布因子为空的应用。  The proxy server first matches its grayscale publishing factor in an application whose grayscale publishing factor is not empty. If the matching hits, the selected application is selected. If there is no matching hit, the application whose grayscale publishing factor is empty is selected.
47、 根据权利要求 41所述的系统, 其特征在于, 该系统进一步包括: 全局配置数据库, 用于保存 应用的配置信息; 所述配置信息包括默认配置信息和特例化配置信息;  The system according to claim 41, wherein the system further comprises: a global configuration database, configured to save configuration information of the application; the configuration information includes default configuration information and special configuration information;
应用服务器, 用于向中心服务器发送配置信息请求消息, 并接收中心服务器返回的配置信息; 中心服务器,用于在接收到应用服务器发送的配置信息请求消息后,根据最大匹配原则对配置信息 请求消息中匹配参数进行匹配, 将匹配到的默认配置信息或特例化配置信息返回给应用服务器。  The application server is configured to send a configuration information request message to the central server, and receive configuration information returned by the central server. The central server is configured to: after receiving the configuration information request message sent by the application server, request the configuration information according to the maximum matching principle. The matching parameters are matched, and the matched default configuration information or special configuration information is returned to the application server.
48、 根据权利要求 47所述的系统, 其特征在于,  48. The system of claim 47, wherein:
中心服务器, 还用于接收终端发起的配置更新请求, 对全局配置数据库中的配置信息进行更新, 并 找到对应的应用进程的连接,通过该连接下发配置更新请求,使得对应的应用进程重新从中心服务器获 取配置信息, 刷新配置信息并返回结果给中心服务器;  The central server is further configured to receive a configuration update request initiated by the terminal, update the configuration information in the global configuration database, and find a connection of the corresponding application process, and send a configuration update request through the connection, so that the corresponding application process is re-routed. The central server obtains configuration information, refreshes the configuration information, and returns the result to the central server;
中心服务器将结果返回给终端。  The central server returns the results to the terminal.
49、根据权利要求 47所述的系统, 其特征在于, 应用服务器包括: 远程加栽模块和本地加栽模块; 其中,  The system according to claim 47, wherein the application server comprises: a remote processing module and a local processing module;
远程加栽模块, 用于向中心服务器发送配置信息请求消息, 并接收中心服务器返回的配置信息; 本地加栽模块, 用于从应用服务器的本地获取配置信息;  a remote loading module, configured to send a configuration information request message to the central server, and receive configuration information returned by the central server; and a local loading module, configured to obtain configuration information locally from the application server;
应用服务器通过切换远程加栽模块和本地加栽模块,来实现远程从中心服务器获取配置信息的模式 以及从本地获取配置信息的模式之间的切换。 The application server switches between the mode of obtaining configuration information remotely from the central server and the mode of obtaining configuration information locally by switching the remote loading module and the local loading module.
50、 根据权利要求 44所述的系统, 其特征在于, 该系统进一步包括: 与中心服务器连接的全局监 控数据库, 与全局监控数据库连接的监控服务器; 每个应用服务器中还包括一个本机日志数据库; 全局监控数据库, 用于保存不同监控策略; 50. The system of claim 44, wherein the system further comprises: a global monitoring database coupled to the central server, a monitoring server coupled to the global monitoring database; each application server further including a native log database ; Global monitoring database for saving different monitoring strategies;
应用服务器中的守护进程以及应用进程, 通过中心服务器从全局监控数据库获取对应的监控策略, 根据所获取的监控策略进行监控,将监控结杲数据保存到本机日志数据库中, 以及根据监控策略将相应 的监控结果数据通过中心服务器上传到全局监控数据库中, 并在获取到的数据超过阀值时附加报警标 记;  The daemon process and the application process in the application server obtain the corresponding monitoring policy from the global monitoring database through the central server, monitor according to the acquired monitoring policy, save the monitoring data to the local log database, and according to the monitoring policy The corresponding monitoring result data is uploaded to the global monitoring database through the central server, and an alarm flag is attached when the acquired data exceeds the threshold;
监控服务器, 用于展示全局监控数据库中的监控结果数据, 并提示报警。  The monitoring server is used to display the monitoring result data in the global monitoring database and prompt the alarm.
51、 根据权利要求 50所述的系统, 其特征在于,  51. The system of claim 50, wherein:
应用服务器中的守护进程根据所获取的监控策略对系统资源计数器进行监控; 监控的指标包括: CPU指标、 内存指标、 磁盘指标、 网卡流量指标或 MySQL指标;  The daemon in the application server monitors system resource counters according to the obtained monitoring policy; the monitored indicators include: CPU indicator, memory indicator, disk indicator, network card traffic indicator or MySQL indicator;
应用服务器中的应用进程中嵌入有程序内嵌计数器,应用服务器中的应用进程根据所获取的监控策 略对程序内嵌计数器进行监控;  The application embedded process counter is embedded in the application process in the application server, and the application process in the application server monitors the embedded counter of the program according to the acquired monitoring policy;
所述程序内嵌计数器包括: 多个名字唯一的类别;每个类别包含多个固定的列和多个名字唯一的实 例。  The program inline counter includes: a plurality of categories with unique names; each category includes a plurality of fixed columns and a plurality of instances with unique names.
52、 根据权利要求 50或 51所述的系统, 其特征在于,  52. The system of claim 50 or 51, wherein
监控服务器,进一步用于对全局监控数据库中的监控策略进行更新,然后向指定应用服务器中的守 护进程和 /或应用进程发送监控策略更新通知;  The monitoring server is further configured to update the monitoring policy in the global monitoring database, and then send a monitoring policy update notification to the protection process and/or the application process in the specified application server;
所述指定应用服务器中的护进程和 /或应用进程收到所述监控策略更新通知后, 从全局配置服务器 获取对应的更新后的监控策略。  After receiving the monitoring policy update notification, the protection process and/or the application process in the specified application server obtains the corresponding updated monitoring policy from the global configuration server.
53、 根据权利要求 41所述的系统, 其特征在于, 该系统进一步包括: 扩展插件, 用于实现对应用 的注入式调试;  The system according to claim 41, wherein the system further comprises: an extension plugin for implementing injecting debugging of the application;
所述扩展插件用于在本地启动应用; 所述启动的应用与代理服务器创建连接,并向代理服务器发送 要调试应用的配置参数; 所述要调试应用的配置参数限定指定范围内的用户;  The extension is used to launch an application locally; the launched application creates a connection with a proxy server, and sends a configuration parameter to the proxy server to debug the application; the configuration parameter of the application to be debugged defines a user within a specified range;
代理服务器在接收到客户端请求消息后,首先匹配所述要调试应用的配置参数,如果匹配成功则将 客户端请求消息发送给所述在插件上启动的应用处理,并将所述启动的应用返回的处理结果发送给客户 端, 如果匹配不成功, 则将客户端请求分发给对应的应用所在的应用服务器。  After receiving the client request message, the proxy server first matches the configuration parameter of the application to be debugged, and if the matching succeeds, sends a client request message to the application processing initiated on the plug-in, and the launched application is The returned processing result is sent to the client. If the matching is unsuccessful, the client request is distributed to the application server where the corresponding application is located.
54、 根据权利要求 41所述的系统, 其特征在于, 该应用服务平台系统进一步包括一个网关, 该网 关与其他应用服务平台系统中的网关进行通信, 实现应用的跨应用服务平台系统访问;  54. The system according to claim 41, wherein the application service platform system further comprises a gateway, and the gateway communicates with a gateway in another application service platform system to implement access of the application across the application service platform system;
所述中心服务器,用于查找出本应用服务平台系统中部署的需要跨平台访问的应用所对应的应用配 置信息列表项, 并发送给本应用服务平台系统的网关;  The central server is configured to find an application configuration information list item corresponding to an application that needs to be accessed across platforms in the application service platform system, and send the information to the gateway of the application service platform system;
所述网关, 用于将所接收的对应应用配置信息列表项信息发送给其他应用服务平台系统中的网关; 用于接收其他应用服务平台系统中的网关发送的应用配置信息列表项,并对本中心服务器上的本地应用 配置信息列表做如下处理:  The gateway is configured to send the received corresponding application configuration information list item information to a gateway in another application service platform system; and receive an application configuration information list item sent by a gateway in another application service platform system, and The list of local application configuration information on the server is handled as follows:
对于所接收的每个应用配置信息列表项,如果本地的应用配置信息列表中存在对应的项,且其中的 应用进程名称不为网关, 则忽略,如果本地的应用配置信息列表中不存在对应的项或者存在但其中的应 用进程名为网关,则用接收的应用配置信息列表项更新本地的应用配置信息列表,并在更新后的应用配 置信息列表项中增加远程系统字段, 将该字段的值设置为所接收应用配置信息列表项的来源系统。  For each application configuration information list item received, if there is a corresponding item in the local application configuration information list, and the application process name is not the gateway, it is ignored, if there is no corresponding corresponding in the local application configuration information list If the item or the existing application process name is a gateway, the local application configuration information list is updated by using the received application configuration information list item, and the remote system field is added in the updated application configuration information list item, and the value of the field is added. Set to the source system of the received application configuration information list item.
55、 根据权利要求 54所述的系统, 其特征在于, 当要跨应用服务平台系统访问应用时, 网关首先从本应用服务平台系统的中心服务器获取对应的应用配置信息列表项,查看对应的应用配 置信息列表项中的应用元数据标注中是否包含对等系统标注; 如果包含对等系统标注,则根据该应用的 应用上下文确定目标应用服务平台系统; 如杲不包含对等系统标注, 则通过该对应的应用配置信息列表 项中的远程系统字段确定目标应用服务平台系统;根据所确定的目标应用服务平台系统获知该目标应用 服务平台系统的网关的地址, 并将应用访问请求转发到目标应用服务平台系统的网关;  The system according to claim 54, wherein, when the application is to be accessed across the application service platform system, the gateway first obtains a corresponding application configuration information list item from the central server of the application service platform system, and views the corresponding application. Whether the application metadata annotation in the configuration information list item includes the peer system annotation; if the peer system annotation is included, the target application service platform system is determined according to the application context of the application; if the peer system annotation is not included, Determining, in the corresponding application configuration information list item, a target application service platform system; obtaining, according to the determined target application service platform system, an address of the gateway of the target application service platform system, and forwarding the application access request to the target application Gateway to the service platform system;
所述网关还用于在接收到其他应用服务平台系统的网关发送的应用访问请求后,根据本应用服务平 台系统内的中心服务器上的应用配置信息列表和应用运行信息列表, 将请求转发到相应的应用。  The gateway is further configured to forward the request to the corresponding application configuration information list and the application running information list on the central server in the application service platform system after receiving the application access request sent by the gateway of the other application service platform system. Applications.
PCT/CN2011/085194 2011-04-18 2011-12-31 Application service platform system and implementation method thereof WO2012142854A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201180062570.8A CN103283209B (en) 2011-04-18 2011-12-31 A kind of application service platform system and its implementation

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
CN 201110097156 CN102185900B (en) 2011-04-18 2011-04-18 Application service platform system and method for developing application services
CN201110097156.2 2011-04-18
CN201110170620.6 2011-06-23
CN201110170620.6A CN102340415B (en) 2011-06-23 2011-06-23 Server cluster system and monitoring method thereof
CN201110171926.3A CN102394901B (en) 2011-06-23 2011-06-23 A kind of server cluster system and monitoring strategies update method wherein
CN201110171673.XA CN102333029B (en) 2011-06-23 2011-06-23 Routing method in server cluster system
CN201110171926.3 2011-06-23
CN201110171673.X 2011-06-23
CN201110182506.5A CN102255752B (en) 2011-06-30 2011-06-30 Configuration management system and method of server cluster
CN201110182506.5 2011-06-30

Publications (1)

Publication Number Publication Date
WO2012142854A1 true WO2012142854A1 (en) 2012-10-26

Family

ID=47041049

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/085194 WO2012142854A1 (en) 2011-04-18 2011-12-31 Application service platform system and implementation method thereof

Country Status (2)

Country Link
CN (1) CN103283209B (en)
WO (1) WO2012142854A1 (en)

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497454A (en) * 2011-12-31 2012-06-13 北京新媒传信科技有限公司 Method for realizing gray publication of application in application service platform system
CN104156309A (en) * 2014-07-29 2014-11-19 深圳市腾讯计算机系统有限公司 Server and terminal application related compatibility test method and device
CN104580520A (en) * 2015-01-29 2015-04-29 广州华多网络科技有限公司 Interactive business operating method and device
CN104660689A (en) * 2015-02-04 2015-05-27 中国南方电网有限责任公司 Distributed computing system
CN105160502A (en) * 2015-07-01 2015-12-16 浪潮集团有限公司 Express delivery distribution device and method based on cloud computing
CN105376301A (en) * 2015-10-14 2016-03-02 贵阳朗玛信息技术股份有限公司 Method for carrying out communication among servers, master server and business servers
CN105512027A (en) * 2015-11-26 2016-04-20 珠海多玩信息技术有限公司 Process state monitor method and device
CN105745620A (en) * 2013-12-31 2016-07-06 北京新媒传信科技有限公司 Implementation method and implementation platform for software architecture
CN106027581A (en) * 2015-03-20 2016-10-12 中国移动通信集团河北有限公司 Method and system for achieving gray scale publishing based on load balancing
CN106445593A (en) * 2016-09-22 2017-02-22 广州华多网络科技有限公司 Gray level upgrading method and device in distributed system communication
CN106899588A (en) * 2017-02-22 2017-06-27 郑州云海信息技术有限公司 It is a kind of to be applied to the program adaptive environment that multiterminal coexist and build system
CN107229646A (en) * 2016-03-24 2017-10-03 中兴通讯股份有限公司 Dispositions method, the apparatus and system of data cluster
CN108616576A (en) * 2018-04-08 2018-10-02 网宿科技股份有限公司 A kind of method and apparatus of scheduling application server
CN105338025B (en) * 2014-07-21 2019-04-09 阿里巴巴集团控股有限公司 Invocation component method, system, client and concentration assembly method and server
CN109934011A (en) * 2019-03-18 2019-06-25 国网安徽省电力有限公司黄山供电公司 A kind of data safety partition method applied to O&M auditing system
CN110825537A (en) * 2019-11-04 2020-02-21 联思智云(北京)科技有限公司 Method, device and equipment for calling remote application based on C/S architecture
CN112100133A (en) * 2020-11-04 2020-12-18 广州市玄武无线科技股份有限公司 Distributed log processing system
US20210084019A1 (en) * 2016-09-15 2021-03-18 Oracle International Corporation Secured rest execution inside headless web application
US10999167B2 (en) 2018-04-13 2021-05-04 At&T Intellectual Property I, L.P. Varying data flow aggregation period relative to data value
US11422791B2 (en) 2020-12-31 2022-08-23 International Business Machines Corporation Upgrading a sequence of microservices in a cloud computing environment

Families Citing this family (80)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684916A (en) * 2013-12-13 2014-03-26 国家计算机网络与信息安全管理中心 Method and system for intelligent monitoring and analyzing under cloud computing
CN103780433B (en) * 2014-02-18 2017-05-24 成都致云科技有限公司 Self-healing type virtual resource configuration management data architecture
CN105490983A (en) * 2014-09-15 2016-04-13 上海天脉聚源文化传媒有限公司 Media bridge information agency method and system
CN104601666B (en) * 2014-12-22 2018-04-27 杭州华为数字技术有限公司 Log services method and cloud platform
CN104516969A (en) * 2014-12-25 2015-04-15 祝峰 Data and compute-intensive processing system of cloud computing platform
CN104699612B (en) * 2015-03-25 2019-05-31 北京嘀嘀无限科技发展有限公司 For processing method, equipment and the system in software test
US10305731B2 (en) * 2015-07-07 2019-05-28 Oracle International Corporation System and method for provisioning cloud services across heterogeneous environments using partitioned provisioning instructions stored on a configuration management server
CN105302664B (en) * 2015-09-22 2019-01-04 上海爱数信息技术股份有限公司 A kind of storage snapshot management method and system
CN105577425A (en) * 2015-12-07 2016-05-11 浪潮通信信息系统有限公司 Method and device for processing network management data
CN105391805A (en) * 2015-12-21 2016-03-09 天津海量信息技术有限公司 Data downloading system and downloading method based on multi-client cluster collaboration
CN105872578A (en) * 2016-03-30 2016-08-17 青岛海信电器股份有限公司 Invoking method and server
CN107302553B (en) * 2016-04-14 2020-11-06 创新先进技术有限公司 User migration method and device
CN107453894B (en) * 2016-05-30 2021-05-25 北京京东尚科信息技术有限公司 Method, system, device and computer readable storage medium for supporting intelligent customer service robot entrance opening
CN105955761A (en) * 2016-06-30 2016-09-21 乐视控股(北京)有限公司 Docker-based gray level issuing device and docker-based gray level issuing method
CN106060164B (en) * 2016-07-12 2021-03-23 Tcl科技集团股份有限公司 Telescopic cloud server system and communication method thereof
CN107798000A (en) * 2016-08-29 2018-03-13 上海宝信软件股份有限公司 Data Migration based on real-time data base compresses synchronous middleware
US10241896B2 (en) * 2016-11-08 2019-03-26 Salesforce, Inc. Formation and manipulation of test data in a database system
CN108089917A (en) * 2016-11-23 2018-05-29 中国移动通信集团广东有限公司 A kind of application process control method and device
CN106789307B (en) * 2016-12-30 2019-12-03 腾讯科技(深圳)有限公司 Configuration data processing method, apparatus and system
CN108347462B (en) * 2017-01-23 2021-02-23 阿里巴巴集团控股有限公司 Method and equipment for transmitting operation data
CN106931596B (en) * 2017-03-13 2020-01-07 珠海格力电器股份有限公司 Engineering monitoring method and system
CN107426266B (en) * 2017-03-14 2020-08-04 阿里巴巴集团控股有限公司 Data processing method and server
CN107423085B (en) * 2017-04-24 2020-07-28 北京百度网讯科技有限公司 Method and apparatus for deploying applications
CN108733738B (en) * 2017-04-25 2023-04-07 腾讯科技(深圳)有限公司 Page loading method, system, server and terminal
CN107391276B (en) * 2017-07-05 2018-09-28 腾讯科技(深圳)有限公司 Distributed monitor method, interception control device and system
CN109426514B (en) * 2017-08-24 2022-09-02 北京金山云网络技术有限公司 Service automation deployment method and device, electronic equipment and storage medium
CN107608285B (en) * 2017-09-01 2019-10-08 北京南凯自动化系统工程有限公司 A kind of comprehensive monitoring system
CN107360261B (en) * 2017-09-07 2020-07-10 北京奇艺世纪科技有限公司 HTTP request processing method and device and electronic equipment
CN111095199B (en) * 2017-10-09 2021-10-01 华为技术有限公司 Application loading method and terminal equipment
CN107902507B (en) * 2017-11-11 2021-05-04 林光琴 Control software field debugging system and debugging method
CN107819858B (en) * 2017-11-14 2020-11-03 青岛聚看云科技有限公司 Method and device for managing cloud service during dynamic expansion and contraction of cloud service
CN109842637B (en) * 2017-11-24 2021-09-07 武汉斗鱼网络科技有限公司 Distributed service registration method and device
CN108255615B (en) * 2017-11-30 2022-03-01 平安科技(深圳)有限公司 Cross-language calling method, server and storage medium
CN108563515B (en) * 2018-03-14 2021-08-27 中国银联股份有限公司 Business process management method and system
CN108572845B (en) * 2018-03-15 2022-05-31 华为技术有限公司 Upgrading method of distributed micro-service cluster and related system
CN108388440A (en) * 2018-04-28 2018-08-10 北京辰森世纪科技股份有限公司 A kind of method that web application systems automatically update
CN108681499B (en) * 2018-05-04 2019-03-15 广州市玄武无线科技股份有限公司 O&M monitoring method, device and computer readable storage medium
CN108683533B (en) * 2018-05-14 2021-05-04 平安科技(深圳)有限公司 Configuration updating method, configuration updating response method, server and system
CN108804166B (en) * 2018-05-31 2022-03-01 创新先进技术有限公司 Method and device for determining liquidity index of business asset
CN109218432B (en) * 2018-09-29 2021-05-14 北京深度奇点科技有限公司 Distributed processing method and device for intelligent computing cloud service
CN109299124B (en) * 2018-09-30 2021-01-08 北京字节跳动网络技术有限公司 Method and apparatus for updating a model
CN111327573B (en) * 2018-12-14 2022-12-02 英业达科技有限公司 Device and method for maintaining log-in state record to transfer data
TWI683556B (en) * 2018-12-18 2020-01-21 英業達股份有限公司 System for maintaining login record to transfer data and method thereof
CN109857424A (en) * 2018-12-20 2019-06-07 航天信息股份有限公司 The application upgrade method and device of server cluster
CN109753420B (en) * 2018-12-29 2023-01-24 深圳市思迪信息技术股份有限公司 Monitoring data acquisition method and device
CN111464574B (en) * 2019-01-21 2022-10-21 阿里巴巴集团控股有限公司 Calling, loading, registering and managing method and route, server, node and medium
CN111464579A (en) * 2019-01-22 2020-07-28 珠海格力电器股份有限公司 Message processing method and server
CN109831361B (en) * 2019-02-28 2020-10-16 东软集团股份有限公司 Distributed debugging method, system and device
CN110032509B (en) * 2019-03-04 2022-08-23 广州华多网络科技有限公司 Method, device and system for switching experiments in local list and storage medium
CN109918151A (en) * 2019-03-14 2019-06-21 佳都新太科技股份有限公司 Workflow implementing method, device, equipment and storage medium
CN109981267B (en) * 2019-03-22 2021-06-08 西安电子科技大学 Large-scale user multi-key scene cloud encryption database system and storage query method
CN110046171B (en) * 2019-04-29 2020-08-14 北京字节跳动网络技术有限公司 System, method and apparatus for obtaining information
CN110324317B (en) * 2019-05-31 2022-11-15 平安科技(深圳)有限公司 Service processing method, device, equipment and storage medium
CN110399142B (en) * 2019-07-26 2023-04-07 四川新网银行股份有限公司 Method and system for isolating gray scale from production environment version
CN114500629B (en) * 2019-07-31 2023-07-18 创新先进技术有限公司 Monitoring processing method and device under credit contract system
CN110311989B (en) * 2019-08-02 2022-01-28 中国工商银行股份有限公司 Gray scale publishing method, device, storage medium, equipment and system
CN112788082A (en) * 2019-11-08 2021-05-11 内江市下一代互联网数据处理技术研究所 High-availability memory caching system
CN110933051B (en) * 2019-11-18 2021-08-31 厦门亿联网络技术股份有限公司 Intercommunication method between SIP signaling services
CN110879811B (en) * 2019-11-18 2023-05-23 浪潮通用软件有限公司 Implementation method for carrying out data and program consistency self-check during running
CN111181858A (en) * 2019-12-24 2020-05-19 浙江大华技术股份有限公司 Method, system, computer device and storage medium for gray scale distribution
CN111163074B (en) * 2019-12-25 2022-11-25 腾讯云计算(北京)有限责任公司 Gateway service control method and device
CN111569417A (en) * 2020-04-30 2020-08-25 北京视博云信息技术有限公司 Peripheral data transmission method and system for cloud games
CN111782260B (en) * 2020-06-29 2024-01-26 中国工商银行股份有限公司 Gray level distribution method and gray level distribution device
US11936624B2 (en) * 2020-07-23 2024-03-19 Dell Products L.P. Method and system for optimizing access to data nodes of a data cluster using a data access gateway and bidding counters
CN111756776B (en) * 2020-07-28 2023-03-24 支付宝(杭州)信息技术有限公司 Server, message distribution device, program handover system, and program handover method
CN111988200B (en) * 2020-08-18 2022-03-08 湖南快乐阳光互动娱乐传媒有限公司 Automatic regression testing method and device based on real flow
CN112202640B (en) * 2020-09-30 2022-02-22 中国工商银行股份有限公司 Monitoring method and device applied to container cloud platform
CN112235651B (en) * 2020-10-12 2022-08-12 北京金山云网络技术有限公司 Configuration parameter selection method, device, equipment and storage medium
CN112422681B (en) * 2020-11-18 2023-01-13 中盈优创资讯科技有限公司 Cross-platform distributed communication calling method and device
CN112600914B (en) * 2020-12-07 2022-04-01 腾讯科技(深圳)有限公司 Data processing method and device, computer readable medium and electronic equipment
CN113377507A (en) * 2021-05-07 2021-09-10 武汉虚咖科技有限公司 Task processing method, device, equipment and computer readable storage medium
CN113360144B (en) * 2021-06-22 2023-08-08 北京百度网讯科技有限公司 Auxiliary processing method, device, storage medium and program product for software development
CN113542373A (en) * 2021-06-30 2021-10-22 深圳市云网万店电子商务有限公司 Routing service discovery device and method for PAAS platform
CN113282335B (en) * 2021-07-19 2021-10-15 北京江融信科技有限公司 Multi-version configuration method and system for application cluster service parameters
CN113301168A (en) * 2021-07-23 2021-08-24 浩鲸云计算科技股份有限公司 Method and system for realizing accurate shunting of requests by dynamic policy gray scale release engine
CN113612837B (en) * 2021-07-30 2023-08-08 杭州朗和科技有限公司 Data processing method, device, medium and computing equipment
CN113687850B (en) * 2021-08-31 2024-05-14 南京数字跳动网络技术有限公司 Unified configuration center system of client based on component library
CN114143321B (en) * 2021-11-26 2023-08-25 中电信数智科技有限公司 Multi-tenant application configuration distribution system based on cross-IDC environment
CN114449040B (en) * 2022-01-28 2023-12-05 杭州迪普科技股份有限公司 Configuration issuing method and device based on cloud platform
CN116974857B (en) * 2023-09-21 2024-01-23 中国西安卫星测控中心 Automatic deployment and update method and system for monitoring agent

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002024120A (en) * 2000-07-11 2002-01-25 Mitsubishi Electric Corp Distributed application server system
CN101110756A (en) * 2006-07-18 2008-01-23 华为技术有限公司 Application server distribution method and device
CN102185900A (en) * 2011-04-18 2011-09-14 北京新媒传信科技有限公司 Application service platform system and method for developing application services
CN102255752A (en) * 2011-06-30 2011-11-23 北京新媒传信科技有限公司 Configuration management system and method of server cluster

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101426021B (en) * 2008-12-10 2012-06-06 高彦 Large information capacity wireless application platform system and transmission method
CN101662503B (en) * 2009-09-14 2012-09-05 金蝶软件(中国)有限公司 Information transmission method, proxy server and service system in network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002024120A (en) * 2000-07-11 2002-01-25 Mitsubishi Electric Corp Distributed application server system
CN101110756A (en) * 2006-07-18 2008-01-23 华为技术有限公司 Application server distribution method and device
CN102185900A (en) * 2011-04-18 2011-09-14 北京新媒传信科技有限公司 Application service platform system and method for developing application services
CN102255752A (en) * 2011-06-30 2011-11-23 北京新媒传信科技有限公司 Configuration management system and method of server cluster

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102497454B (en) * 2011-12-31 2014-06-11 北京新媒传信科技有限公司 Method for realizing gray publication of application in application service platform system
CN102497454A (en) * 2011-12-31 2012-06-13 北京新媒传信科技有限公司 Method for realizing gray publication of application in application service platform system
CN105745620A (en) * 2013-12-31 2016-07-06 北京新媒传信科技有限公司 Implementation method and implementation platform for software architecture
CN105745620B (en) * 2013-12-31 2019-04-30 北京新媒传信科技有限公司 The implementation method and realization platform of software architecture
CN105338025B (en) * 2014-07-21 2019-04-09 阿里巴巴集团控股有限公司 Invocation component method, system, client and concentration assembly method and server
CN104156309A (en) * 2014-07-29 2014-11-19 深圳市腾讯计算机系统有限公司 Server and terminal application related compatibility test method and device
CN104580520A (en) * 2015-01-29 2015-04-29 广州华多网络科技有限公司 Interactive business operating method and device
CN104660689B (en) * 2015-02-04 2018-04-27 中国南方电网有限责任公司 Distributed computing system
CN104660689A (en) * 2015-02-04 2015-05-27 中国南方电网有限责任公司 Distributed computing system
CN106027581B (en) * 2015-03-20 2019-12-10 中国移动通信集团河北有限公司 Method and system for realizing gray scale release based on load balance
CN106027581A (en) * 2015-03-20 2016-10-12 中国移动通信集团河北有限公司 Method and system for achieving gray scale publishing based on load balancing
CN105160502A (en) * 2015-07-01 2015-12-16 浪潮集团有限公司 Express delivery distribution device and method based on cloud computing
CN105376301A (en) * 2015-10-14 2016-03-02 贵阳朗玛信息技术股份有限公司 Method for carrying out communication among servers, master server and business servers
CN105512027A (en) * 2015-11-26 2016-04-20 珠海多玩信息技术有限公司 Process state monitor method and device
CN107229646A (en) * 2016-03-24 2017-10-03 中兴通讯股份有限公司 Dispositions method, the apparatus and system of data cluster
US11522851B2 (en) * 2016-09-15 2022-12-06 Oracle International Corporation Secured rest execution inside headless web application
US20210084019A1 (en) * 2016-09-15 2021-03-18 Oracle International Corporation Secured rest execution inside headless web application
CN106445593A (en) * 2016-09-22 2017-02-22 广州华多网络科技有限公司 Gray level upgrading method and device in distributed system communication
CN106445593B (en) * 2016-09-22 2020-02-18 广州华多网络科技有限公司 Method and device for gray scale upgrading in distributed system communication
CN106899588A (en) * 2017-02-22 2017-06-27 郑州云海信息技术有限公司 It is a kind of to be applied to the program adaptive environment that multiterminal coexist and build system
CN108616576A (en) * 2018-04-08 2018-10-02 网宿科技股份有限公司 A kind of method and apparatus of scheduling application server
US10999167B2 (en) 2018-04-13 2021-05-04 At&T Intellectual Property I, L.P. Varying data flow aggregation period relative to data value
CN109934011A (en) * 2019-03-18 2019-06-25 国网安徽省电力有限公司黄山供电公司 A kind of data safety partition method applied to O&M auditing system
CN110825537A (en) * 2019-11-04 2020-02-21 联思智云(北京)科技有限公司 Method, device and equipment for calling remote application based on C/S architecture
CN112100133A (en) * 2020-11-04 2020-12-18 广州市玄武无线科技股份有限公司 Distributed log processing system
US11422791B2 (en) 2020-12-31 2022-08-23 International Business Machines Corporation Upgrading a sequence of microservices in a cloud computing environment

Also Published As

Publication number Publication date
CN103283209B (en) 2015-12-09
CN103283209A (en) 2013-09-04

Similar Documents

Publication Publication Date Title
WO2012142854A1 (en) Application service platform system and implementation method thereof
US20230350729A1 (en) Managing a virtualized application workspace on a managed computing device
US11714665B2 (en) Method and apparatus for composite user interface creation
US12009999B2 (en) System and method for providing a service management engine for use with a cloud computing environment
US10855620B2 (en) System and method for providing an end-to-end lifecycle in a multitenant application server environment
US10862733B2 (en) Standardized microservices for controlling components of distinct applications in multi-tenant clouds
KR102436295B1 (en) System and method for use of a global runtime in a multitenant application server environment
CN102413022B (en) Application debugging method and system
US10462068B2 (en) System and method for tenant onboarding in a multitenant application server environment
US9350610B2 (en) System and method for configuration management service
US9424024B2 (en) System and method for elasticity management of services with a cloud computing environment
US9357034B2 (en) System and method for orchestration of services for use with a cloud computing environment
US9201639B2 (en) System and method for service definition packages for use with a cloud computing environment
US20210133002A1 (en) Using scripts to bootstrap applications with metadata from a template
CA2890411C (en) System and method for managing dedicated caches
JP4620784B2 (en) Method and system for automatically duplicating an existing IT resource structure
WO2014039896A1 (en) System and method for dynamic modification of service definition packages with a cloud computing environment
US20230205503A1 (en) Method for dynamically integrating application programs, and software system and machine using the same
CN116204239A (en) Service processing method, device and computer readable storage medium
WO2021093671A1 (en) Task processing method, system, apparatus and device, and computer readable storage medium
Vinoski Yaws: Yet another web server
Kumar et al. Concepts and Architecture
Tupamäki Improving framework-based web application architecture and development in cloud environment
Wongwattanarat Deployment module in MIDAS (Middleware Platform for Developing and Deploying Advanced Mobile Services)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11863854

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11863854

Country of ref document: EP

Kind code of ref document: A1