CN103475520B - Service processing control method and device in distribution network - Google Patents

Service processing control method and device in distribution network Download PDF

Info

Publication number
CN103475520B
CN103475520B CN201310409201.2A CN201310409201A CN103475520B CN 103475520 B CN103475520 B CN 103475520B CN 201310409201 A CN201310409201 A CN 201310409201A CN 103475520 B CN103475520 B CN 103475520B
Authority
CN
China
Prior art keywords
transaction
processing
identification information
cache space
network elements
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310409201.2A
Other languages
Chinese (zh)
Other versions
CN103475520A (en
Inventor
刘希伟
王英杰
张乐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Poly Polytron Technologies Inc
Original Assignee
Poly Polytron Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Poly Polytron Technologies Inc filed Critical Poly Polytron Technologies Inc
Priority to CN201310409201.2A priority Critical patent/CN103475520B/en
Publication of CN103475520A publication Critical patent/CN103475520A/en
Application granted granted Critical
Publication of CN103475520B publication Critical patent/CN103475520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a service processing control method and device in a distribution network. The service processing control method comprises the steps that identification information is distributed to service to be processed and the identification information is sent to network elements which processes the service; monitoring is conducted on the processing state of the service; when the fact that the service is in the processing end state is monitored, persistence processing is conducted on the data submitted by the network elements which process the service. Due to the fact that united management is conducted on the service processing process and united processing is conducted on the data submitted by the network elements which process the service, the integrity and unity of the data can be guaranteed without transmission of the data by the network elements, the processing complicity of each network element is reduced, and the processing capability is improved.

Description

Transaction processing control method and device in distributed network
Technical Field
The present invention relates to the field of distributed network technologies, and in particular, to a method and an apparatus for controlling transaction processing in a distributed network.
Background
The cloud platform generally adopts a distributed network architecture and is built by network elements on different servers. A specific service flow usually requires multiple network elements to be completed cooperatively.
In order to keep the integrity of the data uniform, one processing scheme is to keep the data transferred. And continuously accumulating the data of each network element from the initial network element participating in the business processing and transmitting the data to the next network element until the last network element participating in the business processing performs final persistence processing on the data. Although the processing scheme ensures the integrity and unification of the data, the processing complexity of each network element is increased, each network element needs to pay attention to not only the service logic of the network element, but also the data transmitted from the upstream and the data prepared to the downstream, and in addition, the accumulation of the data packets increases the burden of network transmission, which causes low processing capacity.
Disclosure of Invention
The invention aims to provide a transaction management method and a transaction management device in a distributed network, which are used for solving the problems in the existing implementation scheme.
The purpose of the invention is realized by the following technical scheme:
a transaction control method in a distributed network, comprising:
distributing identification information for the transaction to be processed, and sending the identification information to the network element for processing the transaction so as to store the data obtained by processing the transaction by the network element in association with the identification information after the transaction is processed by the network elements at all levels for processing the transaction;
monitoring the processing state of the transaction by reading a cache space for storing state information of the transaction;
and when the processing ending state information corresponding to the identification information of the transaction is read, performing persistence processing on the data associated with the identification information stored by each level of network element for processing the transaction.
The method provided by the embodiment of the invention can uniformly manage the transaction processing process and uniformly process the data submitted by the network elements for processing the transaction, can ensure the completeness and uniformity of the data without transmitting the data by each network element, reduces the processing complexity of each network element and improves the processing capacity.
Preferred implementations of each of the above steps are described below. It should be noted that these preferred implementations can be used alone or in combination.
The specific implementation manner of sending the identification information to the network element that processes the transaction may be sending the identification information to an initial network element that processes the transaction, and in the process of processing the transaction, the identification information is transmitted step by step between network elements at each level that process the transaction. Or sending the identification information to network elements at each level for processing the transaction.
The specific implementation manner of monitoring the processing state of the transaction is related to the state information storage position of the transaction. And if the network element processing the transaction stores the state information of the transaction and the identification information in a shared cache space in a correlated manner, monitoring the state of the transaction by reading the shared cache space. If the state information of the transaction and the identification information are respectively stored in the corresponding cache spaces by the network elements of each level processing the transaction, the processing state of the transaction is monitored by reading the cache spaces corresponding to the network elements of each level.
The specific implementation mode of performing persistence processing on the data associated with the identification information stored by each level of network elements for processing the transaction is related to the position of data storage. If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, a specific implementation manner of performing persistence processing on the data associated with the identification information stored by the network elements at each level for processing the transaction may be: acquiring data associated with the identification information from the shared cache space; and carrying out persistence processing on the acquired data. If the data obtained by processing the transaction by the network elements at each level and the identification information are respectively associated and stored in the corresponding cache space, a specific implementation manner of performing persistence processing on the data associated with the identification information stored by the network elements at each level for processing the transaction may be: respectively obtaining data associated with the identification information from the cache space corresponding to the network elements at each level; and carrying out persistence processing on the acquired data.
Preferably, the shared cache space includes a stack memory and a heap memory. If the network element processing the transaction stores the state information of the transaction and the identification information in a shared cache space in a correlated manner, the state information of the transaction and the identification information are stored in a stack memory of the shared cache space in a correlated manner. If the data obtained by processing the transaction by the network elements at all levels is stored in the shared cache space in association with the identification information, the data obtained by processing the transaction is stored in a stack memory of the shared cache space, and a pointer indicating the data storage position is stored in the stack memory in association with the identification information.
When the network element processing the above transaction is abnormal, the data needs to be rolled back. In the embodiment of the invention, the abnormal network element stores and processes the abnormal state information. Then, based on any of the embodiments, if the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, and before the processing end state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, and the data associated with the identification information stored in the shared cache space is also rolled back; if the data obtained by processing the transaction by the network elements at all levels and the identification information are respectively stored in the corresponding cache spaces in a correlated manner, and before the processing ending state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, and the data associated with the identification information stored in the cache spaces corresponding to the network elements at all levels is subjected to rollback processing.
The method provided by the embodiment of the invention uniformly rolls back the data submitted by the network element after the processing when a certain network element is abnormal, thereby avoiding the generation of dirty data.
Based on the same inventive concept as the method, an embodiment of the present invention further provides a transaction processing control apparatus in a distributed network, including:
the registration module is used for distributing identification information for the transaction to be processed and sending the identification information to the network element for processing the transaction so as to store the data obtained by processing the transaction by the network element and the identification information in a correlation manner after the network elements at all levels for processing the transaction process the transaction;
the monitoring module is used for monitoring the processing state of the transaction by reading a cache space for storing the state information of the transaction;
and the processing module is used for performing persistence processing on the data related to the identification information stored by each level of network element for processing the transaction when the monitoring module reads the processing ending state information corresponding to the identification information of the transaction.
The device provided by the embodiment of the invention can uniformly manage the transaction processing process and uniformly process the data submitted by the network elements for processing the transaction, can ensure the completeness and uniformity of the data without transmitting the data by each network element, reduces the processing complexity of each network element and improves the processing capacity.
Preferred implementations of the above modules are described below. It should be noted that these preferred implementations can be used alone or in combination.
When the identifier information is sent to the network element that processes the transaction, the registration module may be specifically configured to: sending the identification information to an initial network element for processing the transaction, wherein the identification information is transmitted stage by stage between network elements for processing the transaction in the transaction processing process; or sending the identification information to network elements at each level for processing the transaction.
If the network element that processes the transaction stores the state information of the transaction and the identification information in the shared cache space in an associated manner, the monitoring module may be specifically configured to: monitoring the state of the transaction by reading the shared cache space;
if the network elements at each level that process the transaction respectively store the status information of the transaction and the identification information in corresponding cache spaces, the monitoring module may be specifically configured to: and monitoring the processing state of the transaction by reading the cache space corresponding to the network elements at each level.
If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, the processing module may be specifically configured to: acquiring data associated with the identification information from the shared cache space; carrying out persistence processing on the acquired data;
if the data obtained by processing the transaction by the network elements at each level and the identification information are respectively stored in a corresponding cache space in a related manner, the processing module may be specifically configured to: respectively obtaining data associated with the identification information from the cache space corresponding to the network elements at each level; and carrying out persistence processing on the acquired data.
If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module reads the processing abnormal state information corresponding to the identification information of the transaction, the processing module may be further configured to: rolling back the data associated with the identification information stored in the shared cache space; if the data obtained by processing the transaction by the network elements at each level and the identification information are respectively stored in the corresponding cache space in a correlated manner, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module reads the processing abnormal state information corresponding to the identification information of the transaction, the processing module may be further configured to: and performing rollback processing on the data associated with the identification information stored in the cache space corresponding to the network elements at each level.
Based on the same inventive concept as the method, an embodiment of the present invention further provides a network element in a distributed network, including:
the identification information receiving module is used for receiving the identification information of the transaction to be processed;
the transaction processing module is used for processing the transaction;
and the data storage module is used for storing the data obtained by the network element processing the transaction and the identification information in a correlation manner.
The network element provided by the embodiment of the invention does not need to transmit the data obtained by processing the transaction, only needs to store the data obtained by processing the transaction by the network element in association with the identification information, and carries out unified management on the transaction processing process by the transaction processing control device and unified processing on the data submitted by the network element for processing the transaction, thereby reducing the processing complexity of each network element and improving the processing capability.
Preferably, the identification information receiving module is specifically configured to:
receiving identification information of the transaction sent by a transaction control device, wherein the identification information is distributed by the transaction control device; or,
and receiving the identification information of the transaction, which is sent by the upper-level network element for processing the transaction, wherein the identification information is distributed by the transaction processing control device and is sent to the initial network element for processing the transaction.
Drawings
FIG. 1 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 2 is a schematic diagram of a first apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a second apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a network element according to an embodiment of the present invention.
Detailed Description
The technical solutions provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
In order to ensure the integrity and unification of data after transaction processing on the premise of not reducing processing performance, an embodiment of the present invention provides a transaction processing control method in a distributed network, and as shown in fig. 1, the method specifically includes:
step 100, allocating identification Information (ID) to the transaction to be processed, and sending the identification information to the network element that processes the transaction, so that after processing the transaction, the network elements at each level that process the transaction store the data obtained by processing the transaction by the network element in association with the identification information.
In an embodiment of the invention, the transaction is processed by a plurality of network elements in the distributed network. Then the identification information may be sent separately to all network elements that handle the transaction. Preferably, the identification information may also be sent only to the initial network element that processes the transaction, and then each network element sends the identification information to the next level network element after processing the single node transaction. The single-node transaction processing means that during the transaction processing, a single network element processes a part of transactions responsible for the node.
Step 110, monitoring the processing state of the transaction by reading the cache space for saving the state information of the transaction.
The specific implementation manner of monitoring the processing state of the transaction is related to the state information storage position of the transaction. And if the network element processing the transaction stores the state information of the transaction and the identification information in a shared cache space in a correlated manner, monitoring the state of the transaction by reading the shared cache space. If the state information of the transaction and the identification information are respectively stored in the corresponding cache spaces by the network elements of each level processing the transaction, the processing state of the transaction is monitored by reading the cache spaces corresponding to the network elements of each level.
The cache space where the state information of the transaction stored by each level of network element corresponds to the identification information may be the same or different.
And step 120, when the processing end state information corresponding to the identification information of the transaction is read, performing persistence processing on data corresponding to the identification information stored in each level of network element for processing the transaction.
The specific implementation mode of performing persistence processing on the data associated with the identification information stored by each level of network elements for processing the transaction is related to the position of data storage. If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, a specific implementation manner of performing persistence processing on the data associated with the identification information stored by the network elements at each level for processing the transaction may be: acquiring data associated with the identification information from the shared cache space; and carrying out persistence processing on the acquired data. If the data obtained by processing the transaction by the network elements at each level and the identification information are respectively associated and stored in the corresponding cache space, a specific implementation manner of performing persistence processing on the data associated with the identification information stored by the network elements at each level for processing the transaction may be: respectively obtaining data associated with the identification information from the cache space corresponding to the network elements at each level; and carrying out persistence processing on the acquired data.
The corresponding cache spaces for storing the data by the network elements at each level may be the same or different.
In addition, the state information of the transaction stored by each network element and the cache space corresponding to the data may be the same or different.
The method provided by the embodiment of the invention can uniformly manage the transaction processing process and uniformly process the data submitted by the network elements for processing the transaction, can ensure the completeness and uniformity of the data without transmitting the data by each network element, reduces the processing complexity of each network element and improves the processing capacity.
Preferably, the shared cache space includes a stack memory and a heap memory. If the network element processing the transaction stores the state information of the transaction and the identification information in a shared cache space in a correlated manner, the state information of the transaction and the identification information are stored in a stack memory of the shared cache space in a correlated manner. If the data obtained by processing the transaction by the network elements at all levels is stored in the shared cache space in association with the identification information, the data obtained by processing the transaction is stored in a heap memory of the shared cache space, and a pointer indicating the data storage position is stored in a stack memory in association with the identification information.
Because the processing capacity of the stack memory is strong, frequently called information (such as state information of transactions) can be cached in the stack memory, and therefore the performance of the shared cache module is improved.
In the prior art, if a network element is abnormal, the network element performs a transaction rollback operation. In the embodiment of the present invention, the abnormal network element only needs to store the abnormal data in association with the identification information, and store the information for processing the abnormal state. Correspondingly, based on any of the embodiments, if the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, and before the processing end state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, the data associated with the identification information stored in the shared cache space is also subjected to rollback processing, wherein the abnormal network element stores the abnormal data in association with the identification information in the shared cache space. And if the data obtained by processing the transaction by the network elements at all levels and the identification information are respectively stored in the corresponding cache spaces in a correlated manner, and before the processing ending state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, and the data associated with the identification information stored in the cache spaces corresponding to the network elements at all levels is subjected to rollback processing, wherein the abnormal data and the identification information are stored in the corresponding storage spaces in a correlated manner by the abnormal network elements.
So-called rollback, i.e. deleting the corresponding data (including the data obtained by completing the processing and the abnormal data). In the rollback processing in the embodiment of the present invention, all the data corresponding to the reported identification information is deleted. Therefore, after the rollback processing is performed, the transaction processing flow is finished.
In the method provided by the embodiment of the invention, when a certain network element generates abnormal data, the transaction management device uniformly rolls back the data submitted by the network element which has finished processing, so that the generation of dirty data can be avoided.
Based on the same inventive concept as the method, an embodiment of the present invention further provides a transaction control device in a distributed network, as shown in fig. 2, the transaction control device in the distributed network includes:
the registration module 201 is configured to allocate identification information to a transaction to be processed, and send the identification information to a network element that processes the transaction, so that after processing the transaction, each level of network elements that process the transaction store data obtained by processing the transaction by the network element in association with the identification information.
In the embodiment of the present invention, preferably, the registration module 201 registers the transaction to be processed, and performs unified processing and scheduling management on the rules, objects, and resources of the transaction management. Here, registration is to allocate not only identification information to a transaction to be processed, but also to initialize a thread for the transaction and allocate a shared cache space to the transaction.
In addition, after allocating the identification information to the transaction to be processed, the registration module 201 also sends the identification information to the monitoring module 202, and notifies the monitoring module 202 to monitor the processing state of the transaction corresponding to the identification information.
The monitoring module 202 is configured to monitor a processing state of the transaction by reading a cache space for storing state information of the transaction.
Specifically, after receiving the notification from the registration module 201, the monitoring module 202 monitors the processing state of the transaction corresponding to the identification information.
The monitoring of the processing state of the transaction by reading the cache space for storing the state information of the transaction specifically means reading the cache space to obtain the state information of the transaction, and monitoring the processing state of the transaction according to the obtained state information of the transaction.
The processing module 203 performs persistence processing on the data associated with the identification information stored in each level of network element that processes the transaction when the monitoring module 202 reads the processing end state information corresponding to the identification information of the transaction.
Specifically, when the monitoring module 202 reads the processing end state information corresponding to the identification information of the transaction (i.e., monitors the processing end state of the transaction), it notifies the processing module 203 to perform the persistence processing. Correspondingly, the processing module 203 performs persistence processing on the data corresponding to the identification information submitted by the network element that processes the transaction according to the notification.
The device provided by the embodiment of the invention can uniformly manage the transaction processing process and uniformly process the data submitted by the network elements for processing the transaction, can ensure the completeness and uniformity of the data without transmitting the data by each network element, reduces the processing complexity of each network element and improves the processing capacity.
In the embodiment of the present invention, the monitoring module 202 and the processing module 203 may be implemented by threads, specifically, by using a multi-thread polling method. Taking the monitoring module 202 as an example, assuming that one thread for monitoring corresponds to one transaction, each thread for monitoring corresponds to two states, active and dormant. The threads in the activated state occupy more resources, the threads in the dormant state release part of the resources, and each thread in the monitoring thread pool adopts a polling mode to ensure that all the threads for monitoring can be switched in a balanced state so as to monitor the processing states of all the transactions, thereby ensuring the maximum bearing of the processing capacity of the monitoring threads during high concurrency. The initialization of the monitoring thread pool and the control of the polling mode are realized by the registration module 201.
Based on any of the above embodiments, a preferred implementation of each of the above modules is described below. It should be noted that these preferred implementations can be used alone or in combination.
Since the apparatus provided by the embodiment of the present invention gives the same inventive concept as the above method, repeated descriptions will be omitted.
When the identifier information is sent to the network element that processes the transaction, the registration module 201 may be specifically configured to: sending the identification information to an initial network element for processing the transaction, wherein the identification information is transmitted stage by stage between network elements for processing the transaction in the transaction processing process; or sending the identification information to network elements at each level for processing the transaction.
If the network element that processes the transaction stores the state information of the transaction in the shared cache space in association with the identification information, the monitoring module 202 may be specifically configured to: monitoring the state of the transaction by reading the shared cache space;
if the network elements at each level that process the transaction respectively store the status information of the transaction and the identification information in corresponding cache spaces, the monitoring module 202 may be specifically configured to: and monitoring the processing state of the transaction by reading the cache space corresponding to the network elements at each level.
If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, the processing module 203 may be specifically configured to: acquiring data associated with the identification information from the shared cache space; carrying out persistence processing on the acquired data;
if the data obtained by processing the transaction by the network elements at each level and the identification information are respectively stored in a corresponding cache space in a related manner, the processing module 203 may be specifically configured to: respectively obtaining data associated with the identification information from the cache space corresponding to the network elements at each level; and carrying out persistence processing on the acquired data.
Preferably, as shown in fig. 3, the apparatus provided in the embodiment of the present invention may further include a shared cache module 204, where the shared cache module 204 is the above-mentioned shared cache space. Further, the shared cache module 204 includes a stack memory and a heap memory. If the network element processing the transaction stores the state information of the transaction in the shared cache module 204 in association with the identification information, the state information of the transaction is stored in the stack memory of the shared cache module 204 in association with the identification information. If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache module 204 in association with the identification information, the data obtained by processing the transaction is stored in the heap memory of the shared cache module 204, and the pointer indicating the data storage location is stored in the stack memory in association with the identification information.
Because the processing capacity of the stack memory is strong, frequently called information (such as state information of transactions) can be cached in the stack memory, and therefore the performance of the shared cache module is improved.
If the data obtained by processing the transaction by the network elements at each level is stored in the shared cache space in association with the identification information, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module 202 reads the processing abnormal state information corresponding to the identification information of the transaction, the processing module 203 may be further configured to: rolling back the data associated with the identification information stored in the shared cache space; if the data obtained by processing the transaction by the network elements at each level and the identification information are respectively stored in the corresponding cache space in a correlated manner, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module 202 reads the processing abnormal state information corresponding to the identification information of the transaction, the processing module 203 may be further configured to: and performing rollback processing on the data associated with the identification information stored in the cache space corresponding to the network elements at each level.
Based on the same inventive concept as the method, an embodiment of the present invention further provides a network element in a distributed network, as shown in fig. 4, including:
an identification information receiving module 401, configured to receive identification information of a transaction to be processed;
a transaction processing module 402, configured to process the transaction;
a data saving module 403, configured to store the data obtained by processing the transaction by the network element in association with the identifier information.
The network element provided by the embodiment of the invention does not need to transmit the data obtained by processing the transaction, only needs to store the data obtained by processing the transaction by the network element in association with the identification information, and carries out unified management on the transaction processing process by the transaction processing control device and unified processing on the data submitted by the network element for processing the transaction, thereby reducing the processing complexity of each network element and improving the processing capability.
Preferably, the identification information receiving module 401 is specifically configured to:
receiving identification information of the transaction sent by a transaction control device, wherein the identification information is distributed by the transaction control device; or,
and receiving the identification information of the transaction, which is sent by the upper-level network element for processing the transaction, wherein the identification information is distributed by the transaction processing control device and is sent to the initial network element for processing the transaction.
The method provided by the embodiment of the present invention will be described in detail below by taking the network element shown in the transaction control device shown in fig. 3 as an example.
When the flow of the transaction process is started, the registration module 201 of the transaction process control apparatus registers the transaction. Specifically, the identification information is allocated to the transaction, the thread of the monitoring module 202 and the thread of the processing module 203 are initialized for the transaction, and the shared cache space (i.e., the shared cache module 204) is allocated for the transaction.
The registration module 201 sends the identification information to the initial network element that processed the transaction.
The initial network element receives the identification information; processing the part of the transaction which is handled by the local network element; after the processing is completed, the data to be persisted and the identification information obtained by the processing are stored in the shared cache module 204 of the transaction processing control device in an associated manner, and the identification information is sent to the next-level network element.
The next-level network element processes the part of the transaction which is responsible for processing, stores the data which is obtained by processing and needs to be persisted and the identification information into the shared cache module 204 of the transaction processing control device in a correlation manner, and sends the identification information to the next-level network element.
The above steps are repeated until the last level network element processing the transaction, and after the last level network element processes the part of the transaction which is responsible for processing the transaction, the last level network element stores the transaction processing end state information in the shared cache module 204 in addition to the data needing to be persisted according to the above manner.
For any level network element processing the transaction, once an exception occurs when the transaction is processed, the exception data and the identification information are stored in the shared cache module 204 of the transaction processing control device in an associated manner, and transaction processing exception state information is also stored in the shared cache module 204. At this time, the network element finishes the transaction processing flow, and there is no processing action of the subsequent network element.
The specific implementation manner of storing the data to be persisted or the abnormal data and the identification information in the shared cache module 204 in an associated manner may be: judging whether the stack memory of the shared cache module stores the identification information of the transaction, if not, storing the data needing to be persisted in the stack memory of the shared cache module, and storing the identification information and the pointer of the address of the data needing to be persisted in the stack memory in a correlated manner.
Optionally, for the non-last-level network element, after the partial processing of the transaction in charge of the local network element is completed, single-node transaction processing completion state information may also be generated and stored in the shared cache module 204.
The specific implementation manner of storing the processing state information of the transaction (transaction ending state information, transaction exception state information, and single-node transaction completion state information) in the shared cache module 204 may be: and storing the state information and the identification information in a stack memory in a related manner.
In the monitoring module 202, when the thread corresponding to the transaction is in an active state, the stack memory of the shared cache module 204 is continuously read to monitor the state of the transaction. If the transaction processing abnormal state information is read, the processing module 203 is triggered to perform rollback operation, and if the transaction processing ending state information is read, the processing module 203 is triggered to perform persistence operation.
If the rollback operation needs to be performed, the processing module 203 reads all the data corresponding to the above identification information in the heap memory of the shared cache module 204, and deletes the data. If the persistent operation is required, the processing module 203 reads all the data corresponding to the above identification information in the heap memory of the shared cache module 204, and performs the persistent processing on the data.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may 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, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for transaction control in a distributed network, comprising:
allocating identification information for a transaction to be processed, and sending the identification information to a network element for processing the transaction so that after the network elements at all levels for processing the transaction process the transaction, data obtained by the network element for processing the transaction are stored in a correlation manner with the identification information;
monitoring the processing state of the transaction by reading a cache space for storing state information of the transaction;
when the processing ending state information corresponding to the identification information of the transaction is read, performing persistence processing on the data associated with the identification information stored by each level of network elements for processing the transaction;
if the cache space is a shared cache space, and if the network element processing the transaction stores the state information of the transaction and the identification information in the shared cache space in an associated manner, the monitoring the processing state of the transaction by reading the cache space for storing the state information of the transaction includes:
monitoring the state of the transaction by reading the shared cache space;
if the state information of the transaction and the identification information are respectively stored in corresponding cache spaces by the network elements at each level for processing the transaction, the monitoring of the processing state of the transaction by reading the cache spaces for storing the state information of the transaction comprises the following steps:
and monitoring the processing state of the transaction by reading the cache space corresponding to the network elements at each level.
2. The method of claim 1, wherein sending the identification information to a network element that processes the transaction comprises:
sending the identification information to an initial network element for processing the transaction, wherein the identification information is transmitted stage by stage between network elements for processing the transaction in the transaction processing process; or,
and sending the identification information to network elements at all levels for processing the transaction.
3. The method according to claim 1 or 2, wherein if the data obtained by the network elements at each level processing the transaction and the identification information are stored in a shared cache space in an associated manner, the persisting the data associated with the identification information stored in the network elements at each level processing the transaction includes:
acquiring data associated with the identification information from the shared cache space;
carrying out persistence processing on the acquired data;
if the data obtained by the transaction processed by the network elements at each level and the identification information are respectively associated and stored in corresponding cache spaces, the persistent processing of the data associated with the identification information stored by the network elements at each level for processing the transaction includes:
respectively acquiring data associated with the identification information from cache spaces corresponding to the network elements at all levels;
and carrying out persistence processing on the acquired data.
4. The method according to claim 1 or 2, wherein if the data obtained by the network elements at each level processing the transaction and the identification information are stored in a shared cache space in an associated manner, and before the processing end state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, the method further comprises:
performing rollback processing on the data associated with the identification information stored in the shared cache space;
if the data obtained by the transaction processed by the network elements at each level and the identification information are respectively stored in the corresponding cache space in a correlated manner, and before the processing ending state information corresponding to the identification information of the transaction is read, the processing abnormal state information corresponding to the identification information of the transaction is read, the method further comprises the following steps:
and performing rollback processing on the data associated with the identification information stored in the cache space corresponding to each level of network elements.
5. A transaction control device in a distributed network, comprising:
the registration module is used for distributing identification information for the transaction to be processed and sending the identification information to the network element for processing the transaction so as to store the data obtained by processing the transaction by the network element and the identification information in a correlation manner after the network elements at all levels for processing the transaction process the transaction;
the monitoring module is used for monitoring the processing state of the transaction by reading a cache space for storing the state information of the transaction;
the processing module is used for performing persistence processing on data related to the identification information stored by each level of network element for processing the transaction when the monitoring module reads the processing ending state information corresponding to the identification information of the transaction;
if the cache space is a shared cache space, and if the network element that processes the transaction stores the state information of the transaction and the identification information in the shared cache space in an associated manner, the monitoring module is specifically configured to:
monitoring the state of the transaction by reading the shared cache space;
if the network elements at each level that process the transaction respectively store the state information of the transaction and the identification information in corresponding cache spaces, the monitoring module is specifically configured to:
and monitoring the processing state of the transaction by reading the cache space corresponding to the network elements at each level.
6. The apparatus of claim 5, wherein when sending the identification information to the network element that processes the transaction, the registration module is specifically configured to:
sending the identification information to an initial network element for processing the transaction, wherein the identification information is transmitted stage by stage between network elements for processing the transaction in the transaction processing process; or,
and sending the identification information to network elements at all levels for processing the transaction.
7. The apparatus according to claim 5 or 6, wherein if the data obtained by the network elements at each level processing the transaction and the identification information are stored in a shared cache space in an associated manner, the processing module is specifically configured to:
acquiring data associated with the identification information from the shared cache space;
carrying out persistence processing on the acquired data;
if the data obtained by the transaction processed by the network elements at each level and the identification information are respectively stored in a corresponding cache space in a correlated manner, the processing module is specifically configured to:
respectively acquiring data associated with the identification information from cache spaces corresponding to the network elements at all levels;
and carrying out persistence processing on the acquired data.
8. The apparatus according to claim 5 or 6, wherein if the data obtained by the network elements at each level processing the transaction and the identification information are stored in a shared cache space in an associated manner, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module reads the processing abnormal state information corresponding to the identification information of the transaction, the processing module is further configured to:
performing rollback processing on the data associated with the identification information stored in the shared cache space;
if the data obtained by processing the transaction by the network elements at each level and the identification information are respectively stored in the corresponding cache space in a correlated manner, and before the processing end state information corresponding to the identification information of the transaction is read, the monitoring module reads the processing abnormal state information corresponding to the identification information of the transaction, and the processing module is further configured to:
and performing rollback processing on the data associated with the identification information stored in the cache space corresponding to each level of network elements.
9. A network element in a distributed network, comprising:
the identification information receiving module is used for receiving the identification information of the transaction to be processed;
the transaction processing module is used for processing the transaction;
the data storage module is used for storing the data obtained by the network element processing the transaction in association with the identification information so as to monitor the processing state of the transaction by reading the cache space for storing the state information of the transaction; if the cache space is a shared cache space, and if the network element processing the transaction stores the state information of the transaction and the identification information in the shared cache space in an associated manner, the monitoring the processing state of the transaction by reading the cache space for storing the state information of the transaction includes: monitoring the state of the transaction by reading the shared cache space; if the state information of the transaction and the identification information are respectively stored in corresponding cache spaces by the network elements at each level for processing the transaction, the monitoring of the processing state of the transaction by reading the cache spaces for storing the state information of the transaction comprises the following steps: and monitoring the processing state of the transaction by reading the cache space corresponding to the network elements at each level.
10. The network element of claim 9, wherein the identification information receiving module is specifically configured to:
receiving identification information of the transaction sent by a transaction control device, wherein the identification information is distributed by the transaction control device; or,
and receiving the identification information of the transaction, which is sent by the upper-level network element for processing the transaction, wherein the identification information is distributed by the transaction processing control device and is sent to the initial network element for processing the transaction.
CN201310409201.2A 2013-09-10 2013-09-10 Service processing control method and device in distribution network Active CN103475520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310409201.2A CN103475520B (en) 2013-09-10 2013-09-10 Service processing control method and device in distribution network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310409201.2A CN103475520B (en) 2013-09-10 2013-09-10 Service processing control method and device in distribution network

Publications (2)

Publication Number Publication Date
CN103475520A CN103475520A (en) 2013-12-25
CN103475520B true CN103475520B (en) 2017-04-26

Family

ID=49800230

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310409201.2A Active CN103475520B (en) 2013-09-10 2013-09-10 Service processing control method and device in distribution network

Country Status (1)

Country Link
CN (1) CN103475520B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2533416A (en) 2014-12-19 2016-06-22 Advanced Risc Mach Ltd Monitoring utilization of transactional processing resource
CN104486448B (en) * 2014-12-29 2018-09-11 成都极驰科技有限公司 A kind of data processing method and device
CN106155775B (en) * 2015-04-28 2020-02-21 菜鸟智能物流控股有限公司 Message processing method, device and system
CN105204941A (en) * 2015-08-18 2015-12-30 耿懿超 Data processing method and data processing device
CN112492619B (en) * 2019-09-12 2022-04-01 大唐移动通信设备有限公司 Transaction state management method and device and state caching device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101562543A (en) * 2009-05-25 2009-10-21 阿里巴巴集团控股有限公司 Cache data processing method and processing system and device thereof
WO2011000260A1 (en) * 2009-06-30 2011-01-06 华为技术有限公司 Method, apparatus and network system for managing memory resources in cluster system
CN102279730A (en) * 2010-06-10 2011-12-14 阿里巴巴集团控股有限公司 Parallel data processing method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101562543A (en) * 2009-05-25 2009-10-21 阿里巴巴集团控股有限公司 Cache data processing method and processing system and device thereof
WO2011000260A1 (en) * 2009-06-30 2011-01-06 华为技术有限公司 Method, apparatus and network system for managing memory resources in cluster system
CN102279730A (en) * 2010-06-10 2011-12-14 阿里巴巴集团控股有限公司 Parallel data processing method, device and system

Also Published As

Publication number Publication date
CN103475520A (en) 2013-12-25

Similar Documents

Publication Publication Date Title
CN103475520B (en) Service processing control method and device in distribution network
CN107491355A (en) Funcall method and device between a kind of process based on shared drive
CN103412786A (en) High performance server architecture system and data processing method thereof
CN107153643B (en) Data table connection method and device
CN106547612A (en) A kind of multi-task processing method and device
CN106657327A (en) Message pushing method and message pushing device
CN106034137A (en) Intelligent scheduling method for distributed system, and distributed service system
US9104486B2 (en) Apparatuses, systems, and methods for distributed workload serialization
CN105373563B (en) Database switching method and device
CN109992415B (en) Container dispatching method and dispatching system
CN109756429A (en) Bandwidth allocation methods and equipment
CN109670932B (en) Credit data accounting method, apparatus, system and computer storage medium
US8001341B2 (en) Managing dynamically allocated memory in a computer system
CN111400241B (en) Data reconstruction method and device
CN106021026B (en) Backup method and device
CN111427689A (en) Cluster keep-alive method and device and storage medium
CN108984105B (en) Method and device for distributing replication tasks in network storage device
CN115858667A (en) Method, apparatus, device and storage medium for synchronizing data
CN105549911B (en) The data transmission method and device of NVRAM
CN116149814A (en) KAFKA-based data persistence task distributed scheduling method and system
CN102508738B (en) Backup method of service information of multi-core processor, inner core and backup inner core
CN114924888A (en) Resource allocation method, data processing method, device, equipment and storage medium
CN111339132B (en) Data query method and database proxy
CN116185649A (en) Storage control method, storage controller, storage chip, network card, and readable medium
US20130007181A1 (en) Method and system for offloading computation flexibly to a communication adapter

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20170109

Address after: 266000 Shandong Province, Qingdao city Laoshan District Songling Road No. 399

Applicant after: Poly Polytron Technologies Inc

Address before: 266071 Laoshan, Qingdao province Hongkong District No. East Road, room 248, room 131

Applicant before: Hisense Media Networks Co., Ltd.

GR01 Patent grant
GR01 Patent grant