CN108572870B - Data acquisition method, device, electronic equipment, storage medium and system - Google Patents

Data acquisition method, device, electronic equipment, storage medium and system Download PDF

Info

Publication number
CN108572870B
CN108572870B CN201711183112.5A CN201711183112A CN108572870B CN 108572870 B CN108572870 B CN 108572870B CN 201711183112 A CN201711183112 A CN 201711183112A CN 108572870 B CN108572870 B CN 108572870B
Authority
CN
China
Prior art keywords
pass
server
service
management server
passes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711183112.5A
Other languages
Chinese (zh)
Other versions
CN108572870A (en
Inventor
胡伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201711183112.5A priority Critical patent/CN108572870B/en
Publication of CN108572870A publication Critical patent/CN108572870A/en
Application granted granted Critical
Publication of CN108572870B publication Critical patent/CN108572870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/506Constraint

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例提供了一种数据获取方法、装置、电子设备、存储介质及系统,其中,该方法包括:接收N个业务服务器发送的N个通行证获取请求,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;将预先存储的M个通行证分别添加至M个通行证响应信息中;分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,降低业务控制服务器的压力。

Figure 201711183112

Embodiments of the present invention provide a data acquisition method, device, electronic device, storage medium and system, wherein the method includes: receiving N pass acquisition requests sent by N service servers, and judging whether N is greater than a preset number of passes issued M, when N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M request sender service servers carried in the M pass obtaining requests; add each pass to M pieces of pass response information; respectively send M pieces of pass response information to the service server corresponding to the identification information of the M request sender service servers, so that each service server obtains the corresponding information according to the pass response information Data to be obtained. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by the service control server, thereby reducing the pressure on the service control server.

Figure 201711183112

Description

一种数据获取方法、装置、电子设备、存储介质及系统A data acquisition method, device, electronic device, storage medium and system

技术领域technical field

本发明涉及通信技术领域,特别是涉及一种数据获取方法、装置、电子设备、存储介质及系统。The present invention relates to the field of communication technologies, and in particular, to a data acquisition method, device, electronic device, storage medium and system.

背景技术Background technique

随着互联网技术的高速发展,云计算作为一种基于互联网的计算方式得到了广泛应用。其中,云计算的核心思想是将大量用网络连接的计算资源统一管理和调度,构成一个统一资源池向用户提供按需服务。云计算是网格计算、分布式计算、并行计算、效用计算、网络存储、虚拟化、负载均衡等传统计算机和网络技术发展融合的产物。With the rapid development of Internet technology, cloud computing has been widely used as an Internet-based computing method. Among them, the core idea of cloud computing is to manage and schedule a large number of computing resources connected by the network in a unified manner to form a unified resource pool to provide on-demand services to users. Cloud computing is the product of the integration of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage, virtualization, and load balancing.

通过云计算,可以将计算分布在分布式系统中,在该分布式系统中,可以包括业务控制服务器和业务服务器。其中,业务控制服务器用于对计算资源进行统一管理和调度,业务服务器用于根据业务控制服务器的调度指令执行具体业务。一般情况下,业务控制服务器的数量都比较少,而业务服务器的数量比较多。业务服务器需要不定时地从业务控制服务器获取需要的数据。当较多的业务服务器同时需要从业务控制服务器获取数据,且获取数据的业务服务器的数量较大时,会增加业务控制服务器的压力,造成业务控制服务器运行缓慢,最终导致业务控制服务器不能在设定的时间内返回业务服务器需要的数据,甚至会形成DDOS(Distributed Denial of Service,分布式拒绝服务)的情况,更严重的会导致业务控制服务器不堪重负而瘫痪。Through cloud computing, computing can be distributed in a distributed system, and the distributed system can include a service control server and a service server. The service control server is used for unified management and scheduling of computing resources, and the service server is used for executing specific services according to the scheduling instruction of the service control server. In general, the number of service control servers is relatively small, while the number of service servers is relatively large. The service server needs to acquire the required data from the service control server from time to time. When more business servers need to obtain data from the business control server at the same time, and the number of business servers that obtain data is large, it will increase the pressure on the business control server, cause the business control server to run slowly, and eventually cause the business control server to fail in the setting If the data required by the business server is returned within a certain period of time, it may even cause a DDOS (Distributed Denial of Service, Distributed Denial of Service) situation, which will even cause the business control server to be overwhelmed and paralyzed.

为了避免上述问题,一般会采用如下的方案:In order to avoid the above problems, the following solutions are generally adopted:

方案一:避免所有的业务服务器同时获取数据,手动控制业务服务器获取数据的顺序。例如,控制1000个业务服务器分批次获取数据,使业务控制服务器的压力一直在业务控制服务器的可承受范围之内。但是,方案一需要运维管理人员分批次、手动控制所有的业务服务器获取数据,造成业务服务器获取数据的效率低下。Option 1: Avoid all business servers from acquiring data at the same time, and manually control the order in which the business servers acquire data. For example, 1000 service servers are controlled to obtain data in batches, so that the pressure on the service control server is always within the tolerable range of the service control server. However, solution 1 requires operation and maintenance managers to manually control all business servers to obtain data in batches, resulting in low efficiency of business servers to obtain data.

方案二:增加业务控制服务器的数量,使业务控制服务器能够在预设的时间内返回业务服务器需要的数据给所有的业务服务器。但是,在正常情况下,业务控制服务器并不是每个时间点都需要在预设的时间内返回业务服务器需要的数据的。为了应对较多的业务服务器同时获取数据时的情况,而增加业务控制服务器节点,会造成成本增加,并不是最佳方案。Solution 2: Increase the number of service control servers, so that the service control server can return the data required by the service server to all service servers within a preset time. However, under normal circumstances, the service control server does not need to return the data required by the service server within a preset time at every time point. In order to cope with the situation when more service servers acquire data at the same time, adding service control server nodes will increase the cost, which is not the best solution.

方案三:给每个业务服务器设置不同的获取数据时间,使得每个业务服务器按照不同的获取数据时间从业务控制服务器获取数据。方案三看似可以避免所有业务服务器同时从业务控制服务器获取需要的数据,但是,当频繁地增加业务服务器时,则需要频繁地重新设置获取数据时间,显得比较繁琐。Solution 3: Set different data acquisition times for each service server, so that each service server acquires data from the service control server according to different data acquisition times. Solution 3 seems to prevent all business servers from acquiring the required data from the business control server at the same time. However, when the business servers are frequently added, it is necessary to frequently reset the data acquisition time, which is cumbersome.

可见,现有技术的三种方案并不是解决上述问题的优选技术方案。It can be seen that the three solutions in the prior art are not the preferred technical solutions to solve the above problems.

发明内容SUMMARY OF THE INVENTION

本发明实施例的目的在于提供一种数据获取方法、装置、电子设备、存储介质及系统,以实现自动限制同时从业务控制服务器获取数据的业务服务器的数量,从而降低业务控制服务器的压力。具体技术方案如下:The purpose of the embodiments of the present invention is to provide a data acquisition method, device, electronic device, storage medium and system, so as to automatically limit the number of service servers that acquire data from the service control server at the same time, thereby reducing the pressure on the service control server. The specific technical solutions are as follows:

第一方面,本发明实施例提供了一种数据获取方法,应用于通行证管理服务器,该方法包括:In a first aspect, an embodiment of the present invention provides a data acquisition method, which is applied to a passport management server, and the method includes:

接收N个业务服务器发送的N个通行证获取请求,其中,每个业务服务器发送一个通行证获取请求,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向通行证管理服务器发送的,N为大于或等于1的整数;Receive N pass acquisition requests sent by N business servers, wherein each business server sends a pass acquisition request, each pass acquisition request carries the identification information of the business server of the request sender, and each pass acquisition request belongs to When the request sender business server has data to be obtained, it is sent to the pass management server, and N is an integer greater than or equal to 1;

判断N是否大于预设通行证发放数量M;其中,M为大于或等于1的整数;Determine whether N is greater than the preset number of passes issued M; wherein, M is an integer greater than or equal to 1;

在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M request sender service servers carried in the M pass obtaining requests;

将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively;

分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The M pieces of pass response information are respectively sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

可选的,在接收N个业务服务器发送的N个通行证获取请求之前,本发明实施例的一种数据获取方法,还包括:Optionally, before receiving N passport acquisition requests sent by N service servers, a data acquisition method according to an embodiment of the present invention further includes:

接收通行证生成指令;Receive pass generation instructions;

根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。According to the pass generation instruction, according to the preset number M of passes, generate M passes, and store the M passes.

可选的,在接收通行证生成指令之后,本发明实施例的一种数据获取方法,还包括:Optionally, after receiving the pass generation instruction, the data acquisition method according to the embodiment of the present invention further includes:

判断通行证生成指令中是否携带有分布式锁;Determine whether a distributed lock is carried in the pass generation instruction;

相应的,根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证,包括:Correspondingly, according to the pass generation instruction, according to the preset number M of passes, generate M passes, and store the M passes, including:

在通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored.

可选的,存储M个通行证的步骤包括:Optionally, the step of storing the M passes includes:

将M个通行证添加至预设通行证集合;Add M passes to the preset pass set;

在将M个通行证添加至预设通行证集合之后,本发明实施例的一种数据获取方法,还包括:After the M passes are added to the preset pass set, a data acquisition method according to an embodiment of the present invention further includes:

设置预设通行证集合的标记状态为置位状态;Set the flag state of the preset pass set to the set state;

相应的,每个通行证获取请求是每个业务服务器存在待获取数据,且确认预设通行证集合的标记状态为置位状态时,向通行证管理服务器发送的。Correspondingly, each pass obtaining request is sent to the pass management server when each service server has data to be obtained and it is confirmed that the flag state of the preset pass set is set.

第二方面,本发明实施例还提供了一种数据获取方法,应用于业务服务器,该方法包括:In a second aspect, an embodiment of the present invention also provides a data acquisition method, which is applied to a service server, and the method includes:

当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the business server according to the pass obtaining request;

当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information;

将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。Add the passport to the data acquisition request, and send the data acquisition request to the business control server.

可选的,在发送通行证获取请求至通行证管理服务器之前,本发明实施例的一种数据获取方法,还包括:Optionally, before sending the pass obtaining request to the pass management server, a data obtaining method according to the embodiment of the present invention further includes:

获取通行证管理服务器中,存储通行证的通行证集合的标记状态;Obtain the flag status of the pass collection that stores the pass in the pass management server;

相应的,发送通行证获取请求至通行证管理服务器,包括:Correspondingly, send a pass obtaining request to the pass management server, including:

在通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。When the flag state of the pass collection is set, send a pass acquisition request to the pass management server.

可选的,在获取通行证管理服务器中,存储通行证的通行证集合的标记状态之后,本发明实施例的一种数据获取方法,还包括:Optionally, after storing the marked state of the pass set of the pass in the obtaining pass management server, a data obtaining method according to the embodiment of the present invention further includes:

在通行证集合的标记状态为复位状态时,发送分布式锁获取请求至通行证管理服务器;When the marked state of the pass set is the reset state, send a distributed lock acquisition request to the pass management server;

在接收到通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将分布式锁添加至通行证生成指令;After receiving the distributed lock response information carrying the distributed lock sent by the pass management server, the distributed lock is added to the pass generation instruction;

发送携带有分布式锁的通行证生成指令至通行证管理服务器。Send the pass generation instruction carrying the distributed lock to the pass management server.

可选的,在发送通行证获取请求至通行证管理服务器之后,本发明实施例的一种数据获取方法,还包括:Optionally, after sending the pass obtaining request to the pass management server, the data obtaining method according to the embodiment of the present invention further includes:

在未接收到与通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠;When the pass response information corresponding to the pass acquisition request is not received, enter sleep according to the first preset sleep time;

在第一预设休眠时间结束后,重复发送通行证获取请求至通行证管理服务器。After the first preset sleep time expires, the pass acquisition request is repeatedly sent to the pass management server.

可选的,在发送数据获取请求至业务控制服务器之后,本发明实施例的一种数据获取方法,还包括:Optionally, after the data acquisition request is sent to the service control server, the data acquisition method according to the embodiment of the present invention further includes:

在接收到业务控制服务器,发送的与数据获取请求对应的数据后,发送通行证至通行证管理服务器。After receiving the data corresponding to the data acquisition request sent by the service control server, send the pass to the pass management server.

第三方面,本发明实施例还提供了一种数据获取装置,应用于通行证管理服务器,该装置包括:In a third aspect, an embodiment of the present invention further provides a data acquisition device, which is applied to a passport management server, and the device includes:

第一接收模块,用于接收N个业务服务器发送的N个通行证获取请求,其中,每个业务服务器发送一个通行证获取请求,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向通行证管理服务器发送的,N为大于或等于1的整数;The first receiving module is configured to receive N pass acquisition requests sent by N service servers, wherein each service server sends a pass acquisition request, and each pass acquisition request carries the identification information of the service server of the request sender, Each pass obtaining request is sent to the pass management server when the business server of the request sender to which it belongs has data to be obtained, and N is an integer greater than or equal to 1;

第一判断模块,用于判断N是否大于预设通行证发放数量M;其中,M为大于或等于1的整数;The first judgment module is used for judging whether N is greater than the preset number of passes issued M; wherein, M is an integer greater than or equal to 1;

选择模块,用于在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;A selection module, configured to select M passport acquisition requests from the N passport acquisition requests when N is greater than M, and acquire the identification information of the M request sender service servers carried in the M passport acquisition requests;

添加模块,用于将预先存储的M个通行证分别添加至M个通行证响应信息中;The adding module is used to add the pre-stored M passes to the M pass response information respectively;

响应模块,用于分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The response module is used for respectively sending M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

第二接收模块,用于接收通行证生成指令;The second receiving module is used for receiving the pass generation instruction;

存储模块,用于根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。The storage module is used for generating M passes according to the pass generation instruction and according to the preset number M of passes, and storing the M passes.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

第二判断模块,用于判断通行证生成指令中是否携带有分布式锁;The second judgment module is used for judging whether a distributed lock is carried in the pass generation instruction;

相应的,存储模块,具体用于:Correspondingly, the storage module is specifically used for:

在通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored.

可选的,存储模块,具体用于:Optional, storage module, specifically for:

将M个通行证添加至预设通行证集合;Add M passes to the preset pass set;

相应的,本发明实施例的一种数据获取装置,还包括:Correspondingly, a data acquisition device according to an embodiment of the present invention further includes:

标记状态设置模块,用于设置预设通行证集合的标记状态为置位状态;The mark state setting module is used to set the mark state of the preset pass set to the set state;

相应的,每个通行证获取请求是每个业务服务器存在待获取数据,且确认预设通行证集合的标记状态为置位状态时,向通行证管理服务器发送的。Correspondingly, each pass obtaining request is sent to the pass management server when each service server has data to be obtained and it is confirmed that the flag state of the preset pass set is set.

第四方面,本发明实施例还提供了一种数据获取装置,应用于业务服务器,该装置包括:In a fourth aspect, an embodiment of the present invention further provides a data acquisition device, which is applied to a service server, and the device includes:

第一发送模块,用于当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;The first sending module is configured to send a pass obtaining request to the pass management server when there is data to be obtained, so that the pass management server constructs the pass response information including the pass and sends it to the service server according to the pass obtaining request;

第一接收模块,用于当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;a first receiving module, configured to acquire the pass in the pass response information when receiving the pass response information sent by the pass management server;

第二发送模块,用于将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。The second sending module is used to add the passport to the data acquisition request, and send the data acquisition request to the service control server.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

标记状态获取模块,用于获取通行证管理服务器中,存储通行证的通行证集合的标记状态;The mark state obtaining module is used to obtain the mark state of the pass set storing the pass in the pass management server;

相应的,第一发送模块,具体用于:Correspondingly, the first sending module is specifically used for:

在通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。When the flag state of the pass collection is set, send a pass acquisition request to the pass management server.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

第三发送模块,用于在通行证集合的标记状态为复位状态时,发送分布式锁获取请求至通行证管理服务器;a third sending module, configured to send a distributed lock acquisition request to the pass management server when the marked state of the pass set is the reset state;

第二接收模块,用于在接收到通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将分布式锁添加至通行证生成指令;The second receiving module is configured to add the distributed lock to the pass generation instruction after receiving the distributed lock response information carrying the distributed lock sent by the pass management server;

第四发送模块,用于发送携带有分布式锁的通行证生成指令至通行证管理服务器。The fourth sending module is used for sending the pass generation instruction carrying the distributed lock to the pass management server.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

休眠设置模块,用于在未接收到与通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠;在第一预设休眠时间结束后,触发第一发送模块。The sleep setting module is configured to enter sleep according to the first preset sleep time when the pass response information corresponding to the pass acquisition request is not received; after the end of the first preset sleep time, trigger the first sending module.

可选的,本发明实施例的一种数据获取装置,还包括:Optionally, a data acquisition device according to an embodiment of the present invention further includes:

第五发送模块,用于在接收到业务控制服务器,发送的与数据获取请求对应的数据后,发送通行证至通行证管理服务器。The fifth sending module is configured to send the pass to the pass management server after receiving the data corresponding to the data acquisition request sent by the service control server.

第五方面,本发明实施例还提供了一种通行证管理服务器,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使:实现第一方面提供的一种数据获取方法的步骤。In a fifth aspect, an embodiment of the present invention further provides a pass management server, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is Executing the instruction prompts: implementing the steps of the data acquisition method provided by the first aspect.

第六方面,本发明实施例还提供了一种业务服务器,包括处理器和机器可读存储介质,机器可读存储介质存储有能够被处理器执行的机器可执行指令,处理器被机器可执行指令促使:实现第二方面提供的一种数据获取方法的步骤。In a sixth aspect, an embodiment of the present invention further provides a service server, including a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is executable by the machine The instructions cause: the steps of implementing a data acquisition method provided by the second aspect.

第七方面,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,实现第一方面提供的一种数据获取方法的步骤。In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data acquisition method provided in the first aspect is implemented. step.

第八方面,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,实现第二方面提供的一种数据获取方法的步骤。In an eighth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the data acquisition method provided in the second aspect is implemented. step.

第九方面,本发明实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面提供的一种数据获取方法的步骤。In a ninth aspect, an embodiment of the present invention further provides a computer program product including instructions, which, when running on a computer, cause the computer to execute the steps of the data acquisition method provided in the first aspect.

第十方面,本发明实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第二方面提供的一种数据获取方法的步骤。In a tenth aspect, an embodiment of the present invention further provides a computer program product including instructions, which, when running on a computer, cause the computer to execute the steps of the data acquisition method provided in the second aspect above.

第十一方面,本发明实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面提供的一种数据获取方法的步骤。In an eleventh aspect, an embodiment of the present invention further provides a computer program, which, when running on a computer, causes the computer to execute the steps of the data acquisition method provided in the first aspect.

第十二方面,本发明实施例还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第二方面提供的一种数据获取方法的步骤。In a twelfth aspect, an embodiment of the present invention further provides a computer program that, when running on a computer, causes the computer to execute the steps of the data acquisition method provided in the second aspect.

第十三方面,本发明实施例还提供了一种数据获取系统,该系统包括:通行证管理服务器、业务服务器和业务控制服务器;In a thirteenth aspect, an embodiment of the present invention further provides a data acquisition system, the system comprising: a pass management server, a service server, and a service control server;

业务服务器,用于当存在待获取数据时,发送通行证获取请求至通行证管理服务器,其中,业务服务器包括N个,N为大于或等于1的整数;a business server, configured to send a pass obtaining request to a pass management server when there is data to be obtained, wherein the business server includes N, and N is an integer greater than or equal to 1;

通行证管理服务器,用于接收N个业务服务器发送的N个通行证获取请求,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息,将预先存储的M个通行证分别添加至M个通行证响应信息中,分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,其中,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,M为大于或等于1的整数;The pass management server is used to receive N pass acquisition requests sent by N service servers, determine whether N is greater than the preset pass issuance quantity M, and when N is greater than M, select M pass acquisition requests from the N pass acquisition requests, and obtain the identification information of the M service servers carried in the M pass acquisition requests, add the pre-stored M passes to the M pass response information respectively, and send the M pass response information respectively to the M requests to which they belong. The service server corresponding to the identification information of the sender's service server, wherein each pass obtaining request carries the identification information of the corresponding request sender's service server, and M is an integer greater than or equal to 1;

业务服务器,还用于当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证,将通行证响应信息中的通行证添加至数据获取请求中,并发送数据获取请求至业务控制服务器;The business server is further configured to obtain the pass in the pass response information when receiving the pass response information sent by the pass management server, add the pass in the pass response information to the data acquisition request, and send the data acquisition request to the business control server ;

业务控制服务器,用于接收业务服务器发送的数据获取请求,并将与数据获取请求对应的待获取数据发送至业务服务器。The service control server is configured to receive the data acquisition request sent by the service server, and send the data to be acquired corresponding to the data acquisition request to the service server.

本发明实施例提供的一种数据获取方法、装置、电子设备、存储介质及系统,在接收到N个业务服务器发送的N个通行证获取请求后,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,然后获取M个通行证获取请求中携带的M个业务服务器的标识信息,再将预先存储的M个通行证分别添加至M个通行证响应信息中,最后分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。当然,实施本发明的任一产品或方法并不一定需要同时达到上述的所有优点。In a data acquisition method, device, electronic device, storage medium, and system provided by an embodiment of the present invention, after receiving N pass acquisition requests sent by N service servers, it is determined whether N is greater than a preset number M of passes issued, and in When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, then obtain the identification information of the M service servers carried in the M pass obtaining requests, and then add the pre-stored M passes to the M passes respectively. In the pass response information, M pieces of pass response information are finally sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server. Of course, it is not necessary for any product or method of the present invention to achieve all of the above-mentioned advantages at the same time.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

图1为本发明实施例的一种数据获取方法应用于分布式系统的系统示意图;1 is a schematic diagram of a system in which a data acquisition method according to an embodiment of the present invention is applied to a distributed system;

图2为本发明实施例的一种数据获取方法应用于通行证管理服务器的第一种实施方式的流程图;2 is a flowchart of a first implementation manner in which a data acquisition method according to an embodiment of the present invention is applied to a passport management server;

图3为本发明实施例的一种数据获取方法应用于业务服务器的第一种实施方式的流程图;FIG. 3 is a flowchart of a first implementation manner in which a data acquisition method according to an embodiment of the present invention is applied to a service server;

图4为本发明实施例的一种数据获取装置应用于通行证管理服务器的结构示意图;4 is a schematic structural diagram of a data acquisition device applied to a passport management server according to an embodiment of the present invention;

图5为本发明实施例的一种数据获取装置应用于业务服务器的结构示意图;5 is a schematic structural diagram of a data acquisition apparatus applied to a service server according to an embodiment of the present invention;

图6为本发明实施例的一种通行证管理服务器的结构示意图;6 is a schematic structural diagram of a pass management server according to an embodiment of the present invention;

图7为本发明实施例的一种业务服务器的结构示意图;7 is a schematic structural diagram of a service server according to an embodiment of the present invention;

图8为本发明实施例的一种数据获取系统的结构示意图。FIG. 8 is a schematic structural diagram of a data acquisition system according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

为了解决现有技术存在的问题,本发明实施例提供了一种数据获取方法、装置、电子设备、存储介质及系统,以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。In order to solve the problems existing in the prior art, the embodiments of the present invention provide a data acquisition method, device, electronic device, storage medium and system, so as to automatically limit the number of service servers that simultaneously acquire the data required by themselves from the service control server , thereby reducing the pressure on the service control server.

首先,本发明实施例的一种数据获取方法,可以应用于分布式系统中,如图1所示,为本发明实施例的一种数据获取方法应用于分布式系统的系统示意图,该系统可以包括:通行证管理服务器101、业务控制服务器102、第一业务服务器103、第二业务服务器104及第三业务服务器105,其中,线段106可以表示业务服务器与通行证管理服务器101的通信线路,线段107可以表示业务服务器与业务控制服务器102的通信线路。First, a data acquisition method according to an embodiment of the present invention can be applied to a distributed system. As shown in FIG. 1 , it is a schematic diagram of a system in which a data acquisition method according to an embodiment of the present invention is applied to a distributed system. It includes: the pass management server 101, the service control server 102, the first service server 103, the second service server 104 and the third service server 105, wherein the line segment 106 may represent the communication line between the service server and the pass management server 101, and the line segment 107 may The communication line between the service server and the service control server 102 is shown.

在该系统中,第一业务服务器103、第二业务服务器104及第三业务服务器105,在发送数据获取请求至业务控制服务器102之前,可以首先从通行证管理服务器101获取通行证。在从通行证管理服务器101获取到通行证后,再发送数据获取请求至业务控制服务器102,当从通行证管理服务器101中未获取到通行证时,则不发送数据获取请求至业务控制服务器102。从而实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,降低业务控制服务器的压力。例如,第一业务服务器103从通行证管理服务器101中获取到通行证后,可以发送数据获取请求至业务控制服务器102。第二业务服务器104未从通行证管理服务器101中获取到通行证,则不发送数据获取请求至业务控制服务器102。In this system, the first service server 103 , the second service server 104 and the third service server 105 may first obtain the passport from the passport management server 101 before sending the data acquisition request to the service control server 102 . After obtaining the pass from the pass management server 101 , the data acquisition request is sent to the service control server 102 . When the pass is not obtained from the pass management server 101 , the data acquisition request is not sent to the service control server 102 . Thereby, the number of service servers that simultaneously obtain the data required by themselves from the service control server is automatically limited, and the pressure on the service control server is reduced. For example, after acquiring the pass from the pass management server 101 , the first service server 103 may send a data acquisition request to the service control server 102 . The second service server 104 does not obtain a pass from the pass management server 101 , and does not send a data acquisition request to the service control server 102 .

下面,对本发明实施例的一种数据获取方法进行介绍,如图2所示,本发明实施例的一种数据获取方法应用于通行证管理服务器的第一种实施方式的流程图,该方法可以包括:Next, a data acquisition method according to an embodiment of the present invention is introduced. As shown in FIG. 2 , a flowchart of a first implementation manner in which a data acquisition method according to an embodiment of the present invention is applied to a passport management server, the method may include :

S201,接收N个业务服务器发送的N个通行证获取请求。S201: Receive N passport acquisition requests sent by N service servers.

其中,每个业务服务器发送一个通行证获取请求,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向通行证管理服务器发送的,N为大于或等于1的整数,该标识信息可以是业务服务器的IP地址、MAC地址等。Among them, each service server sends a pass acquisition request, each pass acquisition request carries the identification information of the request sender business server to which it belongs, and each pass pass acquisition request belongs to the request sender business server when there is data to be acquired, it is sent to Sent by the passport management server, N is an integer greater than or equal to 1, and the identification information may be the IP address, MAC address, etc. of the service server.

具体的,在业务服务器从业务控制服务器获取待获取数据之前,可以首先向通行证管理服务器发送通行证获取请求,以获取通行证。因此,在本步骤中,应用本发明实施例的一种数据获取方法的通行证管理服务器可以接收到N个业务服务器发送的N个通行证获取请求。Specifically, before the service server obtains the data to be obtained from the service control server, it may first send a pass obtaining request to the pass management server to obtain the pass. Therefore, in this step, a pass management server applying a data acquisition method according to an embodiment of the present invention may receive N pass acquisition requests sent by N service servers.

在一些示例中,上述的业务服务器可以是在一个物理服务器上,通过虚拟技术实现的虚拟服务器,每一个虚拟服务器可以有独立的标识信息。In some examples, the above-mentioned service server may be a virtual server implemented by a virtual technology on a physical server, and each virtual server may have independent identification information.

在一些示例中,上述的业务服务器也可以是物理服务器,每一个物理服务器可以具有不同的标识信息。In some examples, the above-mentioned service servers may also be physical servers, and each physical server may have different identification information.

在一些示例中,该业务服务器中还可以加载有虚拟交换机或虚拟路由器。In some examples, the service server may also be loaded with a virtual switch or a virtual router.

在又一些示例中,上述的N个业务服务器,可以一部分为虚拟服务器,另一部分为物理服务器。In still other examples, a part of the above N service servers may be virtual servers and the other part may be physical servers.

例如,图1所示的第一业务服务器103、第二业务服务器104及第三业务服务器105可以全为虚拟服务器,也可以全为物理服务器;还可以是三个业务服务器中的任两个业务服务器为虚拟服务器,或者三个业务服务器中的任一个业务服务器为虚拟服务器。For example, the first service server 103, the second service server 104, and the third service server 105 shown in FIG. 1 may all be virtual servers or all physical servers; they may also be any two of the three service servers. The server is a virtual server, or any one of the three service servers is a virtual server.

具体的,应用本发明实施例的一种数据获取方法的通行证管理服务器在接收到N个业务服务器发送的N个通行证获取请求后,可以统计通行证获取请求的数量。Specifically, the pass management server applying the data acquisition method according to the embodiment of the present invention may count the number of pass acquisition requests after receiving N pass acquisition requests sent by N service servers.

S202,判断N是否大于预设通行证发放数量M。S202, judging whether N is greater than the preset number M of passes issued.

其中,M为大于或等于1的整数,预设通行证发放数量可以根据经验设置,也可以根据业务控制服务器的性能设置。Wherein, M is an integer greater than or equal to 1, and the preset number of passes issued may be set according to experience, or may be set according to the performance of the service control server.

具体的,在通过上述步骤接收到N个通行证获取请求后,可以判断N与预设通行证发放数量M的大小关系,即,判断N是大于预设通行证发放数量M,还是小于或等于预设通行证发放数量M。Specifically, after receiving N pass acquisition requests through the above steps, it is possible to determine the size relationship between N and the preset number of passes issued M, that is, to determine whether N is greater than the preset number of passes issued M, or less than or equal to the preset number of passes Issue quantity M.

在一些示例中,在应用本发明实施例的一种数据获取方法的通行证管理服务器中预设通行证发放数量,可以限制从通行证管理服务器获取到通行证的业务服务器的数量,从而减少同时发送数据获取请求的业务服务器的数量,降低业务控制服务器的压力。In some examples, by presetting the number of passes issued in the pass management server to which the data acquisition method according to the embodiment of the present invention is applied, the number of service servers that obtain passes from the pass management server can be limited, thereby reducing the simultaneous sending of data acquisition requests The number of business servers is reduced, and the pressure on business control servers is reduced.

在另一些示例中,本步骤中的预设通行证发放数量可以由业务控制服务器预先设置。具体的,业务控制服务器可以预先发送携带有通行证发放数量M的设置指令给通行证管理服务器,通行证管理服务器在接收到设置指令后,可以从该设置指令中获取到通行证发放数量M,并记录该通行证发放数量M。In other examples, the preset number of passes issued in this step may be preset by the service control server. Specifically, the service control server may send a setting instruction carrying the number M of passes issued to the pass management server in advance. After receiving the setting instruction, the pass management server may obtain the number M of passes issued from the setting instruction, and record the pass Issue quantity M.

S203,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息。S203, when N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain identification information of M request sender service servers carried in the M pass obtaining requests.

具体的,在通过上述步骤判断N是否大于M后,本发明实施例的一种数据获取方法提供了一种可行的实现方式:在N大于M时,首先从N个通行证获取请求中选择M个通行证获取请求。Specifically, after judging whether N is greater than M through the above steps, a data acquisition method according to an embodiment of the present invention provides a feasible implementation manner: when N is greater than M, first select M from N pass acquisition requests Pass acquisition request.

在一些示例中,在从N个通行证获取请求中选择M个通行证获取请求时,可以随机选择M个通行证获取请求。In some examples, when M pass acquisition requests are selected from N pass acquisition requests, the M pass acquisition requests may be randomly selected.

在一些示例中,在通过步骤S201,接收N个业务服务器发送的N个通行证获取请求后,还可以为每个通行证获取请求生成一个标识号,因此,在本步骤中,从N个通行证获取请求中选择M个通行证获取请求时,可以按照该标识号从大到小的顺序,或者,从小到大的顺序,选择M个通行证获取请求。In some examples, after receiving N pass acquisition requests sent by N service servers through step S201, an identification number may also be generated for each pass acquisition request. Therefore, in this step, from the N pass acquisition requests When selecting M pass acquisition requests from among the ID numbers, the M pass acquisition requests may be selected in descending order of the identification number, or in descending order.

在又一些示例中,在选择M个通行证获取请求后,可以获取该M个通行证获取请求中携带的M个业务服务器的标识信息。通过本步骤,应用本发明实施例的一种数据获取方法的通行证管理服务器,可以仅获取M个业务服务器的标识信息,减少通行证管理服务器获取标识信息的数量,从而降低通行证管理服务器的工作量。In still other examples, after selecting the M pass obtaining requests, the identification information of the M service servers carried in the M pass obtaining requests may be obtained. Through this step, the pass management server applying the data acquisition method of the embodiment of the present invention can only obtain the identification information of M service servers, thereby reducing the number of identification information obtained by the pass management server, thereby reducing the workload of the pass management server.

S204,将预先存储的M个通行证分别添加至M个通行证响应信息中。S204, adding the pre-stored M passes to the M pieces of pass response information respectively.

其中,该预先存储的M个通行证可以是,应用本发明实施例的一种数据获取方法的通行证管理服务器,预先生成并存储的。The pre-stored M passes may be pre-generated and stored by a pass management server applying a data acquisition method according to an embodiment of the present invention.

在一些示例中,本步骤中的M个通行证,可以由应用本发明实施例的一种数据获取方法的通行证管理服务器,预先生成并存储。通过预先生成并存储,可以减少业务服务器获取通行证的时间开销,从而使得业务服务器能够及时发送数据获取请求至业务控制服务器,获取待获取数据。In some examples, the M passes in this step may be pre-generated and stored by a pass management server applying a data acquisition method according to an embodiment of the present invention. By generating and storing in advance, the time overhead for the service server to obtain the pass can be reduced, so that the service server can send a data obtaining request to the service control server in time to obtain the data to be obtained.

在一些示例中,当通过上述步骤,选择M个通行证获取请求后,可以触发生成通行证响应信息,在本步骤中,可以将预先存储的M个通行证分别添加到M个通行证响应信息中,以分别生成M个携带有M个通行证的通行证响应信息,其中,一个通行证响应信息携带有一个通行证。In some examples, after selecting M pass acquisition requests through the above steps, the generation of pass response information may be triggered. In this step, the pre-stored M passes may be added to the M pass response information respectively to M pieces of pass response information carrying M passes are generated, wherein one pass response message carries one pass.

通过本步骤,可以使得每个通行证响应信息中仅携带有一个通行证,在通过后续步骤,业务服务器获取到该通行证响应信息后,可以仅通过该一个通行证发送一次数据获取请求。防止业务服务器在获取一次通行证响应信息后,可以发送多次数据获取请求。从而可以降低业务控制服务器的压力。Through this step, each pass response information can only carry one pass, and after obtaining the pass response information through the subsequent steps, the service server can only send a data acquisition request through the one pass. Prevent the business server from sending multiple data acquisition requests after acquiring the pass response information once. Thus, the pressure on the service control server can be reduced.

S205,分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。S205: Send M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

在通过上述步骤,分别获取到M个业务服务器的标识信息,得到M个通行证响应信息后,为了使业务服务器能够通过通行证从业务控制服务器获取待获取数据。在本步骤中,可以分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器。每个业务服务器可以获取到一个通行证响应信息。After obtaining the identification information of M service servers through the above steps, and obtaining M pieces of pass response information, in order to enable the service server to obtain the data to be obtained from the service control server through the pass. In this step, M pieces of pass response information may be respectively sent to the service servers corresponding to the identification information of the M request sender service servers to which they belong. Each service server can obtain a passport response message.

在一些示例中,可以依次发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器。可以减少通行证管理服务器瞬时的带宽占用。In some examples, M pieces of pass response information may be sequentially sent to the service servers corresponding to the identification information of the M request sender service servers to which they belong. It can reduce the instantaneous bandwidth usage of the pass management server.

在一些示例中,可以同时分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器。可以减少发送通行证响应信息的时间,使得业务服务器能够及时获取到通信证响应信息,进而可以根据通行证响应信息,获取待获取数据。In some examples, M pieces of pass response information may be respectively sent to the service servers corresponding to the identification information of the M request-sender service servers to which they belong. The time for sending the pass response information can be reduced, so that the service server can obtain the communication pass response information in time, and then can obtain the data to be obtained according to the pass response information.

通过本发明实施例提供的一种数据获取方法,在接收到N个业务服务器发送的N个通行证获取请求后,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,然后获取M个通行证获取请求中携带的M个业务服务器的标识信息,再将预先存储的M个通行证分别添加至M个通行证响应信息中,最后分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With a data acquisition method provided by an embodiment of the present invention, after receiving N pass acquisition requests sent by N service servers, it is determined whether N is greater than the preset number M of passes issued, and when N is greater than M, the number of passes from the N passes is determined. In the acquisition request, select M passport acquisition requests, then acquire the identification information of the M service servers carried in the M passport acquisition requests, and then add the pre-stored M passports to the M passport response information respectively, and finally send M respectively. The pieces of pass response information are sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

在本发明实施例的一种可能的实现方式中,业务服务器在启动阶段,可以应用本发明实施例的一种数据获取方法,首先发送通行证获取请求,至应用本发明实施例的一种数据获取方法的通行证管理服务器,该通行证管理服务器可以在接收到该通行证获取请求后,可以通过本发明实施例的一种数据获取方法的第一种实现方式发送通行证响应信息至业务服务器,业务服务器在接收到该通行证相应信息后,从该通行证相应信息中获取通行证,然后再根据该通行证,从业务控制服务器获取待获取数据。In a possible implementation manner of the embodiment of the present invention, the service server may apply a data acquisition method of the embodiment of the present invention in the startup phase, firstly send a pass acquisition request, and then apply the data acquisition method of the embodiment of the present invention The pass management server of the method, after receiving the pass acquisition request, the pass management server can send the pass response information to the business server through the first implementation of a data acquisition method according to the embodiment of the present invention, and the business server is receiving the pass. After the corresponding information of the pass is obtained, the pass is obtained from the corresponding information of the pass, and then the data to be obtained is obtained from the service control server according to the pass.

具体的,该通行证可以是分布式锁。当该通行证为分布式锁时,该分布式锁可以预先存储在应用本发明实施例的数据获取方法的通行证管理服务器。Specifically, the pass can be a distributed lock. When the pass is a distributed lock, the distributed lock may be pre-stored in a pass management server to which the data acquisition method of the embodiment of the present invention is applied.

应当理解的是,作为通行证的分布式锁,可以由上述的通行证管理服务器通过多个分布式锁生成应用程序分别生成多个,并存储在通行证管理服务器本地。It should be understood that, as a distributed lock for a pass, a plurality of distributed locks can be generated by the above-mentioned pass management server through a plurality of distributed lock generating applications, and stored locally on the pass management server.

在一些示例中,该通行证还可以是令牌,在该通行证为令牌时,本发明实施例还提供了一种可能的实现方式,在接收N个业务服务器发送的N个通行证获取请求之前,还可以接收通行证生成指令,再根据该通行证生成指令,生成M个通行证,并存储。In some examples, the pass may also be a token. When the pass is a token, the embodiment of the present invention also provides a possible implementation manner, before receiving N pass acquisition requests sent by N service servers, It is also possible to receive a pass generation instruction, and then generate M passes according to the pass generation instruction, and store them.

具体的,在S201,接收N个业务服务器发送的N个通行证获取请求之前,本发明实施例的一种数据获取方法,还可以包括:Specifically, in S201, before receiving N passport acquisition requests sent by N service servers, a data acquisition method according to an embodiment of the present invention may further include:

S2010,接收通行证生成指令。S2010, receive a pass generation instruction.

在一些示例中,该通行证生成指令可以由业务控制服务器发送,例如,在图1中,该通行证生成指令可以由业务控制服务器102发送。具体的,该业务控制服务器中可以存储有通行证管理服务器的标识信息,业务控制服务器产生通行证生成指令后,可以将该通行证管理服务器的标识信息添加至通行证生成指令中,并发送给通行证管理服务器。In some examples, the pass generation instruction may be sent by the service control server, eg, in FIG. 1 , the pass generation instruction may be sent by the service control server 102 . Specifically, the service control server can store the identification information of the pass management server. After the service control server generates the pass generation instruction, the identification information of the pass management server can be added to the pass generation instruction and sent to the pass management server.

在一些示例中,该通行证生成指令也可以由业务服务器发送。具体的,业务服务器在发送通行证获取请求之前,可以首先发送通行证生成指令,使通行证管理服务器根据该通行证生成指令,生成通行证,然后再发送通行证获取请求,这样,可以保证N个业务服务器发送N个通行证获取请求后,N个业务服务器中的一部分业务服务器可以获取到通行证管理服务器返回的通行证。In some examples, the pass generation instruction may also be sent by the service server. Specifically, before sending the pass obtaining request, the business server may first send the pass generating instruction, so that the pass management server generates the pass according to the pass generating instruction, and then sends the pass obtaining request. In this way, it can be ensured that N service servers send N After the pass obtaining request, a part of the service servers in the N service servers can obtain the pass returned by the pass management server.

S2011,根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。S2011 , according to the pass generation instruction, and according to the preset number M of passes, generate M passes, and store the M passes.

在一些示例中,应用本发明实施例的一种数据获取方法的通行证管理服务器,在接收到通行证生成指令后,可以触发对应的应用程序生成通行证。In some examples, a pass management server applying a data acquisition method according to an embodiment of the present invention may trigger a corresponding application to generate a pass after receiving the pass generation instruction.

具体的,可以按照预设通行证发放数量M,生成M个通行证,并将该M个通行证存储在该通行证管理服务器中。Specifically, M passes may be generated according to the preset number M of passes, and the M passes may be stored in the pass management server.

在一些示例中,该M个通行证可以存储在该通行证管理服务器的数据库中。In some examples, the M passes may be stored in a database of the pass management server.

在本步骤中,通过生成M个通行证,可以限制获取到通行证的业务服务器数量,从而限制发送数据获取请求至业务控制服务器的数量,进而降低业务控制服务器的压力。In this step, by generating M passes, the number of service servers that obtain the passes can be limited, thereby limiting the number of sending data acquisition requests to the service control server, thereby reducing the pressure on the service control server.

在一些示例中,上述的实现方式可以应用于业务控制服务器只有一个的情况下。当业务控制服务器有多个时,可能会有多个业务控制服务器发送多个通行证生成指令给通行证管理服务器,从而造成通行证管理服务器根据该多个通行证生成指令生成通行证,影响通行证管理服务器的效率。In some examples, the above-mentioned implementation manner can be applied to the case where there is only one service control server. When there are multiple service control servers, there may be multiple service control servers sending multiple pass generation instructions to the pass management server, thereby causing the pass management server to generate passes according to the multiple pass generation instructions, affecting the efficiency of the pass management server.

在本发明实施例的一种可能的实现方式中,通行证管理服务器接收到多个业务控制服务器发送的多个通行证生成指令,为了避免通行证管理服务器在接收到多个通行证生成指令后,分别根据该多个通行证生成指令重复生成通行证,本发明实施例还提供了一种可能的实现方式,在接收通行证生成指令之后,本发明实施例的一种数据获取方法,还可以包括:In a possible implementation manner of the embodiment of the present invention, the pass management server receives multiple pass generation instructions sent by multiple service control servers, in order to prevent the pass management server from receiving multiple pass generation instructions according to the Multiple pass generation instructions repeatedly generate a pass, and the embodiment of the present invention also provides a possible implementation manner. After receiving the pass generation instruction, a data acquisition method according to the embodiment of the present invention may further include:

判断通行证生成指令中是否携带有分布式锁。Determine whether a distributed lock is carried in the pass generation instruction.

在一些示例中,应用本发明实施例的一种数据获取方法的通行证管理服务器,可能会接收到多个通行证生成指令,当该通行证管理服务器接收到多个通行证生成指令后,可以判断该多个通行证生成指令中是否携带有分布式锁,从而可以确定,根据该多个通行证生成指令中的哪一个通行证生成指令,生成通行证。In some examples, a pass management server applying a data acquisition method according to an embodiment of the present invention may receive multiple pass generation instructions, and when the pass management server receives multiple pass generation instructions, it can determine the multiple Whether a distributed lock is carried in the pass generation instruction, it can be determined, according to which pass generation instruction among the plurality of pass generation instructions, the pass is generated.

在一些示例中,应用本发明实施例的一种数据获取方法的通行证管理服务器,可以在仅接收到一个通行证生成指令后,判断该通行证生成指令中是否携带有分布式锁,判断是否根据该通行证生成指令生成通行证。In some examples, a pass management server applying a data acquisition method according to an embodiment of the present invention may, after receiving only one pass generation instruction, determine whether the pass generation instruction carries a distributed lock, and determine whether the pass The generate instruction generates a pass.

通过判断通行证生成指令中是否携带有分布式锁,可以使得上述的通行证管理服务器只根据携带有分布式锁的通行证生成指令生成通行证,可以避免根据未携带有分布式锁的多个通行证生成指令重复生成通行证,避免通行证管理服务器的资源浪费。By judging whether a distributed lock is carried in the pass generation instruction, the above-mentioned pass management server can only generate the pass according to the pass generation instruction carrying the distributed lock, which can avoid the repetition of the generation instructions according to multiple passes that do not carry the distributed lock. Generate passports to avoid wasting resources of the passport management server.

相应的,在判断通行证生成指令中是否携带有分布式锁之后,上述步骤中,根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证,可以包括:Correspondingly, after judging whether a distributed lock is carried in the pass generation instruction, in the above steps, according to the pass generation instruction, according to the preset number of passes M, generate M passes, and store the M passes, which may include:

在通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored.

具体的,应用本发明实施例的一种数据获取方法的通行证管理服务器在判断通行证生成指令中是否携带有分布式锁之后,确定通行证生成指令中携带有分布式锁后,可以按照预设通行证发放数量M,生成M个通行证,并将该M个通行证存储在该通行证管理服务器的数据库中。Specifically, after judging whether a distributed lock is carried in the pass generation instruction, the pass management server applying the data acquisition method according to the embodiment of the present invention can issue the pass according to the preset after determining that the distributed lock is carried in the pass generation instruction M number of passes is generated, and the M passes are stored in the database of the pass management server.

在本发明实施例的一种可能的应用场景中,该通行证生成指令可以由业务服务器发送,当该通行证生成指令由业务服务器发送时,也可以判断业务服务器发送的通行证生成指令中是否携带有分布式锁。In a possible application scenario of the embodiment of the present invention, the pass generation instruction may be sent by the service server, and when the pass generation instruction is sent by the service server, it may also be determined whether the pass generation instruction sent by the service server carries the distribution lock.

在一些示例中,该携带有分布式锁的通行证生成指令只有一个。In some examples, there is only one pass generation instruction that carries a distributed lock.

通过上述步骤,可以保证该通行证管理服务器只根据一个通行证生成指令生成通行证,避免通行证管理服务器接收到多个业务控制服务器发送的多个通行证生成指令,提高通行证管理服务器的效率。Through the above steps, it can be ensured that the pass management server generates a pass only according to one pass generation instruction, so as to avoid the pass management server from receiving multiple pass generation instructions sent by multiple service control servers, and improve the efficiency of the pass management server.

在本发明实施例的又一种可能的实现方式中,在存储M个通行证时,可以将该M个通行证添加至预设通行证集合中进行存储。In another possible implementation manner of the embodiment of the present invention, when storing M passes, the M passes may be added to a preset pass set for storage.

其中,该预设通行证集合可以预先设置在通行证管理服务器中。Wherein, the preset pass set may be preset in the pass management server.

通过将M个通行证添加至预设通行证集合中进行存储,可以方便该通行证管理服务器对该M个通行证进行管理。By adding the M passes to the preset pass set for storage, it is convenient for the pass management server to manage the M passes.

在一些示例中,在将M个通行证添加至预设通行证集合之后,本发明实施例的一种数据获取方法,还提供了一种可能的实现方法,该方法可以包括:In some examples, after the M passes are added to the preset pass set, a data acquisition method according to an embodiment of the present invention also provides a possible implementation method, and the method may include:

设置预设通行证集合的标记状态为置位状态。Sets the flag state of the preset pass collection to the set state.

在一些示例中,在预先设置该预设通行证集合时,可以为该预设通行证集合设置一个标记状态,例如,当该预设通行证集合中未存储通行证时,该标记状态为复位状态,在该预设通行证集合中存储有通行证时,该标记状态为置位状态。In some examples, when the preset pass set is preset, a flag state may be set for the preset pass set. For example, when no pass is stored in the preset pass set, the flag state is a reset state, and in this When a pass is stored in the preset pass set, the flag state is the set state.

在一些示例中,该置位状态和复位状态可以分别用二进制数中的“1”和“0”表示,例如,置位状态用“1”表示,复位状态用“0”表示。In some examples, the set state and reset state may be represented by "1" and "0" in binary numbers, respectively, eg, the set state is represented by a "1" and the reset state is represented by a "0".

在一些示例中,每个通行证获取请求是每个业务服务器存在待获取数据,且确认预设通行证集合的标记状态为置位状态时,向通行证管理服务器发送的。In some examples, each pass acquisition request is sent to the pass management server when each service server has data to be acquired and it is confirmed that the flag state of the preset pass set is set.

通过设置预设通行证集合的标记状态为置位状态,可以使得业务服务器在发送通行证获取请求之前,先查看该预设通行证集合的标记状态,从而判断该预设通行证集合中是否存储有通行证,避免所有业务服务器在发送通行证获取请求后,都不能获取到通行证的问题。By setting the mark state of the preset pass set to the set state, the service server can first check the mark state of the preset pass set before sending the pass acquisition request, so as to determine whether the pass is stored in the preset pass set. The problem that all business servers cannot obtain the passport after sending the request for obtaining the passport.

本发明实施例还提供了一种数据获取方法,应用于业务服务器,如图3所示,为本发明实施例的一种数据获取方法应用于业务服务器的第一种实施方式的流程图,该方法可以包括:An embodiment of the present invention also provides a data acquisition method, which is applied to a service server. As shown in FIG. 3 , it is a flowchart of the first implementation manner of applying the data acquisition method of the embodiment of the present invention to a service server. Methods can include:

S301,当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器。S301, when there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the service server according to the pass obtaining request.

在一些示例中,为了限制同时向业务控制服务器发送数据获取请求的业务服务器的数量,在业务服务器要从业务控制服务器获取待获取数据之前,可以首先发送通行证获取请求至通行证管理服务器。In some examples, in order to limit the number of service servers that simultaneously send data acquisition requests to the service control server, before the service server acquires data to be acquired from the service control server, it may first send a pass acquisition request to the pass management server.

具体的,该业务服务器中可以存储有该通行证管理服务器的标识信息,在从业务控制服务器获取待获取数据之前,可以生成一个携带有通行证管理服务器的标识信息的通行证获取请求,然后发送该通行证获取请求给通行证管理服务器。Specifically, the business server may store the identification information of the pass management server, and before acquiring the data to be acquired from the business control server, a pass acquisition request carrying the identification information of the pass management server may be generated, and then the pass acquisition request is sent. Request to pass management server.

在一些示例中,该通行证获取请求中还可以携带有该业务服务器的标识信息,以便通行证管理服务器,在发送与通行证获取请求对应的通行证响应信息时,可以正确的发送给与该标识信息对应的业务服务器。In some examples, the pass acquisition request may also carry the identification information of the service server, so that the pass management server, when sending the pass response information corresponding to the pass acquisition request, can correctly send it to the service server corresponding to the identification information. business server.

S302,当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证。S302, when the passport response information sent by the passport management server is received, obtain the passport in the passport response information.

在一些示例中,发送通行证获取请求的业务服务器的数量可以是多个,为了限制同时向业务控制服务器发送数据获取请求的业务服务器的数量,通行证管理服务器发送的携带有通行证的通行证响应信息的数量,可能少于发送通行证获取请求的业务服务器的数量,因此,在多个发送通行证获取请求的业务服务器中,可能有一部分业务服务器可以接收到通行证响应信息,有一部分业务服务器未接收到通行证响应信息。In some examples, the number of service servers that send the pass acquisition request may be multiple. In order to limit the number of service servers that simultaneously send the data acquisition request to the service control server, the number of the pass response information carrying the pass sent by the pass management server , which may be less than the number of business servers that send the pass obtaining request. Therefore, among the multiple business servers that send the pass obtaining request, some business servers may receive the pass response information, and some business servers may not receive the pass response information. .

当业务服务器接收到通行证管理服务器发送的通行证响应信息时,可以从该通行证响应信息中获取携带的通行证。以便在后续步骤中,通过该通行证,发送数据获取请求至业务控制服务器,以获取待获取数据。When the service server receives the pass response information sent by the pass management server, it can obtain the carried pass from the pass response information. In the subsequent steps, a data acquisition request is sent to the service control server through the pass to acquire the data to be acquired.

S303,将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。S303, add the passport to the data acquisition request, and send the data acquisition request to the service control server.

在一些示例中,当应用本发明实施例的一种数据获取方法的业务服务器,接收到通行证管理服务器发送的通行证响应信息,并获取到通行证后,可以调用相应的应用程序,生成数据获取请求。In some examples, when a service server applying a data acquisition method according to an embodiment of the present invention receives the pass response information sent by the pass management server and obtains the pass, it can call a corresponding application to generate a data acquisition request.

具体的,在生成数据获取请求时,可以将该通行证添加至数据获取请求中,然后可以发送该数据获取请求至业务控制服务器。Specifically, when the data acquisition request is generated, the pass can be added to the data acquisition request, and then the data acquisition request can be sent to the service control server.

在一些示例中,该业务服务器中还可以存储有业务控制服务器的标识信息,在生成数据获取请求时,还可以将该业务控制服务器的标识信息添加至该数据获取请求中,发送至业务控制服务器。In some examples, the service server may also store identification information of the service control server, and when generating the data acquisition request, the identification information of the service control server may also be added to the data acquisition request and sent to the service control server .

通过本发明实施例的一种数据获取方法,业务服务器在发送数据获取请求前,可以首先发送通行证获取请求,在业务服务器接收通行证管理服务器发送的、与通行证获取请求对应的通行证相应信息后,从该通行证响应信息中获取到通行证,再根据该通行证,向业务控制服务器发送数据获取请求,以获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With the data acquisition method according to the embodiment of the present invention, before sending the data acquisition request, the service server can first send the pass acquisition request, and after the service server receives the pass corresponding information sent by the pass management server and corresponding to the pass acquisition request, it can send the request from the service server. The passport is obtained from the passport response information, and then according to the passport, a data acquisition request is sent to the service control server to acquire the data to be acquired. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

当该通行证管理服务器中的通行证存储在预设通行证集合中,设置该预设通行证集合的标记状态为置位状态时,与应用本发明实施例的一种数据获取方法的通行证管理服务器对应,应用本发明实施例的一种数据获取方法的业务服务器,在发送通行证获取请求至通行证管理服务器之前,还可以获取通行证管理服务器中,存储通行证的通行证集合的标记状态。When the pass in the pass management server is stored in the preset pass set, and the flag state of the preset pass set is set as the set state, corresponding to the pass management server applying the data acquisition method according to the embodiment of the present invention, the application The service server of the data acquisition method according to the embodiment of the present invention may also acquire the flag state of the passport set storing the passport in the passport management server before sending the passport acquisition request to the passport management server.

在一些示例中,该业务服务器可以发送一条标记状态获取请求至上述通行证管理服务器,上述通行证管理服务器在接收到该标记状态获取请求后,可以获取本地通行证集合的标记状态,然后生成一个标记状态响应信息,并发送该标记状态响应给该业务服务器,因此,该业务服务器可以接收到上述通行证管理服务器发送的标记状态响应信息,可以根据该标记状态响应信息判断上述通行证管理服务器中存储的通行证集合的标记状态是置位状态或者复位状态。In some examples, the service server may send a tag status acquisition request to the pass management server, and after receiving the tag status acquisition request, the pass management server may acquire the tag status of the local pass set, and then generate a tag status response information, and send the mark status response to the service server, therefore, the business server can receive the mark status response information sent by the above-mentioned pass management server, and can judge the pass set stored in the above-mentioned pass management server according to the mark status response information. The flag state is either a set state or a reset state.

相应的,应用本发明实施例的一种数据获取方法的业务服务器,可以在通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。Correspondingly, a service server applying a data acquisition method according to an embodiment of the present invention can send a pass acquisition request to a pass management server when the flag state of the pass set is set.

在一些示例中,当上述业务服务器,在获取通行证管理服务器中存储通行证的通行证集合的标记状态之后,该通行证集合的标记状态为复位状态时,本发明实施例还提供了一种可能的实现方法,该方法可以包括:In some examples, when the above-mentioned service server obtains the marked state of the pass set storing the pass in the pass management server, and the marked state of the pass set is the reset state, the embodiment of the present invention also provides a possible implementation method. , the method can include:

步骤A,在通行证集合的标记状态为复位状态时,发送分布式锁获取请求至通行证管理服务器。Step A, when the marked state of the pass set is the reset state, send a distributed lock acquisition request to the pass management server.

在一些示例中,当上述业务服务器,在获取通行证管理服务器中,存储通行证的通行证集合的标记状态,并确定该标记状态为复位状态后,可以调用相应的应用程序,生成分布式锁获取请求,然后发送该分布式锁获取请求至通行证管理服务器。其中,该分布式锁可以预先存储在通行证管理服务器中,并且,该分布式锁可以仅有一个。In some examples, when the above-mentioned business server, in the pass acquisition management server, stores the mark state of the pass set of the pass, and determines that the mark state is the reset state, it can call the corresponding application program to generate a distributed lock acquisition request, The distributed lock acquisition request is then sent to the pass management server. Wherein, the distributed lock may be pre-stored in the pass management server, and there may be only one distributed lock.

在一些示例中,在生成分布式锁获取请求时,还可以将通行证管理服务器的标识信息添加至该分布式锁获取请求中。In some examples, when the distributed lock acquisition request is generated, the identification information of the pass management server may also be added to the distributed lock acquisition request.

步骤B,在接收到通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将分布式锁添加至通行证生成指令。Step B, after receiving the distributed lock response information carrying the distributed lock sent by the pass management server, adding the distributed lock to the pass generation instruction.

在一些示例中,发送分布式锁获取请求的上述业务服务器可以有多个。例如,图1所示的第一业务服务器103、第二业务服务器104和第三业务服务器105,都可以发送分布式锁获取请求至上述通行证管理服务器。当上述通行证管理服务器,在接收到多个业务服务器发送的分布式锁获取请求后,可以随机选择一个业务服务器发送的分布式锁获取请求,生成与该分布式锁获取请求对应的分布式锁响应信息,并发送该分布式锁响应信息至与该分布式锁获取请求对应的业务服务器。In some examples, there may be multiple above-mentioned business servers that send distributed lock acquisition requests. For example, the first service server 103, the second service server 104, and the third service server 105 shown in FIG. 1 can all send a distributed lock acquisition request to the above-mentioned pass management server. When the above-mentioned pass management server, after receiving distributed lock acquisition requests sent by multiple business servers, can randomly select a distributed lock acquisition request sent by a business server, and generate a distributed lock response corresponding to the distributed lock acquisition request information, and send the distributed lock response information to the service server corresponding to the distributed lock acquisition request.

步骤C,发送携带有分布式锁的通行证生成指令至通行证管理服务器。Step C, sending the pass generation instruction carrying the distributed lock to the pass management server.

在一些示例中,在发送分布式锁获取请求的业务服务器,接收到上述通行证管理服务器发送的分布式锁响应信息后,可以获取该分布式锁响应信息中的分布式锁,并触发生成通行证生成指令。In some examples, after receiving the distributed lock response information sent by the above-mentioned pass management server, the business server that sends the distributed lock acquisition request can acquire the distributed lock in the distributed lock response information, and trigger the generation of the pass. instruction.

具体的,在生成通行证生成指令时,可以将该分布式锁和该业务服务器的标识信息添加至该通行证生成指令中,发送至通行证管理服务器。Specifically, when the pass generation instruction is generated, the distributed lock and the identification information of the service server may be added to the pass generation instruction and sent to the pass management server.

应当理解的是,在应用本发明实施例的一种数据获取方法的通行证管理服务器中,可以管理有两种分布式锁,第一种分布式锁为用于在接收到第一种分布式锁获取请求时,返回携带有该第一种分布式锁的分布式锁响应消息,以使得业务服务器能够在获取到该第一种分布式锁后,发送携带有该第一种分布式锁的通行证生成指令至上述的通行证管理服务器。上述的通行证管理服务器还可以管理有第二分布式锁,该第二种分布式锁可以由上述的通行证管理服务器在接收到通行证生成指令后,通过多个分布式锁生成应用程序分别生成多个,并存储在通行证管理服务器本地。It should be understood that, in the pass management server applying the data acquisition method of the embodiment of the present invention, two distributed locks can be managed, and the first distributed lock is used for receiving the first distributed lock. When acquiring the request, return a distributed lock response message carrying the first type of distributed lock, so that the business server can send a pass carrying the first type of distributed lock after acquiring the first type of distributed lock Generate an instruction to the above-mentioned pass management server. The above-mentioned pass management server can also manage a second distributed lock, and the second kind of distributed lock can be generated by the above-mentioned pass management server after receiving the pass generation instruction through a plurality of distributed lock generation applications. , and stored locally on the Pass Management Server.

通过本发明实施例的一种数据获取方法,可以使得上述通行证管理服务器的通行证集合中存储有通行证时,业务服务器再发送通行证获取请求,从而减少业务服务器发送通行证获取请求的次数,避免对通行证管理服务器的带宽造成不必要的浪费。Through a data acquisition method according to the embodiment of the present invention, when a passport is stored in the passport collection of the above-mentioned passport management server, the service server sends a passport acquisition request, thereby reducing the number of times the service server sends a passport acquisition request and avoiding the management of passports. Server bandwidth is unnecessarily wasted.

在一些示例中,当业务服务器未接收到通行证响应信息时,本发明实施例还提供了一种可能的实现方式,在S301,当存在待获取数据时,发送通行证获取请求至通行证管理服务器之后,本发明实施例的一种数据获取方法,还可以包括:In some examples, when the service server does not receive the pass response information, the embodiment of the present invention also provides a possible implementation manner. In S301, when there is data to be acquired, after sending a pass acquisition request to the pass management server, A data acquisition method according to an embodiment of the present invention may further include:

S304,在未接收到与通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠。S304, when no pass response information corresponding to the pass acquisition request is received, enter sleep according to the first preset sleep time.

在一些示例中,可以为每个业务服务器预先设置第一预设休眠时间,当该业务服务器未接收到上述通行证管理服务器发送的,与通行证获取请求对应的通行证响应信息时,应用本发明实施例的一种数据获取方法的业务服务器,可以按照该第一预设休眠时间进入休眠状态。In some examples, a first preset sleep time may be preset for each service server, and when the service server does not receive the pass response information corresponding to the pass acquisition request sent by the pass management server, the embodiment of the present invention is applied. The service server of the data acquisition method can enter the sleep state according to the first preset sleep time.

S305,在第一预设休眠时间结束后,重复发送通行证获取请求至通行证管理服务器。S305, after the first preset sleep time expires, repeatedly send the pass obtaining request to the pass management server.

在一些示例中,在上述未接收到通行证响应信息的业务服务器,进入休眠状态后,可以对该业务服务器进入休眠状态的时间进行计时,当计时结束后,上述未接收到通行证响应信息的业务服务器,可以再次发送通行证获取请求至通行证管理服务器。In some examples, after the above-mentioned service server that has not received the pass response information enters the dormant state, the time when the service server enters the dormant state may be timed, and when the timing ends, the above-mentioned service server that has not received the pass response information , you can send the pass obtaining request to the pass management server again.

通过本步骤,可以使得未接收到通行证响应信息的业务服务器及时进入休眠状态,减少能源开销。Through this step, the service server that has not received the pass response information can be made to enter a dormant state in time, thereby reducing energy consumption.

在本发明实施例的一种可能的实现方式中,在发送数据获取请求至业务控制服务器之后,本发明实施例的一种数据获取方法,还可以包括:In a possible implementation manner of the embodiment of the present invention, after the data acquisition request is sent to the service control server, the data acquisition method of the embodiment of the present invention may further include:

在接收到业务控制服务器,发送的与数据获取请求对应的数据后,发送通行证至通行证管理服务器。After receiving the data corresponding to the data acquisition request sent by the service control server, send the pass to the pass management server.

在一些示例中,当获取到通行证响应信息的业务服务器,接收到业务控制服务器发送的与数据获取请求对应的数据后,可以将获取到的通行证响应信息中的通行证发送至通行证管理服务器。In some examples, after the service server that obtains the pass response information, after receiving the data corresponding to the data obtaining request sent by the service control server, it can send the pass in the obtained pass response information to the pass management server.

在一些示例中,上述的通行证管理服务器在生成M个通行证后,该M个通行证的总数量保持不变。在该通行证管理服务器将预先存储的M个通行证分别添加至M个通行证响应信息,并分别发送M个通行证响应信息至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器后,该通行证管理服务器中的通行证的数量为零,这时,上述的通行证管理服务器不再重新生成通行证,可以等待上述的获取到M个通行证的M个业务服务器将对应的通行证返回至通行证管理服务器,从而可以保证通行证管理服务器中的通行证的总数量保持为M个。In some examples, after the above-mentioned pass management server generates M passes, the total number of the M passes remains unchanged. After the pass management server adds the pre-stored M passes to the M pieces of pass response information, and sends the M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers, the The number of passes in the pass management server is zero. At this time, the above-mentioned pass management server does not regenerate the pass, and can wait for the above-mentioned M service servers that have obtained M passes to return the corresponding passes to the pass management server, thereby It can be guaranteed that the total number of passes in the pass management server remains M.

通过本步骤,可以使得通行证响应信息的业务服务器,能够及时返回获取到的通行证,并且,还可以使得未获取到通行证响应信息的业务服务器,在再次发送通行证请求信息后,能够及时获取到通行证响应信息,并根据通行证响应信息中的通行证发送数据获取请求,以获取待获取数据。Through this step, the business server of the pass response information can be made to return the obtained pass in time, and the business server that has not obtained the pass response information can also be made to obtain the pass response in time after sending the pass request information again. information, and send a data acquisition request according to the pass in the pass response information to obtain the data to be acquired.

进一步的,通过本步骤,可以在生成通行证后,在业务服务器的数量和业务控制服务器的数量未发生变化的情况下,不需要再次执行生成通行证的步骤,减少生成通行证的次数。Further, through this step, after the pass is generated, under the condition that the number of service servers and the number of service control servers do not change, it is not necessary to perform the step of generating the pass again, thereby reducing the number of times of generating the pass.

在一些示例中,当获取到通行证响应信息的业务服务器,发送数据获取请求至业务控制服务器后,未获取到与数据获取请求对应的待获取数据时,可以生成一个异常事件日志,并对上述的未获取到与数据获取请求对应的待获取数据的事件进行记录。In some examples, when the service server that has obtained the pass response information sends a data acquisition request to the service control server, but fails to acquire the data to be acquired corresponding to the data acquisition request, an abnormal event log can be generated, and the above-mentioned abnormal event log can be generated. The event that the data to be acquired corresponding to the data acquisition request is not acquired is recorded.

进一步的,该异常事件记录日志中还可以记录发送数据获取请求至业务控制服务器的时间,以及该业务控制服务器的标识信息等。Further, the abnormal event record log may also record the time when the data acquisition request is sent to the service control server, the identification information of the service control server, and the like.

本发明实施例还提供了一种数据获取装置,应用于通行证管理服务器,如图4所示,为本发明实施例的一种数据获取装置应用于通行证管理服务器的结构示意图,该装置可以包括:An embodiment of the present invention further provides a data acquisition device, which is applied to a passport management server. As shown in FIG. 4 , it is a schematic structural diagram of a data acquisition device according to an embodiment of the present invention applied to a passport management server. The device may include:

第一接收模块401,用于接收N个业务服务器发送的N个通行证获取请求,其中,每个业务服务器发送一个通行证获取请求,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向通行证管理服务器发送的,N为大于或等于1的整数;The first receiving module 401 is configured to receive N pass acquisition requests sent by N service servers, wherein each service server sends a pass acquisition request, and each pass acquisition request carries the identification information of the service server of the request sender. , each pass acquisition request is sent to the pass management server when the business server of the request sender to which it belongs has data to be acquired, and N is an integer greater than or equal to 1;

第一判断模块402,用于判断N是否大于预设通行证发放数量M;其中,M为大于或等于1的整数;The first judging module 402 is used for judging whether N is greater than the preset pass issuance quantity M; wherein, M is an integer greater than or equal to 1;

选择模块403,用于在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;The selection module 403 is configured to select M passport acquisition requests from the N passport acquisition requests when N is greater than M, and acquire the identification information of the M request sender service servers carried in the M passport acquisition requests;

添加模块404,用于将预先存储的M个通行证分别添加至M个通行证响应信息中;The adding module 404 is configured to add the pre-stored M passes to the M pass response information respectively;

响应模块405,用于分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The response module 405 is configured to send M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

通过本发明实施例提供的一种数据获取装置,在接收到N个业务服务器发送的N个通行证获取请求后,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,然后获取M个通行证获取请求中携带的M个业务服务器的标识信息,再将预先存储的M个通行证分别添加至M个通行证响应信息中,最后分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With a data acquisition device provided by an embodiment of the present invention, after receiving N pass acquisition requests sent by N service servers, it is determined whether N is greater than the preset number M of passes issued, and when N is greater than M, the number of passes from the N passes is determined. In the acquisition request, select M passport acquisition requests, then acquire the identification information of the M service servers carried in the M passport acquisition requests, and then add the pre-stored M passports to the M passport response information respectively, and finally send M respectively. The pieces of pass response information are sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

第二接收模块,用于接收通行证生成指令;The second receiving module is used for receiving the pass generation instruction;

存储模块,用于根据通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。The storage module is used for generating M passes according to the pass generation instruction and according to the preset number M of passes, and storing the M passes.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

第二判断模块,用于判断通行证生成指令中是否携带有分布式锁;The second judgment module is used for judging whether a distributed lock is carried in the pass generation instruction;

相应的,存储模块,具体用于:Correspondingly, the storage module is specifically used for:

在通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored.

具体的,存储模块,具体用于:Specifically, the storage module is specifically used for:

将M个通行证添加至预设通行证集合;Add M passes to the preset pass set;

相应的,本发明实施例的一种数据获取装置,还可以包括:Correspondingly, a data acquisition apparatus according to an embodiment of the present invention may further include:

标记状态设置模块,用于设置预设通行证集合的标记状态为置位状态;The mark state setting module is used to set the mark state of the preset pass set to the set state;

相应的,每个通行证获取请求是每个业务服务器存在待获取数据,且确认预设通行证集合的标记状态为置位状态时,向通行证管理服务器发送的。Correspondingly, each pass obtaining request is sent to the pass management server when each service server has data to be obtained and it is confirmed that the flag state of the preset pass set is set.

本发明实施例还提供了一种数据获取装置,应用于业务服务器,如图5所示,为本发明实施例的一种数据获取装置应用于业务服务器的结构示意图,该装置可以包括:An embodiment of the present invention further provides a data acquisition apparatus, which is applied to a service server. As shown in FIG. 5 , it is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present invention applied to a service server. The apparatus may include:

第一发送模块501,用于当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;The first sending module 501 is configured to send a pass obtaining request to the pass management server when there is data to be obtained, so that the pass management server constructs the pass response information including the pass and sends it to the service server according to the pass obtaining request;

第一接收模块502,用于当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;The first receiving module 502 is configured to acquire the passport in the passport response information when receiving the passport response information sent by the passport management server;

第二发送模块503,用于将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。The second sending module 503 is configured to add the passport to the data acquisition request, and send the data acquisition request to the service control server.

通过本发明实施例的一种数据获取装置,在发送数据获取请求前,可以首先发送通行证获取请求,在业务服务器接收通行证管理服务器发送的、与通行证获取请求对应的通行证相应信息后,从该通行证响应信息中获取到通行证,再根据该通行证,向业务控制服务器发送数据获取请求,以获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With a data acquisition device according to an embodiment of the present invention, before sending a data acquisition request, a pass acquisition request can be sent first, and after the service server receives the pass corresponding information sent by the pass management server and corresponding to the pass acquisition request, the pass is obtained from the pass. The passport is obtained from the response information, and then according to the passport, a data acquisition request is sent to the service control server to acquire the data to be acquired. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

标记状态获取模块,用于获取通行证管理服务器中,存储通行证的通行证集合的标记状态;The mark state obtaining module is used to obtain the mark state of the pass set storing the pass in the pass management server;

相应的,第一发送模块501,具体用于:Correspondingly, the first sending module 501 is specifically used for:

在通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。When the flag state of the pass collection is set, send a pass acquisition request to the pass management server.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

第三发送模块,用于在通行证集合的标记状态为复位状态时,发送分布式锁获取请求至通行证管理服务器;a third sending module, configured to send a distributed lock acquisition request to the pass management server when the marked state of the pass set is the reset state;

第二接收模块,用于在接收到通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将分布式锁添加至通行证生成指令;The second receiving module is configured to add the distributed lock to the pass generation instruction after receiving the distributed lock response information carrying the distributed lock sent by the pass management server;

第四发送模块,用于发送携带有分布式锁的通行证生成指令至通行证管理服务器。The fourth sending module is used for sending the pass generation instruction carrying the distributed lock to the pass management server.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

休眠设置模块,用于在未接收到与通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠;在第一预设休眠时间结束后,触发第一发送模块501。The sleep setting module is configured to enter sleep according to the first preset sleep time when the pass response information corresponding to the pass acquisition request is not received; after the end of the first preset sleep time, the first sending module 501 is triggered.

具体的,本发明实施例的一种数据获取装置,还可以包括:Specifically, a data acquisition device according to an embodiment of the present invention may further include:

第五发送模块,用于在接收到业务控制服务器,发送的与数据获取请求对应的数据后,发送通行证至通行证管理服务器。The fifth sending module is configured to send the pass to the pass management server after receiving the data corresponding to the data acquisition request sent by the service control server.

本发明实施例还提供了一种通行证管理服务器,如图6所示,为本发明实施例的一种数据获取方法应用于通行证管理服务器的结构示意图,该通行证管理服务器可以包括处理器601和机器可读存储介质602,机器可读存储介质602存储有能够被处理器601执行的机器可执行指令,处理器601被机器可执行指令促使实现以下步骤:An embodiment of the present invention also provides a pass management server. As shown in FIG. 6 , it is a schematic structural diagram of a data acquisition method according to an embodiment of the present invention applied to a pass management server. The pass management server may include a processor 601 and a machine A readable storage medium 602 that stores machine-executable instructions that can be executed by a processor 601 that is caused by the machine-executable instructions to perform the following steps:

接收N个业务服务器发送的N个通行证获取请求;Receive N passport acquisition requests sent by N service servers;

判断N是否大于预设通行证发放数量M;Determine whether N is greater than the preset number M of passes issued;

在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M service servers carried in the M pass obtaining requests;

将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively;

分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The M pieces of pass response information are respectively sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

通过本发明实施例提供的一种通行证管理服务器,在接收到N个业务服务器发送的N个通行证获取请求后,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,然后获取M个通行证获取请求中携带的M个业务服务器的标识信息,再将预先存储的M个通行证分别添加至M个通行证响应信息中,最后分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。Through the pass management server provided by the embodiment of the present invention, after receiving N pass acquisition requests sent by N service servers, it is judged whether N is greater than the preset number M of passes issued, and when N is greater than M, the number of passes from the N passes is determined. In the acquisition request, select M passport acquisition requests, then acquire the identification information of the M service servers carried in the M passport acquisition requests, and then add the pre-stored M passports to the M passport response information respectively, and finally send M respectively. The pieces of pass response information are sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

本发明实施例还提供了一种业务服务器,如图7所示,为本发明实施例的一种数据获取方法应用于业务服务器的结构示意图,该业务服务器可以包括处理器701和机器可读存储介质702,机器可读存储介质702存储有能够被处理器701执行的机器可执行指令,处理器701被机器可执行指令促使实现以下步骤:An embodiment of the present invention also provides a service server. As shown in FIG. 7 , it is a schematic structural diagram of a data acquisition method according to an embodiment of the present invention applied to a service server. The service server may include a processor 701 and a machine-readable storage. Medium 702, the machine-readable storage medium 702 stores machine-executable instructions executable by the processor 701, the processor 701 being caused by the machine-executable instructions to perform the following steps:

当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the business server according to the pass obtaining request;

当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information;

将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。Add the passport to the data acquisition request, and send the data acquisition request to the business control server.

通过本发明实施例的一种业务服务器,在发送数据获取请求前,可以首先发送通行证获取请求,在业务服务器接收通行证管理服务器发送的、与通行证获取请求对应的通行证相应信息后,从该通行证响应信息中获取到通行证,再根据该通行证,向业务控制服务器发送数据获取请求,以获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With a service server according to an embodiment of the present invention, before sending a data acquisition request, a pass acquisition request may be sent first, and after the service server receives the pass corresponding information sent by the pass management server and corresponding to the pass acquisition request, it responds from the pass The passport is obtained from the information, and then according to the passport, a data acquisition request is sent to the service control server to acquire the data to be acquired. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

机器可读存储介质可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The machine-readable storage medium may include random access memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-Volatile Memory, NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital SignalProcessing,DSP)、专用集成电路(Application Specific IntegratedCircuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; may also be a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

本发明实施例还提供了一种计算机可读存储介质,应用于通行证管理服务器,该计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,实现以下步骤:An embodiment of the present invention also provides a computer-readable storage medium, which is applied to a passport management server, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:

接收N个业务服务器发送的N个通行证获取请求;Receive N passport acquisition requests sent by N service servers;

判断N是否大于预设通行证发放数量M;Determine whether N is greater than the preset number M of passes issued;

在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M service servers carried in the M pass obtaining requests;

将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively;

分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The M pieces of pass response information are respectively sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

通过本发明实施例提供的一种计算机可读存储介质,在接收到N个业务服务器发送的N个通行证获取请求后,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,然后获取M个通行证获取请求中携带的M个业务服务器的标识信息,再将预先存储的M个通行证分别添加至M个通行证响应信息中,最后分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。Through a computer-readable storage medium provided by an embodiment of the present invention, after receiving N pass acquisition requests sent by N service servers, it is judged whether N is greater than the preset number M of passes issued, and when N is greater than M, from N Select M pass obtaining requests from the pass obtaining requests, then obtain the identification information of the M service servers carried in the M pass obtaining requests, and then add the pre-stored M passes to the M pass response information respectively, and finally respectively Send M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

本发明实施例还提供了一种计算机可读存储介质,应用于业务服务器,该计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时,实现以下方法步骤:The embodiment of the present invention also provides a computer-readable storage medium, which is applied to a service server, and a computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the following method steps are implemented:

当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the business server according to the pass obtaining request;

当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information;

将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。Add the passport to the data acquisition request, and send the data acquisition request to the business control server.

通过本发明实施例的一种计算机可读存储介质,在发送数据获取请求前,可以首先发送通行证获取请求,在业务服务器接收通行证管理服务器发送的、与通行证获取请求对应的通行证相应信息后,从该通行证响应信息中获取到通行证,再根据该通行证,向业务控制服务器发送数据获取请求,以获取待获取数据。从而可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。With a computer-readable storage medium according to an embodiment of the present invention, before sending a data acquisition request, a pass acquisition request may be sent first, and after the service server receives the pass corresponding information sent by the pass management server and corresponding to the pass acquisition request, the request is sent from the service server. The passport is obtained from the passport response information, and then according to the passport, a data acquisition request is sent to the service control server to acquire the data to be acquired. Therefore, it is possible to automatically limit the number of service servers that simultaneously obtain data required by themselves from the service control server, thereby reducing the pressure on the service control server.

本发明实施例还提供了一种包含指令的计算机程序产品,应用于通行证管理服务器,当其在计算机上运行时,使得计算机执行以下步骤:The embodiment of the present invention also provides a computer program product containing instructions, which is applied to a pass management server, and when it runs on a computer, causes the computer to execute the following steps:

接收N个业务服务器发送的N个通行证获取请求;Receive N passport acquisition requests sent by N service servers;

判断N是否大于预设通行证发放数量M;Determine whether N is greater than the preset number M of passes issued;

在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M service servers carried in the M pass obtaining requests;

将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively;

分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The M pieces of pass response information are respectively sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

本发明实施例还提供了一种包含指令的计算机程序产品,应用于业务服务器,当其在计算机上运行时,使得计算机执行以下步骤:The embodiment of the present invention also provides a computer program product containing instructions, which is applied to a service server, and when it runs on a computer, causes the computer to perform the following steps:

当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the business server according to the pass obtaining request;

当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information;

将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。Add the passport to the data acquisition request, and send the data acquisition request to the business control server.

本发明实施例还提供了一种计算机程序,应用于通行证管理服务器,当其在计算机上运行时,使得计算机执行以下步骤:The embodiment of the present invention also provides a computer program, which is applied to the pass management server, and when it runs on the computer, causes the computer to execute the following steps:

接收N个业务服务器发送的N个通行证获取请求;Receive N passport acquisition requests sent by N service servers;

判断N是否大于预设通行证发放数量M;Determine whether N is greater than the preset number M of passes issued;

在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M service servers carried in the M pass obtaining requests;

将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively;

分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器根据通行证响应信息,获取待获取数据。The M pieces of pass response information are respectively sent to the service servers corresponding to the identification information of the M request sender service servers, so that each service server obtains the data to be obtained according to the pass response information.

本发明实施例还提供了一种计算机程序,应用于业务服务器,当其在计算机上运行时,使得计算机执行以下步骤:The embodiment of the present invention also provides a computer program, which is applied to the service server, and when it runs on the computer, causes the computer to perform the following steps:

当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使通行证管理服务器根据通行证获取请求,构建包含通行证的通行证响应信息并发送给业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server constructs the pass response information including the pass and sends it to the business server according to the pass obtaining request;

当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information;

将通行证添加至数据获取请求,并发送数据获取请求至业务控制服务器。Add the passport to the data acquisition request, and send the data acquisition request to the business control server.

本发明实施例还提供了一种数据获取系统,如图8所示,为本发明实施例的一种数据获取系统的结构示意图,该系统可以包括:通行证管理服务器801、业务服务器802和业务控制服务器803;An embodiment of the present invention also provides a data acquisition system. As shown in FIG. 8, it is a schematic structural diagram of a data acquisition system according to an embodiment of the present invention. The system may include: a pass management server 801, a service server 802, and a service control server 803;

业务服务器802,用于当存在待获取数据时,发送通行证获取请求至通行证管理服务器,其中,业务服务器包括N个,N为大于或等于1的整数;A service server 802, configured to send a pass obtaining request to a pass management server when there is data to be obtained, wherein the service servers include N, and N is an integer greater than or equal to 1;

通行证管理服务器801,用于接收N个业务服务器发送的N个通行证获取请求,判断N是否大于预设通行证发放数量M,在N大于M时,从N个通行证获取请求中选择M个通行证获取请求,并获取M个通行证获取请求中携带的M个业务服务器的标识信息,将预先存储的M个通行证分别添加至M个通行证响应信息中,分别发送M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,其中,每个通行证获取请求携带有所属的请求发送方业务服务器的标识信息,M为大于或等于1的整数;The pass management server 801 is configured to receive N pass acquisition requests sent by N service servers, determine whether N is greater than the preset number of passes M, and when N is greater than M, select M pass acquisition requests from the N pass acquisition requests , and obtain the identification information of the M service servers carried in the M pass acquisition requests, add the pre-stored M passes to the M pass response information respectively, and send the M pass response information respectively to the corresponding M The service server corresponding to the identification information of the service server of the request sender, wherein each pass acquisition request carries the identification information of the service server of the request sender to which it belongs, and M is an integer greater than or equal to 1;

业务服务器802,还用于当接收到通行证管理服务器发送的通行证响应信息时,获取通行证响应信息中的通行证,将通行证响应信息中的通行证添加至数据获取请求中,并发送数据获取请求至业务控制服务器;The service server 802 is further configured to obtain the passport in the passport response information when receiving the passport response information sent by the passport management server, add the passport in the passport response information to the data acquisition request, and send the data acquisition request to the service control server;

业务控制服务器803,用于接收业务服务器发送的数据获取请求,并将与数据获取请求对应的待获取数据发送至业务服务器。The service control server 803 is configured to receive the data acquisition request sent by the service server, and send the data to be acquired corresponding to the data acquisition request to the service server.

通过本发明实施例的一种数据获取系统,通行证管理服务器可以在N个业务服务器发送的通行证获取请求的数量N大于预设通行证发放数量M,选择M个通行证,并且生成M个通行证响应信息,返回给M个业务服务器,使得N个业务服务器中的M个业务服务器,可以从接收的通行证响应信息中获取到通行证,并通过该通行证,发送数据获取请求,从业务控制服务器获取待获取数据,可以实现自动限制同时从业务控制服务器获取自身需要的数据的业务服务器的数量,从而降低业务控制服务器的压力。Through a data acquisition system according to an embodiment of the present invention, the pass management server can select M passes, and generate M pass response messages when the number N of pass acquisition requests sent by N service servers is greater than the preset pass issuance number M, It is returned to the M service servers, so that M service servers in the N service servers can obtain the passport from the received passport response information, and send a data acquisition request through the passport, and obtain the data to be acquired from the service control server, It is possible to automatically limit the number of service servers that acquire the data required by themselves from the service control server at the same time, thereby reducing the pressure on the service control server.

需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.

上所仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (23)

1.一种数据获取方法,其特征在于,应用于通行证管理服务器,所述方法包括:1. a data acquisition method, is characterized in that, is applied to the passport management server, and described method comprises: 接收N个业务服务器发送的N个通行证获取请求,其中,每个业务服务器发送一个通行证获取请求,每个所述通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个所述通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向所述通行证管理服务器发送的,所述N为大于或等于1的整数,所述业务服务器是在一个物理服务器上,通过虚拟技术实现的虚拟服务器,所述物理服务器上设置有多个所述业务服务器;Receive N pass acquisition requests sent by N service servers, wherein each service server sends a pass acquisition request, and each pass acquisition request carries the identification information of the service server of the request sender, and each pass The acquisition request is sent to the pass management server when there is data to be acquired in the service server of the request sender, the N is an integer greater than or equal to 1, and the service server is on a physical server, through the virtual technology The implemented virtual server, the physical server is provided with a plurality of the business servers; 判断N是否大于预设通行证发放数量M;其中,所述M为大于或等于1的整数;Determine whether N is greater than the preset number of passes issued M; wherein, the M is an integer greater than or equal to 1; 在N大于M时,从所述N个通行证获取请求中选择M个通行证获取请求,并获取所述M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;When N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M request sender service servers carried in the M pass obtaining requests; 将预先存储的M个通行证分别添加至M个通行证响应信息中;adding the pre-stored M passes to the M pass response information respectively; 分别发送所述M个通行证响应信息至与所述所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器在接收到所述通行证管理服务器发送的通行证响应信息时,获取所述通行证响应信息中的通行证,并将所获取的通行证添加至数据获取请求,发送数据获取请求至业务控制服务器以获取待获取数据。Send the M pass response information to the service servers corresponding to the identification information of the M request sender service servers, so that when each service server receives the pass response information sent by the pass management server, Acquire the pass in the pass response information, add the acquired pass to the data acquisition request, and send the data acquisition request to the service control server to acquire the data to be acquired. 2.根据权利要求1所述的方法,其特征在于,在所述接收N个业务服务器发送的N个通行证获取请求之前,所述方法还包括:2. The method according to claim 1, characterized in that, before receiving N passport acquisition requests sent by N service servers, the method further comprises: 接收通行证生成指令;Receive pass generation instructions; 根据所述通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储所述M个通行证。According to the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored. 3.根据权利要求2所述的方法,其特征在于,在所述接收通行证生成指令之后,所述方法还包括:3. The method according to claim 2, characterized in that, after receiving the pass generation instruction, the method further comprises: 判断所述通行证生成指令中是否携带有分布式锁;Determine whether the pass generation instruction carries a distributed lock; 相应的,所述根据所述通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储所述M个通行证,包括:Correspondingly, according to the pass generation instruction, according to the preset number M of passes, generate M passes, and store the M passes, including: 在所述通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储所述M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored. 4.根据权利要求2或3所述的方法,其特征在于,所述存储所述M个通行证的步骤包括:4. The method according to claim 2 or 3, wherein the step of storing the M passes comprises: 将所述M个通行证添加至预设通行证集合;adding the M passes to a preset set of passes; 在所述将所述M个通行证添加至预设通行证集合之后,所述方法还包括:After the adding the M passes to the preset pass set, the method further includes: 设置所述预设通行证集合的标记状态为置位状态;setting the marked state of the preset pass set as a set state; 相应的,每个所述通行证获取请求是每个业务服务器存在待获取数据,且确认所述预设通行证集合的标记状态为置位状态时,向所述通行证管理服务器发送的。Correspondingly, each pass obtaining request is sent to the pass management server when each service server has data to be obtained and the flag state of the preset pass set is confirmed to be set. 5.一种数据获取方法,其特征在于,应用于业务服务器,所述方法包括:5. A data acquisition method, characterized in that, applied to a service server, the method comprising: 当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使所述通行证管理服务器在接收到N个业务服务器发送的N个通行证获取请求时,判断N是否大于预设通行证发放数量M,并在N大于M时,从所述N个通行证获取请求中选择M个通行证获取请求,并获取所述M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;将预先存储的M个通行证分别添加至M个通行证响应信息中;分别发送所述M个通行证响应信息至与所述所属的M个请求发送方业务服务器的标识信息对应的业务服务器,其中,所述业务服务器是在一个物理服务器上,通过虚拟技术实现的虚拟服务器,所述物理服务器上设置有多个所述业务服务器;When there is data to be acquired, send a pass obtaining request to the pass management server, so that the pass management server, when receiving N pass obtaining requests sent by N service servers, judges whether N is greater than the preset number of passes M is issued, And when N is greater than M, select M pass obtaining requests from the N pass obtaining requests, and obtain the identification information of the M request sender service servers carried in the M pass obtaining requests; The stored M passports are respectively added to the M passport response messages; the M passport response messages are respectively sent to the service servers corresponding to the identification information of the M request sender service servers to which they belong, wherein the service The server is a virtual server implemented by virtual technology on a physical server, and a plurality of the service servers are set on the physical server; 当接收到所述通行证管理服务器发送的所述通行证响应信息时,获取所述通行证响应信息中的通行证;When receiving the pass response information sent by the pass management server, obtain the pass in the pass response information; 将所述通行证添加至数据获取请求,并发送所述数据获取请求至业务控制服务器。The pass is added to the data acquisition request, and the data acquisition request is sent to the service control server. 6.根据权利要求5所述的方法,其特征在于,在所述发送通行证获取请求至通行证管理服务器之前,所述方法还包括:6. The method according to claim 5, wherein before the sending the pass obtaining request to the pass management server, the method further comprises: 获取所述通行证管理服务器中,存储所述通行证的通行证集合的标记状态;Acquire the mark state of the pass set of the pass that is stored in the pass management server; 相应的,所述发送通行证获取请求至通行证管理服务器,包括:Correspondingly, the sending the pass obtaining request to the pass management server includes: 在所述通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。When the flag state of the pass set is the set state, a pass acquisition request is sent to the pass management server. 7.根据权利要求6所述的方法,其特征在于,在所述获取所述通行证管理服务器中,存储所述通行证的通行证集合的标记状态之后,所述方法还包括:7. The method according to claim 6, characterized in that, after storing the marked state of the pass set of the pass in the acquiring the pass management server, the method further comprises: 在所述通行证集合的标记状态为复位状态时,发送分布式锁获取请求至所述通行证管理服务器;When the marked state of the pass set is the reset state, sending a distributed lock acquisition request to the pass management server; 在接收到所述通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将所述分布式锁添加至通行证生成指令;After receiving the distributed lock response information carrying the distributed lock sent by the pass management server, adding the distributed lock to the pass generation instruction; 发送携带有所述分布式锁的通行证生成指令至所述通行证管理服务器。Send a pass generation instruction carrying the distributed lock to the pass management server. 8.根据权利要求5所述的方法,其特征在于,在发送通行证获取请求至通行证管理服务器之后,所述方法还包括:8. The method according to claim 5, wherein after sending the pass obtaining request to the pass management server, the method further comprises: 在未接收到与所述通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠;When the pass response information corresponding to the pass acquisition request is not received, enter sleep according to the first preset sleep time; 在第一预设休眠时间结束后,重复发送通行证获取请求至通行证管理服务器。After the first preset sleep time expires, the pass acquisition request is repeatedly sent to the pass management server. 9.根据权利要求5所述的方法,其特征在于,在所述发送所述数据获取请求至业务控制服务器之后,所述方法还包括:9. The method according to claim 5, wherein after the sending the data acquisition request to the service control server, the method further comprises: 在接收到所述业务控制服务器,发送的与所述数据获取请求对应的数据后,发送所述通行证至所述通行证管理服务器。After receiving the data corresponding to the data acquisition request sent by the service control server, the pass is sent to the pass management server. 10.一种数据获取装置,其特征在于,应用于通行证管理服务器,所述装置包括:10. A data acquisition device, characterized in that, applied to a passport management server, the device comprising: 第一接收模块,用于接收N个业务服务器发送的N个通行证获取请求,其中,每个业务服务器发送一个通行证获取请求,每个所述通行证获取请求携带有所属的请求发送方业务服务器的标识信息,每个所述通行证获取请求为所属的请求发送方业务服务器存在待获取数据时,向所述通行证管理服务器发送的,所述N为大于或等于1的整数,所述业务服务器是在一个物理服务器上,通过虚拟技术实现的虚拟服务器,所述物理服务器上设置有多个所述业务服务器;The first receiving module is configured to receive N pass acquisition requests sent by N service servers, wherein each service server sends a pass acquisition request, and each pass acquisition request carries the identity of the service server of the request sender Information, each of the pass acquisition requests is sent to the pass management server when the business server of the request sender to which it belongs has data to be obtained, the N is an integer greater than or equal to 1, and the business server is in a On the physical server, a virtual server realized by virtual technology, and the physical server is provided with a plurality of the business servers; 第一判断模块,用于判断N是否大于预设通行证发放数量M;其中,所述M为大于或等于1的整数;The first judgment module is used for judging whether N is greater than the preset pass issuance quantity M; wherein, the M is an integer greater than or equal to 1; 选择模块,用于在N大于M时,从所述N个通行证获取请求中选择M个通行证获取请求,并获取所述M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;A selection module, configured to select M pass obtaining requests from the N pass obtaining requests when N is greater than M, and obtain the identifiers of the M request sender service servers carried in the M pass obtaining requests information; 添加模块,用于将预先存储的M个通行证分别添加至M个通行证响应信息中;The adding module is used to add the pre-stored M passes to the M pass response information respectively; 响应模块,用于分别发送所述M个通行证响应信息至与所述所属的M个请求发送方业务服务器的标识信息对应的业务服务器,以使各业务服务器在接收到所述通行证管理服务器发送的通行证响应信息时,获取所述通行证响应信息中的通行证,并将所获取的通行证添加至数据获取请求,发送数据获取请求至业务控制服务器以获取待获取数据。The response module is used to respectively send the M pieces of pass response information to the service servers corresponding to the identification information of the M request sender service servers to which they belong, so that each service server receives the information sent by the pass management server. When the pass response information is obtained, the pass in the pass response information is obtained, the obtained pass is added to the data acquisition request, and the data acquisition request is sent to the service control server to acquire the data to be acquired. 11.根据权利要求10所述的装置,其特征在于,所述装置还包括:11. The apparatus of claim 10, wherein the apparatus further comprises: 第二接收模块,用于接收通行证生成指令;The second receiving module is used for receiving the pass generation instruction; 存储模块,用于根据所述通行证生成指令,按照预设通行证发放数量M,生成M个通行证,并存储所述M个通行证。The storage module is configured to generate M passes according to the pass generation instruction and according to the preset number M of passes, and store the M passes. 12.根据权利要求11所述的装置,其特征在于,所述装置还包括:12. The apparatus of claim 11, wherein the apparatus further comprises: 第二判断模块,用于判断所述通行证生成指令中是否携带有分布式锁;a second judging module, configured to judge whether the pass generation instruction carries a distributed lock; 相应的,所述存储模块,具体用于:Correspondingly, the storage module is specifically used for: 在所述通行证生成指令中携带有分布式锁时,按照预设通行证发放数量M,生成M个通行证,并存储所述M个通行证。When the distributed lock is carried in the pass generation instruction, M passes are generated according to the preset number M of passes, and the M passes are stored. 13.根据权利要求11或12所述的装置,其特征在于,所述存储模块,具体用于:13. The device according to claim 11 or 12, wherein the storage module is specifically used for: 将所述M个通行证添加至预设通行证集合;adding the M passes to a preset set of passes; 相应的,所述装置还包括:Correspondingly, the device further includes: 标记状态设置模块,用于设置所述预设通行证集合的标记状态为置位状态;a mark state setting module, configured to set the mark state of the preset pass set to a set state; 相应的,每个所述通行证获取请求是每个业务服务器存在待获取数据,且确认所述预设通行证集合的标记状态为置位状态时,向所述通行证管理服务器发送的。Correspondingly, each pass obtaining request is sent to the pass management server when each service server has data to be obtained and the flag state of the preset pass set is confirmed to be set. 14.一种数据获取装置,其特征在于,应用于业务服务器,所述装置包括:14. A data acquisition device, characterized in that, applied to a service server, the device comprising: 第一发送模块,用于当存在待获取数据时,发送通行证获取请求至通行证管理服务器,以使所述通行证管理服务器在接收到N个业务服务器发送的N个通行证获取请求时,判断N是否大于预设通行证发放数量M,并在N大于M时,从所述N个通行证获取请求中选择M个通行证获取请求,并获取所述M个通行证获取请求中携带的所属的M个请求发送方业务服务器的标识信息;将预先存储的M个通行证分别添加至M个通行证响应信息中;分别发送所述M个通行证响应信息至与所述所属的M个请求发送方业务服务器的标识信息对应的业务服务器,其中,所述业务服务器是在一个物理服务器上,通过虚拟技术实现的虚拟服务器,所述物理服务器上设置有多个所述业务服务器;The first sending module is configured to send a pass obtaining request to the pass management server when there is data to be obtained, so that the pass management server, when receiving N pass obtaining requests sent by N service servers, judges whether N is greater than or equal to Preset the number M of passport issuances, and when N is greater than M, select M passport acquisition requests from the N passport acquisition requests, and acquire the M request sender services carried in the M passport acquisition requests The identification information of the server; adding the pre-stored M passes to the M pass response information respectively; respectively sending the M pass response information to the service corresponding to the identification information of the M request sender service servers to which they belong A server, wherein the service server is a virtual server implemented by a virtual technology on a physical server, and a plurality of the service servers are set on the physical server; 第一接收模块,用于当接收到所述通行证管理服务器发送的所述通行证响应信息时,获取所述通行证响应信息中的通行证;a first receiving module, configured to acquire the pass in the pass response information when receiving the pass response information sent by the pass management server; 第二发送模块,用于将所述通行证添加至数据获取请求,并发送所述数据获取请求至业务控制服务器。The second sending module is configured to add the pass to the data acquisition request, and send the data acquisition request to the service control server. 15.根据权利要求14所述的装置,其特征在于,所述装置还包括:15. The apparatus of claim 14, wherein the apparatus further comprises: 标记状态获取模块,用于获取所述通行证管理服务器中,存储所述通行证的通行证集合的标记状态;a mark state obtaining module, configured to obtain the mark state of the pass set storing the pass in the pass management server; 相应的,所述第一发送模块,具体用于:Correspondingly, the first sending module is specifically used for: 在所述通行证集合的标记状态为置位状态时,发送通行证获取请求至通行证管理服务器。When the flag state of the pass set is the set state, a pass acquisition request is sent to the pass management server. 16.根据权利要求15所述的装置,其特征在于,所述装置还包括:16. The apparatus of claim 15, wherein the apparatus further comprises: 第三发送模块,用于在所述通行证集合的标记状态为复位状态时,发送分布式锁获取请求至所述通行证管理服务器;a third sending module, configured to send a distributed lock acquisition request to the pass management server when the marked state of the pass set is a reset state; 第二接收模块,用于在接收到所述通行证管理服务器,发送的携带有分布式锁的分布式锁响应信息后,将所述分布式锁添加至通行证生成指令;The second receiving module is configured to add the distributed lock to the pass generation instruction after receiving the distributed lock response information carrying the distributed lock sent by the pass management server; 第四发送模块,用于发送携带有所述分布式锁的通行证生成指令至所述通行证管理服务器。The fourth sending module is configured to send the pass generation instruction carrying the distributed lock to the pass management server. 17.根据权利要求14所述的装置,其特征在于,所述装置还包括:17. The apparatus of claim 14, wherein the apparatus further comprises: 休眠设置模块,用于在未接收到与所述通行证获取请求对应的通行证响应信息时,按照第一预设休眠时间进入休眠;在第一预设休眠时间结束后,触发所述第一发送模块。a sleep setting module, configured to enter sleep according to a first preset sleep time when the pass response information corresponding to the pass acquisition request is not received; after the end of the first preset sleep time, trigger the first sending module . 18.根据权利要求14所述的装置,其特征在于,所述装置还包括:18. The apparatus of claim 14, wherein the apparatus further comprises: 第五发送模块,用于在接收到所述业务控制服务器,发送的与所述数据获取请求对应的数据后,发送所述通行证至所述通行证管理服务器。The fifth sending module is configured to send the pass to the pass management server after receiving the data corresponding to the data acquisition request sent by the service control server. 19.一种通行证管理服务器,其特征在于,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使:实现权利要求1~4任一项所述的方法步骤。19. A pass management server, characterized by comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor is executed by the processor. The machine-executable instructions cause: implementing the method steps of any one of claims 1-4. 20.一种业务服务器,其特征在于,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令,所述处理器被所述机器可执行指令促使:实现权利要求5~9任一项所述的方法步骤。20. A service server, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is executed by the processor. Machine-executable instructions cause to implement the method steps of any of claims 5-9. 21.一种计算机可读存储介质,其特征在于,应用于通行证管理服务器,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时,实现权利要求1~4任一项所述的方法步骤。21. A computer-readable storage medium, characterized in that it is applied to a passport management server, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any one of claims 1 to 4 can be realized. The method steps of a. 22.一种计算机可读存储介质,其特征在于,应用于业务服务器,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时,实现权利要求5~9任一项所述的方法步骤。22. A computer-readable storage medium, characterized in that, when applied to a service server, a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any one of claims 5 to 9 is implemented. The method steps described in item. 23.一种数据获取系统,其特征在于,所述系统包括:通行证管理服务器、业务服务器和业务控制服务器;23. A data acquisition system, characterized in that the system comprises: a passport management server, a service server and a service control server; 所述业务服务器,用于当存在待获取数据时,发送通行证获取请求至所述通行证管理服务器,其中,所述业务服务器包括N个,所述N为大于或等于1的整数;the business server, configured to send a pass obtaining request to the pass management server when there is data to be obtained, wherein the business server includes N, and N is an integer greater than or equal to 1; 所述通行证管理服务器,用于接收N个业务服务器发送的N个通行证获取请求,判断所述N是否大于预设通行证发放数量M,在所述N大于所述M时,从所述N个通行证获取请求中选择M个通行证获取请求,并获取所述M个通行证获取请求中携带的M个业务服务器的标识信息,将预先存储的M个通行证分别添加至M个通行证响应信息中,分别发送所述M个通行证响应信息,至与所属的M个请求发送方业务服务器的标识信息对应的业务服务器,其中,每个所述通行证获取请求携带有所属的请求发送方业务服务器的标识信息,所述M为大于或等于1的整数;The pass management server is configured to receive N pass acquisition requests sent by N service servers, determine whether the N is greater than the preset number M of passes issued, and when the N is greater than the M, select the N passes from the N passes. In the acquisition request, select M pass acquisition requests, and acquire the identification information of M service servers carried in the M pass acquisition requests, add the pre-stored M passes to the M pass response information, respectively, send the The M pieces of pass response information are sent to the service servers corresponding to the identification information of the M request-sender service servers to which they belong, wherein each of the pass-acquisition requests carries the identification information of the request-sender service server to which they belong, and the M is an integer greater than or equal to 1; 所述业务服务器,还用于当接收到所述通行证管理服务器发送的所述通行证响应信息时,获取所述通行证响应信息中的通行证,将所述通行证响应信息中的通行证添加至数据获取请求中,并发送所述数据获取请求至所述业务控制服务器;The service server is further configured to, when receiving the pass response information sent by the pass management server, acquire the pass in the pass response information, and add the pass in the pass response information to the data acquisition request , and send the data acquisition request to the service control server; 所述业务控制服务器,用于接收所述业务服务器发送的所述数据获取请求,并将与所述数据获取请求对应的待获取数据发送至所述业务服务器。The service control server is configured to receive the data acquisition request sent by the service server, and send the data to be acquired corresponding to the data acquisition request to the service server.
CN201711183112.5A 2017-11-23 2017-11-23 Data acquisition method, device, electronic equipment, storage medium and system Active CN108572870B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711183112.5A CN108572870B (en) 2017-11-23 2017-11-23 Data acquisition method, device, electronic equipment, storage medium and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711183112.5A CN108572870B (en) 2017-11-23 2017-11-23 Data acquisition method, device, electronic equipment, storage medium and system

Publications (2)

Publication Number Publication Date
CN108572870A CN108572870A (en) 2018-09-25
CN108572870B true CN108572870B (en) 2020-11-06

Family

ID=63575914

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711183112.5A Active CN108572870B (en) 2017-11-23 2017-11-23 Data acquisition method, device, electronic equipment, storage medium and system

Country Status (1)

Country Link
CN (1) CN108572870B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546532B (en) * 2010-12-07 2016-03-30 中国移动通信集团公司 Capacity calling method, request unit, platform and system
CN103514164B (en) * 2012-06-15 2016-12-21 阿里巴巴集团控股有限公司 Data migration method and system
CN105610934A (en) * 2015-12-25 2016-05-25 北京奇虎科技有限公司 Data request concurrency processing method and apparatus
CN106843170B (en) * 2016-11-30 2019-06-14 浙江中控软件技术有限公司 Token-based task scheduling method

Also Published As

Publication number Publication date
CN108572870A (en) 2018-09-25

Similar Documents

Publication Publication Date Title
Han et al. Evaluating blockchains for IoT
US10491632B1 (en) Methods for reducing compliance violations in mobile application management environments and devices thereof
CN104219316B (en) A kind of call request processing method and processing device in distributed system
US12192325B2 (en) Blockchain platform service
US11716264B2 (en) In situ triggered function as a service within a service mesh
WO2020133967A1 (en) Method for scheduling shared computing resources, shared computing system, server, and storage medium
CN107241281B (en) Data processing method and device
WO2019232071A1 (en) Aggregation of scalable network flow events
US20180091449A1 (en) Event-driven policy-based distributed container management system
US10530726B2 (en) Email notifications
US9749354B1 (en) Establishing and transferring connections
US9104488B2 (en) Support server for redirecting task results to a wake-up server
WO2015149625A1 (en) Method and system for network element access with multi-instance parallelism
WO2013152565A1 (en) Capability aggregation and exposure method and system
WO2020216077A1 (en) Blockchain event deduplication method and apparatus, and computer device and storage medium
WO2016149945A1 (en) Life cycle event processing method and vnfm
US9838482B1 (en) Maintaining client/server session affinity through load balancers
CN109600240A (en) Group Communications method and device
CN106533961B (en) Flow control method and device
US11861386B1 (en) Application gateways in an on-demand network code execution system
CN112733001A (en) Method and device for acquiring subscription information and electronic equipment
CN110297706A (en) A kind of inserting method based on Eureka-Server project
US9942354B1 (en) Managing service message rates in a computing service environment
CN108572870B (en) Data acquisition method, device, electronic equipment, storage medium and system
CN111831402B (en) Method, apparatus and computer program product for managing software functions

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant