WO2012068840A1 - 客户端/服务端架构下的调度方法和服务器 - Google Patents

客户端/服务端架构下的调度方法和服务器 Download PDF

Info

Publication number
WO2012068840A1
WO2012068840A1 PCT/CN2011/074204 CN2011074204W WO2012068840A1 WO 2012068840 A1 WO2012068840 A1 WO 2012068840A1 CN 2011074204 W CN2011074204 W CN 2011074204W WO 2012068840 A1 WO2012068840 A1 WO 2012068840A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
client
single instance
interface
level function
Prior art date
Application number
PCT/CN2011/074204
Other languages
English (en)
French (fr)
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 WO2012068840A1 publication Critical patent/WO2012068840A1/zh

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/14Session management

Definitions

  • the present invention relates to the field of communications, and in particular, to a scheduling method in a C/S (Client/Server, Client/Server) architecture (Double Level Lock Schedule Method, DL 2 SM ) and server.
  • C/S Client/Server, Client/Server
  • DL 2 SM Double Level Lock Schedule Method
  • server BACKGROUND
  • the same server needs to support multiple clients at the same time, and multiple clients can concurrently access the server.
  • multiple users can be used simultaneously by multiple clients at the same time.
  • there are some features that are "mutually exclusive" between clients that is, multiple clients are not allowed to be used at the same time.
  • some of the functions provided by applications have their own particularities, and they have special requirements in case of exceptions.
  • Multi-client concurrent access to the server's mutual exclusion requirements under the /S architecture.
  • OMC Operaation Management Center
  • the functions that need to be mutually exclusive can be divided into two types.
  • this function-level mutual exclusion function is called “single instance” function, that is, only one instance of this function can be used.
  • single instance For mutual exclusion at the NE level, you can use the mutual exclusion permission to guarantee, but for the mutual exclusion of the functional level, because the mutual exclusion permission does not need to depend on the network element, it cannot be guaranteed by using the existing mutual exclusion permission.
  • a new approach is needed to ensure mutual exclusion of feature usage.
  • the previous method is to use a function lock method: Set a mutex attribute for each single instance function on the server side, when a client tries to enter the single instance function menu, go to The server determines whether the function is locked.
  • GUI Level interface level
  • GUI Level feature lock seems to solve the problem successfully, but with careful consideration, there are still some cases that are not considered.
  • the function lock of the existing GUI Level can operate normally under normal conditions. However, when a client that has acquired the function lock exits abnormally, such as disconnecting the network, powering off, and forcibly ending the process, the client will not Proactively ask the server to release the function lock that it has already occupied. At this time, the function lock of the service is still occupied. If other clients try to use this function, they will not be able to enter the function interface because they cannot obtain the function lock, but the actual There are no other functions on the client that take up this feature, because the client that occupies this feature lock has quit.
  • a main object of the present invention is to provide a scheduling method and a server in a C/S architecture, which solves the problem of data confusion caused by the inability to mutually exclusive in the prior art.
  • a scheduling method in a client/server architecture including the following steps: a server receives a request message used by a client to request a single instance; and the server determines a single instance requested by the client. Whether the interface is being accessed or is the single instance requested by the client positive? If it is determined that the single instance interface requested by the client is being accessed or the single instance requested by the client is being run, the server sends a response message for rejecting the client access to the client.
  • the server determines whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being run: the server determines whether the interface level function lock state is locked, or the runtime level Whether the function lock state is in the locked state; if the interface level function lock state is in the locked state, the server judges that the single instance interface is being accessed, or if the runtime level function lock state is in the locked state, the server determines the single instance Being run. If it is determined that the single instance interface is not accessed and the single instance is not run, the method further includes: the server allows the client to access the server; the server sets the interface level function lock state and the runtime level function lock state to the locked state.
  • the server sets the interface level function lock status to the unlocked state, and will run.
  • the time level function lock status is set to the lock status.
  • the server sets the interface level function lock status to the lock status, The runtime level feature lock status is set to unlocked.
  • the server further includes: when the interface of the single instance exits normally, the server sets the interface level function lock state to the unlocked state; Whether the terminal is still running a single instance, and if so, the server sets the runtime level function lock state to the locked state; otherwise, sets the runtime level function lock state to the unlocked state.
  • the server-level interface lock state and the run-time function lock state are set to the lock state, the following includes: When the single instance running by the server exits normally, the server sets the runtime level function lock state to the unlocked state. Determine whether the client is still accessing the single instance interface. If yes, the server sets the interface level function lock state to the lock state.
  • a server including: a receiving unit, configured to receive a request message for a client to request a single instance; and a determining unit configured to determine whether a single instance interface requested by the client is Whether the single instance being accessed or requested by the client is being run;
  • the sending unit is configured to send a response message for rejecting the client access when the determining unit determines that the single instance interface requested by the client is being accessed or the single instance requested by the client is being run.
  • the determining unit comprises: a first determining module, configured to determine whether the interface level function lock state is in a locked state, and if the interface level function lock state is in a locked state, the single instance interface is being accessed; the second determining module is set to determine Whether the runtime level function lock status is locked. If the runtime level function lock status is locked, it means that the single instance is running.
  • the server further includes: an access unit, configured to allow the client to access the server when the determining unit determines that the interface of the single instance is not accessed and the single instance is not operated; and the setting unit is configured to be after the client accesses the server Set the interface level function lock status and the runtime level function lock status to the lock status.
  • the setting unit includes: a first setting module, configured to set the interface level function lock state to an unlocked state when the single instance interface is normal or abnormally exited; the second setting module is set to be a single instance running on the server or When exiting abnormally, set the runtime level function lock status to unlocked.
  • a first setting module configured to set the interface level function lock state to an unlocked state when the single instance interface is normal or abnormally exited
  • the second setting module is set to be a single instance running on the server or When exiting abnormally, set the runtime level function lock status to unlocked.
  • FIG. 1 is a single lock scheduling model of a prior art GUI Level function lock
  • FIG. 2 is a preferred flowchart provided by a scheduling method under a client/server architecture according to an embodiment of the present invention
  • 4 is a single-lock scheduling model with a Client Status Detector provided by a scheduling method under the client/server architecture according to an embodiment of the present invention
  • FIG. 5 is a client/in accordance with an embodiment of the present invention. Scheduling model DL 2 SM provided by the scheduling method under the server architecture;
  • FIG. 6 is a client execution flowchart of another embodiment provided by the scheduling method under the client/server architecture according to an embodiment of the present invention.
  • the server provided by the scheduling method in the client/server architecture receives the execution flow after obtaining the GUI Level Lock request.
  • FIG. 8 is a client/server according to an embodiment of the present invention.
  • BEST MODE FOR CARRYING OUT THE INVENTION BEST MODE FOR CARRYING OUT THE INVENTION
  • the server receives a request message that is used by the client to request a single instance.
  • the server determines whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being run; S206, if it is determined that the interface of the single instance requested by the client is being accessed or the client The single instance requested by the terminal is running, and the server sends a response message to the client for denying the client access.
  • the server determines whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being executed, so that the single instance can only be executed by one client at the same time. Therefore, the problem of data confusion caused by the mutual exclusion of the prior art is solved, and the mutual exclusion scheduling of multiple clients concurrent access in the C/S architecture is reasonably realized.
  • the step of determining, by the server, whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being executed comprises: determining, by the server, whether the interface level function lock state is in a locked state, or Whether the runtime level function lock state is in the locked state; if the interface level function lock state is in the locked state, the server judges that the single instance interface is being accessed, or if the runtime level function lock state is in the locked state, the server end Determine that the single instance is running.
  • the single instance can only be executed by one client at the same time.
  • the method further includes: the server allows the client to access the server; the server sets the interface level function lock state and the runtime level function lock state to Locked state.
  • the client can access the server when the single instance interface is not accessed and the single instance is not running, further ensuring the mutually exclusive state, and improving the ease of mutual exclusion scheduling. , correctness and robustness.
  • the server further includes: when the interface of the single instance exits abnormally, the server sets the interface level function lock state to an unlocked state. , set the runtime level feature lock state to the locked state.
  • the mutually exclusive state of the single instance interface is abnormally exited, which further ensures accurate data transmission and improves correctness.
  • the server further includes: when the single instance of the server runs abnormally exits, the server sets the interface level function lock state to be locked. Status, sets the runtime level feature lock status to unlocked.
  • the server further includes: when the interface of the single instance exits normally, the server sets the interface level function lock state to an unlocked state. Determines whether the server is still running a single instance. If so, the server sets the runtime level function lock state to the locked state; otherwise, sets the runtime level function lock state to the unlocked state.
  • the mutually exclusive state when the interface of the single instance is normally exited is ensured, which further ensures accurate data transmission and improves correctness.
  • the server further includes: when the single instance running by the server exits normally, the server sets the runtime level function lock state to Unlocked state; Determines whether the client is still accessing the single instance interface. If yes, the server sets the interface level function lock state to the locked state. Otherwise, sets the interface level function lock state to the unlocked state.
  • the mutually exclusive state when the single instance running by the server is normally exited is ensured, which further ensures accurate data transmission and improves correctness.
  • the present invention provides a server that uses a scheduling method in a client/server architecture, and includes: a receiving unit 301, configured to receive a request message used by a client to request a single instance; 302, set to determine whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being run; the sending unit 303 is configured to: when the determining unit determines the single instance requested by the client A response message is sent to deny client access when the interface is being accessed or a single instance requested by the client is being run.
  • the server determines whether the interface of the single instance requested by the client is being accessed or whether the single instance requested by the client is being executed, so that the single instance can only be executed by one client at the same time.
  • the determining unit 302 includes: a first determining module 3021, configured to determine whether the interface level function lock state is in a locked state, and if the interface level function lock state is in a locked state, indicating that the single instance interface is being accessed;
  • the module 3022 is configured to determine whether the runtime level function lock state is in a locked state. If the runtime level function lock state is in a locked state, it indicates that a single instance is being run.
  • the server further includes: an access unit 304, configured to allow the client to access the server when the determining unit 302 determines that the interface of the single instance is not accessed and the single instance is not running; the setting unit 305 is set to be in the client After the server is connected to the server, the interface level function lock status and the runtime level function lock status are set to the lock status.
  • the setting unit 305 includes: a first setting module 3051, configured to set the interface level function lock state to an unlocked state when the single instance interface is normal or abnormally exited; the second setting module 3052 is set to be in the service When the single instance running on the side is normal or abnormally exited, the runtime level function lock status is set to the unlocked state.
  • the single-instance running by the server is normal or the mutual exclusion state is abnormally exited, thereby further ensuring accurate data transmission and improving correctness.
  • one embodiment of the present invention is a dual lock mutual exclusion scheduling method that uses both a GUI Level lock and a Run Level lock.
  • Embodiment 3 Referring to FIG. 4, in the DL 2 SM scheduling method, first, a server status detector 402 (Client Status Detector) is used at the server 401 to monitor the exit of the client 403. The specific implementation may be through a timed handshake mechanism. When the server 401 detects that the client 403 exits abnormally without actively releasing the function lock, the server 401 initiates release of all the locks occupied by the exiting client 403.
  • a function lock attribute of a Running Level is added to the server 501 for each single instance function to indicate whether the single instance function is being executed by the server.
  • the state of the client 503 is detected by the client state detector 502.
  • the function lock state of the Running Level is maintained by the server 501.
  • Embodiment 4 When the user attempts to use the single instance function on the client, first apply for the GUI Level Lock to the server's Mutex Pool (the interface level function lock). (The server receives the GUI Level Lock request after receiving the GUI Level Lock request. , to check the status of the Running Level Lock, According to this return result, if the application fails, the user is not allowed to enter the operation interface. If the application is successful, the operation interface is opened, and the GUI Level Lock status is set to Locked; The client execution process is shown in Figure 6. Step 4 is as follows:
  • step S610 the notification server releases the lock, and the process goes to step S614; S612, prompting the user that the single instance function is being used by other clients, and cannot enter;
  • the client receives the GUI Level Lock request from the client;
  • step S704 the status of the Running Level Lock corresponding to the GUI Level Lock is Unlocked, if yes, go to step S706; otherwise, go to step 712;
  • the function level of the Running Level is maintained by the server.
  • the Running Level function lock status is set to Locked.
  • the Running Level function lock status is set to Unlocked.
  • the method uses an interface level mutual exclusion lock to ensure that only one client obtains the permission to use the mutual exclusion function under normal conditions;
  • the method uses the runtime level lock of the server to ensure the correctness of the mutual exclusion permission. That is, if the mutual exclusion function of the server end has been terminated, the client's permission is released; if the mutual exclusion function of the server is still running. , rejects other clients to apply for mutual exclusion. This ensures the correct scheduling of the mutex system in any case.
  • the two-layer function lock is used to effectively control the concurrent access of multiple clients.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Computer And Data Communications (AREA)

Description

客户端 /服务端架构下的调度方法和服务器 技术领域 本发明涉及通信领域, 具体而言, 涉及一种 C/S ( Client/Server, 客户端 / 月艮务端)架构下的调度方法( Double Level Lock Schedule Method, DL2SM )和 服务器。 背景技术 在 C/S架构下, 同一个服务端需要同时支持多个客户端, 多个客户端可以 并发的访问服务端。 对于服务端所提供的某些功能, 同一时刻多个用户可以通 过多个客户端同时使用。 但是, 有一些功能, 对于客户端之间是"互斥的", 即 在同一时刻不允许多个客户端同时使用。 在面向用户的应用程序中, 有些应用 程序所提供的功能在某种程度上有其特殊性, 在异常情况下也有其特殊的要 求, 因此, 使用传统的多线程互斥调度方法往往难以满足 C/S架构下的多客户 端并发访问服务端的互斥要求。 在 OMC ( Operation Management Center, 操作维护中心) 中, 需要互斥的 功能可以分成两种类型, 第一, 网元级别的互斥, 即对于同一个网元, 在同一 时刻只能有一个客户端在操作, 如配置参数的修改保存; 第二, 功能级别的互 斥, 即不再区分网元, 而是对于某一个功能在同一时刻只能有一个客户端使用, 如配置同步, 要求同一时刻只能够有一个客户端打开配置同步这个功能界面, 通常把这种具有功能级别的互斥的功能叫做"单实例 "功能, 即这个功能只能有 一个实例在被使用。 对于网元级别的互斥, 可以使用互斥权限来保证, 但是对于功能级别的互 斥, 因为互斥权限是不需要依赖于网元的, 因此不能够使用已有的互斥权限来 保证。 需要使用一种新的方法来保证功能使用上的互斥。 对于功能上的互斥, 以往的方法是使用一种功能锁的方法: 在服务端为每 一个单实例功能设置一个互斥锁属性, 在某客户端尝试进入单实例的功能菜单 时, 要去服务端判断此功能是否被锁, 如果被锁, 表示其他客户端正在占用, 那么此客户端无法进入这个功能菜单; 如果没有被锁, 那么向服务端申请锁住 此功能, 不允许其他客户端同时使用, 之后打开这个功能菜单, 当用户完成操 作, 关闭功能页面时, 向服务端通知释放功能锁, 允许其他客户端使用。 由于这里使用的功能锁保证了同一时刻只能有一个客户端打开单实例功 能的操作界面,是操作界面级别的单实例保证, 因此在这里把它叫做 GUI Level (界面级别) 的功能锁, 由 GUI Level功能锁实现的单重锁调度模型如图 1。 使用这种 GUI Level的功能锁, 看上去成功的解决了问题, 但是仔细考虑, 还有一些情况没有考虑到。 目前已有的 GUI Level的功能锁, 在正常情况下可以正常运转, 但是, 当 某获取到了功能锁的客户端异常退出时, 比如断网、 断电、 强制结束进程, 这 个时候客户端不会主动去要求服务端释放掉自己已经占用的功能锁, 这时在服 务的功能锁仍在占用状态, 如果其他客户端尝试使用此功能, 会因为获取不到 功能锁而无法进入功能界面, 但实际上已经没有其他客户端占用此功能的功能 锁了, 因为占用此功能锁的客户端已经退出。 而且, 即使客户端异常退出后功能锁能够被释放, 还会存在如下问题: 当客户端使用单实例功能发起执行请求后, 请求在服务端还没有执行完成 的时候, 客户端异常退出, 被服务端监听到, 于是释放掉了这个客户端占用的 功能锁。 这个时候虽然没有客户端占用这个功能, 但是此功能的请求仍在服务 端执行, 因此如果有其他客户端在这一时刻使用这个本来应该是单实例的功 能, 还会出现问题。 例如, 客户端 A发起批量参数导出, 导出过程需要 10分 钟, 客户端 A在进入导出界面时向服务端申请了批量参数导出功能锁, 如果导 出过程在服务端执行到第 5分钟的时候, 客户端断电异常退出, 服务端的状态 检测器监听到了客户端的退出, 释放掉客户端 A占用的批量参数导出功能锁, 允许其他客户端使用批量参数导出功能, 这个时候问题出现了, 因为此时批量 参数导出还在月艮务端执行, 并没有在客户端异常退出后就真正的结束, 此时如 果其他客户端再使用这个功能, 就会与单实例功能的设计不符, 出现数据混乱 等问题。 发明内容 本发明的主要目的在于提供一种 C/S架构下的调度方法和服务器, 解决了 现有技术中由于不能互斥而导致出现数据混乱问题。 根据本发明的一个方面, 提供了一种客户端 /服务端架构下的调度方法, 包 括如下步骤: 服务端接收客户端用于请求单实例的请求消息; 服务端判断客户 端所请求的单实例的界面是否正在被访问或者客户端所请求的单实例是否正 在被运行; 若判断出客户端所请求的单实例的界面正在被访问或者客户端所请 求的单实例正在被运行, 则服务端向客户端发送用于拒绝客户端接入的响应消 息。 服务端判断客户端所请求的单实例的界面是否正在被访问或者客户端所 请求的单实例是否正在被运行的步骤包括: 服务端判断界面级别功能锁状态是 否处于锁定状态, 或者, 运行时级别功能锁状态是否处于锁定状态; 若界面级 别功能锁状态处于锁定状态, 则服务端判断单实例的界面正在被访问, 或者, 若运行时级别功能锁状态处于锁定状态, 则 艮务端判断单实例正在被运行。 若判断出单实例的界面没有被访问且单实例没有被运行, 还包括: 服务端 允许客户端接入服务端; 服务端将界面级别功能锁状态以及运行时级别功能锁 状态设置为锁定状态。 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置为锁定 状态之后, 还包括: 当单实例的界面异常退出时, 服务端将界面级别功能锁状 态设置为未锁状态, 将运行时级别功能锁状态设置为锁定状态。 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置为锁定 状态之后, 还包括: 当服务端运行的单实例异常退出时, 服务端将界面级别功 能锁状态设置为锁定状态, 将运行时级别功能锁状态设置为未锁状态。 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置为锁定 状态之后, 还包括: 当单实例的界面正常退出时, 服务端将界面级别功能锁状 态设置为未锁状态; 判断服务端是否还在运行单实例, 若是, 则服务端将运行 时级别功能锁状态设置为锁定状态; 否则, 将运行时级别功能锁状态设置为未 锁状态。 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置为锁定 状态之后, 还包括: 当服务端运行的单实例正常退出时, 服务端将运行时级别 功能锁状态设置为未锁状态; 判断客户端是否还在访问单实例的界面,若是, 则 服务端将界面级别功能锁状态设置为锁定状态, 否则, 将界面级别功能锁状态 设置为未锁状态。 根据本发明的另一个方面, 提供了一种服务器, 包括: 接收单元, 设置为 接收客户端用于请求单实例的请求消息; 判断单元, 设置为判断客户端所请求 的单实例的界面是否正在被访问或者客户端所请求的单实例是否正在被运行; 发送单元, 设置为当判断单元判断出客户端所请求的单实例的界面正在被访问 或者客户端所请求的单实例正在被运行时, 发送用于拒绝客户端接入的响应消 息。 判断单元包括: 第一判断模块, 设置为判断界面级别功能锁状态是否处于 锁定状态, 若界面级别功能锁状态处于锁定状态, 则表示单实例的界面正在被 访问; 第二判断模块, 设置为判断运行时级别功能锁状态是否处于锁定状态, 若运行时级别功能锁状态处于锁定状态, 则表示单实例正在被运行。 上述服务器还包括: 接入单元, 设置为在判断单元判断出单实例的界面没 有被访问且单实例没有被运行时, 允许客户端接入服务器; 设置单元, 设置为 在客户端接入服务器之后, 将界面级别功能锁状态以及运行时级别功能锁状态 设置为锁定状态。 设置单元包括: 第一设置模块,设置为在单实例的界面正常或异常退出时, 将界面级别功能锁状态设置为未锁状态; 第二设置模块, 设置为在服务端运行 的单实例正常或异常退出时, 将运行时级别功能锁状态设置为未锁状态。 在本发明中, 通过月艮务端判断客户端所请求的单实例的界面是否正在被访 问或者客户端所请求的单实例是否正在被运行, 使得单实例只能同时被一个客 户端所执行, 从而解决了现有技术中由于不能互斥而导致出现数据混乱问题, 合理地实现了 C/S架构下多客户端并发访问时的互斥调度。 此外, 通过双重锁 的调度, 使得在异常情况下也准确的保证了互斥状态, 提高了互斥调度的易用 性、 正确性以及健壮性。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不 当限定。 在附图中: 图 1是现有技术 GUI Level功能锁的单重锁调度模型; 图 2 是根据本发明实施例客户端 /服务端架构下的调度方法提供的一种优 选流程图; 图 3是根据本发明服务器提供的一种优选结构框图; 图 4 是根据本发明实施例客户端 /服务端架构下的调度方法提供的加入了 客户端状态检测器 ( Client Status Detector ) 的单重锁调度模型; 图 5 是根据本发明实施例客户端 /服务端架构下的调度方法提供的调度模 型 DL2SM; 图 6 是根据本发明实施例客户端 /服务端架构下的调度方法提供的另一种 实施例的客户端执行流程图; 图 7 是根据本发明实施例客户端 /服务端架构下的调度方法提供的另一种 实施例的服务端收到获取 GUI Level Lock请求后的执行流程; 图 8 是根据本发明实施例客户端 /服务端架构下的调度方法提供的另一种 实施例的 Running Level (运行时级别) 的功能锁状态转换流程图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不 冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 实施例 1 参见图 2, 居本优选实施例的客户端 艮务端架构下的调度方法包括如下 步骤:
S202, 服务端接收客户端用于请求单实例的请求消息;
S204, 服务端判断客户端所请求的单实例的界面是否正在被访问或者客户 端所请求的单实例是否正在被运行; S206, 若判断出客户端所请求的单实例的界面正在被访问或者客户端所请 求的单实例正在被运行, 则服务端向客户端发送用于拒绝客户端接入的响应消 息。 在本优选的实施例中, 通过服务端判断客户端所请求的单实例的界面是否 正在被访问或者客户端所请求的单实例是否正在被运行, 使得单实例只能同时 被一个客户端所执行, 从而解决了现有技术中由于不能互斥而导致出现数据混 乱等问题, 合理地实现了 C/S架构下多客户端并发访问时的互斥调度。 优选的, 服务端判断客户端所请求的单实例的界面是否正在被访问或者客 户端所请求的单实例是否正在被运行的步骤包括: 服务端判断界面级别功能锁 状态是否处于锁定状态, 或者, 运行时级别功能锁状态是否处于锁定状态; 若 界面级别功能锁状态处于锁定状态, 则服务端判断单实例的界面正在被访问, 或者, 若运行时级别功能锁状态处于锁定状态, 则所服务端判断单实例正在被 运行。 在本优选的实施例中, 保证界面级别功能锁或运行时级别功能锁处于锁 定状态时, 即单实例的界面被访问或者单实例被运行时, 单实例只能同时被一 个客户端所执行, 从而保证了互斥状态, 进一步提高了互斥调度的易用性、 正 确性以及健壮性。 优选的,若判断出单实例的界面没有被访问且单实例没有被运行,还包括: 服务端允许客户端接入服务端; 服务端将界面级别功能锁状态以及运行时级别 功能锁状态设置为锁定状态。 在本优选的实施例中, 保证了在单实例的界面没 有被访问且单实例没有被运行时, 客户端可以接入服务端, 进一步保证了互斥 状态, 提高了互斥调度的易用性、 正确性以及健壮性。 优选的, 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置 为锁定状态之后, 还包括: 当单实例的界面异常退出时, 服务端将界面级别功 能锁状态设置为未锁状态, 将运行时级别功能锁状态设置为锁定状态。 在本优 选的实施例中, 保证了单实例的界面异常退出时的互斥状态, 进一步保证了数 据传递准确, 提高了正确性。 优选的, 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置 为锁定状态之后, 还包括: 当服务端运行的单实例异常退出时, 服务端将界面 级别功能锁状态设置为锁定状态, 将运行时级别功能锁状态设置为未锁状态。 在本优选的实施例中, 保证了服务端运行的单实例异常退出时的互斥状态, 进 一步保证了数据传递准确, 提高了正确性。 优选的, 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置 为锁定状态之后, 还包括: 当单实例的界面正常退出时, 服务端将界面级别功 能锁状态设置为未锁状态; 判断服务端是否还在运行单实例, 若是, 则服务端 将运行时级别功能锁状态设置为锁定状态; 否则, 将运行时级别功能锁状态设 置为未锁状态。 在本优选的实施例中, 保证了单实例的界面正常退出时的互斥 状态, 进一步保证了数据传递准确, 提高了正确性。 优选的, 在服务端将界面级别功能锁状态以及运行时级别功能锁状态设置 为锁定状态之后, 还包括: 当服务端运行的单实例正常退出时, 服务端将运行 时级别功能锁状态设置为未锁状态; 判断客户端是否还在访问单实例的界面, 若是, 则服务端将界面级别功能锁状态设置为锁定状态, 否则, 将界面级别功 能锁状态设置为未锁状态。 在本优选的实施例中, 保证了服务端运行的单实例 正常退出时的互斥状态, 进一步保证了数据传递准确, 提高了正确性。 实施例 2 参见图 3 , 本发明提供了一种釆用客户端 /服务端架构下的调度方法的服务 器, 包括: 接收单元 301 , 设置为接收客户端用于请求单实例的请求消息; 判 断单元 302 , 设置为判断客户端所请求的单实例的界面是否正在被访问或者客 户端所请求的单实例是否正在被运行; 发送单元 303 , 设置为当判断单元判断 出客户端所请求的单实例的界面正在被访问或者客户端所请求的单实例正在 被运行时, 发送用于拒绝客户端接入的响应消息。 在本优选的实施例中, 通过服务端判断客户端所请求的单实例的界面是否 正在被访问或者客户端所请求的单实例是否正在被运行, 使得单实例只能同时 被一个客户端所执行, 从而解决了现有技术中由于不能互斥而导致出现数据混 乱等问题, 合理地实现了 C/S架构下多客户端并发访问时的互斥调度。 优选的, 判断单元 302包括: 第一判断模块 3021 , 设置为判断界面级别功 能锁状态是否处于锁定状态, 若界面级别功能锁状态处于锁定状态, 则表示单 实例的界面正在被访问; 第二判断模块 3022 , 设置为判断运行时级别功能锁状 态是否处于锁定状态, 若运行时级别功能锁状态处于锁定状态, 则表示单实例 正在被运行。 在本优选实施例中, 保证界面级别功能锁或运行时级别功能锁处 于锁定状态时, 即单实例的界面被访问或者单实例被运行时, 单实例不可以被 多个客户端所执行, 从而保证了互斥状态, 进一步提高了互斥调度的易用性、 正确性以及健壮性。 优选的, 服务器还包括: 接入单元 304 , 设置为在判断单元 302判断出单 实例的界面没有被访问且单实例没有被运行时, 允许客户端接入服务器; 设置 单元 305 , 设置为在客户端接入服务器之后, 将界面级别功能锁状态以及运行 时级别功能锁状态设置为锁定状态。 在本优选实施例中, 保证界面级别功能锁 且运行时级别功能锁处于未锁状态时, 即单实例的界面没有被访问且单实例没 有被运行时, 单实例只能同时被一个客户端所执行, 从而保证了互斥状态, 进 一步提高了互斥调度的易用性、 正确性以及健壮性。 优选的, 设置单元 305包括: 第一设置模块 3051 , 设置为在单实例的界面 正常或异常退出时, 将界面级别功能锁状态设置为未锁状态; 第二设置模块 3052 , 设置为在艮务端运行的单实例正常或异常退出时, 将运行时级别功能锁 状态设置为未锁状态。 在本优选实施例中, 保证了服务器运行的单实例正常或 者异常退出时的互斥状态, 进一步保证了数据传递准确, 提高了正确性。 从而可以看出,本发明釆用的一种实施例为同时使用界面级别( GUI Level ) 锁和运行时级别 ( Running Level ) 锁的双重锁互斥调度方法。 实施例 3 参见图 4, 在 DL2SM调度方法中, 首先, 在服务端 401使用一个客户端状 态检测器 402 ( Client Status Detector ) 来监听客户端 403的退出, 具体实现可 以通过定时握手机制。 当月艮务端 401监听到客户端 403异常退出而没有主动释 放功能锁的时候,会由服务端 401发起释放掉退出的客户端 403占用的所有锁。 使用这种带有客户端状态检测器 402的模型, 可以防止客户端 403出现断 电、 断网的不可预知异常时造成的服务端 401功能互斥锁状态的错乱, 从一定 程度上保证了功能锁的正确性和健壮性。 参见图 5 , 然后, 在服务端 501为每个单实例功能增加一个 Running Level (运行时级别) 的功能锁属性, 用来表示单实例功能是否正在服务端执行。 同 时由客户端状态检测器 502检测客户端 503的状态, Running Level的功能锁状 态由服务端 501维护,当单实例功能在服务端 501执行开始时,将 Running Level 功能锁状态置为 Locked (锁定;), 当执行结束时, 将 Running Level功能锁状态 置为 Unlocked (未锁)。
GUI Level的功能锁和 Running Level的功能锁共同构成了双重锁。 实施例 4 当用户在客户端尝试使用单实例功能时, 先向服务端的 Mutex Pool (互斥 功能锁集合) 申请 GUI Level Lock (界面级别功能锁), (服务端在收到 GUI Level Lock请求后, 要检查 Running Level Lock (运行时级别功能锁) 的状态, 据此返回结果), 如果申请失败, 则不允许用户进入操作界面, 如果申请成功, 打开操作界面, 并且将 GUI Level Lock状态置为 Locked (锁定;)。 客户端执行流程参见图 6, 步 4聚如下:
S602, 客户端点击单实例功能菜单; S604, 向服务端申请 GUI Level Lock, 并判断申请是否成功? 若成功, 则 转至步 4聚 S606; 若失败, 则转至步 4聚 S612;
S606, 进入单实例功能界面;
S608, 执行操作后退出;
S610, 通知服务端释放 Lock, 转步骤 S614; S612, 提示用户单实例功能正在被其他客户端使用, 无法进入;
S614, 结束。 服务端收到客户端申请 GUI Level Lock请求后, 返回申请成功的条件是 GUI Level Lock没有被其他客户端占用,并且单实例功能的 Running Level Lock 的 态为 Unlocked。 月艮务端响应申请 GUI Level Lock请求的执行流程参见图 7 , 步骤如下:
S702 , 月艮务端收到客户端的获取 GUI Level Lock请求;
S704 , GUI Level Lock 所对应的 Running Level Lock 的状态是否为 Unlocked, 若是, 则转至步骤 S706; 否则, 转至步骤 712;
S706, GUI Level Lock的状态是否为 Unlocked, 若是, 则转至 S708; 否 则, 转至 S712;
S708 , GUI Level Lock状态置为 Locked;
S710, 返回成功, 转步 4聚 S714;
S712, 返回失败;
S714, 结束。 Running Level的功能锁状态由月艮务端维护, 当单实例功能在月艮务端执行开 始时, 将 Running Level功能锁状态置为 Locked, 当执行结束时, 将 Running Level功能锁状态置为 Unlocked,
Running Level的功能锁状态转换流程图参见图 8, 步骤如下: S802, 月艮务端开始执行单实例功能;
S 804 , 设置 Running Level Lock的 态为 Locked;
S806, 月艮务端单实例功能执行完成;
S 808 , 设置 Running Level Lock的状态为 Unlocked;
S810, 结束。 从以上的描述中, 可以看出, 本发明实现了如下技术效果: 该方法使用界面级别的互斥锁, 保证正常情况下只有一个客户端得到使用 互斥功能的权限; 在客户端出现异常的情况下, 本方法使用服务端的运行时级 别锁来保证互斥权限的正确性, 即如果艮务端的互斥功能运行已经终止, 则释 放客户端的权限; 如果月艮务端的互斥功能仍然在运行, 则拒绝其他客户端申请 互斥权限。 从而保证了任何情况下互斥系统的正确调度。 通过双层功能锁来对多个客户端并发访问服务端做了有效的控制, 不但合 理的实现了 C/S架构下多客户端并发访问时的互斥调度, 而且在异常情况下也 准确的保证了互斥状态, 提高了互斥调度的易用性、 正确性以及健壮性。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以 用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多 个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码 来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并且在某些 情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者将它们分别 制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作成单个集成电 路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领 域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的 ^"神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之 内。

Claims

权 利 要 求 书
1. 一种客户端 /艮务端架构下的调度方法, 包括如下步骤:
服务端接收客户端用于请求单实例的请求消息;
所述服务端判断所述客户端所请求的单实例的界面是否正在被访问 或者所述客户端所请求的单实例是否正在被运行;
若判断出所述客户端所请求的单实例的界面正在被访问或者所述客 户端所请求的单实例正在被运行, 则所述月艮务端向所述客户端发送用于 拒绝所述客户端接入的响应消息。
2. 根据权利要求 1所述的方法, 其中, 所述服务端判断所述客户端所请求 的单实例的界面是否正在被访问或者所述客户端所请求的单实例是否正 在被运行的步骤包括:
所述服务端判断界面级别功能锁状态是否处于锁定状态, 或者, 运 行时级别功能锁状态是否处于锁定状态;
若所述界面级别功能锁状态处于锁定状态, 则所述服务端判断所述 单实例的界面正在被访问, 或者, 若所述运行时级别功能锁状态处于锁 定状态, 则所述艮务端判断所述单实例正在被运行。
3. 根据权利要求 2所述的方法, 其中, 若判断出所述单实例的界面没有被 访问且所述单实例没有被运行, 还包括:
所述月艮务端允许所述客户端接入所述月艮务端;
所述艮务端将所述界面级别功能锁状态以及所述运行时级别功能锁 状态设置为锁定状态。
4. 根据权利要求 3所述的方法, 其中, 在所述服务端将所述界面级别功能 锁状态以及所述运行时级别功能锁状态设置为锁定状态之后, 还包括: 当所述单实例的界面异常退出时, 所述服务端将所述界面级别功能 锁状态设置为未锁状态,将所述运行时级别功能锁状态设置为锁定状态。
5. 根据权利要求 3所述的方法, 其中, 在所述服务端将所述界面级别功能 锁状态以及所述运行时级别功能锁状态设置为锁定状态之后, 还包括: 当所述服务端运行的所述单实例异常退出时, 所述服务端将所述界 面级别功能锁状态设置为锁定状态, 将所述运行时级别功能锁状态设置 为未锁状态。
6. 根据权利要求 3所述的方法, 其中, 在所述服务端将所述界面级别功能 锁状态以及所述运行时级别功能锁状态设置为锁定状态之后, 还包括: 当所述单实例的界面正常退出时, 所述月艮务端将所述界面级别功能 锁状态设置为未锁状态;
判断所述艮务端是否还在运行所述单实例, 若是, 则所述艮务端将 所述运行时级别功能锁状态设置为锁定状态; 否则, 将所述运行时级别 功能锁状态设置为未锁状态。
7. 根据权利要求 3所述的方法, 其中, 在所述服务端将所述界面级别功能 锁状态以及所述运行时级别功能锁状态设置为锁定状态之后, 还包括: 当所述月艮务端运行的所述单实例正常退出时, 所述月艮务端将所述运 行时级别功能锁状态设置为未锁状态;
判断所述客户端是否还在访问所述单实例的界面, 若是, 则所述服 务端将所述界面级别功能锁状态设置为锁定状态, 否则, 将所述界面级 别功能锁状态设置为未锁状态。
8. —种服务器, 包括:
接收单元, 设置为接收客户端用于请求单实例的请求消息; 判断单元, 设置为判断所述客户端所请求的单实例的界面是否正在 被访问或者所述客户端所请求的单实例是否正在被运行;
发送单元, 设置为当所述判断单元判断出所述客户端所请求的单实 例的界面正在被访问或者所述客户端所请求的单实例正在被运行时, 发 送用于拒绝所述客户端接入的响应消息。
9. 根据权利要求 8所述的服务器, 其中, 所述判断单元包括:
第一判断模块,设置为判断界面级别功能锁状态是否处于锁定状态, 若所述界面级别功能锁状态处于锁定状态, 则表示所述单实例的界面正 在被访问; 第二判断模块, 设置为判断运行时级别功能锁状态是否处于锁定状 态, 若所述运行时级别功能锁状态处于锁定状态, 则表示所述单实例正 在被运行。
10. 根据权利要求 8所述的服务器, 其中, 还包括:
接入单元, 设置为在所述判断单元判断出所述单实例的界面没有被 访问且所述单实例没有被运行时, 允许所述客户端接入所述月艮务器; 设置单元, 设置为在所述客户端接入所述服务器之后, 将所述界面 级别功能锁状态以及所述运行时级别功能锁状态设置为锁定状态。
11. 根据权利要求 10所述的服务器, 其中, 所述设置单元包括:
第一设置模块, 设置为在所述单实例的界面正常或异常退出时, 将 所述界面级别功能锁状态设置为未锁状态;
第二设置模块, 设置为在所述服务端运行的所述单实例正常或异常 退出时, 将所述运行时级别功能锁状态设置为未锁状态。
PCT/CN2011/074204 2010-11-26 2011-05-17 客户端/服务端架构下的调度方法和服务器 WO2012068840A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010563498.4 2010-11-26
CN2010105634984A CN102025728A (zh) 2010-11-26 2010-11-26 客户端/服务端架构下的调度方法和服务器

Publications (1)

Publication Number Publication Date
WO2012068840A1 true WO2012068840A1 (zh) 2012-05-31

Family

ID=43866582

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/074204 WO2012068840A1 (zh) 2010-11-26 2011-05-17 客户端/服务端架构下的调度方法和服务器

Country Status (2)

Country Link
CN (1) CN102025728A (zh)
WO (1) WO2012068840A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025728A (zh) * 2010-11-26 2011-04-20 中兴通讯股份有限公司 客户端/服务端架构下的调度方法和服务器
CN102355423B (zh) * 2011-10-19 2013-11-27 迈普通信技术股份有限公司 转发资源访问方法和路由系统
CN102761604B (zh) * 2012-06-11 2015-06-17 深圳中兴网信科技有限公司 请求处理系统、请求处理方法和服务器
CN104159142A (zh) * 2014-08-06 2014-11-19 乐视网信息技术(北京)股份有限公司 一种设备的视频软解码方法和装置
CN109725950B (zh) * 2018-12-29 2022-02-22 武汉斗鱼网络科技有限公司 一种实现客户端单实例运行的方法、装置及存储介质
CN113240383B (zh) * 2021-04-30 2024-04-05 江苏康众汽配有限公司 一种基于汽配业务的saas管理系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101355775A (zh) * 2008-08-15 2009-01-28 中兴通讯股份有限公司 配置数据批量导入装置及其多客户端互斥方法
WO2010062064A2 (en) * 2008-11-03 2010-06-03 Samsung Electronics Co., Ltd. Method and apparatus for controlling access to resources in remote user interface service
CN101753552A (zh) * 2008-12-01 2010-06-23 鸿富锦精密工业(深圳)有限公司 网络通信系统及方法
CN102025728A (zh) * 2010-11-26 2011-04-20 中兴通讯股份有限公司 客户端/服务端架构下的调度方法和服务器

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364230B (zh) * 2008-09-24 2011-04-20 金蝶软件(中国)有限公司 一种并发访问控制方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101355775A (zh) * 2008-08-15 2009-01-28 中兴通讯股份有限公司 配置数据批量导入装置及其多客户端互斥方法
WO2010062064A2 (en) * 2008-11-03 2010-06-03 Samsung Electronics Co., Ltd. Method and apparatus for controlling access to resources in remote user interface service
CN101753552A (zh) * 2008-12-01 2010-06-23 鸿富锦精密工业(深圳)有限公司 网络通信系统及方法
CN102025728A (zh) * 2010-11-26 2011-04-20 中兴通讯股份有限公司 客户端/服务端架构下的调度方法和服务器

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LUXIAMIN DESIGN AND IMPLEMENTATION IN CONFIGURATION MANAGEMENT SYSTEM OF TMN COMPUTER TECHNOLOGY AND DEVELOPMENT, vol. 16, no. 7, July 2006 (2006-07-01), pages 172 - 173 *

Also Published As

Publication number Publication date
CN102025728A (zh) 2011-04-20

Similar Documents

Publication Publication Date Title
US9807600B2 (en) Mobile device management
EP2645636B1 (en) Home gateway, cloud server, and method for communication therebetween
US9529878B2 (en) System and method for supporting subnet manager (SM) master negotiation in a network environment
WO2012068840A1 (zh) 客户端/服务端架构下的调度方法和服务器
US9307017B2 (en) Member-oriented hybrid cloud operating system architecture and communication method thereof
US7694312B2 (en) Methods and apparatus for enabling bus connectivity over a data network
US7451209B1 (en) Improving reliability and availability of a load balanced server
US8326993B2 (en) Techniques for managing terminal services sessions
CN103401896B (zh) 一种多Android客户端服务共享方法及系统
EP2323344A1 (en) Method for preventing thread hanging in a multi-thread communication program
US9292355B2 (en) Broker system for a plurality of brokers, clients and servers in a heterogeneous network
US9110861B2 (en) Managing host computing devices with a host control component
CN104038390A (zh) 一种基于netlink的linux服务器集群统一外设事件监听方法
CN112448987B (zh) 一种熔断降级的触发方法、系统和存储介质
WO2017219587A1 (zh) 主从设备切换方法、从设备、管理服务器及存储介质
US10637924B2 (en) Cloud metadata discovery API
Li et al. Design and implementation of high availability distributed system based on multi-level heartbeat protocol
CN111327447A (zh) 一种分布式系统、仲裁方法、节点设备及存储介质
CN104811426B (zh) 用户代理客户端发送注册请求的方法及用户代理客户端
US20240214434A1 (en) Remote desktop connection communications
TWI838136B (zh) 用於存取和移動性管理之容錯系統、方法及其電腦可讀媒介
KR20010110102A (ko) 클라이언트 프로세스와 서버 프로세스간의 서비스 접속을감시하는 방법 및 시스템과 프로그램 저장 장치
KR100898734B1 (ko) 호 처리 서비스를 위한 미디어 서버와 어플리케이션 서버간 초기 접속 방법 및 시스템
CN116346568A (zh) 一种对微服务进行服务治理的方法及系统
JP6809244B2 (ja) 分散式コントローラ

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

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

Country of ref document: EP

Kind code of ref document: A1