WO2013152691A1 - Service logic execution device and method - Google Patents

Service logic execution device and method Download PDF

Info

Publication number
WO2013152691A1
WO2013152691A1 PCT/CN2013/073690 CN2013073690W WO2013152691A1 WO 2013152691 A1 WO2013152691 A1 WO 2013152691A1 CN 2013073690 W CN2013073690 W CN 2013073690W WO 2013152691 A1 WO2013152691 A1 WO 2013152691A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
application
function module
execution
business logic
Prior art date
Application number
PCT/CN2013/073690
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
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2013152691A1 publication Critical patent/WO2013152691A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the present invention relates to the field of communications and Internet technologies, and in particular, to a service logic executing apparatus and method.
  • Both communication operators and Internet vendors are building their own business platforms. These business platforms generally aggregate three types of resources, namely: various business capabilities from the telecommunications domain, the Internet domain, and the IT (Information Technology) domain. Engine; various content resources such as pictures, voice, video, and IPTV (Internet Protocol Television) programs; and cloud computing resources such as computing power, storage, and bandwidth. These resources can be opened to the developer by the business platform and create new applications. They can also be directly used by third-party SP/CP (Service Provider/Content Provider) through the resource open interface.
  • SP/CP Service Provider/Content Provider
  • the logic execution device of the above service platform is shown in FIG. 1 .
  • the main unit related to the execution of the business logic in the service platform includes a service execution unit and a resource adaptation unit, and the service execution unit completes the parsing of the authenticated resource request initiated from the application, and then forwards the resource request to the resource adaptation.
  • the resource adaptation unit mainly completes the adaptation of the request message, protocol and media format, The resource request is then forwarded to the corresponding resource; after the resource execution is completed, the result is returned to the application through the resource adaptation unit and the service execution unit respectively.
  • the application's business logic may contain multiple resources to be executed, and the application completes the call to the resources according to the business logic through the service platform.
  • the service platform provides a standardized resource invocation interface for various applications, and interacts with various resources in multiple domains to open them to upper-layer applications.
  • the basic process of using the resource by the service platform is as follows:
  • the application sends a request to the service execution unit in the service platform according to the service logic, and the service execution unit adjusts, authenticates, and parses the request to the resource adaptation unit in the service platform.
  • the resource adaptation unit After forwarding the request for the resource, the resource adaptation unit sends a request message to the corresponding resource after the protocol and the message are adapted, and the resource returns the result to the application through the service platform after the execution.
  • the process is as shown in FIG. 2, and includes the following steps.
  • Step 2.1 The application sends a resource request to the service platform.
  • Step 2.2 After receiving the authenticated resource request, the service execution unit selects an appropriate resource and forwards the resource request to the resource adaptation unit.
  • Step 2.3 The resource adaptation unit sends a request for the resource to the corresponding resource after being adapted by the message and the protocol.
  • Step 2.4 Successfully invoke or execute the resource after receiving the request.
  • Steps 2.5 ⁇ 2.7 The results of resource invocation or execution are returned to the application through the resource adaptation unit and the business execution unit respectively.
  • the above is a call to the resource by the application.
  • the application business logic generally contains multiple resources. When the business logic is executed, the above steps 2.1 2.7 are repeated to complete the call to the resources in turn.
  • Steps 2.8 ⁇ 2.10 The application requests execution of new resources in the business logic through the service execution unit and the resource adaptation unit.
  • Step 2.11 The resource fails to execute due to its own unavailability or network reasons.
  • Step 2.12 The result of the resource call or execution failure is returned to the application through the resource adaptation unit and the service execution unit respectively.
  • an embodiment of the present invention discloses a service logic execution apparatus, including a service logic parsing and processing function module and a resource status function module, where:
  • the business logic parsing and processing function module is configured to: parse a business logic of an application that initiates a resource request, request, from the resource status function module, status information of a resource to be used by the application business logic, and according to the acquired resource Status information is processed;
  • the resource status function module is configured to: collect and store status information of the resource, and parse and return status information of the resource to the processing function module according to the received request.
  • the status information of the resource includes resource availability, quality of service (QoS), and resource performance.
  • the service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource by:
  • the resource to be used by the application's service logic is a specific resource, according to the status information of the received resource, if it is determined that at least one or more specific resources of the resource to be used by the application's service logic are unavailable, Stopping execution of the application's business logic and returning a message that execution failed to the application.
  • the service logic parsing and processing function module is further configured to: if it is determined that all the specific resources in the resource to be used by the application logic of the application are available, according to the status information of the received resource, proceed to perform Execution of the application's business logic.
  • the service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource by:
  • the service logic parsing and processing function module is further configured to: if it is determined that at least one or more specific resources are available in the universal resource according to the status information of the received resource, and the service logic of the application is If other specific resources other than the universal resources are available, the execution of the business logic of the application is continued.
  • the embodiment of the invention also discloses a method for executing business logic, including:
  • the business logic analysis and processing function module in the business logic execution device parses the business logic of the application that initiates the resource request, and requests the resource status function module in the service logic execution device to request status information of the resource used by the application logic of the application, according to The status information of the acquired resource is processed.
  • the status information of the resource includes resource availability and resource service quality.
  • the step of processing, by the service logic parsing and processing function module, according to the acquired state information of the resource includes:
  • the business logic parsing and processing function module determines the resource to be used by the application's business logic according to the received state information of the resource, Or a plurality of specific resources are unavailable, then execution of the application's business logic is stopped, and a message that the execution fails is returned to the application.
  • the step of processing, by the service logic analysis and processing function module, according to the obtained state information of the resource further includes:
  • the service logic parsing and processing function module determines that all the specific resources in the resource to be used by the application logic are available according to the status information of the received resource, the execution of the service logic of the application is continued.
  • the step of processing, by the service logic parsing and processing function module, according to the acquired state information of the resource includes:
  • the step of processing, by the service logic analysis and processing function module, according to the acquired state information of the resource further includes:
  • service logic parsing and processing function module determines, according to the status information of the received resource, that at least one or more specific resources in the universal resource are available, and the service logic of the application is used outside the universal resource. Other specific resources are available, and the execution of the business logic of the application continues.
  • the technical solution of the present application can terminate the execution of the entire business logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources.
  • the technical solution of the present application can also replace the unavailable resources with available resources in advance, ensure the normal execution of the application and reduce the delay of application execution.
  • FIG. 1 is a schematic structural diagram of an existing business logic execution device
  • FIG. 3 is a schematic structural diagram of a service logic execution apparatus according to an embodiment of the present disclosure.
  • FIG. 4 is a flowchart of execution of a service logic according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of another service logic execution according to the embodiment.
  • Example 1 The applicant of the present invention proposes that for complex business logic execution, the execution of the entire business logic can be terminated ahead of time in the event that a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources; or replacing the available resources in advance.
  • the resources used ensure the normal execution of the application and reduce the delay of application execution.
  • the embodiment provides a service logic execution apparatus, which can avoid waste of resources caused by partial service execution failure when executing business logic.
  • the device includes a business logic analysis and processing function module and a resource status function module in addition to the existing service execution function modules.
  • the business logic parsing and processing function module is configured to: parse the business logic of the application that initiates the resource request, request the resource status function module to use the status information of the resource to be used by the application business logic, and process according to the acquired status information of the resource.
  • the resource status function module is configured to: collect and store status information of the resource, and parse and return status information of the resource to the processing function module according to the received request.
  • the status information of the above resources includes information such as resource availability, resource QoS, and resource performance.
  • the service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource: when the resource to be used by the application business logic is a specific resource, according to the status of the received resource.
  • the information if it is determined that at least one or more specific resources of the resources to be used by the business logic are unavailable, stopping execution of the business logic, and returning a message of execution failure to the application; the service logic parsing and processing function module is further configured to : According to the status information of the received resource, if it is determined that all the specific resources in the resource to be used by the business logic are available, the execution of the business logic is continued.
  • the service logic parsing and processing function module is configured to:
  • the service logic parsing and processing function module is further configured to: according to the status information of the received resource, if it is determined that at least one or more specific resources of the universal resource to be used by the service logic are available, and the service logic uses The other specific resources outside the general resources are available, and the normal business logic is executed.
  • the service logic execution process of the foregoing service logic execution apparatus is as shown in FIG. 4, and includes the following steps. Step 4.1 The application sends a resource request to the service platform (that is, the above-mentioned business logic execution device). In the above steps, the application sends a resource request carrying the service logic to the service execution function module in the service logic execution device.
  • Step 4.2 The service execution function module obtains the business logic of the application from the received resource request.
  • Step 4.3 The service execution function module sends the acquired business logic to the business logic analysis and processing function module.
  • Step 4.4 The business logic parsing and processing function module parses the business logic, obtains the resources to be used by the application's business logic, and requests the resource status function module for the status information of the resources.
  • Step 4.5 The Resource Status function module returns the real-time status information of these resources to the business logic parsing and processing function module, for example, the availability of resources.
  • the resources to be used by the service logic are specific resources, and when at least one of the resources to be used by the service logic is determined to be unavailable according to the obtained availability information of the resources, the service is stopped.
  • the execution of the logic returns a message of execution failure to the application through the service execution function module, and the process ends; if not, step 4.6b is performed.
  • Step 4.6b When determining that all resources to be used by the business logic are available according to the obtained availability information of the resource, the business logic parsing and processing function module notifies the service execution function module to perform normal business logic execution.
  • Step 4.7b The service execution function module forwards the resource request to the resource adaptation unit.
  • Step 4.8 After the resource is triggered and executed, the result is returned to the application through the resource adaptation unit and the service execution unit.
  • FIG. 5 another flow chart is executed by the service logic according to the embodiment of the present invention.
  • the steps are as follows.
  • Step 5.1 The application sends a resource request to the service platform (that is, the above-mentioned business logic execution device). In this step, the application sends a resource request carrying the business logic to the service logic executing device.
  • the business execution function module in the middle.
  • Step 5.2 The service execution function module obtains the business logic of the application from the received resource request carrying the business logic.
  • Step 5.3 The business execution function module sends the acquired business logic to the business logic analysis and processing function module.
  • Step 5.4 The business logic parsing and processing function module parses the business logic, obtains the resources to be used by the application's business logic, and requests the resource status information from the resource status information function module.
  • Step 5.5 The resource status information function module returns real-time status information of these resources to the business logic parsing and processing function module, for example, resource availability, resource QoS, and resource performance.
  • Step 5.6 the resource to be used by the business logic includes the encapsulated universal resource, and the business logic parsing and processing function module checks the availability of all possible specific resources of the universal resource.
  • Steps 5.7a ⁇ 5.8a stop the execution of the business logic if all the specific resources of the universal resource are unavailable, and return the execution failure message to the application, and the process ends; if not, execute step 5.7b.
  • step 5.7b if the specific resources other than the universal resources used by the business logic are available, and the resources available in the specific resources of the universal resources are available, that is, if one of the universal resources to be used by the business logic or When a plurality of specific resources are available, the business logic parsing and processing function module saves the information of the available specific resources in the business logic, and notifies the service execution function module to perform normal business logic execution, so as to directly trigger the saved when the subsequent calling universal resources are invoked.
  • the specific resources can be.
  • the business logic analysis and processing function module can only save one specific resource available.
  • selecting which specific resource to save from a variety of available specific resources it can be further considered in combination with the resource QoS and resource performance of the available specific resources. For example, from the various specific resources available, choose the specific resources that maintain the best resource QoS and resource performance.
  • Step 5.8b The service execution function module forwards the resource request to the resource adaptation unit. Steps 5.9 ⁇ 5.14 After the resource is triggered and executed, the result is returned to the application through the resource adaptation unit and the service execution unit.
  • the service execution unit after receiving the resource request, the service execution unit first obtains the state information of the resource, and then determines how to proceed according to the real-time state information of the resources; another feasible solution is the resource execution request and the resource. The two steps of obtaining the status information are performed simultaneously. If the real-time status information of the resource is received and there are unavailable resources, the execution of the business logic is stopped and a failure response is returned to the application. If the resources are available, the execution of the business logic is continued. Said to save application execution time.
  • the real-time status information of the above resources is obtained by connecting with various resources or by timing heartbeat messages.
  • This embodiment introduces a method for performing business logic, which can be implemented by relying on the business logic executing apparatus in Embodiment 1 above.
  • the business logic execution process in this embodiment includes:
  • the business logic analysis and processing function module in the business logic execution device parses the business logic of the application that initiates the resource request, and requests the resource status function module of the business logic execution device to request the state information of the resource used by the application business logic, according to the acquired resource Status information is processed.
  • the status information of the resource includes resource availability, resource QoS, and resource performance.
  • the steps of the foregoing service logic parsing and processing function module processing according to the acquired state information of the resource include:
  • the business logic parsing and processing function module determines that at least one or more specific resources of the resource to be used by the business logic are unavailable according to the status information of the received resource, Stopping the execution of the business logic, returning a message that the execution failed to the application; and, if the business logic parsing and processing function module determines that all the specific resources in the resource to be used by the business logic are available according to the status information of the received resource, continue Perform business logic execution.
  • the step of processing, by the service logic parsing and processing function module, according to the obtained state information of the resource further includes:
  • the business logic analysis and processing function module determines that all the specific resources in the universal resource are unavailable according to the received state information of the resource, the execution of the business logic is stopped. And returning a message of execution failure to the application; and, if the business logic parsing and processing function module determines, according to the status information of the received resource, that at least one or more specific resources in the universal resource are available, and the universal resource used by the business logic Other specific resources are available, and the execution of the business logic continues.
  • the specific process of the service logic parsing and processing function module processing according to the obtained state information of the resource may be referred to the working process of the service logic executing device in the foregoing Embodiment 1, and details are not described herein again.
  • the technical solution of the present application can terminate the execution of the entire service logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources.
  • the technical solution of the present application may also replace the unavailable resources with available resources in advance (that is, the case where the resources to be used for the business logic include the universal resources, and at least one specific resource is available in the universal resources and other uses are required. Specific resources are available, and normal business logic can be executed. This ensures the normal execution of the application and reduces the delay of application execution.
  • the technical solution of the present application can terminate the execution of the entire business logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources. It is also possible to replace the unavailable resources with available resources in advance, to ensure the normal execution of the application and to reduce the delay of application execution.

Abstract

Disclosed are a service logic execution device and method, which relate to the technical fields of communications and Internet. The disclosed device comprises a service logic resolving and processing function module which resolves a service logic of an application which initiates a resource request, requests from a resource state function module state information about a resource which needs to be used by the service logic of the application, and processes same according to the obtained state information about the resource; and the resource state function module which acquires and stores the state information about the resource, and according to the received request, returns the state information about the resource to the service logic resolving and processing function module. Also disclosed is a service logic execution method. The technical solution of the present application avoids the invalid usage of resources, and can also replace unusable resources with available resources in advance, thereby ensuring the normal execution of an application and reducing the time delay of application execution.

Description

一种业务逻辑执行装置和方法  Business logic execution device and method
技术领域 Technical field
本发明涉及通信和互联网技术领域, 具体涉及一种业务逻辑执行装置和 方法。  The present invention relates to the field of communications and Internet technologies, and in particular, to a service logic executing apparatus and method.
背景技术 Background technique
为满足用户对于应用的各种层次和多样化的需求, 在利用业务实现这些 功能时, 单个业务一般不能完成全部的需求, 必须依靠多个业务相互之间协 作才能达到目的。 越来越多的通信运营商和互联网厂商开放自己的基本业务 能力, 供第三方 SP ( Service Provider, 业务提供商)或者个人开发者基于这 些能力开发复杂和更高层次的丰富应用。  In order to meet the various levels and diverse needs of users, when a service is used to implement these functions, a single service generally cannot complete all the requirements, and must rely on multiple services to cooperate with each other to achieve the purpose. More and more communication operators and Internet vendors are opening up their basic business capabilities for third-party SPs (Service Providers) or individual developers to develop complex and higher-level rich applications based on these capabilities.
这些能力开放一般釆用 Web Service或者 REST ( Representational State Transfer, 表述性状态转移)接口供第三方调用, 对于业务的合成一般也有业 务编制( Service Orchestration )和业务编 4非 ( Service Choreography )两种方式。 在互联网领域通过 Mashup技术可以将多个能力整合为满足用户需求的互联 网应用。  These capabilities are generally open to Web services or REST (Representational State Transfer) interfaces for third-party calls. For service composition, there are generally two methods: Service Orchestration and Service Choreography. . In the Internet domain, Mashup technology can be used to integrate multiple capabilities into Internet applications that meet user needs.
通信运营商和互联网厂商都在建设自己的业务平台, 这些业务平台一般 聚合的资源包括三种类型, 分别是: 来自电信域、 互联网域和 IT ( Information Technology,信息技术)域的各种业务能力引擎;各种内容资源如图片、语音、 视频、 以及 IPTV ( Internet Protocol Television, 互联协议电视)节目等; 以及 计算能力、 存储、 以及带宽等云计算资源。 这些资源可以由业务平台开放给 开发者使用并创建新的应用,也可以由第三方 SP/CP( Service Provider/Content Provider, 业务提供商 /内容提供商)通过资源开放接口直接使用。  Both communication operators and Internet vendors are building their own business platforms. These business platforms generally aggregate three types of resources, namely: various business capabilities from the telecommunications domain, the Internet domain, and the IT (Information Technology) domain. Engine; various content resources such as pictures, voice, video, and IPTV (Internet Protocol Television) programs; and cloud computing resources such as computing power, storage, and bandwidth. These resources can be opened to the developer by the business platform and create new applications. They can also be directly used by third-party SP/CP (Service Provider/Content Provider) through the resource open interface.
而目前上述业务平台的逻辑执行装置如图 1所示。 在业务平台中与业务 逻辑执行相关的主要单元包括业务执行单元和资源适配单元, 业务执行单元 完成对从应用发起的经认证后的资源请求的解析, 然后将此资源请求转发到 资源适配单元; 资源适配单元主要完成请求消息、 协议和媒体格式的适配, 然后将资源请求转发到相应的资源; 在资源执行完成后再分别通过资源适配 单元和业务执行单元将结果返回给应用。 应用的业务逻辑可能包含了多个需 执行的资源, 应用通过业务平台根据该业务逻辑依次完成对资源的调用。 业 务平台向上为各种应用提供规范的资源调用接口, 向下与多个领域的各种资 源交互将它们开放给上层应用。 The logic execution device of the above service platform is shown in FIG. 1 . The main unit related to the execution of the business logic in the service platform includes a service execution unit and a resource adaptation unit, and the service execution unit completes the parsing of the authenticated resource request initiated from the application, and then forwards the resource request to the resource adaptation. Unit; the resource adaptation unit mainly completes the adaptation of the request message, protocol and media format, The resource request is then forwarded to the corresponding resource; after the resource execution is completed, the result is returned to the application through the resource adaptation unit and the service execution unit respectively. The application's business logic may contain multiple resources to be executed, and the application completes the call to the resources according to the business logic through the service platform. The service platform provides a standardized resource invocation interface for various applications, and interacts with various resources in multiple domains to open them to upper-layer applications.
而业务平台使用资源的基本过程是: 应用根据业务逻辑依次向业务平台 中的业务执行单元发送请求, 业务执行单元在对该请求进行认证、 鉴权和解 析后向业务平台中的资源适配单元转发对资源的请求, 资源适配单元在进行 协议和消息的适配后向相应的资源发送请求消息, 资源在执行后通过业务平 台向应用返回结果。 具体地, 该过程如图 2所示, 包括如下步骤。  The basic process of using the resource by the service platform is as follows: The application sends a request to the service execution unit in the service platform according to the service logic, and the service execution unit adjusts, authenticates, and parses the request to the resource adaptation unit in the service platform. After forwarding the request for the resource, the resource adaptation unit sends a request message to the corresponding resource after the protocol and the message are adapted, and the resource returns the result to the application through the service platform after the execution. Specifically, the process is as shown in FIG. 2, and includes the following steps.
步骤 2.1 应用向业务平台发送资源请求。  Step 2.1 The application sends a resource request to the service platform.
步骤 2.2 业务执行单元在接收到经认证后的资源请求后选择合适的资源 并将该资源请求转发给资源适配单元。  Step 2.2 After receiving the authenticated resource request, the service execution unit selects an appropriate resource and forwards the resource request to the resource adaptation unit.
步骤 2.3 资源适配单元在经过消息和协议的适配后将对资源的请求发送 给相应的资源。  Step 2.3 The resource adaptation unit sends a request for the resource to the corresponding resource after being adapted by the message and the protocol.
步骤 2.4 在收到请求后对资源进行成功调用或执行。  Step 2.4 Successfully invoke or execute the resource after receiving the request.
步骤 2.5~2.7 资源调用或执行的结果分别通过资源适配单元和业务执行 单元返回给应用。  Steps 2.5~2.7 The results of resource invocation or execution are returned to the application through the resource adaptation unit and the business execution unit respectively.
以上是应用对资源的一次调用, 应用的业务逻辑一般包含多个资源, 在 执行业务逻辑的时候将重复上述步骤 2.1 2.7以依次完成对资源的调用。  The above is a call to the resource by the application. The application business logic generally contains multiple resources. When the business logic is executed, the above steps 2.1 2.7 are repeated to complete the call to the resources in turn.
步骤 2.8 ~ 2.10 应用通过业务执行单元和资源适配单元请求执行业务逻 辑中新的资源。  Steps 2.8 ~ 2.10 The application requests execution of new resources in the business logic through the service execution unit and the resource adaptation unit.
步骤 2.11 资源由于本身不可用或者网络原因执行失败。  Step 2.11 The resource fails to execute due to its own unavailability or network reasons.
步骤 2.12 2.14 资源调用或执行的失败结果分别通过资源适配单元和业 务执行单元返回给应用。  Step 2.12 2.14 The result of the resource call or execution failure is returned to the application through the resource adaptation unit and the service execution unit respectively.
从上述内容可以看出, 对于一些应用有可能存在比较复杂的业务逻辑, 有可能出现在部分业务 (即资源)执行完成后, 由于后续某个业务执行不成功, 导致整个应用执行失败的情况, 这对于已经调用的资源和业务平台来说都是 一种无效的浪费。 尤其对于批量执行的应用该问题更为突出。 As can be seen from the above, for some applications, there may be more complicated business logic. It may happen that after some services (that is, resources) are executed, the execution of the entire application fails because the subsequent execution of a certain service is unsuccessful. This is for the resources and business platforms that have been called. An invalid waste. This problem is especially acute for applications that are executed in batches.
发明内容 Summary of the invention
本发明的目的是, 提供一种业务逻辑执行装置和方法, 以避免执行业务 逻辑的时候因部分业务执行失败而造成的资源浪费。  It is an object of the present invention to provide a service logic execution apparatus and method that avoids wasting resources due to partial service execution failures when executing business logic.
为了达到上述目的, 本发明实施例公开了一种业务逻辑执行装置, 包括 业务逻辑解析与处理功能模块和资源状态功能模块, 其中:  In order to achieve the above objective, an embodiment of the present invention discloses a service logic execution apparatus, including a service logic parsing and processing function module and a resource status function module, where:
所述业务逻辑解析与处理功能模块设置成: 解析发起资源请求的应用的 业务逻辑, 向所述资源状态功能模块请求所述应用的业务逻辑所要使用的资 源的状态信息, 并根据获取的资源的状态信息进行处理;  The business logic parsing and processing function module is configured to: parse a business logic of an application that initiates a resource request, request, from the resource status function module, status information of a resource to be used by the application business logic, and according to the acquired resource Status information is processed;
所述资源状态功能模块设置成: 收集和存储资源的状态信息, 并根据收 到的请求向所述业务逻辑解析与处理功能模块返回资源的状态信息。  The resource status function module is configured to: collect and store status information of the resource, and parse and return status information of the resource to the processing function module according to the received request.
上述装置中, 所述资源的状态信息包括资源的可用性、 资源服务质量 ( QoS, Quality of Service )和资源性能。  In the foregoing apparatus, the status information of the resource includes resource availability, quality of service (QoS), and resource performance.
上述装置中, 所述业务逻辑解析与处理功能模块是设置成通过如下方式 根据获取的资源的状态信息进行相应的处理:  In the above apparatus, the service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource by:
当所述应用的业务逻辑所要使用的资源为具体资源时, 根据收到的资源 的状态信息, 若确定所述应用的业务逻辑所要使用的资源中至少一种或多种 具体资源不可用, 则停止所述应用的业务逻辑的执行, 并向所述应用返回执 行失败的消息。  When the resource to be used by the application's service logic is a specific resource, according to the status information of the received resource, if it is determined that at least one or more specific resources of the resource to be used by the application's service logic are unavailable, Stopping execution of the application's business logic and returning a message that execution failed to the application.
上述装置中, 所述业务逻辑解析与处理功能模块还设置成: 根据收到的 资源的状态信息, 若确定所述应用的业务逻辑所要使用的资源中所有具体资 源均可用, 则继续进行所述应用的业务逻辑的执行。  In the above device, the service logic parsing and processing function module is further configured to: if it is determined that all the specific resources in the resource to be used by the application logic of the application are available, according to the status information of the received resource, proceed to perform Execution of the application's business logic.
上述装置中, 所述业务逻辑解析与处理功能模块是设置成通过如下方式 根据获取的资源的状态信息进行相应的处理:  In the above apparatus, the service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource by:
当所述应用的业务逻辑所要使用的资源包含通用资源时, 根据收到的资 源的状态信息, 若确定所述通用资源中所有具体资源均不可用, 则停止所述 应用的业务逻辑的执行, 并向所述应用返回执行失败的消息。 上述装置中, 所述业务逻辑解析与处理功能模块还设置成: 根据收到资 源的状态信息, 若确定所述通用资源中至少有一种或几种具体资源可用, 并 且所述应用的业务逻辑所使用的所述通用资源外的其它具体资源都可用, 则 继续进行所述应用的业务逻辑的执行。 本发明实施例还公开了一种业务逻辑执行的方法, 包括: When the resource to be used by the application's service logic includes a common resource, if it is determined that all the specific resources in the universal resource are unavailable, the execution of the service logic of the application is stopped according to the status information of the received resource. And return a message that the execution failed to the application. In the foregoing apparatus, the service logic parsing and processing function module is further configured to: if it is determined that at least one or more specific resources are available in the universal resource according to the status information of the received resource, and the service logic of the application is If other specific resources other than the universal resources are available, the execution of the business logic of the application is continued. The embodiment of the invention also discloses a method for executing business logic, including:
业务逻辑执行装置中业务逻辑解析与处理功能模块解析发起资源请求的 应用的业务逻辑, 向所述业务逻辑执行装置中资源状态功能模块请求所述应 用的业务逻辑所要使用的资源的状态信息, 根据获取的资源的状态信息进行 处理。  The business logic analysis and processing function module in the business logic execution device parses the business logic of the application that initiates the resource request, and requests the resource status function module in the service logic execution device to request status information of the resource used by the application logic of the application, according to The status information of the acquired resource is processed.
上述方法中, 所述资源的状态信息包括资源的可用性、 资源服务质量 In the above method, the status information of the resource includes resource availability and resource service quality.
( QoS )和资源性能。 (QoS) and resource performance.
上述方法中, 所述业务逻辑解析与处理功能模块根据获取的资源的状态 信息进行处理的步骤包括:  In the above method, the step of processing, by the service logic parsing and processing function module, according to the acquired state information of the resource, includes:
当所述应用的业务逻辑所要使用的资源为具体资源时, 若所述业务逻辑 解析与处理功能模块根据收到的资源的状态信息, 确定所述应用的业务逻辑 所要使用的资源中至少一种或多种具体资源不可用, 则停止所述应用的业务 逻辑的执行, 并向所述应用返回执行失败的消息。  When the resource to be used by the application's business logic is a specific resource, if the business logic parsing and processing function module determines the resource to be used by the application's business logic according to the received state information of the resource, Or a plurality of specific resources are unavailable, then execution of the application's business logic is stopped, and a message that the execution fails is returned to the application.
上述方法中, 所述业务逻辑解析与处理功能模块根据获取的资源的状态 信息进行处理的步骤还包括:  In the above method, the step of processing, by the service logic analysis and processing function module, according to the obtained state information of the resource, further includes:
若所述业务逻辑解析与处理功能模块根据收到的资源的状态信息, 确定 所述应用的业务逻辑所要使用的资源中所有具体资源均可用, 则继续进行所 述应用的业务逻辑的执行。  If the service logic parsing and processing function module determines that all the specific resources in the resource to be used by the application logic are available according to the status information of the received resource, the execution of the service logic of the application is continued.
上述方法中, 所述业务逻辑解析与处理功能模块根据获取的资源的状态 信息进行处理的步骤包括:  In the above method, the step of processing, by the service logic parsing and processing function module, according to the acquired state information of the resource, includes:
当所述应用的业务逻辑所要使用的资源包含通用资源时, 若所述业务逻 辑解析与处理功能模块根据收到的资源的状态信息, 确定所述通用资源中所 有具体资源均不可用, 则停止所述应用的业务逻辑的执行, 并向所述应用返 回执行失败的消息。 上述方法中, 所述业务逻辑解析与处理功能模块根据获取的资源的状态 信息进行处理的步骤还包括: When the resource to be used by the application's business logic includes a universal resource, if the service logic parsing and processing function module determines that all the specific resources in the universal resource are unavailable according to the status information of the received resource, Execution of the application's business logic, and returning a message that execution failed to the application. In the above method, the step of processing, by the service logic analysis and processing function module, according to the acquired state information of the resource, further includes:
若所述业务逻辑解析与处理功能模块根据收到资源的状态信息, 确定所 述通用资源中至少有一种或几种具体资源可用, 并且所述应用的业务逻辑所 使用的所述通用资源外的其它具体资源都可用, 则继续进行所述应用的业务 逻辑的执行。  If the service logic parsing and processing function module determines, according to the status information of the received resource, that at least one or more specific resources in the universal resource are available, and the service logic of the application is used outside the universal resource. Other specific resources are available, and the execution of the business logic of the application continues.
本申请技术方案能够在业务逻辑中后续某个资源不可用的情况下, 提前 结束整个业务逻辑的执行, 从而避免资源的无效使用。 另外, 本申请技术方 案还可以预先用可用资源替换不可用的资源, 保证应用的正常执行并减少应 用执行的时延。 The technical solution of the present application can terminate the execution of the entire business logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources. In addition, the technical solution of the present application can also replace the unavailable resources with available resources in advance, ensure the normal execution of the application and reduce the delay of application execution.
附图说明 DRAWINGS
附图用来提供对本申请的进一步理解, 并且构成说明书的一部分, 与本 申请的实施例一起用于解释本申请, 并不构成对本申请的限制。 在附图中: 图 1为现有业务逻辑执行装置结构示意图;  The accompanying drawings are used to provide a further understanding of the present invention, and are intended to be a part of the description of the invention. In the drawings: FIG. 1 is a schematic structural diagram of an existing business logic execution device;
图 2为现有业务逻辑执行流程图;  2 is a flow chart of execution of existing business logic;
图 3为本实施例提供的业务逻辑执行装置结构示意图;  FIG. 3 is a schematic structural diagram of a service logic execution apparatus according to an embodiment of the present disclosure;
图 4为本实施例提供的一种业务逻辑执行流程图;  FIG. 4 is a flowchart of execution of a service logic according to an embodiment of the present invention;
图 5为本实施例提供的另一种业务逻辑执行流程图。  FIG. 5 is a flowchart of another service logic execution according to the embodiment.
具体实施方式 detailed description
为使本发明的目的、 技术方案和优点更加清楚明白, 下文将结合附图对 本发明技术方案作进一步详细说明。 需要说明的是, 在不冲突的情况下, 本 申请的实施例和实施例中的特征可以任意相互组合。  In order to make the objects, technical solutions and advantages of the present invention more comprehensible, the technical solutions of the present invention will be further described in detail below with reference to the accompanying drawings. It should be noted that the features in the embodiments and the embodiments of the present application may be arbitrarily combined with each other without conflict.
实施例 1 本发明申请人提出, 对于复杂的业务逻辑执行, 能够在业务逻辑中后续 某个资源不可用的情况下, 提前结束整个业务逻辑的执行, 从而避免资源的 无效使用; 或者预先用可用资源替换不可用的资源, 保证应用的正常执行并 减少应用执行的时延。 Example 1 The applicant of the present invention proposes that for complex business logic execution, the execution of the entire business logic can be terminated ahead of time in the event that a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources; or replacing the available resources in advance. The resources used ensure the normal execution of the application and reduce the delay of application execution.
基于上述思想, 本实施例提供一种业务逻辑执行装置, 可以避免执行业 务逻辑的时候因部分业务执行失败而造成的资源浪费。 该装置如图 3所示, 除了已有的业务执行功能模块外, 还包括业务逻辑解析与处理功能模块和资 源状态功能模块。  Based on the above idea, the embodiment provides a service logic execution apparatus, which can avoid waste of resources caused by partial service execution failure when executing business logic. As shown in FIG. 3, the device includes a business logic analysis and processing function module and a resource status function module in addition to the existing service execution function modules.
业务逻辑解析与处理功能模块设置成: 解析发起资源请求的应用的业务 逻辑,向资源状态功能模块请求应用的业务逻辑所要使用的资源的状态信息, 并根据获取的资源的状态信息进行处理。  The business logic parsing and processing function module is configured to: parse the business logic of the application that initiates the resource request, request the resource status function module to use the status information of the resource to be used by the application business logic, and process according to the acquired status information of the resource.
资源状态功能模块设置成: 收集和存储资源的状态信息, 并根据收到的 请求向业务逻辑解析与处理功能模块返回资源的状态信息。 上述资源的状态信息包括资源的可用性、 资源 QoS和资源性能等信息。 其中, 所述业务逻辑解析与处理功能模块是设置成通过如下方式根据获 取的资源的状态信息进行相应的处理: 当应用的业务逻辑所要使用的资源为具体资源时, 根据收到的资源的状 态信息, 如果确定业务逻辑所要使用的资源中至少一种或几种具体资源不可 用, 则停止业务逻辑的执行, 并向应用返回执行失败的消息; 所述业务逻辑 解析与处理功能模块还设置成: 根据收到的资源的状态信息, 如果确定业务 逻辑所要使用的资源中所有具体资源均可用, 则继续进行业务逻辑的执行。  The resource status function module is configured to: collect and store status information of the resource, and parse and return status information of the resource to the processing function module according to the received request. The status information of the above resources includes information such as resource availability, resource QoS, and resource performance. The service logic parsing and processing function module is configured to perform corresponding processing according to the acquired state information of the resource: when the resource to be used by the application business logic is a specific resource, according to the status of the received resource The information, if it is determined that at least one or more specific resources of the resources to be used by the business logic are unavailable, stopping execution of the business logic, and returning a message of execution failure to the application; the service logic parsing and processing function module is further configured to : According to the status information of the received resource, if it is determined that all the specific resources in the resource to be used by the business logic are available, the execution of the business logic is continued.
其中, 所述业务逻辑解析与处理功能模块是设置成:  The service logic parsing and processing function module is configured to:
当应用的业务逻辑所要使用的资源包含封装的通用资源时, 根据收到的 资源的状态信息, 如果确定该通用资源所有具体资源的均不可用, 则停止业 务逻辑的执行, 向应用返回执行失败的消息; 所述业务逻辑解析与处理功能 模块还设置成: 根据收到的资源的状态信息, 如果确定业务逻辑所要使用的 通用资源中至少一种或几种具体资源可用, 并且业务逻辑所使用的通用资源 外的其它具体资源都可用, 则继续进行正常的业务逻辑的执行。 具体地, 上述业务逻辑执行装置的业务逻辑执行过程如图 4所示, 包括 如下步骤。 步骤 4.1 应用向业务平台(即为上述业务逻辑执行装置)发送资源请求。 上述步骤中, 应用将携带有业务逻辑的资源请求发送到业务逻辑执行装 置中的业务执行功能模块。 When the resource to be used by the application's business logic includes the encapsulated universal resource, according to the status information of the received resource, if it is determined that all the specific resources of the universal resource are unavailable, the execution of the business logic is stopped, and the execution failure is returned to the application. The service logic parsing and processing function module is further configured to: according to the status information of the received resource, if it is determined that at least one or more specific resources of the universal resource to be used by the service logic are available, and the service logic uses The other specific resources outside the general resources are available, and the normal business logic is executed. Specifically, the service logic execution process of the foregoing service logic execution apparatus is as shown in FIG. 4, and includes the following steps. Step 4.1 The application sends a resource request to the service platform (that is, the above-mentioned business logic execution device). In the above steps, the application sends a resource request carrying the service logic to the service execution function module in the service logic execution device.
步骤 4.2 业务执行功能模块从接收到的资源请求中获取该应用的业务逻 辑。  Step 4.2 The service execution function module obtains the business logic of the application from the received resource request.
步骤 4.3 业务执行功能模块将获取的业务逻辑发送到业务逻辑解析与处 理功能模块。  Step 4.3 The service execution function module sends the acquired business logic to the business logic analysis and processing function module.
步骤 4.4 业务逻辑解析与处理功能模块解析该业务逻辑, 获取该应用的 业务逻辑所要使用的资源, 向资源状态功能模块请求这些资源的状态信息。  Step 4.4 The business logic parsing and processing function module parses the business logic, obtains the resources to be used by the application's business logic, and requests the resource status function module for the status information of the resources.
步骤 4.5 资源状态功能模块向业务逻辑解析与处理功能模块返回这些资 源的实时状态信息, 例如, 资源的可用性。  Step 4.5 The Resource Status function module returns the real-time status information of these resources to the business logic parsing and processing function module, for example, the availability of resources.
步骤 4.6a ~ 4.7a本实施例中, 4叚设业务逻辑所要使用的资源为具体资源, 根据所获取的资源的可用性信息确定业务逻辑所要使用的资源中至少一种资 源不可用时, 则停止业务逻辑的执行, 通过业务执行功能模块向应用返回执 行失败的消息, 此时流程结束; 如否, 则执行步骤 4.6b。  Steps 4.6a to 4.7a In this embodiment, the resources to be used by the service logic are specific resources, and when at least one of the resources to be used by the service logic is determined to be unavailable according to the obtained availability information of the resources, the service is stopped. The execution of the logic returns a message of execution failure to the application through the service execution function module, and the process ends; if not, step 4.6b is performed.
步骤 4.6b根据所获取的资源的可用性信息确定业务逻辑所要使用的所 有资源都可用时, 业务逻辑解析与处理功能模块则通知业务执行功能模块进 行正常的业务逻辑执行。  Step 4.6b: When determining that all resources to be used by the business logic are available according to the obtained availability information of the resource, the business logic parsing and processing function module notifies the service execution function module to perform normal business logic execution.
步骤 4.7b 业务执行功能模块向资源适配单元转发资源请求。  Step 4.7b The service execution function module forwards the resource request to the resource adaptation unit.
步骤 4.8 4.13 资源被触发和执行完成后通过资源适配单元和业务执行单 元向应用返回结果。  Step 4.8 4.13 After the resource is triggered and executed, the result is returned to the application through the resource adaptation unit and the service execution unit.
如图 5所示, 是本发明实施例所述的业务逻辑执行另一流程图。 包括如 下步骤。  As shown in FIG. 5, another flow chart is executed by the service logic according to the embodiment of the present invention. The steps are as follows.
步骤 5.1 应用向业务平台(即为上述业务逻辑执行装置)发送资源请求。 该步骤中, 应用将携带有业务逻辑的资源请求发送到业务逻辑执行装置 中的业务执行功能模块。 Step 5.1 The application sends a resource request to the service platform (that is, the above-mentioned business logic execution device). In this step, the application sends a resource request carrying the business logic to the service logic executing device. The business execution function module in the middle.
步骤 5.2 业务执行功能模块从接收到的携带有业务逻辑的资源请求中获 取该应用的业务逻辑。  Step 5.2 The service execution function module obtains the business logic of the application from the received resource request carrying the business logic.
步骤 5.3 业务执行功能模块将获取的业务逻辑发送到业务逻辑解析与处 理功能模块。  Step 5.3 The business execution function module sends the acquired business logic to the business logic analysis and processing function module.
步骤 5.4 业务逻辑解析与处理功能模块解析该业务逻辑, 获取该应用的 业务逻辑所要使用的资源, 并向资源状态信息功能模块请求这些资源的状态 信息。  Step 5.4 The business logic parsing and processing function module parses the business logic, obtains the resources to be used by the application's business logic, and requests the resource status information from the resource status information function module.
步骤 5.5 资源状态信息功能模块向业务逻辑解析与处理功能模块返回这 些资源的实时状态信息, 例如, 资源的可用性、 资源 QoS和资源性能等信息。  Step 5.5 The resource status information function module returns real-time status information of these resources to the business logic parsing and processing function module, for example, resource availability, resource QoS, and resource performance.
步骤 5.6在本实施例中, 假设业务逻辑所要使用的资源包含封装的通用 资源, 业务逻辑解析与处理功能模块则检查该通用资源所有可能具体资源的 可用性。  Step 5.6 In this embodiment, it is assumed that the resource to be used by the business logic includes the encapsulated universal resource, and the business logic parsing and processing function module checks the availability of all possible specific resources of the universal resource.
步骤 5.7a ~ 5.8a如果通用资源的所有具体资源都不可用则停止业务逻辑 的执行, 并向应用返回执行失败的消息, 此时流程结束; 如果否, 则执行步 骤 5.7b。  Steps 5.7a ~ 5.8a stop the execution of the business logic if all the specific resources of the universal resource are unavailable, and return the execution failure message to the application, and the process ends; if not, execute step 5.7b.
步骤 5.7b中,如果业务逻辑所使用的通用资源外的其它具体资源都可用, 以及通用资源的可能具体资源中有可用的资源, 也就是说, 如果业务逻辑所 要使用的通用资源中一种或多种具体资源可用, 则业务逻辑解析与处理功能 模块在业务逻辑中保存可用的具体资源的信息, 并通知业务执行功能模块进 行正常的业务逻辑执行, 以在后续调用通用资源时直接触发所保存的具体资 源即可。  In step 5.7b, if the specific resources other than the universal resources used by the business logic are available, and the resources available in the specific resources of the universal resources are available, that is, if one of the universal resources to be used by the business logic or When a plurality of specific resources are available, the business logic parsing and processing function module saves the information of the available specific resources in the business logic, and notifies the service execution function module to perform normal business logic execution, so as to directly trigger the saved when the subsequent calling universal resources are invoked. The specific resources can be.
这里需要说明的是, 当通用资源中有多个具体资源可用时, 业务逻辑解 析与处理功能模块仅保存一种可用的具体资源即可。 而从多种可用的具体资 源中选择保存哪一种具体资源时, 可进一步结合可用的具体资源的资源 QoS 和资源性能来考虑。 例如, 从可用的多种具体资源中, 选择保持资源 QoS和 资源性能最好的具体资源。  It should be noted here that when there are multiple specific resources available in the universal resource, the business logic analysis and processing function module can only save one specific resource available. When selecting which specific resource to save from a variety of available specific resources, it can be further considered in combination with the resource QoS and resource performance of the available specific resources. For example, from the various specific resources available, choose the specific resources that maintain the best resource QoS and resource performance.
步骤 5.8b 业务执行功能模块向资源适配单元转发资源请求。 步骤 5.9~5.14 资源被触发和执行完成后通过资源适配单元和业务执行单 元向应用返回结果。 Step 5.8b The service execution function module forwards the resource request to the resource adaptation unit. Steps 5.9~5.14 After the resource is triggered and executed, the result is returned to the application through the resource adaptation unit and the service execution unit.
以上两个流程中, 业务执行单元在收到资源请求后, 先获取资源的状态 信息, 然后根据这些资源的实时状态信息决定下一步如何处理; 另一种可行 的方案是资源的执行请求和资源状态信息的获取两个步骤同时进行, 如果收 到资源实时状态信息并有不可用资源, 则停止业务逻辑执行并向应用返回失 败响应, 如果资源都可用则继续业务逻辑执行, 这种方案相对来说能够节约 应用执行时间。  In the above two processes, after receiving the resource request, the service execution unit first obtains the state information of the resource, and then determines how to proceed according to the real-time state information of the resources; another feasible solution is the resource execution request and the resource. The two steps of obtaining the status information are performed simultaneously. If the real-time status information of the resource is received and there are unavailable resources, the execution of the business logic is stopped and a failure response is returned to the application. If the resources are available, the execution of the business logic is continued. Said to save application execution time.
对于业务逻辑中存在判断和执行路径分支的情况, 有可能需要业务逻辑 解析与处理功能模块多次获取资源的状态信息并进行处理。  For the case where there is a judgment and execution path branch in the business logic, it may be necessary for the business logic parsing and processing function module to acquire the state information of the resource multiple times and process it.
上述资源的实时状态信息是通过与各个资源连接或通过定时心跳消息来 获取的。  The real-time status information of the above resources is obtained by connecting with various resources or by timing heartbeat messages.
实施例 2 Example 2
本实施例介绍一种业务逻辑执行的方法, 该方法可依赖于上述实施例 1 中的业务逻辑执行装置来实现。 本实施例中业务逻辑执行过程包括:  This embodiment introduces a method for performing business logic, which can be implemented by relying on the business logic executing apparatus in Embodiment 1 above. The business logic execution process in this embodiment includes:
业务逻辑执行装置中业务逻辑解析与处理功能模块解析发起资源请求的 应用的业务逻辑, 向业务逻辑执行装置中资源状态功能模块请求应用的业务 逻辑所要使用的资源的状态信息, 根据获取的资源的状态信息进行处理。 其 中, 所述资源的状态信息包括资源的可用性、 资源 QoS和资源性能。  The business logic analysis and processing function module in the business logic execution device parses the business logic of the application that initiates the resource request, and requests the resource status function module of the business logic execution device to request the state information of the resource used by the application business logic, according to the acquired resource Status information is processed. The status information of the resource includes resource availability, resource QoS, and resource performance.
而上述业务逻辑解析与处理功能模块根据获取的资源的状态信息进行处 理的步骤包括:  The steps of the foregoing service logic parsing and processing function module processing according to the acquired state information of the resource include:
当应用的业务逻辑所要使用的资源为具体资源时, 如果业务逻辑解析与 处理功能模块根据收到的资源的状态信息, 确定业务逻辑所要使用的资源中 至少一种或多种具体资源不可用, 则停止业务逻辑的执行, 向应用返回执行 失败的消息; 以及, 如果业务逻辑解析与处理功能模块根据收到的资源的状 态信息, 确定业务逻辑所要使用的资源中所有具体资源均可用, 则继续进行 业务逻辑的执行。 而上述业务逻辑解析与处理功能模块根据获取的资源的状态信息进行处 理的步骤还包括: When the resource to be used by the application's business logic is a specific resource, if the business logic parsing and processing function module determines that at least one or more specific resources of the resource to be used by the business logic are unavailable according to the status information of the received resource, Stopping the execution of the business logic, returning a message that the execution failed to the application; and, if the business logic parsing and processing function module determines that all the specific resources in the resource to be used by the business logic are available according to the status information of the received resource, continue Perform business logic execution. The step of processing, by the service logic parsing and processing function module, according to the obtained state information of the resource, further includes:
当应用的业务逻辑所要使用的资源包含通用资源时, 如果业务逻辑解析 与处理功能模块根据收到的资源的状态信息, 确定该通用资源中所有具体资 源均不可用, 则停止业务逻辑的执行, 并向应用返回执行失败的消息; 以及, 如果业务逻辑解析与处理功能模块根据收到资源的状态信息, 确定该通用资 源中至少有一种或几种具体资源可用, 并且业务逻辑所使用的通用资源外的 其它具体资源都可用, 则继续进行业务逻辑的执行。  When the resource to be used by the application's business logic includes a common resource, if the business logic analysis and processing function module determines that all the specific resources in the universal resource are unavailable according to the received state information of the resource, the execution of the business logic is stopped. And returning a message of execution failure to the application; and, if the business logic parsing and processing function module determines, according to the status information of the received resource, that at least one or more specific resources in the universal resource are available, and the universal resource used by the business logic Other specific resources are available, and the execution of the business logic continues.
上述方法中, 业务逻辑解析与处理功能模块根据获取的资源的状态信息 进行处理的具体过程,可参见上述实施例 1中业务逻辑执行装置的工作过程, 在此不再赘述。  In the foregoing method, the specific process of the service logic parsing and processing function module processing according to the obtained state information of the resource may be referred to the working process of the service logic executing device in the foregoing Embodiment 1, and details are not described herein again.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本申请不限制于任 何特定形式的硬件和软件的结合。 One of ordinary skill in the art will appreciate that all or a portion of the above steps may be accomplished by a program instructing the associated hardware, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment may be implemented in the form of hardware or in the form of a software function module. This application is not limited to any specific form of combination of hardware and software.
从上述实施例可以看出, 本申请技术方案, 对于复杂的业务逻辑执行, 能够在业务逻辑中后续某个资源不可用的情况下, 提前结束整个业务逻辑的 执行, 从而避免资源的无效使用。 另外, 本申请技术方案还可以预先用可用 资源替换不可用的资源 (即针对业务逻辑所要使用的资源中包含有通用资源 的情况, 通用资源中只要有至少一种具体资源可用且所要使用的其他具体资 源均可用, 即可进行正常的业务逻辑的执行) , 保证应用的正常执行并减少 应用执行的时延。  As can be seen from the foregoing embodiments, the technical solution of the present application can terminate the execution of the entire service logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources. In addition, the technical solution of the present application may also replace the unavailable resources with available resources in advance (that is, the case where the resources to be used for the business logic include the universal resources, and at least one specific resource is available in the universal resources and other uses are required. Specific resources are available, and normal business logic can be executed. This ensures the normal execution of the application and reduces the delay of application execution.
以上所述, 仅为本发明的较佳实例而已, 并非用于限定本发明的保护范 围。 凡在本发明的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 工业实用性 The above is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and scope of the present invention are intended to be included within the scope of the present invention. Industrial applicability
本申请技术方案能够在业务逻辑中后续某个资源不可用的情况下, 提前 结束整个业务逻辑的执行, 从而避免资源的无效使用。 还可以预先用可用资 源替换不可用的资源, 保证应用的正常执行并减少应用执行的时延。  The technical solution of the present application can terminate the execution of the entire business logic in advance in the case where a certain resource is unavailable in the business logic, thereby avoiding invalid use of resources. It is also possible to replace the unavailable resources with available resources in advance, to ensure the normal execution of the application and to reduce the delay of application execution.

Claims

权 利 要 求 书 Claim
1、 一种业务逻辑执行装置, 包括: 业务逻辑解析与处理功能模块和资源 状态功能模块, 其中: A business logic execution device, comprising: a business logic analysis and processing function module and a resource status function module, wherein:
所述业务逻辑解析与处理功能模块设置成: 解析发起资源请求的应用的 业务逻辑, 向所述资源状态功能模块请求所述应用的业务逻辑所要使用的资 源的状态信息, 并根据获取的资源的状态信息进行处理;  The business logic parsing and processing function module is configured to: parse a business logic of an application that initiates a resource request, request, from the resource status function module, status information of a resource to be used by the application business logic, and according to the acquired resource Status information is processed;
所述资源状态功能模块设置成: 收集和存储资源的状态信息, 并根据收 到的请求向所述业务逻辑解析与处理功能模块返回资源的状态信息。  The resource status function module is configured to: collect and store status information of the resource, and parse and return status information of the resource to the processing function module according to the received request.
2、 根据权利要求 1所述的装置, 其中, 2. The apparatus according to claim 1, wherein
所述资源的状态信息包括资源的可用性、 资源服务质量(QoS )和资源 性能。  The status information of the resource includes resource availability, resource quality of service (QoS), and resource performance.
3、 根据权利要求 1或 2所述的装置, 其中, 所述业务逻辑解析与处理功 能模块是设置成通过如下方式根据获取的资源的状态信息进行相应的处理: 当所述应用的业务逻辑所要使用的资源为具体资源时, 根据收到的资源 的状态信息, 若确定所述应用的业务逻辑所要使用的资源中至少一种或多种 具体资源不可用, 则停止所述应用的业务逻辑的执行, 并向所述应用返回执 行失败的消息。 The device according to claim 1 or 2, wherein the service logic parsing and processing function module is configured to perform corresponding processing according to status information of the acquired resource by: when the business logic of the application is required When the resource used is a specific resource, according to the status information of the received resource, if it is determined that at least one or more specific resources of the resource to be used by the application business logic are unavailable, the service logic of the application is stopped. Execute, and return a message that execution failed to the application.
4、 根据权利要求 3所述的装置, 其中, 4. The apparatus according to claim 3, wherein
所述业务逻辑解析与处理功能模块还设置成: 根据收到的资源的状态信 息, 若确定所述应用的业务逻辑所要使用的资源中所有具体资源均可用, 则 继续进行所述应用的业务逻辑的执行。  The service logic parsing and processing function module is further configured to: according to the status information of the received resource, if it is determined that all the specific resources in the resource to be used by the application logic of the application are available, proceed to perform the service logic of the application Execution.
5、 根据权利要求 1或 2所述的装置, 其中, 所述业务逻辑解析与处理功 能模块是设置成通过如下方式根据获取的资源的状态信息进行相应的处理: 当所述应用的业务逻辑所要使用的资源包含通用资源时, 根据收到的资 源的状态信息, 若确定所述通用资源中所有具体资源均不可用, 则停止所述 应用的业务逻辑的执行, 并向所述应用返回执行失败的消息。 The device according to claim 1 or 2, wherein the service logic parsing and processing function module is configured to perform corresponding processing according to status information of the acquired resource by: when the business logic of the application is required When the used resource includes a common resource, if it is determined that all the specific resources in the universal resource are unavailable, the execution of the business logic of the application is stopped, and the execution failure is returned to the application. Message.
6、 根据权利要求 5所述的装置, 其中, 6. The apparatus according to claim 5, wherein
所述业务逻辑解析与处理功能模块还设置成:根据收到资源的状态信息, 若确定所述通用资源中至少有一种或几种具体资源可用, 并且所述应用的业 务逻辑所使用的所述通用资源外的其它具体资源都可用, 则继续进行所述应 用的业务逻辑的执行。  The service logic parsing and processing function module is further configured to: if it is determined that at least one or more specific resources are available in the universal resource according to the status information of the received resource, and the service logic used by the application is If other specific resources other than the general resources are available, the execution of the business logic of the application is continued.
7、 一种业务逻辑执行的方法, 包括: 7. A method of executing business logic, comprising:
业务逻辑执行装置中业务逻辑解析与处理功能模块解析发起资源请求的 应用的业务逻辑, 向所述业务逻辑执行装置中资源状态功能模块请求所述应 用的业务逻辑所要使用的资源的状态信息, 根据获取的资源的状态信息进行 处理。  The business logic analysis and processing function module in the business logic execution device parses the business logic of the application that initiates the resource request, and requests the resource status function module in the service logic execution device to request status information of the resource used by the application logic of the application, according to The status information of the acquired resource is processed.
8、 根据权利要求 7所述的方法, 其中, 8. The method according to claim 7, wherein
所述资源的状态信息包括资源的可用性、 资源服务质量(QoS )和资源 性能。  The status information of the resource includes resource availability, resource quality of service (QoS), and resource performance.
9、 根据权利要求 7或 8所述的方法, 其中, 所述业务逻辑解析与处理功 能模块根据获取的资源的状态信息进行处理的步骤包括: The method according to claim 7 or 8, wherein the step of processing by the service logic parsing and processing function module according to the acquired state information of the resource comprises:
当所述应用的业务逻辑所要使用的资源为具体资源时, 若所述业务逻辑 解析与处理功能模块根据收到的资源的状态信息, 确定所述应用的业务逻辑 所要使用的资源中至少一种或多种具体资源不可用, 则停止所述应用的业务 逻辑的执行, 并向所述应用返回执行失败的消息。  When the resource to be used by the application's business logic is a specific resource, if the business logic parsing and processing function module determines the resource to be used by the application's business logic according to the received state information of the resource, Or a plurality of specific resources are unavailable, then execution of the application's business logic is stopped, and a message that the execution fails is returned to the application.
10、 根据权利要求 9所述的方法, 其中, 所述业务逻辑解析与处理功能 模块根据获取的资源的状态信息进行处理的步骤还包括: The method according to claim 9, wherein the step of processing, by the service logic analysis and processing function module, according to the acquired state information of the resource, further includes:
若所述业务逻辑解析与处理功能模块根据收到的资源的状态信息, 确定 所述应用的业务逻辑所要使用的资源中所有具体资源均可用, 则继续进行所 述应用的业务逻辑的执行。  If the service logic parsing and processing function module determines that all the specific resources in the resource to be used by the application logic are available according to the status information of the received resource, the execution of the service logic of the application is continued.
11、 根据权利要求 7或 8所述的方法, 其中, 所述业务逻辑解析与处理 功能模块根据获取的资源的状态信息进行处理的步骤包括: 当所述应用的业务逻辑所要使用的资源包含通用资源时, 若所述业务逻 辑解析与处理功能模块根据收到的资源的状态信息, 确定所述通用资源中所 有具体资源均不可用, 则停止所述应用的业务逻辑的执行, 并向所述应用返 回执行失败的消息。 The method according to claim 7 or 8, wherein the step of processing by the service logic parsing and processing function module according to the acquired state information of the resource comprises: When the resource to be used by the application's business logic includes a universal resource, if the service logic parsing and processing function module determines that all the specific resources in the universal resource are unavailable according to the status information of the received resource, Execution of the application's business logic, and returning a message that execution failed to the application.
12、 根据权利要求 11所述的方法, 其中, 所述业务逻辑解析与处理功能 模块根据获取的资源的状态信息进行处理的步骤还包括: The method according to claim 11, wherein the step of processing by the service logic parsing and processing function module according to the acquired state information of the resource further comprises:
若所述业务逻辑解析与处理功能模块根据收到资源的状态信息, 确定所 述通用资源中至少有一种或几种具体资源可用, 并且所述应用的业务逻辑所 使用的所述通用资源外的其它具体资源都可用, 则继续进行所述应用的业务 逻辑的执行。  If the service logic parsing and processing function module determines, according to the status information of the received resource, that at least one or more specific resources in the universal resource are available, and the service logic of the application is used outside the universal resource. Other specific resources are available, and the execution of the business logic of the application continues.
PCT/CN2013/073690 2012-04-09 2013-04-03 Service logic execution device and method WO2013152691A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210100936.2 2012-04-09
CN201210100936.2A CN103369012B (en) 2012-04-09 2012-04-09 A kind of service logic performs device and method

Publications (1)

Publication Number Publication Date
WO2013152691A1 true WO2013152691A1 (en) 2013-10-17

Family

ID=49327095

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073690 WO2013152691A1 (en) 2012-04-09 2013-04-03 Service logic execution device and method

Country Status (2)

Country Link
CN (1) CN103369012B (en)
WO (1) WO2013152691A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161050B (en) * 2015-03-30 2020-12-18 联想(北京)有限公司 Problem resource indicating device and problem resource indicating method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159740A (en) * 2005-03-08 2008-04-09 华为技术有限公司 Method and device for implementing proxy demand mode resource preservation in next generation network
CN102164068A (en) * 2010-02-20 2011-08-24 中兴通讯股份有限公司 Resource and admission control method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729491B (en) * 2008-10-17 2014-04-16 华为技术有限公司 Method, device and system for enhancing application reliability of script-based business

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159740A (en) * 2005-03-08 2008-04-09 华为技术有限公司 Method and device for implementing proxy demand mode resource preservation in next generation network
CN102164068A (en) * 2010-02-20 2011-08-24 中兴通讯股份有限公司 Resource and admission control method and system

Also Published As

Publication number Publication date
CN103369012A (en) 2013-10-23
CN103369012B (en) 2017-12-08

Similar Documents

Publication Publication Date Title
EP2620872B1 (en) Method and device for callback processing in telecommunication capacity opening
US8401022B2 (en) Pragmatic approaches to IMS
EP2561656B1 (en) Servlet api and method for xmpp protocol
US11563649B2 (en) NF service consumer restart detection using direct signaling between NFs
US20090113460A1 (en) Systems and methods for providing a generic interface in a communications environment
KR102148046B1 (en) Calling an unready terminal
WO2017162089A1 (en) Service configuration method and device for network service
US10999405B2 (en) Method for processing access requests and web browser
US8364827B2 (en) Communication system
US9253218B2 (en) Interface for connecting a network element to a session initiation protocol application server
KR20030007816A (en) Media session framework using protocol independent control module to direct and manage application and service servers
JP5716795B2 (en) Service control apparatus, service control system and method
KR20140133854A (en) Multi-modal communication priority over wireless networks
WO2013152565A1 (en) Capability aggregation and exposure method and system
WO2014101731A1 (en) System and method for opening network capabilities, and related network elements
CN111770122A (en) Service communication agent SCP registration method, service calling method and network equipment
US9374391B2 (en) Composite endpoint mechanism
WO2013152691A1 (en) Service logic execution device and method
CN117097702A (en) High concurrency WebRTC gateway processing method based on SIP protocol, gateway system, electronic device and storage medium
WO2015085531A1 (en) Method, device and system for improving qos
US9479606B2 (en) System and method for enhanced media brokering in VoIP network
Femminella et al. Enhancing java call control with media server control functions
WO2017113355A1 (en) Service management method, device, entity and service offering system
US8769109B2 (en) JRuby and SIP servlets integration
Umair Performance Evaluation and Elastic Scaling of an IP Multimedia Subsystem Implemented in a Cloud

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: 13775735

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: 13775735

Country of ref document: EP

Kind code of ref document: A1