WO2017045537A1 - Method and device for processing request in distributed system - Google Patents
Method and device for processing request in distributed system Download PDFInfo
- Publication number
- WO2017045537A1 WO2017045537A1 PCT/CN2016/097997 CN2016097997W WO2017045537A1 WO 2017045537 A1 WO2017045537 A1 WO 2017045537A1 CN 2016097997 W CN2016097997 W CN 2016097997W WO 2017045537 A1 WO2017045537 A1 WO 2017045537A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- request
- sub
- distributed system
- processing
- service request
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/567—Integrating service provisioning from a plurality of service providers
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5038—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
Definitions
- the present application relates to the field of distributed system technologies, and in particular, to a processing method for a request in a distributed system.
- the application also relates to a processing device for requesting in a distributed system.
- a user-initiated service request often cannot directly obtain an implementation object, and needs to perform collaborative processing on the user's service request through multiple intermediate service components, and finally completes the operation.
- a user's simple write request for a file may require intermediate service components such as scheduling, communication, indexing, and distributed storage to complete a file write operation.
- intermediate service components are generally deployed in The different processes of the server and the different software components are due to the complexity of the distributed system, which makes the performance analysis of the distributed system more difficult.
- the processing method of the request in the distributed system includes: sampling a user request received by each server in the distributed system; generating a corresponding identifier for the user request sampled by each server, the identifier
- the variable is passed to the current thread as a variable
- the tracking interface is injected into the running process of each server in the distributed system, and when the process runs to the tracking interface, if the current process is detected,
- the identifier is associated with the related information of the function indicated by the tracking interface and generates a log; the generated logs are respectively summarized according to the corresponding identifier.
- the processing method of the request in the distributed system obtains the user request as a sample from the distributed system in a sampling manner, and passes the abnormal request that affects the performance of the sample (especially the request for processing timeout, that is, Slow request) analysis to improve the performance of distributed systems, low efficiency, and flaws.
- slow requests are relatively small compared to all requests.
- the sampling rate is low, generally one thousandth or even lower, so it is captured by sampling.
- Slow request ratio Less, the effect on the performance improvement of the distributed system is small; and the slow request is analyzed by collecting the log, and the adjustment made to the distributed system according to the analysis result of the slow request needs to wait for the next iteration period (log analysis period)
- the iteration cycle is generally at the minute level (5-10 minutes), and the efficiency is low; in addition, many distributed systems applied to cloud services require capturing each slow request, which is requested in the distributed system provided by the prior art. The processing method cannot be satisfied and there are defects.
- the present application provides a processing method for a request in a distributed system to solve the problems of low efficiency and drawbacks existing in the prior art.
- the application also relates to a processing device for requesting in a distributed system.
- the application provides a processing method for a request in a distributed system, including:
- the execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requester.
- the generating an execution record of the sub-request includes:
- the summarizing the execution record of the sub-request associated with the service request corresponding to the sub-request, and generating the execution record of the service request and returning to the requesting party specifically:
- a summary of the execution record of the business request is returned to the requestor.
- the calling link includes:
- a summary of the execution record of the business request is returned to the requestor.
- the service request is split into at least one and the service.
- the service request is split into at least one and the service.
- the dimension participating in the data operation when processing according to the service request in the distributed system splitting the service request into at least one sub-request step associated with the service request, and executing in the Before the sub-request is distributed to the corresponding processing unit in the distributed system for performing the processing step, the following steps are performed:
- the sub-request is distributed to a corresponding processing unit in the distributed system for processing, and specifically includes:
- a summary of the execution record of the service request is recorded in a log corresponding to the service request.
- the dimensions include:
- the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
- the processing unit is composed of at least one server in the distributed system.
- At least one of the following information is recorded in the execution record:
- the identifier the identity of the server participating in the processing, the processing time, the name of the function called, the time the function was called And related information generated at the time of the call.
- At least one of the following information is recorded in the summary of the execution record:
- the identifier The identifier, the identity of the server participating in the processing, and the processing time.
- the exception log records an exception information generated when the function is called.
- the application also provides a processing device for requesting in a distributed system, comprising:
- a service request receiving unit configured to receive a service request initiated by the requesting party
- a service request splitting unit configured to split the service request into at least one sub-request associated with the service request according to a dimension involved in the data operation when the service request is processed in the distributed system
- a sub-request distribution unit configured to distribute the sub-request to a corresponding processing unit in the distributed system for processing
- a sub-request judging unit configured to determine whether a processing time of the sub-request exceeds a preset time threshold of each processing unit in the distributed system
- the execution record generating unit is configured to generate an execution record of the subrequest
- the execution record summary feedback unit is configured to summarize an execution record of the sub-request associated with the service request corresponding to the sub-request, and generate an execution record of the service request to be returned to the requesting party.
- the execution record generating unit specifically includes:
- sub-request execution record generation sub-unit for generating an execution record of the sub-request
- a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests
- a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request is a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
- the performing record summary feedback unit specifically includes:
- sub-request summary summary sub-unit configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request
- a service request summary generation subunit configured to generate a summary of an execution record of the service request
- the service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
- the following unit is performed:
- a sub-request execution record generating unit configured to generate an execution record of the sub-request
- a sub-request summary extracting unit configured to extract a summary of an execution record of the sub-request
- sub-request summary summary unit for summarizing summaries of execution records of the sub-requests
- a service request summary generating unit configured to generate a summary of an execution record of the service request
- a service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
- the processing device requested in the distributed system includes:
- a service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
- the processing device requested in the distributed system includes:
- a sub-request identifier generating unit configured to generate an identifier corresponding to each of the sub-requests.
- the sub-request distribution unit specifically includes:
- a sub-request distribution sub-unit configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system
- the processing unit corresponding to the dimension participating in the data operation when processing in the system.
- the method for processing a request in a distributed system includes: receiving a service request initiated by a requester; and participating in a data operation dimension in processing in the distributed system according to the service request, splitting the service request into at least one The service requests the associated sub-request; the sub-request is distributed to a corresponding processing unit in the distributed system for processing; and it is determined whether the processing time of the sub-request exceeds a preset of the processing unit in the distributed system a time threshold; if yes, generating an execution record of the sub-request; summarizing an execution record of the sub-request associated with the service request corresponding to the sub-request, and generating an execution record of the service request to be returned to the requesting party.
- the processing method of the request in the distributed system sets a corresponding time threshold for the processing unit in the distributed system, and filters out the sub-request with the processing time exceeding the corresponding time threshold by the time threshold in the processing unit, that is, the slow request.
- the processing of the slow request is more comprehensive and more efficient. At the same time, the processing efficiency of the distributed system is improved.
- FIG. 1 is a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application
- FIG. 2 is a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
- the present application provides a processing method for a request in a distributed system, and the present application further provides a processing device for requesting in a distributed system, which is described in detail below with reference to the accompanying drawings of the embodiments provided herein, and Each step is explained.
- the processing method for requesting in a distributed system is as follows:
- FIG. 1 there is shown a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application. Furthermore, the relationship between the various steps of the processing method embodiment of the request in the distributed system is determined according to FIG.
- Step S101 Receive a service request initiated by the requesting party.
- the requesting party refers to a user of a distributed system, such as a user who uses or rents an Open Structured Data Service (OTS).
- Open Structured Data Service is a multi-tenant cloud service that provides cloud services to users. Rent a business.
- the service request refers to a user-initiated user request in a distributed system.
- a service request involves more types of data operations
- when the service request is processed in a distributed system it may be split into multiple sub-requests, which are respectively processed by corresponding processing units in the distributed system. For example, if the service request involves data reading, it is processed by a processing unit dedicated to data reading in the distributed system; and if the service request involves data writing, data query, and data deletion, the operation is performed in a distributed system. When processed, it is split into three sub-requests, which are processed by processing units for data writing, data query, and data deletion in the distributed system.
- processing unit in the distributed system is composed of servers in a distributed system, and each subsystem includes at least one server.
- each service request has a unique corresponding identifier, such as for each service request With a unique corresponding ID.
- sub-requests also have respective corresponding identifiers, such as respectively assigning IDs for sub-requests.
- sub-requests are obtained by splitting according to service requests. Therefore, there is an association relationship between service requests and sub-requests.
- the association between the service request and the sub-request is determined according to an association relationship between an identifier of the service request and an identifier of the sub-request. For example, if the ID corresponding to the service request is 201508070024, the ID corresponding to the sub-request associated with the service request may be set to 201508070001_1, 201508070001_2, . . . , 201508070001_x, or 20150807000101, 20150807000102, . . . , 201508070001x.
- the time threshold is used to filter the slow request in the distributed system.
- the processing time is exceeded.
- the pre-set time threshold then the service request or the sub-request is determined to be a slow request, and vice versa.
- the step is performed, that is, after receiving the service request initiated by the requesting party, performing the step of generating an identifier corresponding to the service request uniquely.
- Step S102 Participate in a dimension of the data operation according to the service request in the distributed system, and split the service request into at least one sub-request associated with the service request.
- the dimension of the service request participating in the data operation when processed in the distributed system refers to the type of data operation involved when the service request is processed in the distributed system.
- the dimensions include: data reading, data writing, data query, and data deletion; in a specific implementation, the dimension may also include other types of data operations, which are not limited herein.
- the service request is split into at least one sub-request associated with the service request, and the sub-request is distributed by the system.
- the corresponding processing unit in the process is processed.
- the step of generating an identifier corresponding to each of the sub-requests is performed.
- Step S103 distributing the sub-request to a corresponding processing unit in the distributed system for processing.
- the processing unit is set according to the dimension of the data operation when the service request is processed in the distributed system, for example, the service request participates in processing in the distributed system.
- Data operations dimensions such as data reading, data writing, data query, and data deletion are set in a distributed system for processing processing units involving data reading, data writing, data query, and data deletion;
- step S102 in the distributed system, the service request is distributed according to the service request.
- the dimension involved in the data operation during processing is split into at least one sub-request associated with the service request;
- the dimensions of the two are consistent with each other, that is, the service request is split according to the processing unit in the distributed system, and split into at least one sub-request for processing in the corresponding processing unit.
- a sub-request corresponding to each type of service request may be generated.
- the sub-request is distributed to a corresponding processing unit in the distributed system for processing.
- the sub-requests are respectively sent to the pre-set and the sub-requests are processed in the distributed system when the sub-requests are processed in the distributed system.
- the processing unit corresponding to the dimension of the data operation.
- Step S104 Determine whether the processing time of the sub-request exceeds a preset time threshold of the processing unit in the distributed system.
- a corresponding time threshold is preset for each processing unit in the distributed system.
- the time threshold is a time threshold set in advance for a processing unit in a distributed system.
- the sub-request associated with the service request is processed by each processing unit of the distributed system, once the processing time of the sub-request in any one of the processing units of the distributed system exceeds a preset time threshold of the processing unit, The subrequest is determined to be a slow request, and vice versa.
- a corresponding time threshold may be preset for each server in the processing unit.
- the processing request associated with the sub-request of the server exceeds the preset time threshold of the server, the service request or the The subrequest is determined to be a slow request, and vice versa.
- a time threshold set in advance for the processing unit in the distributed system may be dynamically adjusted.
- Step S105 generating an execution record of the subrequest.
- step S104 it is determined whether the processing time of the sub-request exceeds the preset time threshold of the processing unit in the distributed system, that is, the determination is
- the subrequest is a slow request.
- an execution record of the slow request ie, the subrequest
- the service request association corresponding to the slow request is summarized.
- An execution record of the child request, and an execution record of the generated business request is returned to the requester.
- the execution record refers to the detailed information when executed in a distributed system.
- the execution record records at least one piece of information: an identifier, an identifier of a server participating in the processing, a processing time, a function name of the call, a time of calling the function, and related information generated when the call is made.
- execution information of a subrequest in a distributed system is:
- 201508070001_1 refers to the identifier (ID) of the sub-request
- A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
- 1s, 2s, 1s refers to the time taken to process the servers at a1, a2, and a3 respectively;
- Read() refers to the name of the function being called
- Xx:xx:xx refers to the time point when the function is called
- Xxxx is the result of a function call, that is, the related information generated when the function is called.
- the step specifically includes the following three sub-steps:
- any slow request has its own corresponding exception log.
- the abnormality log is used to record an execution record of a slow request.
- the exception log records an exception information generated when the function is called, such as an exception log of the JAVA function.
- the performance loss when performing corresponding data processing in the distributed system can be reduced; on the other hand, the distribution can be reduced.
- At least one piece of information is recorded in the summary of the execution record: an identifier, an identifier of a server participating in the processing, and a processing time.
- the summary of the execution record of the extracted subrequest is:
- 201508070001_1 refers to the identifier (ID) of the sub-request
- A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
- 1s, 2s, and 1s refer to the length of time spent on processing at the a1, a2, and a3 servers.
- other information in the execution record may also be used as a digest, as long as it can be ensured that the slow request can be located by the digest or the reason for the slow request can be analyzed.
- Step S106 the execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requesting party.
- the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and the execution record of the service request is returned to the requesting party.
- the requesting party may perform the record according to the execution record. Troubleshoot the problem and determine whether it is a code problem, a network problem, or a distributed system problem. If it is a distributed system problem, you can get a corresponding solution by feeding back to the administrator of the distributed system.
- any one of the sub-requests in the distributed system is determined to be a slow request
- the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and an execution record of the service request is generated and returned to the The requesting party is very helpful in analyzing and locating the slow request by the requesting party.
- step S105 based on the summary of the execution record of the sub-request, preferably, the step specifically includes the following three sub-steps:
- the role of the invoking link is to determine the location of the sub-request associated with the service request in the distributed system, thereby acting as a "location".
- the calling link refers to a sequential combination of all servers in the distributed system that participate in processing the service request associated sub-request.
- sub-request A there are two sub-requests for a service request: sub-request A and sub-request B.
- sub-request A When sub-request A is processed in a distributed system, the servers participating in processing the request A have a1, a2, and a3, and sub-request A Distributed
- the calling link in the system (the sequential combination of all the servers participating in the processing of the sub-request) is: a1->a2->a3, or (a1, a2, a3); correspondingly, the sub-request B is in the distributed system
- the processing link is: c1->c2->c3, or (c1, c2, c3); the calling link of the service request is: a1->a2->a3, c1->c2->c3, or (a1) , a2, a3; c1, c2, c3).
- the step is executed, that is, after generating the digest of the execution record of the service request, performing a sub-step of recording the summary of the execution record of the service request to the log corresponding to the service request.
- any one of the sub-requests in the distributed system is determined to be a slow request, the summary of the execution record of the sub-request involved in the invocation link of the service request corresponding to the slow request is summarized, and an execution record of the service request is generated. And returned to the requestor.
- step S104 if it is determined whether the processing time of the sub-request exceeds a time threshold set by each of the processing units in the distributed system, the determination result is no, that is, the sub-request Instead of a slow request, perform the following steps:
- a summary of the execution record of the business request is returned to the requestor.
- the summary of the execution record of the service request may also be summarized and generated according to the calling link of the service request.
- the sub-request is not a slow request, except the above steps.
- other processing may be performed on the sub-request or the service request, or no processing is performed, which is not limited thereto.
- the processing method of the request in the distributed system sets a corresponding time threshold for the processing unit in the distributed system, and filters out the processing time beyond the corresponding time threshold by using the time threshold in the processing unit.
- the request that is, the slow request, captures all the slow requests in the distributed system, and the execution records of each slow request are recorded in the corresponding exception logs, and are not missed, and the execution record of the service request is recorded to the corresponding In the log, the information collected for slow requests is more complete, and the analysis of the location and cause of slow requests Provided convenience; in addition, according to the execution record of the sub-request, the execution record of the service request is obtained, and the execution record of the service request is returned to the requesting party, and the processing of the slow request is more comprehensive and more efficient, and the distributed system is improved. Processing efficiency.
- the processing device requested in a distributed system provided by the present application is implemented as follows:
- a processing method for a request in a distributed system is provided.
- the present application further provides a processing device for requesting in a distributed system, which will be described below with reference to the accompanying drawings.
- FIG. 2 there is shown a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
- the application provides a processing device for requesting in a distributed system, including:
- the service request receiving unit 201 is configured to receive a service request initiated by the requesting party;
- the service request splitting unit 202 is configured to split the service request into at least one sub-request associated with the service request according to the dimension of the data operation participating in processing in the distributed system according to the service request;
- a sub-request distribution unit 203 configured to distribute the sub-request to a corresponding processing unit in the distributed system for processing
- the sub-request judging unit 204 is configured to determine whether the processing time of the sub-request exceeds a preset time threshold of each of the processing units in the distributed system;
- the execution record generating unit 205 is configured to generate an execution record of the subrequest
- the execution record summary feedback unit 206 is configured to summarize execution records of the sub-requests associated with the service request corresponding to the sub-request, and generate an execution record of the service request to be returned to the requesting party.
- the execution record generating unit 205 specifically includes:
- sub-request execution record generation sub-unit for generating an execution record of the sub-request
- a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests
- a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request is a sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
- the execution record summary feedback unit 206 specifically includes:
- sub-request summary summary sub-unit configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request
- a service request summary generation subunit configured to generate a summary of an execution record of the service request
- the service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
- the calling link includes:
- a sub-request execution record generating unit configured to generate an execution record of the sub-request
- a sub-request summary extracting unit configured to extract a summary of an execution record of the sub-request
- sub-request summary summary unit for summarizing summaries of execution records of the sub-requests
- a service request summary generating unit configured to generate a summary of an execution record of the service request
- a service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
- the processing device requested in the distributed system includes:
- a service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
- the processing device requested in the distributed system includes:
- a sub-request identifier generating unit configured to generate an identifier corresponding to each of the sub-requests.
- the sub-request distribution unit 203 specifically includes:
- a sub-request distribution sub-unit configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system
- the processing unit corresponding to the dimension participating in the data operation when processing in the system.
- the processing device requested in the distributed system includes:
- the record recording log unit is configured to record a summary of the execution record of the service request into a log corresponding to the service request.
- the dimensions include:
- the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
- the processing unit is composed of at least one server in the distributed system.
- At least one of the following information is recorded in the execution record:
- the identifier the identity of the server participating in the processing, the processing time, the name of the function being called, the time the function was called, and related information generated at the time of the call.
- At least one of the following information is recorded in the summary of the execution record:
- the identifier The identifier, the identity of the server participating in the processing, and the processing time.
- the exception log records an exception information generated when the function is called.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
- computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
- embodiments of the present application can be provided as a method, system, or computer program product.
- the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
- the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
本申请要求2015年09月14日递交的申请号为201510582405.5、发明名称为“一种分布式系统中请求的处理方法以及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510582405.5, filed on Sep. 14, 2015, entitled,,,,,,,,,,,,,, in.
本申请涉及分布式系统技术领域,具体涉及一种分布式系统中请求的处理方法。本申请同时涉及一种分布式系统中请求的处理装置。The present application relates to the field of distributed system technologies, and in particular, to a processing method for a request in a distributed system. The application also relates to a processing device for requesting in a distributed system.
随着计算机技术和网络技术的不断发展,分布式系统架构的应用越来越广泛。在分布式系统中,用户发起的服务请求往往不能直接获得实现对象,需要经过多个中间服务构件对用户的服务请求进行协同处理,并最终完成操作。比如在现有的云计算平台中,用户简单的一次写文件的访问请求,可能需要经过调度、通信、索引以及分布式存储等中间服务构件,才能完成写文件操作,这些中间服务构件一般部署在服务器的不同进程上,并且由不同的软件构成,正是由于分布式系统的复杂性,导致对分布式系统的性能分析的难度较大。With the continuous development of computer technology and network technology, the application of distributed system architecture is more and more extensive. In a distributed system, a user-initiated service request often cannot directly obtain an implementation object, and needs to perform collaborative processing on the user's service request through multiple intermediate service components, and finally completes the operation. For example, in an existing cloud computing platform, a user's simple write request for a file may require intermediate service components such as scheduling, communication, indexing, and distributed storage to complete a file write operation. These intermediate service components are generally deployed in The different processes of the server and the different software components are due to the complexity of the distributed system, which makes the performance analysis of the distributed system more difficult.
目前,现有技术提供的分布式系统中请求的处理方法,包括:对分布式系统中各服务器接收到的用户请求进行采样;对各服务器采样到的用户请求生成对应的标识符,所述标识符在所述用户请求调用线程时会作为变量被传递到当前线程中;预先对分布式系统中各服务器运行的进程注入跟踪接口,当进程运行到该跟踪接口时,若检测到当前该进程包含用户请求对应的标识符,则将所述标识符和跟踪接口所指示的函数的相关信息对应并生成日志;将生成的日志按照所对应的标识符分别进行汇总。At present, the processing method of the request in the distributed system provided by the prior art includes: sampling a user request received by each server in the distributed system; generating a corresponding identifier for the user request sampled by each server, the identifier When the user requests the calling thread, the variable is passed to the current thread as a variable; the tracking interface is injected into the running process of each server in the distributed system, and when the process runs to the tracking interface, if the current process is detected, When the user requests the corresponding identifier, the identifier is associated with the related information of the function indicated by the tracking interface and generates a log; the generated logs are respectively summarized according to the corresponding identifier.
上述现有技术提供的分布式系统中请求的处理方法存在明显的缺陷。The processing method of the request in the distributed system provided by the above prior art has obvious drawbacks.
上述现有技术提供的分布式系统中请求的处理方法,以采样的方式从分布式系统中获取用户请求作为样本,通过对样本中影响其性能的异常请求(尤其是处理时间超时的请求,即慢请求)进行分析,以提高分布式系统的性能,效率较低,且存在缺陷。The processing method of the request in the distributed system provided by the above prior art obtains the user request as a sample from the distributed system in a sampling manner, and passes the abnormal request that affects the performance of the sample (especially the request for processing timeout, that is, Slow request) analysis to improve the performance of distributed systems, low efficiency, and flaws.
在分布式系统中,慢请求相比全部请求而言,是比较少的,采样为了减少对性能的影响,采样率较低,一般是千分之一甚至更低,因此通过采样的方式捕捉到的慢请求比 较少,对分布式系统性能提升的作用很小;并通过收集日志的方式来分析慢请求,根据慢请求的分析结果对分布式系统做出的调整需要等待下一个迭代周期(日志分析周期)才能生效,迭代周期一般在分钟级别(5-10分钟),效率低;此外,许多应用于云服务的分布式系统中,要求捕捉每个慢请求,现有技术提供的分布式系统中请求的处理方法无法满足,存在缺陷。In a distributed system, slow requests are relatively small compared to all requests. In order to reduce the impact on performance, the sampling rate is low, generally one thousandth or even lower, so it is captured by sampling. Slow request ratio Less, the effect on the performance improvement of the distributed system is small; and the slow request is analyzed by collecting the log, and the adjustment made to the distributed system according to the analysis result of the slow request needs to wait for the next iteration period (log analysis period) In order to take effect, the iteration cycle is generally at the minute level (5-10 minutes), and the efficiency is low; in addition, many distributed systems applied to cloud services require capturing each slow request, which is requested in the distributed system provided by the prior art. The processing method cannot be satisfied and there are defects.
发明内容Summary of the invention
本申请提供一种分布式系统中请求的处理方法,以解决现有技术的存在的效率较低和存在缺陷的问题。The present application provides a processing method for a request in a distributed system to solve the problems of low efficiency and drawbacks existing in the prior art.
本申请同时涉及一种分布式系统中请求的处理装置。The application also relates to a processing device for requesting in a distributed system.
本申请提供一种分布式系统中请求的处理方法,包括:The application provides a processing method for a request in a distributed system, including:
接收请求方发起的业务请求;Receiving a service request initiated by the requesting party;
按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;Dividing the service request into at least one sub-request associated with the service request according to a dimension of the data operation involved in processing the service request in the distributed system;
将所述子请求分发至所述分布式系统中的相应处理单元进行处理;Distributing the sub-request to a corresponding processing unit in the distributed system for processing;
判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;Determining whether the processing time of the sub-request exceeds a preset time threshold of each processing unit in the distributed system;
若是,生成所述子请求的执行记录;If yes, generating an execution record of the subrequest;
汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。The execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requester.
可选的,所述生成所述子请求的执行记录,具体包括:Optionally, the generating an execution record of the sub-request includes:
生成所述子请求的执行记录;Generating an execution record of the subrequest;
将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;Recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests;
提取所述子请求的执行记录的摘要。Extract a summary of the execution record of the subrequest.
可选的,所述汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,具体包括:Optionally, the summarizing the execution record of the sub-request associated with the service request corresponding to the sub-request, and generating the execution record of the service request and returning to the requesting party, specifically:
汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;Summarizing a summary of execution records of the sub-requests involved in the calling link of the service request corresponding to the sub-request;
生成该业务请求的执行记录的摘要;Generate a summary of the execution record of the business request;
将该业务请求的执行记录的摘要返回给所述请求方。A summary of the execution record of the business request is returned to the requestor.
可选的,所述调用链路包括: Optionally, the calling link includes:
所述分布式系统中、参与处理该业务请求关联子请求的所有服务器的顺序组合。In the distributed system, the sequential combination of all servers participating in processing the service request associated subrequest.
可选的,若所述判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值步骤的判断结果为否,执行下述步骤:Optionally, if the determining whether the processing time of the sub-request exceeds a time threshold step preset by the processing unit in the distributed system is no, perform the following steps:
生成所述子请求的执行记录;Generating an execution record of the subrequest;
提取所述子请求的执行记录的摘要;Extracting a summary of the execution record of the subrequest;
汇总所述子请求的执行记录的摘要;Summarizing a summary of the execution records of the subrequests;
生成该业务请求的执行记录的摘要;Generate a summary of the execution record of the business request;
将该业务请求的执行记录的摘要返回给所述请求方。A summary of the execution record of the business request is returned to the requestor.
可选的,所述接收请求方发起的业务请求步骤执行之后,并在所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之前,执行下述步骤:Optionally, after receiving the service request step initiated by the requesting party, and performing the data operation dimension according to the service request in the distributed system, the service request is split into at least one and the service. Before requesting the associated subrequest step, perform the following steps:
生成该业务请求唯一对应的标识符。Generate an identifier that uniquely corresponds to the business request.
可选的,所述按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求步骤执行之后,并在所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理步骤执行之前,执行下述步骤:Optionally, the dimension participating in the data operation when processing according to the service request in the distributed system, splitting the service request into at least one sub-request step associated with the service request, and executing in the Before the sub-request is distributed to the corresponding processing unit in the distributed system for performing the processing step, the following steps are performed:
生成所述子请求各自对应的标识符。Generating an identifier corresponding to each of the sub-requests.
可选的,所述将所述子请求分发至所述分布式系统中的相应处理单元进行处理,具体包括:Optionally, the sub-request is distributed to a corresponding processing unit in the distributed system for processing, and specifically includes:
按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。And respectively participating in the dimension of the data operation when the sub-request is processed in the distributed system, respectively sending the sub-request to a pre-set, participating in data operation when the sub-request is processed in the distributed system The processing unit corresponding to the dimension.
可选的,所述生成该业务请求的执行记录的摘要子步骤执行之后,执行下述子步骤:Optionally, after the digest substep of generating the execution record of the service request is performed, performing the following substeps:
将该业务请求的执行记录的摘要记录到该业务请求对应的日志中。A summary of the execution record of the service request is recorded in a log corresponding to the service request.
可选的,所述维度包括:Optionally, the dimensions include:
数据读取、数据写入、数据查询和数据删除。Data reading, data writing, data query and data deletion.
可选的,该业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。Optionally, the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
可选的,所述处理单元由所述分布式系统中的至少一台服务器组成。Optionally, the processing unit is composed of at least one server in the distributed system.
可选的,所述执行记录中记录有下述至少一项信息:Optionally, at least one of the following information is recorded in the execution record:
标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间 和调用时产生的相关信息。The identifier, the identity of the server participating in the processing, the processing time, the name of the function called, the time the function was called And related information generated at the time of the call.
可选的,所述执行记录的摘要中记录有下述至少一项信息:Optionally, at least one of the following information is recorded in the summary of the execution record:
标识符、参与处理的服务器的标识、处理时间。The identifier, the identity of the server participating in the processing, and the processing time.
可选的,所述异常日志中记录有调用函数时产生的异常信息。Optionally, the exception log records an exception information generated when the function is called.
本申请还提供一种分布式系统中请求的处理装置,包括:The application also provides a processing device for requesting in a distributed system, comprising:
业务请求接收单元,用于接收请求方发起的业务请求;a service request receiving unit, configured to receive a service request initiated by the requesting party;
业务请求拆分单元,用于按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;a service request splitting unit, configured to split the service request into at least one sub-request associated with the service request according to a dimension involved in the data operation when the service request is processed in the distributed system;
子请求分发单元,用于将所述子请求分发至所述分布式系统中的相应处理单元进行处理;a sub-request distribution unit, configured to distribute the sub-request to a corresponding processing unit in the distributed system for processing;
子请求判断单元,用于判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;a sub-request judging unit, configured to determine whether a processing time of the sub-request exceeds a preset time threshold of each processing unit in the distributed system;
若是,则进入执行记录生成单元;If yes, enter the execution record generation unit;
所述执行记录生成单元,用于生成所述子请求的执行记录;The execution record generating unit is configured to generate an execution record of the subrequest;
执行记录汇总反馈单元,用于汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。The execution record summary feedback unit is configured to summarize an execution record of the sub-request associated with the service request corresponding to the sub-request, and generate an execution record of the service request to be returned to the requesting party.
可选的,所述执行记录生成单元,具体包括:Optionally, the execution record generating unit specifically includes:
子请求执行记录生成子单元,用于生成所述子请求的执行记录;a sub-request execution record generation sub-unit for generating an execution record of the sub-request;
子请求异常日志记录子单元,用于将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests;
子请求摘要提取子单元,用于提取所述子请求的执行记录的摘要。A sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
可选的,所述执行记录汇总反馈单元,具体包括:Optionally, the performing record summary feedback unit specifically includes:
子请求摘要汇总子单元,用于汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;a sub-request summary summary sub-unit, configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request;
业务请求摘要生成子单元,用于生成该业务请求的执行记录的摘要;a service request summary generation subunit, configured to generate a summary of an execution record of the service request;
业务请求摘要返回子单元,用于将该业务请求的执行记录的摘要返回给所述请求方。The service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
可选的,若所述子请求判断单元的判断结果为否,则进行下述单元:Optionally, if the judgment result of the sub-request judgment unit is no, the following unit is performed:
子请求执行记录生成单元,用于生成所述子请求的执行记录;a sub-request execution record generating unit, configured to generate an execution record of the sub-request;
子请求摘要提取单元,用于提取所述子请求的执行记录的摘要;a sub-request summary extracting unit, configured to extract a summary of an execution record of the sub-request;
子请求摘要汇总单元,用于汇总所述子请求的执行记录的摘要; a sub-request summary summary unit for summarizing summaries of execution records of the sub-requests;
业务请求摘要生成单元,用于生成该业务请求的执行记录的摘要;a service request summary generating unit, configured to generate a summary of an execution record of the service request;
业务请求摘要返回单元,用于将该业务请求的执行记录的摘要返回给所述请求方。A service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
可选的,所述分布式系统中请求的处理装置,包括:Optionally, the processing device requested in the distributed system includes:
业务请求标识符生成单元,用于生成该业务请求唯一对应的标识符。A service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
可选的,所述分布式系统中请求的处理装置,包括:Optionally, the processing device requested in the distributed system includes:
子请求标识符生成单元,用于生成所述子请求各自对应的标识符。a sub-request identifier generating unit, configured to generate an identifier corresponding to each of the sub-requests.
可选的,所述子请求分发单元,具体包括:Optionally, the sub-request distribution unit specifically includes:
子请求分发子单元,用于按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。a sub-request distribution sub-unit, configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system The processing unit corresponding to the dimension participating in the data operation when processing in the system.
与现有技术相比,本申请具有以下优点:Compared with the prior art, the present application has the following advantages:
本申请提供的分布式系统中请求的处理方法,包括:接收请求方发起的业务请求;按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;将所述子请求分发至所述分布式系统中的相应处理单元进行处理;判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;若是,生成所述子请求的执行记录;汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。The method for processing a request in a distributed system provided by the present application includes: receiving a service request initiated by a requester; and participating in a data operation dimension in processing in the distributed system according to the service request, splitting the service request into at least one The service requests the associated sub-request; the sub-request is distributed to a corresponding processing unit in the distributed system for processing; and it is determined whether the processing time of the sub-request exceeds a preset of the processing unit in the distributed system a time threshold; if yes, generating an execution record of the sub-request; summarizing an execution record of the sub-request associated with the service request corresponding to the sub-request, and generating an execution record of the service request to be returned to the requesting party.
本申请提供的分布式系统中请求的处理方法,预先针对分布式系统中的处理单元设置相应的时间阈值,通过处理单元中的时间阈值筛选出处理时间超出对应时间阈值的子请求,即慢请求,从而捕捉到分布式系统中所有的慢请求,并且根据子请求的执行记录汇总获得业务请求的执行记录,将业务请求的执行记录返回给请求方,对慢请求的处理更加全面,效率更高,同时提升了分布式系统的处理效率。The processing method of the request in the distributed system provided by the present application sets a corresponding time threshold for the processing unit in the distributed system, and filters out the sub-request with the processing time exceeding the corresponding time threshold by the time threshold in the processing unit, that is, the slow request In order to capture all the slow requests in the distributed system, and obtain the execution record of the service request according to the execution record summary of the sub-request, and return the execution record of the service request to the requesting party, and the processing of the slow request is more comprehensive and more efficient. At the same time, the processing efficiency of the distributed system is improved.
附图1是本申请提供的一种分布式系统中请求的处理方法实施例的处理流程图;1 is a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application;
附图2是本申请提供的一种分布式系统中请求的处理装置实施例的示意图。2 is a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其他方式来实施,本领域技术人员可以在不违背本申请内涵的情况 下做类似推广,因此本申请不受下面公开的具体实施的限制。Numerous specific details are set forth in the description below in order to provide a thorough understanding of the application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can do not violate the meaning of the present application. A similar promotion is made, and thus the application is not limited by the specific implementations disclosed below.
本申请提供一种分布式系统中请求的处理方法,本申请还提供一种分布式系统中请求的处理装置,以下分别结合本申请提供的实施例的附图逐一进行详细说明,并且对方法的各个步骤进行说明。The present application provides a processing method for a request in a distributed system, and the present application further provides a processing device for requesting in a distributed system, which is described in detail below with reference to the accompanying drawings of the embodiments provided herein, and Each step is explained.
本申请提供的一种分布式系统中请求的处理方法实施例如下:The processing method for requesting in a distributed system provided by the present application is as follows:
参照附图1,其示出了本申请提供的一种分布式系统中请求的处理方法实施例的处理流程图。此外,所述分布式系统中请求的处理方法实施例的各个步骤之间的关系,请根据附图1确定。Referring to Figure 1, there is shown a process flow diagram of an embodiment of a processing method of a request in a distributed system provided by the present application. Furthermore, the relationship between the various steps of the processing method embodiment of the request in the distributed system is determined according to FIG.
步骤S101,接收请求方发起的业务请求。Step S101: Receive a service request initiated by the requesting party.
对于分布式系统,影响其性能的一个重要因素是其中异常请求的数目,尤其是慢请求的数目,一旦分布式系统中的慢请求数目过多,则会导致分布式系统的处理性能大大降低,为提高分布式系统的处理效率,需要分析分布式系统中慢请求存在的原因,但由于分布式系统的复杂性,慢请求的追踪和定位的难度较大。在这种情况下,采用本申请提供的分布式系统中请求的处理方法,在充分考虑分布式系统自身特性的基础上,通过设置时间阈值,捕捉分布式系统中的所有慢请求,并通过慢请求的执行记录,可以准确的定位慢请求,从而分析慢请求发生的原因,实时做出相应处理,提高分布式系统的处理效率。For distributed systems, an important factor affecting their performance is the number of exception requests, especially the number of slow requests. Once the number of slow requests in a distributed system is too large, the processing performance of the distributed system is greatly reduced. In order to improve the processing efficiency of distributed systems, it is necessary to analyze the reasons for the existence of slow requests in distributed systems. However, due to the complexity of distributed systems, it is difficult to track and locate slow requests. In this case, using the processing method of the request in the distributed system provided by the present application, on the basis of fully considering the characteristics of the distributed system, all the slow requests in the distributed system are captured by setting the time threshold, and the slow The requested execution record can accurately locate the slow request, thereby analyzing the cause of the slow request, and correspondingly processing in real time to improve the processing efficiency of the distributed system.
所述请求方,是指分布式系统的用户,比如使用或者租用开放结构化数据服务(OTS)的用户,开放结构化数据服务(OTS)是一种多租户云服务,向用户提供云服务的租用业务。所述业务请求,是指分布式系统中的用户发起的用户请求。The requesting party refers to a user of a distributed system, such as a user who uses or rents an Open Structured Data Service (OTS). Open Structured Data Service (OTS) is a multi-tenant cloud service that provides cloud services to users. Rent a business. The service request refers to a user-initiated user request in a distributed system.
一般而言,在分布式系统中,有多个子系统,每一个子系统作为一个处理单元,处理单元用于处理业务请求。如果一个业务请求涉及的数据操作的类型比较多,该业务请求在分布式系统中进行处理时,可能被拆分为多个子请求,分别由分布式系统中的相应处理单元进行相应处理。比如业务请求涉及数据读取,则由分布式系统中专门用于数据读取的处理单元进行处理;再比如业务请求涉及数据写入、数据查询和数据删除等操作,则在分布式系统中进行处理时,被拆分为3个子请求,分别由分布式系统中用于数据写入、数据查询和数据删除的处理单元进行处理。In general, in a distributed system, there are multiple subsystems, each of which acts as a processing unit for processing business requests. If a service request involves more types of data operations, when the service request is processed in a distributed system, it may be split into multiple sub-requests, which are respectively processed by corresponding processing units in the distributed system. For example, if the service request involves data reading, it is processed by a processing unit dedicated to data reading in the distributed system; and if the service request involves data writing, data query, and data deletion, the operation is performed in a distributed system. When processed, it is split into three sub-requests, which are processed by processing units for data writing, data query, and data deletion in the distributed system.
需要说明的是,所述分布式系统中的处理单元,是由分布式系统中的服务器组成,每个子系统包含至少一台服务器。It should be noted that the processing unit in the distributed system is composed of servers in a distributed system, and each subsystem includes at least one server.
在具体实施时,每个业务请求都具有唯一对应的标识符,比如针对每个业务请求分 配唯一对应的ID。In the specific implementation, each service request has a unique corresponding identifier, such as for each service request With a unique corresponding ID.
相应的,所述子请求同样具有各自对应的标识符,比如针对子请求分别分配ID。Correspondingly, the sub-requests also have respective corresponding identifiers, such as respectively assigning IDs for sub-requests.
在分布式系统中,子请求都是根据业务请求拆分获得的,因此,业务请求与子请求之间具有关联关系。优选的,所述业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。比如业务请求对应的ID是201508070024,则与该业务请求关联的子请求对应的ID可以设置为201508070001_1、201508070001_2、···、201508070001_x,或者20150807000101、20150807000102、···、201508070001x。In a distributed system, sub-requests are obtained by splitting according to service requests. Therefore, there is an association relationship between service requests and sub-requests. Preferably, the association between the service request and the sub-request is determined according to an association relationship between an identifier of the service request and an identifier of the sub-request. For example, if the ID corresponding to the service request is 201508070024, the ID corresponding to the sub-request associated with the service request may be set to 201508070001_1, 201508070001_2, . . . , 201508070001_x, or 20150807000101, 20150807000102, . . . , 201508070001x.
所述时间阈值,是用于筛选分布式系统中慢请求的筛选依据,所述业务请求或者所述子请求在分布式系统中进行处理时,一旦该业务请求或者该子请求在的处理时间超出预先设置的时间阈值,则该业务请求或者该子请求被确定为是慢请求,反之。The time threshold is used to filter the slow request in the distributed system. When the service request or the sub-request is processed in the distributed system, once the service request or the sub-request is processed, the processing time is exceeded. The pre-set time threshold, then the service request or the sub-request is determined to be a slow request, and vice versa.
优选的,在本步骤执行之后,即接收到请求方发起的业务请求之后,执行生成所述业务请求唯一对应的标识符步骤。Preferably, after the step is performed, that is, after receiving the service request initiated by the requesting party, performing the step of generating an identifier corresponding to the service request uniquely.
步骤S102,按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求。Step S102: Participate in a dimension of the data operation according to the service request in the distributed system, and split the service request into at least one sub-request associated with the service request.
在分布式系统中,所述业务请求在分布式系统中处理时参与数据操作的维度,是指所述业务请求在分布式系统中处理时参与数据操作类型。优选的,所述维度包括:数据读取、数据写入、数据查询和数据删除;在具体实施时,所述维度还可以包括其他数据操作的类型,在此不做限定。In a distributed system, the dimension of the service request participating in the data operation when processed in the distributed system refers to the type of data operation involved when the service request is processed in the distributed system. Preferably, the dimensions include: data reading, data writing, data query, and data deletion; in a specific implementation, the dimension may also include other types of data operations, which are not limited herein.
本步骤中,按照所述业务请求在分布式系统中处理时参与数据操作的维度,将所述业务请求拆分为至少一个与该业务请求相关联的子请求,所述子请求由分布式系统中的相应处理单元进行处理。In this step, according to the dimension of the data operation involved in processing the service request in the distributed system, the service request is split into at least one sub-request associated with the service request, and the sub-request is distributed by the system. The corresponding processing unit in the process is processed.
优选的,在本步骤执行之后,即将所述业务请求拆分为至少一个与所述业务请求相关联的子请求之后,执行生成所述子请求各自对应的标识符步骤。Preferably, after the step is performed, after the service request is split into at least one sub-request associated with the service request, the step of generating an identifier corresponding to each of the sub-requests is performed.
步骤S103,将所述子请求分发至所述分布式系统中的相应处理单元进行处理。Step S103, distributing the sub-request to a corresponding processing unit in the distributed system for processing.
根据上述步骤S101可知,在分布式系统中,所述处理单元是按照所述业务请求在分布式系统中处理时参与数据操作的维度设置的,比如所述业务请求在分布式系统中处理时参与数据操作的维度有数据读取、数据写入、数据查询和数据删除,则在分布式系统中设置用于处理涉及数据读取、数据写入、数据查询和数据删除的处理单元;According to the above step S101, in the distributed system, the processing unit is set according to the dimension of the data operation when the service request is processed in the distributed system, for example, the service request participates in processing in the distributed system. Data operations dimensions such as data reading, data writing, data query, and data deletion are set in a distributed system for processing processing units involving data reading, data writing, data query, and data deletion;
根据上述步骤S102可知,在分布式系统中,所述业务请求是按照该业务请求在分布 式系统中处理时参与数据操作的维度拆分为至少一个与该业务请求相关联的子请求;According to the above step S102, in the distributed system, the service request is distributed according to the service request. The dimension involved in the data operation during processing is split into at least one sub-request associated with the service request;
由此可知,上述二者的维度是相互一致的,即业务请求是根据分布式系统中的处理单元进行拆分的,拆分为至少一个子请求在相应处理单元进行处理。It can be seen that the dimensions of the two are consistent with each other, that is, the service request is split according to the processing unit in the distributed system, and split into at least one sub-request for processing in the corresponding processing unit.
在具体实施时,对于一些较为特殊的业务请求,在分布式系统中进行处理时仅仅涉及一种数据操作的维度,则生成该类业务请求各自对应的一个子请求即可。In a specific implementation, for some special service requests, when processing in a distributed system involves only one dimension of data operation, a sub-request corresponding to each type of service request may be generated.
本实施例中,将所述子请求分发至所述分布式系统中的相应处理单元进行处理。In this embodiment, the sub-request is distributed to a corresponding processing unit in the distributed system for processing.
优选的,按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。Preferably, the sub-requests are respectively sent to the pre-set and the sub-requests are processed in the distributed system when the sub-requests are processed in the distributed system. The processing unit corresponding to the dimension of the data operation.
步骤S104,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值。Step S104: Determine whether the processing time of the sub-request exceeds a preset time threshold of the processing unit in the distributed system.
本实施例中,为了将分布式系统中的所有慢请求都筛选出来,预先针对分布式系统中的每个处理单元,各自预设了相应的时间阈值。In this embodiment, in order to filter all the slow requests in the distributed system, a corresponding time threshold is preset for each processing unit in the distributed system.
所述时间阈值是针对分布式系统中的处理单元预先设置的时间阈值。相应的,对于业务请求关联的子请求,在分布式系统的各个处理单元进行处理时,一旦该子请求在分布式系统的任意一个处理单元的处理时间超出该处理单元预先设置的时间阈值,则该子请求被确定为是慢请求,反之。The time threshold is a time threshold set in advance for a processing unit in a distributed system. Correspondingly, when the sub-request associated with the service request is processed by each processing unit of the distributed system, once the processing time of the sub-request in any one of the processing units of the distributed system exceeds a preset time threshold of the processing unit, The subrequest is determined to be a slow request, and vice versa.
在具体实施时,还可以针对处理单元中的各个服务器预先设置相应的时间阈值,当业务请求关联的子请求在任意一个服务器的处理时间超出该服务器预先设置的时间阈值,则该业务请求或者该子请求被确定为是慢请求,反之。In a specific implementation, a corresponding time threshold may be preset for each server in the processing unit. When the processing request associated with the sub-request of the server exceeds the preset time threshold of the server, the service request or the The subrequest is determined to be a slow request, and vice versa.
此外,在具体实施时,针对所述分布式系统中的处理单元预先设置的时间阈值,可以进行动态调整。In addition, in a specific implementation, a time threshold set in advance for the processing unit in the distributed system may be dynamically adjusted.
本实施例中,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值;In this embodiment, it is determined whether the processing time of the sub-request exceeds a time threshold set by each of the processing units in the distributed system;
若是,则执行下述步骤S105和步骤S106。If so, the following steps S105 and S106 are performed.
步骤S105,生成所述子请求的执行记录。Step S105, generating an execution record of the subrequest.
本步骤和下述步骤S105得以实施的前提是,上述步骤S104中,判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值的判断结果为是,即判定所述子请求是慢请求。本实施例中,针对分布式系统中的慢请求,结合本步骤和下述步骤S105,生成慢请求(即:子请求)的执行记录,汇总慢请求对应的业务请求关联 的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。This step and the following step S105 are implemented. In the above step S104, it is determined whether the processing time of the sub-request exceeds the preset time threshold of the processing unit in the distributed system, that is, the determination is The subrequest is a slow request. In this embodiment, for the slow request in the distributed system, in combination with this step and the following step S105, an execution record of the slow request (ie, the subrequest) is generated, and the service request association corresponding to the slow request is summarized. An execution record of the child request, and an execution record of the generated business request is returned to the requester.
所述执行记录,是指在分布式系统中执行时的细节信息。优选的,所述执行记录中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间和调用时产生的相关信息。The execution record refers to the detailed information when executed in a distributed system. Preferably, the execution record records at least one piece of information: an identifier, an identifier of a server participating in the processing, a processing time, a function name of the call, a time of calling the function, and related information generated when the call is made.
例如分布式系统中子请求的执行信息为:For example, the execution information of a subrequest in a distributed system is:
201508070001_1;201508070001_1;
a1、a2、a3;A1, a2, a3;
1s、2s、1s;1s, 2s, 1s;
read();Read();
xx:xx:xx;Xx:xx:xx;
xxxx。Xxxx.
其中,201508070001_1,是指该子请求的标识符(ID);Where 201508070001_1 refers to the identifier (ID) of the sub-request;
a1、a2、a3,是指分布式系统中参与处理该子请求的服务器的标识符(ID);A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
1s、2s、1s,是指分别在a1,a2,a3服务器进行处理所耗时长;1s, 2s, 1s, refers to the time taken to process the servers at a1, a2, and a3 respectively;
read(),是指调用的函数名称;Read() refers to the name of the function being called;
xx:xx:xx,是指调用函数时的时间点;Xx:xx:xx, refers to the time point when the function is called;
xxxx,是指函数调用的结果,即函数调用时产生的相关信息。Xxxx is the result of a function call, that is, the related information generated when the function is called.
在具体实施时,所述执行记录中还可以记录有上述信息之外的其他信息,在此不做限定。In the specific implementation, other information than the foregoing information may be recorded in the execution record, which is not limited herein.
优选的,在具体实施时,本步骤具体包括下述3个子步骤:Preferably, in a specific implementation, the step specifically includes the following three sub-steps:
1)生成所述子请求的执行记录;1) generating an execution record of the subrequest;
即生成上述所述慢请求(即:子请求)的执行记录。That is, an execution record of the slow request (ie, a subrequest) described above is generated.
2)将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;2) recording an execution record of the subrequest to an exception log corresponding to each of the subrequests;
在分布式系统中,任意一个慢请求,都有各自对应的异常日志。所述异常日志,用于记录慢请求的执行记录。In a distributed system, any slow request has its own corresponding exception log. The abnormality log is used to record an execution record of a slow request.
优选的,所述异常日志中记录有调用函数时产生的异常信息,比如JAVA函数的异常日志。Preferably, the exception log records an exception information generated when the function is called, such as an exception log of the JAVA function.
3)提取所述子请求的执行记录的摘要。3) Extract a summary of the execution record of the subrequest.
在分布式系统中,通过提取慢请求的执行记录的摘要,相比执行记录,一方面,可以降低在分布式系统中进行相应数据处理时的性能损耗;另一方面,还可以减少在分布 式系统与请求方之间传输时占用的网络带宽。In the distributed system, by extracting the summary of the execution record of the slow request, compared with the execution record, on the one hand, the performance loss when performing corresponding data processing in the distributed system can be reduced; on the other hand, the distribution can be reduced. The network bandwidth occupied by the system and the requester.
优选的,所述执行记录的摘要中记录有下述至少一项信息:标识符、参与处理的服务器的标识、处理时间。Preferably, at least one piece of information is recorded in the summary of the execution record: an identifier, an identifier of a server participating in the processing, and a processing time.
例如提取出的子请求的执行记录的摘要为:For example, the summary of the execution record of the extracted subrequest is:
201508070001_1;201508070001_1;
a1、a2、a3;A1, a2, a3;
1s、2s、1s。1s, 2s, 1s.
其中,201508070001_1,是指该子请求的标识符(ID);Where 201508070001_1 refers to the identifier (ID) of the sub-request;
a1、a2、a3,是指分布式系统中参与处理该子请求的服务器的标识符(ID);A1, a2, a3, refer to an identifier (ID) of a server participating in processing the sub-request in the distributed system;
1s、2s、1s,是指分别在a1,a2,a3服务器进行处理所耗时长。1s, 2s, and 1s refer to the length of time spent on processing at the a1, a2, and a3 servers.
在具体实施时,还可以以所述执行记录中的其他信息作为摘要,只要能够确保通过摘要能够定位慢请求或者分析慢请求产生的原因即可。In a specific implementation, other information in the execution record may also be used as a digest, as long as it can be ensured that the slow request can be located by the digest or the reason for the slow request can be analyzed.
步骤S106,汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。Step S106, the execution record of the sub-request associated with the service request corresponding to the sub-request is summarized, and an execution record of the service request is generated and returned to the requesting party.
本步骤中,汇总慢请求对应的业务请求关联的所有子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,请求方接收到业务请求的执行记录之后,可以根据执行记录自行排查问题,确定是代码问题、网络问题还是分布式系统问题,如果是分布式系统的问题,可以通过向分布式系统的管理员反馈获得相应解决方法。In this step, the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and the execution record of the service request is returned to the requesting party. After receiving the execution record of the service request, the requesting party may perform the record according to the execution record. Troubleshoot the problem and determine whether it is a code problem, a network problem, or a distributed system problem. If it is a distributed system problem, you can get a corresponding solution by feeding back to the administrator of the distributed system.
本实施例中,如果分布式系统中的任意一个子请求被判定为是慢请求,则汇总慢请求对应的业务请求关联的所有子请求的执行记录,生成该业务请求的执行记录返回给所述请求方,对请求方分析和定位所述慢请求很有帮助,In this embodiment, if any one of the sub-requests in the distributed system is determined to be a slow request, the execution record of all the sub-requests associated with the service request corresponding to the slow request is summarized, and an execution record of the service request is generated and returned to the The requesting party is very helpful in analyzing and locating the slow request by the requesting party.
在上述步骤S105中,提取出所述子请求的执行记录的摘要的基础上,优选的,本步骤具体包括下述3个子步骤:In the above step S105, based on the summary of the execution record of the sub-request, preferably, the step specifically includes the following three sub-steps:
1)汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要;1) summary of the execution record of the sub-request involved in the calling link of the service request corresponding to the sub-request;
所述调用链路的作用在于确定业务请求关联的子请求在分布式系统中的位置,在此起到“定位”作用。The role of the invoking link is to determine the location of the sub-request associated with the service request in the distributed system, thereby acting as a "location".
优选的,所述调用链路,是指所述分布式系统中、参与处理所述业务请求关联子请求的所有服务器的顺序组合。Preferably, the calling link refers to a sequential combination of all servers in the distributed system that participate in processing the service request associated sub-request.
比如某业务请求的子请求有两个:子请求A和子请求B,其中,子请求A在分布式系统中进行处理时,参与处理该请求A的服务器有a1、a2和a3,则子请求A在分布式 系统中的调用链路(参与处理该子请求的所有服务器的顺序组合)为:a1->a2->a3,或者(a1,a2,a3);相应的,子请求B在分布式系统中的处理链路为:c1->c2->c3,或者(c1,c2,c3);该业务请求的调用链路为:a1->a2->a3、c1->c2->c3,或者(a1,a2,a3;c1,c2,c3)。For example, there are two sub-requests for a service request: sub-request A and sub-request B. When sub-request A is processed in a distributed system, the servers participating in processing the request A have a1, a2, and a3, and sub-request A Distributed The calling link in the system (the sequential combination of all the servers participating in the processing of the sub-request) is: a1->a2->a3, or (a1, a2, a3); correspondingly, the sub-request B is in the distributed system The processing link is: c1->c2->c3, or (c1, c2, c3); the calling link of the service request is: a1->a2->a3, c1->c2->c3, or (a1) , a2, a3; c1, c2, c3).
2)生成该业务请求的执行记录的摘要;2) generating a summary of the execution record of the business request;
优选的,在本步骤执行之后,即生成该业务请求的执行记录的摘要之后,执行将该业务请求的执行记录的摘要记录到该业务请求对应的日志中子步骤。Preferably, after the step is executed, that is, after generating the digest of the execution record of the service request, performing a sub-step of recording the summary of the execution record of the service request to the log corresponding to the service request.
3)将该业务请求的执行记录的摘要返回给所述请求方。3) Return a summary of the execution record of the business request to the requesting party.
即:如果分布式系统中的任意一个子请求被判定为是慢请求,则汇总该慢请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要,生成该业务请求的执行记录,并返回给所述请求方。That is, if any one of the sub-requests in the distributed system is determined to be a slow request, the summary of the execution record of the sub-request involved in the invocation link of the service request corresponding to the slow request is summarized, and an execution record of the service request is generated. And returned to the requestor.
优选的,在具体实施时,在上述步骤S104中,若判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值的判断结果为否,即所述子请求不是慢请求,执行下述步骤:Preferably, in a specific implementation, in the foregoing step S104, if it is determined whether the processing time of the sub-request exceeds a time threshold set by each of the processing units in the distributed system, the determination result is no, that is, the sub-request Instead of a slow request, perform the following steps:
生成所述子请求的执行记录;Generating an execution record of the subrequest;
提取所述子请求的执行记录的摘要;Extracting a summary of the execution record of the subrequest;
汇总所述子请求的执行记录的摘要;Summarizing a summary of the execution records of the subrequests;
生成该业务请求的执行记录的摘要;Generate a summary of the execution record of the business request;
将该业务请求的执行记录的摘要返回给所述请求方。A summary of the execution record of the business request is returned to the requestor.
在具体实施时,还可以根据该业务请求的调用链路来汇总并生成该业务请求的执行记录的摘要。In a specific implementation, the summary of the execution record of the service request may also be summarized and generated according to the calling link of the service request.
此外,在具体实施时,若判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预先设置的时间阈值的判断结果为否,即所述子请求不是慢请求,除上述步骤之外,还可以针对所述子请求或者所述业务请求做其他处理,或者不作任何处理,对此不做限定。In addition, in a specific implementation, if it is determined whether the processing time of the sub-request exceeds a time threshold set by each of the processing units in the distributed system, the sub-request is not a slow request, except the above steps. In addition, other processing may be performed on the sub-request or the service request, or no processing is performed, which is not limited thereto.
综上所述,本申请提供的分布式系统中请求的处理方法,预先针对分布式系统中的处理单元设置相应的时间阈值,通过处理单元中的时间阈值筛选出处理时间超出对应时间阈值的子请求,即慢请求,从而捕捉到分布式系统中所有的慢请求,每个慢请求的执行记录都被记录到各自对应的异常日志中,不会遗漏,并且业务请求的执行记录被记录到对应的日志中,针对慢请求收集的信息更加完整,为慢请求的定位和产生原因的分析 提供了方便;此外,根据子请求的执行记录汇总获得业务请求的执行记录,将业务请求的执行记录返回给请求方,对慢请求的处理更加全面,效率更高,同时提升了分布式系统的处理效率。In summary, the processing method of the request in the distributed system provided by the present application sets a corresponding time threshold for the processing unit in the distributed system, and filters out the processing time beyond the corresponding time threshold by using the time threshold in the processing unit. The request, that is, the slow request, captures all the slow requests in the distributed system, and the execution records of each slow request are recorded in the corresponding exception logs, and are not missed, and the execution record of the service request is recorded to the corresponding In the log, the information collected for slow requests is more complete, and the analysis of the location and cause of slow requests Provided convenience; in addition, according to the execution record of the sub-request, the execution record of the service request is obtained, and the execution record of the service request is returned to the requesting party, and the processing of the slow request is more comprehensive and more efficient, and the distributed system is improved. Processing efficiency.
本申请提供的一种分布式系统中请求的处理装置实施例如下:The processing device requested in a distributed system provided by the present application is implemented as follows:
在上述的实施例中,提供了一种分布式系统中请求的处理方法,与之相对应的,本申请还提供了一种分布式系统中请求的处理装置,下面结合附图进行说明。In the above embodiments, a processing method for a request in a distributed system is provided. Correspondingly, the present application further provides a processing device for requesting in a distributed system, which will be described below with reference to the accompanying drawings.
参照附图2,其示出了本申请提供的一种分布式系统中请求的处理装置实施例的示意图。Referring to Figure 2, there is shown a schematic diagram of an embodiment of a processing device requested in a distributed system provided by the present application.
由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关的部分请参见上述提供的方法实施例的对应说明即可。下述描述的装置实施例仅仅是示意性的。Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the corresponding description of the method embodiment provided above. The device embodiments described below are merely illustrative.
本申请提供一种分布式系统中请求的处理装置,包括:The application provides a processing device for requesting in a distributed system, including:
业务请求接收单元201,用于接收请求方发起的业务请求;The service
业务请求拆分单元202,用于按照该业务请求在分布式系统中处理时参与数据操作的维度,将该业务请求拆分为至少一个与该业务请求相关联的子请求;The service
子请求分发单元203,用于将所述子请求分发至所述分布式系统中的相应处理单元进行处理;a
子请求判断单元204,用于判断所述子请求的处理时间是否超出所述分布式系统中处理单元各自预设的时间阈值;The
若是,则进入执行记录生成单元205;If yes, enter the execution
所述执行记录生成单元205,用于生成所述子请求的执行记录;The execution
执行记录汇总反馈单元206,用于汇总该子请求对应的业务请求关联的子请求的执行记录,生成该业务请求的执行记录返回给所述请求方。The execution record
可选的,所述执行记录生成单元205,具体包括:Optionally, the execution
子请求执行记录生成子单元,用于生成所述子请求的执行记录;a sub-request execution record generation sub-unit for generating an execution record of the sub-request;
子请求异常日志记录子单元,用于将所述子请求的执行记录记录到所述子请求各自对应的异常日志中;a sub-requesting exception logging sub-unit for recording an execution record of the sub-request into an exception log corresponding to each of the sub-requests;
子请求摘要提取子单元,用于提取所述子请求的执行记录的摘要。A sub-request digest extraction sub-unit for extracting a summary of execution records of the sub-request.
可选的,所述执行记录汇总反馈单元206,具体包括:Optionally, the execution record
子请求摘要汇总子单元,用于汇总该子请求对应的业务请求的调用链路涉及的子请求的执行记录的摘要; a sub-request summary summary sub-unit, configured to summarize a summary of execution records of the sub-requests involved in the invocation link of the service request corresponding to the sub-request;
业务请求摘要生成子单元,用于生成该业务请求的执行记录的摘要;a service request summary generation subunit, configured to generate a summary of an execution record of the service request;
业务请求摘要返回子单元,用于将该业务请求的执行记录的摘要返回给所述请求方。The service request summary returns a subunit for returning a summary of the execution record of the service request to the requestor.
可选的,所述调用链路包括:Optionally, the calling link includes:
所述分布式系统中、参与处理该业务请求关联子请求的所有服务器的顺序组合。In the distributed system, the sequential combination of all servers participating in processing the service request associated subrequest.
可选的,若所述子请求判断单元204的判断结果为否,进入下述单元:Optionally, if the judgment result of the
子请求执行记录生成单元,用于生成所述子请求的执行记录;a sub-request execution record generating unit, configured to generate an execution record of the sub-request;
子请求摘要提取单元,用于提取所述子请求的执行记录的摘要;a sub-request summary extracting unit, configured to extract a summary of an execution record of the sub-request;
子请求摘要汇总单元,用于汇总所述子请求的执行记录的摘要;a sub-request summary summary unit for summarizing summaries of execution records of the sub-requests;
业务请求摘要生成单元,用于生成该业务请求的执行记录的摘要;a service request summary generating unit, configured to generate a summary of an execution record of the service request;
业务请求摘要返回单元,用于将该业务请求的执行记录的摘要返回给所述请求方。A service request summary return unit is configured to return a summary of the execution record of the service request to the requester.
可选的,所述分布式系统中请求的处理装置,包括:Optionally, the processing device requested in the distributed system includes:
业务请求标识符生成单元,用于生成该业务请求唯一对应的标识符。A service request identifier generating unit is configured to generate an identifier corresponding to the service request uniquely.
可选的,所述分布式系统中请求的处理装置,包括:Optionally, the processing device requested in the distributed system includes:
子请求标识符生成单元,用于生成所述子请求各自对应的标识符。a sub-request identifier generating unit, configured to generate an identifier corresponding to each of the sub-requests.
可选的,所述子请求分发单元203,具体包括:Optionally, the
子请求分发子单元,用于按照所述子请求在所述分布式系统中处理时参与数据操作的维度,分别将所述子请求发送至预先设置的、与所述子请求在所述分布式系统中处理时参与数据操作的维度对应的处理单元。a sub-request distribution sub-unit, configured to separately send the sub-request to a pre-set, and the sub-request in the distributed according to a dimension of the data operation involved in processing the sub-request in the distributed system The processing unit corresponding to the dimension participating in the data operation when processing in the system.
可选的,所述分布式系统中请求的处理装置,包括:Optionally, the processing device requested in the distributed system includes:
执行记录记录日志单元,用于将该业务请求的执行记录的摘要记录到该业务请求对应的日志中。The record recording log unit is configured to record a summary of the execution record of the service request into a log corresponding to the service request.
可选的,所述维度包括:Optionally, the dimensions include:
数据读取、数据写入、数据查询和数据删除。Data reading, data writing, data query and data deletion.
可选的,该业务请求和所述子请求的关联,根据该业务请求的标识符和所述子请求的标识符之间的关联关系确定。Optionally, the association between the service request and the sub-request is determined according to an association between an identifier of the service request and an identifier of the sub-request.
可选的,所述处理单元由所述分布式系统中的至少一台服务器组成。Optionally, the processing unit is composed of at least one server in the distributed system.
可选的,所述执行记录中记录有下述至少一项信息:Optionally, at least one of the following information is recorded in the execution record:
标识符、参与处理的服务器的标识、处理时间、调用的函数名称、调用函数的时间和调用时产生的相关信息。The identifier, the identity of the server participating in the processing, the processing time, the name of the function being called, the time the function was called, and related information generated at the time of the call.
可选的,所述执行记录的摘要中记录有下述至少一项信息: Optionally, at least one of the following information is recorded in the summary of the execution record:
标识符、参与处理的服务器的标识、处理时间。The identifier, the identity of the server participating in the processing, and the processing time.
可选的,所述异常日志中记录有调用函数时产生的异常信息。Optionally, the exception log records an exception information generated when the function is called.
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。The present application is disclosed in the above preferred embodiments, but it is not intended to limit the present application, and any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of the present application. The scope of protection should be based on the scope defined by the claims of the present application.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium.
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。1. Computer readable media including both permanent and non-persistent, removable and non-removable media may be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。 2. Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
Claims (22)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510582405.5A CN106534242B (en) | 2015-09-14 | 2015-09-14 | The processing method and device requested in a kind of distributed system |
CN201510582405.5 | 2015-09-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017045537A1 true WO2017045537A1 (en) | 2017-03-23 |
Family
ID=58288636
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/097997 WO2017045537A1 (en) | 2015-09-14 | 2016-09-05 | Method and device for processing request in distributed system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106534242B (en) |
WO (1) | WO2017045537A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143151A (en) * | 2018-11-02 | 2020-05-12 | 菜鸟智能物流控股有限公司 | Service monitoring method and device and electronic equipment |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108737473B (en) * | 2017-04-20 | 2019-12-20 | 贵州白山云科技股份有限公司 | Data processing method, device and system |
CN109218041B (en) * | 2017-06-29 | 2022-03-11 | 北京京东尚科信息技术有限公司 | Request processing method and device for server system |
CN107977300A (en) * | 2017-11-07 | 2018-05-01 | 山东中创软件商用中间件股份有限公司 | A kind of request tracing method and device |
CN108171488B (en) * | 2017-11-28 | 2021-06-01 | 创新先进技术有限公司 | Data processing method, apparatus and system |
CN110888780A (en) * | 2019-11-19 | 2020-03-17 | 泰康保险集团股份有限公司 | Application monitoring method, device, equipment and storage medium |
CN111049916A (en) * | 2019-12-18 | 2020-04-21 | 腾讯云计算(北京)有限责任公司 | A control method, device, proxy server and storage medium |
EP3961397B1 (en) * | 2020-08-24 | 2025-10-01 | Hitachi Energy Ltd | Remote procedure call between entities in a service bus communication system |
CN117294757B (en) * | 2023-11-27 | 2024-02-20 | 山东省计算中心(国家超级计算济南中心) | Complex service splitting execution method, system, equipment and medium based on block chain |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101997851A (en) * | 2009-08-17 | 2011-03-30 | 中兴通讯股份有限公司 | Method for accessing directory of server side, client side, server side and system |
US20130085895A1 (en) * | 2011-09-30 | 2013-04-04 | Oracle International Corporation | High throughput global order promising system |
CN103838632A (en) * | 2012-11-21 | 2014-06-04 | 阿里巴巴集团控股有限公司 | Data querying method and device |
CN104571957A (en) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | Data reading method and assembling device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2666576A1 (en) * | 2006-10-11 | 2008-04-17 | Quartex, Division Of Primex, Inc. | Traceable record generation system and method using wireless networks |
CN103699340B (en) * | 2013-12-16 | 2016-12-07 | 华为数字技术(苏州)有限公司 | A kind of request processing method and equipment |
-
2015
- 2015-09-14 CN CN201510582405.5A patent/CN106534242B/en active Active
-
2016
- 2016-09-05 WO PCT/CN2016/097997 patent/WO2017045537A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101997851A (en) * | 2009-08-17 | 2011-03-30 | 中兴通讯股份有限公司 | Method for accessing directory of server side, client side, server side and system |
US20130085895A1 (en) * | 2011-09-30 | 2013-04-04 | Oracle International Corporation | High throughput global order promising system |
CN103838632A (en) * | 2012-11-21 | 2014-06-04 | 阿里巴巴集团控股有限公司 | Data querying method and device |
CN104571957A (en) * | 2014-12-29 | 2015-04-29 | 成都致云科技有限公司 | Data reading method and assembling device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111143151A (en) * | 2018-11-02 | 2020-05-12 | 菜鸟智能物流控股有限公司 | Service monitoring method and device and electronic equipment |
CN111143151B (en) * | 2018-11-02 | 2023-11-17 | 菜鸟智能物流控股有限公司 | Service monitoring method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN106534242A (en) | 2017-03-22 |
CN106534242B (en) | 2019-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106534242B (en) | The processing method and device requested in a kind of distributed system | |
TWI564732B (en) | A method and apparatus for monitoring user requests to run in a decentralized system | |
CN106202235B (en) | A data processing method and device | |
CN111737127B (en) | Method and apparatus for testing map services | |
WO2020238066A1 (en) | Software pressure test method and apparatus, and storage medium and server | |
WO2016206567A1 (en) | Distributed stream computing system, method and device | |
CN105912587A (en) | Data acquisition method and system | |
US9298492B2 (en) | System and method for modifying allocated resources | |
CN110035105A (en) | Screen recording evidence obtaining method and system based on block chain and electronic equipment | |
TW201638779A (en) | Method, device, system, and electronic facility for resource management of virtual host | |
CN112948492A (en) | Data processing system, method and device, electronic equipment and storage medium | |
CN110798373A (en) | A method for realizing performance test, test server and computer storage medium | |
CN111177193A (en) | A method and system for log stream processing based on Flink | |
CN108259207B (en) | Traffic statistics method, client, server and system | |
CN106649000B (en) | Fault recovery method of real-time processing engine and corresponding server | |
CN115580607A (en) | Lottery system link monitoring method, device and system | |
CN114281648A (en) | A data collection method, device, electronic device and storage medium | |
CN112395591A (en) | Encryption method and system | |
US11171846B1 (en) | Log throttling | |
CN116107781A (en) | Log tracking method, device, electronic equipment and computer program product | |
CN108959497A (en) | distributed file system log processing method, device, equipment and storage medium | |
CN102055620A (en) | Method and system for monitoring user experience | |
US9633061B2 (en) | Methods for determining event counts based on time-sampled data | |
CN109389271B (en) | Application performance management method and system | |
CN106161066A (en) | A kind of log collection method and server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16845651 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16845651 Country of ref document: EP Kind code of ref document: A1 |