CN110851243B - Flow access control method and device, storage medium and electronic equipment - Google Patents

Flow access control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110851243B
CN110851243B CN201911072168.2A CN201911072168A CN110851243B CN 110851243 B CN110851243 B CN 110851243B CN 201911072168 A CN201911072168 A CN 201911072168A CN 110851243 B CN110851243 B CN 110851243B
Authority
CN
China
Prior art keywords
access information
access
current
range
conflict
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
CN201911072168.2A
Other languages
Chinese (zh)
Other versions
CN110851243A (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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201911072168.2A priority Critical patent/CN110851243B/en
Publication of CN110851243A publication Critical patent/CN110851243A/en
Application granted granted Critical
Publication of CN110851243B publication Critical patent/CN110851243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Abstract

The disclosure relates to a flow access control method, a flow access control device, a storage medium and an electronic device, wherein the method comprises the following steps: determining current access information corresponding to a current access request according to the received current access request aiming at a process, wherein the access information comprises an access type and an access range, and the access range comprises part of nodes in the process; determining whether conflict access information corresponding to the current access information exists in each piece of existing access information of the process, wherein the existing access information corresponds to an access request earlier than the current access request, and the operation corresponding to the existing access information is not executed yet; and if the conflict access information exists, executing the operation corresponding to the current access information according to the conflict access information and the current access information. Therefore, the concurrency performance of flow access can be effectively improved. And moreover, the consistency of data in the concurrent access process of the process can be effectively ensured.

Description

Flow access control method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of process processing, and in particular, to a process access control method, an apparatus, a storage medium, and an electronic device.
Background
With the continuous development of enterprises, the flow of various businesses or examinations is more and more complex. To improve the operation efficiency of the process, the process model is usually loaded into the memory. When the process model is concurrently accessed, if the same data in the process model is simultaneously read and modified, the data may be inconsistent. In the prior art, the following method is adopted to ensure the consistency of data:
when a certain transaction operates the process model, the memory corresponding to the whole process model is locked and controlled, and other transactions are not allowed to access. Although the above solution can solve the problem of data inconsistency, the concurrent performance is seriously degraded.
Disclosure of Invention
The purpose of the present disclosure is to provide a flow access control method, apparatus, storage medium, and electronic device that can ensure data consistency and effectively improve concurrency performance.
According to a first aspect of the present disclosure, there is provided a flow access control method, the method including:
determining current access information corresponding to a current access request according to the received current access request aiming at a process, wherein the access information comprises an access type and an access range, and the access range comprises part of nodes in the process;
determining whether conflict access information corresponding to the current access information exists in each piece of existing access information of the process, wherein the existing access information corresponds to an access request earlier than the current access request, and the operation corresponding to the existing access information is not executed yet;
and if the conflict access information exists, executing the operation corresponding to the current access information according to the conflict access information and the current access information.
Optionally, the determining whether conflicting access information corresponding to the current access information exists in each existing access information of the flow includes:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
Optionally, each node in the flow corresponds to a one-bit binary number, and the access range is represented by a binary number corresponding to each node in the flow, where the binary number corresponding to the node belonging to the access range is 1, and the binary number corresponding to the node not belonging to the access range is 0;
the determining whether conflict access information corresponding to the current access information exists in each existing access information of the process includes:
and for each piece of the existing access information, performing and operation on the binary representation corresponding to the access range of the existing access information and the binary representation corresponding to the access range of the current access information, and if the and operation result is not 0, determining the existing access information as the conflict access information.
Optionally, the executing, according to the conflicting access information and the current access information, an operation corresponding to the current access information includes:
when the operation corresponding to the previous conflict access information of the current access information is in an execution state:
if the access type of the previous conflict access information is a read type and the access type of the current access information is a read type, executing a reading operation on a node in the access range of the current access information, wherein the previous conflict access information is the conflict access information which is closest to the current access information in time in the conflict access information;
if the access type of the previous conflict access information is a read type and the access type of the current access information is a write type, generating a process copy according to the access range of the current access information, wherein the process copy comprises each node in the access range of the current access information; executing the operation corresponding to the current access information in the process copy; if the operation corresponding to the current access information in the process copy is completed and the operation corresponding to the conflict access information is completed, replacing the node in the process and in the access range of the current access information with the node of the process copy;
and if the access type of the previous conflict access information is a write type, executing the operation corresponding to the current access information after the operation corresponding to the previous conflict access information is finished.
Optionally, the method further comprises:
determining coefficients representing concurrency capabilities of the process engine system;
and if the coefficient is in a preset concurrent interval, executing the step of determining current access information corresponding to the current access request according to the received current access request aiming at the process.
Optionally, the coefficient for representing the concurrency capability of the process engine system is determined by the following formula:
Figure BDA0002261291740000031
wherein Q is the coefficient used for expressing the concurrency capability of the process engine system;
p is the concurrency number of the process engine;
s is the number of CPU cores;
t is a coefficient for representing the computing power of the CPU core.
According to a second aspect of the present disclosure, there is provided a flow access control apparatus, the apparatus including:
the system comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining current access information corresponding to a current access request according to the received current access request aiming at a process, the access information comprises an access type and an access range, and the access range comprises part of nodes in the process;
a second determining module, configured to determine whether conflicting access information corresponding to the current access information exists in each piece of existing access information of the flow, where the existing access information corresponds to an access request earlier than the current access request, and an operation corresponding to the existing access information is not yet executed and completed;
and the execution module is used for executing the operation corresponding to the current access information according to the conflict access information and the current access information if the conflict access information is determined to exist.
Optionally, the second determining module is configured to:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
Optionally, each node in the flow corresponds to a one-bit binary number, and the access range is represented by a binary number corresponding to each node in the flow, where the binary number corresponding to the node belonging to the access range is 1, and the binary number corresponding to the node not belonging to the access range is 0;
the second determination module is to:
and for each piece of the existing access information, performing and operation on the binary representation corresponding to the access range of the existing access information and the binary representation corresponding to the access range of the current access information, and if the and operation result is not 0, determining the existing access information as the conflict access information.
Optionally, the execution module includes:
a first execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a read type and an access type of the current access information is a read type, execute a read operation on a node within an access range of the current access information, where the previous conflicting access information is conflicting access information that is temporally closest to the current access information in the conflicting access information;
a second execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a read type and an access type of the current access information is a write type, generate a process copy according to an access range of the current access information, where the process copy includes nodes in the access range of the current access information; executing the operation corresponding to the current access information in the process copy; if the operation corresponding to the current access information in the process copy is completed and the operation corresponding to the conflict access information is completed, replacing the node in the process and in the access range of the current access information with the node of the process copy;
and a third execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a write type, wait for completion of the operation corresponding to the previous conflicting access information, and execute the operation corresponding to the current access information.
Optionally, the apparatus further comprises:
a second determination module for determining coefficients representing concurrency capabilities of the process engine system;
and if the coefficient is in a preset concurrency interval, triggering the first determining module to determine current access information corresponding to the current access request according to the received current access request aiming at the process.
Optionally, the coefficient for representing the concurrency capability of the process engine system is determined by the following formula:
Figure BDA0002261291740000051
wherein Q is the coefficient used for expressing the concurrency capability of the process engine system;
p is the concurrency number of the process engine;
s is the number of CPU cores;
t is a coefficient for representing the computing power of the CPU core.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the above-mentioned first aspects.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the first aspects above.
In the above technical solution, according to a received current access request for a flow, current access information corresponding to the current access request is determined, so that an access range corresponding to the current access request can be determined, where the access range includes a part of nodes in the flow, so that when the flow is accessed, locking control can be performed on a part of node segments in the flow, and thus, the problem that, like when the flow is accessed in the prior art, locking control is performed on the whole flow by using all nodes in the flow as a whole can be avoided, and thus concurrency performance of flow access can be effectively improved. And whether the conflict access information corresponding to the current access information exists in the existing access information is determined, so that the consistency of data in the process of concurrent access of the process can be effectively ensured, and the data security is ensured.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a flow chart of a flow access control method provided according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a process;
FIG. 3 is a schematic diagram of a process;
FIG. 4 is a schematic diagram of a process;
FIG. 5 is a diagram of flow concurrency versus CPU and memory of the system;
FIG. 6 is a block diagram of a process access control apparatus provided in accordance with one embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment;
FIG. 8 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
As described in the background art, when accessing a flow, a concurrent access manner is usually adopted to improve the operation efficiency, but when access control is performed on the flow through a cache locking mechanism of the entire flow model, the concurrent performance is reduced. In addition, a node lock can be set for each node in the process, although the concurrency performance can be improved by the method, the complexity and the occupation of the memory and the CPU are greatly increased by setting the node lock for each node.
Based on this, in order to solve the above problem, the present disclosure provides a flow access control method. Fig. 1 is a flowchart of a flow access control method according to an embodiment of the present disclosure, where as shown in fig. 1, the method includes:
in S11, according to the received current access request for the flow, current access information corresponding to the current access request is determined, where the access information includes an access type and an access range, and the access range includes a part of nodes in the flow.
The access requests for the process may be implemented in a transaction manner, that is, each access request corresponds to one transaction. And, after the process is released, subsequent modifications will typically modify one node or a plurality of consecutive nodes therein. Therefore, when an access request for a flow is received, access information can be determined according to an operation corresponding to the access request. Illustratively, as shown in fig. 2, a schematic diagram of a process is shown, wherein the process includes a node A, B, C, D, E, F, and the association relationship between the nodes is shown by arrows in fig. 2.
As an example, when determining the access range corresponding to the current access request, the range formed by the operation node indicated in the access request may be determined as the access range, that is, the range formed by the first and last nodes in the sequence in the operation node, so that when accessing the flow, locking control may be performed according to the access range.
For example, if the access range corresponding to the operation node indicated in the access request is ABC when the operation node indicated in the access request is A, B, C, then the lock control may be performed only on the node segment formed by ABC, and other nodes in the flow may be in an accessible state. For another example, when the operation node indicated in the access request is A, C, the access range formed according to the first and last nodes in the order of the indicated operation nodes is ABC, so that it is possible to facilitate uniform management of the access range and reduce the overhead of memory and CPU. When only one operation node indicated by the access request exists, the access range corresponding to the access request is the operation node.
In S12, it is determined whether there is conflicting access information corresponding to current access information in each existing access information of the flow, where the existing access information corresponds to an access request earlier than the current access request, and an operation corresponding to the existing access information has not been performed yet.
The conflict access information is the existing access information with the overlapping access range corresponding to the current access information. Illustratively, the access information may be stored by way of a queue, and the access message is dequeued from the queue when an operation to access the message is performed.
In S13, if it is determined that there is conflicting access information, an operation corresponding to the current access information is executed based on the conflicting access information and the current access information.
If it is determined that the conflicting access information exists, it indicates that the operation corresponding to the current access information may not be executed immediately, for example, the access range of the current access information is ABC, and the access range of the conflicting access information is CD, and at this time, it is necessary to determine when to execute the operation corresponding to the current access information according to the conflicting access information and the current access information.
If the conflict access information does not exist, the operation corresponding to the current access information can be immediately executed, and at the moment, the operation corresponding to the current access information can be directly executed.
In the above technical solution, according to a received current access request for a flow, current access information corresponding to the current access request is determined, so that an access range corresponding to the current access request can be determined, where the access range includes a part of nodes in the flow, so that when the flow is accessed, locking control can be performed on a part of node segments in the flow, and thus, the problem that, like when the flow is accessed in the prior art, locking control is performed on the whole flow by using all nodes in the flow as a whole can be avoided, and thus concurrency performance of flow access can be effectively improved. And whether the conflict access information corresponding to the current access information exists in the existing access information is determined, so that the consistency of data in the process of concurrent access of the process can be effectively ensured, and the data security is ensured.
Optionally, in S12, an exemplary implementation manner of determining whether there is conflicting access information corresponding to the current access information in each existing access information of the flow is as follows, which may include:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
For example, as shown in fig. 2, the access range determined by the existing access information M1 is BCD, and the access range determined by the existing access information M2 is EF. The access range of the current access information N is ABC.
As an example, when comparing the access range of the existing access information with the access range of the current access information, the comparison may be performed by determining whether a node within the access range of the current access information belongs to the access range of the existing access information.
For example, for the existing access information M1 and the current access information N, the access range of the current access information N is ABC, it may be first determined whether the node a belongs to the access range of the existing access information M1. Since the access range of the existing access information M1 is BCD, the node a does not belong to the access range of the existing access information M1. Then, if it is determined that the node B belongs to the access range of the existing access information M1 and the access range of the existing access information M1, it may be determined that the access ranges of the two are overlapped, and the existing access information M1 is determined as the conflicting access information.
As another example, for the existing access information M2 and the current access information N, determining that neither node A, B, C in the access range of the current access information N belongs to the access range of the existing access information M2 in the above manner indicates that the existing access information M2 does not conflict with the current access information N.
In the technical scheme, the current access information is compared with each piece of current access information, so that the conflict access information which is coincident with the access range of the current access information in the current access information can be determined, the risk of data inconsistency caused by the simultaneous execution of the operations corresponding to the conflict access information and the current access information can be effectively avoided, and the safety and the accuracy of the process access control are ensured.
Optionally, each node in the flow corresponds to a one-bit binary number, and the access range is represented by a binary number corresponding to each node in the flow, where the binary number corresponding to the node belonging to the access range is 1, and the binary number corresponding to the node not belonging to the access range is 0;
another exemplary embodiment of the determining whether conflicting access information corresponding to the current access information exists in each existing access information of the flow may include the following:
and for each piece of the existing access information, performing and operation on the binary representation corresponding to the access range of the existing access information and the binary representation corresponding to the access range of the current access information, and if the and operation result is not 0, determining the existing access information as the conflict access information.
Following the above example, as shown in FIG. 2, there are 6 nodes in the flow, respectively node A, B, C, D, E, F, and when the flow is not being accessed, the initialization is represented as 000000. For example, if the access range determined by the existing access information M1 is BCD, the access range of the existing access information M1 may be denoted as 011100; if the access range determined by the existing access information M2 is EF, the access range of the existing access information M2 may be represented as 000011; the access range of the current access information N is ABC, and the access range of the current access information N is 111000.
Then, the and operation is performed on the access range of the current access information M1 and the access range of the current access information N, and the result is as follows:
011100&111000->011000
and operation is performed on the access range of the existing access information M2 and the access range of the current access information N, and the result is as follows:
000011&111000->000000
as can be seen from the above, if the result of the and operation performed on the access ranges of the current access information M1 and the current access information N is not 0, that is, at least one same node exists in the access ranges of the current access information M1 and the current access information N, and the access ranges thereof conflict with each other, the current access information M1 is determined as the conflicting access information; the result of the and operation performed on the access ranges of the current access information M2 and the current access information N is 0, that is, there is no conflict between the access ranges of the current access information M2 and the current access information N.
In the above technical solution, the access information is represented by a binary number, on one hand, the access information and the access range can be uniformly represented, which is convenient for controlling the concurrent access of the process, and on the other hand, based on the and operation of the binary number, the conflict access message corresponding to the current access information in the current access information can be effectively and quickly determined, which can improve the access efficiency of the process and further ensure the high concurrency performance of the process.
Optionally, each access information that is not yet executed for the process may be stored in a queue, and the access information is stored according to the sequence of the generation time of the access information. As an example, whether the access information in the queue can be executed may be determined at intervals of a preset time, for example, whether conflicting access information exists in the access information in the queue may be detected every 1s, and if not, it indicates that the access information is executable. As another example, detecting whether access information in the queue can be executed may be triggered upon completion of any access information execution operation. The foregoing is merely an exemplary embodiment and is not intended to limit the present disclosure.
Optionally, in S13, according to the conflicting access information and the current access information, an operation corresponding to the current access information is executed, where the operation includes:
when the operation corresponding to the previous conflict access information of the current access information is in an execution state:
in the first case: and if the access type of the previous conflict access information is a read type and the access type of the current access information is a read type, executing a reading operation on a node in the access range of the current access information, wherein the previous conflict access information is the conflict access information which is closest to the current access information in time in the conflict access information.
Illustratively, the access type of the previous conflicting access information M3 is read type, the access scope is ABCD, the access type of the current access information is read type, and the access scope is CD. Because the phenomenon of inconsistent data cannot be caused by reading the data in the process, at this time, the reading operations corresponding to the previous conflict access information and the current access information respectively can be executed simultaneously, namely, the transaction of the previous conflict access information can read the data of the ABCD, and the transaction of the current access information can read the CD, so that the high concurrency of the process access is effectively improved.
In the second case: if the access type of the previous conflict access information is a read type and the access type of the current access information is a write type, generating a process copy according to the access range of the current access information, wherein the process copy comprises each node in the access range of the current access information; executing the operation corresponding to the current access information in the process copy; and if the operation corresponding to the current access information in the process copy is completed and the operation corresponding to the conflict access information is completed, replacing the node in the process and in the access range of the current access information with the node of the process copy.
Illustratively, the access type of the previous conflicting access information M3 is read type, the access scope is ABCD, the access type of the current access information is write type, and the access scope is CD. Since the write-type operation modifies the data in the flow, if the operations corresponding to the previous conflict access information and the current access information are performed simultaneously, the problem of data inconsistency may occur. Therefore, in this embodiment, at this time, a flow copy L may be generated according to the access scope of the current access information, and as shown in fig. 3, the flow copy L includes nodes C 'and D'.
Thereafter, an operation corresponding to the current access information, i.e., a modification operation on the nodes C 'and D', may be performed in the flow copy. After the modifying operation on the nodes C 'and D' is completed, it is determined whether the operation corresponding to the conflicting access information corresponding to the current access information is completed, and after the operations corresponding to the conflicting access information are all completed, the node in the process and within the access range of the current access information is replaced with the node of the process copy, that is, the nodes C and D in the process are replaced with the nodes C 'and D', as shown in fig. 4. Wherein, the removed nodes C and D can be recycled through a garbage recycling mechanism.
It should be noted that, when replacing a node in the access range of the current access information in the flow with a node of the flow copy, it is necessary to ensure unique access to the node in the access range, for example, an exclusive lock may be added to the node in the access range, so as to avoid data inconsistency caused by interference of other transactions in the process of replacing the flow node. For example, the above replacement operation may be completed by modifying the pointer direction in the flow node, and the pointer modification mode is an existing mode and is not described herein again.
Optionally, for the access information of the read type, when the execution of the operation corresponding to the access information starts, a locking operation may be performed on an access range of the access information, the lock has no exclusivity, and may allow multiple transactions to access simultaneously, and the locking operation may indicate that the nodes in the range are executing corresponding operations, so as to effectively avoid interference of transactions of other access information. And after the execution of the operation corresponding to the access information is finished, the lock corresponding to the access range can be released in time, so that whether the operation corresponding to the access information is finished or not can be determined according to the state of the lock, the concurrent access and consistency of data can be effectively guaranteed, and the efficiency of process access control can be effectively improved.
In the third case: and if the access type of the previous conflict access information is a write type, executing the operation corresponding to the current access information after the operation corresponding to the previous conflict access information is finished.
In this embodiment, if the access type of the previous conflicting access information is a write type, the operation corresponding to the previous conflicting access information may modify the data in the process, and in order to ensure the consistency of the data during concurrent access of the process, it is necessary to wait for the completion of the operation corresponding to the previous conflicting access information and then execute the operation corresponding to the current access information, thereby ensuring the consistency and security of the data and ensuring the accuracy of the process access control.
Optionally, the method further comprises:
determining a coefficient for representing the concurrency capability of the process engine system, specifically, the coefficient for representing the concurrency capability of the process engine system can be determined by the following formula:
Figure BDA0002261291740000141
wherein Q is the coefficient used for expressing the concurrency capability of the process engine system;
p is a process engine concurrency number, wherein the process engine concurrency number can be obtained by acquiring parameters of the process engine;
s is the number of CPU cores;
t is a coefficient for indicating the computing power of the CPU core, wherein the coefficient for indicating the computing power of the CPU core is set to 1 by default, and the value of the coefficient is used to adjust the difference in the computing power of different CPU cores, as an example. For example, the value of T may be determined by using the computing power of an intel I5-6500 chip as a reference value, the chip of the CPU core is an intel I5-6500 chip, T is 1, the T values of the other chips depend on the comparison result of the computing power (laboratory test value, unit: hundred million times/second) of the chip and the I5-6500 chip, for example, if the computing power value of a certain X chip is 2 times that of the I5-6500 chip, the value of T corresponding to the X chip is 2.
If the coefficient is in the preset concurrency interval, the step S11 of determining the current access information corresponding to the current access request according to the received current access request for the process is executed.
Wherein the preset concurrency interval can be set according to the actual use scene,
through experimentation, applicants have discovered that, as shown in fig. 5, the X-axis represents the amount of concurrency of process accesses and the Y-axis represents the CPU and memory overhead. When determining the corresponding access range according to the access request, if the concurrency of the current access of the flow is small (i.e., the concurrency is less than K1 in fig. 5), the overhead of the CPU and the memory is too large; if the amount of concurrency currently accessed by the flow is too large (i.e., the amount of concurrency is greater than K2 in fig. 5), the CPU and memory overhead increases exponentially as the amount of concurrency increases. When the concurrency amount is in the interval of [ K1, K2], the overhead of CPU and memory required for concurrent access control increases smoothly, as shown in fig. 5.
According to the determined concurrency [ K1, K2] interval, the preset concurrency interval can be set to [25,100 ]. That is, if the determined coefficient for indicating the concurrency capability of the process engine system is 30, the current access information corresponding to the current access request is determined according to the received current access request for the process.
If the determined coefficient for representing the concurrency capability of the process engine system is 10, at this time, according to the received current access request for the process, it is determined that the overhead of the CPU and the memory caused by the current access information corresponding to the current access request is relatively large, and at this time, all the entire nodes in the process can be directly used as the access range corresponding to the access request, that is, when the operation corresponding to the current access information is executed, the entire process is locked.
Through the technical scheme, the concurrent access control on the process is adaptive to the system performance, the high concurrent access performance of the process is ensured, the extra occupation of the process concurrent access on the system resources is effectively reduced, the overall performance of a process engine and the system is ensured, and the safety and the accuracy of the process access can be effectively ensured.
The present disclosure also provides a flow access control apparatus, as shown in fig. 6, where the apparatus 10 includes:
a first determining module 100, configured to determine, according to a received current access request for a flow, current access information corresponding to the current access request, where the access information includes an access type and an access range, and the access range includes a part of nodes in the flow;
a second determining module 200, configured to determine whether conflicting access information corresponding to the current access information exists in each existing access information of the process, where the existing access information corresponds to an access request earlier than the current access request, and an operation corresponding to the existing access information is not yet executed;
and the executing module 300 is configured to, if it is determined that the conflict access information exists, execute an operation corresponding to the current access information according to the conflict access information and the current access information.
Optionally, the second determining module is configured to:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
Optionally, each node in the flow corresponds to a one-bit binary number, and the access range is represented by a binary number corresponding to each node in the flow, where the binary number corresponding to the node belonging to the access range is 1, and the binary number corresponding to the node not belonging to the access range is 0;
the second determination module is to:
and for each piece of the existing access information, performing and operation on the binary representation corresponding to the access range of the existing access information and the binary representation corresponding to the access range of the current access information, and if the and operation result is not 0, determining the existing access information as the conflict access information.
Optionally, the execution module includes:
a first execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a read type and an access type of the current access information is a read type, execute a read operation on a node within an access range of the current access information, where the previous conflicting access information is conflicting access information that is temporally closest to the current access information in the conflicting access information;
a second execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a read type and an access type of the current access information is a write type, generate a process copy according to an access range of the current access information, where the process copy includes nodes in the access range of the current access information; executing the operation corresponding to the current access information in the process copy; if the operation corresponding to the current access information in the process copy is completed and the operation corresponding to the conflict access information is completed, replacing the node in the process and in the access range of the current access information with the node of the process copy;
and a third execution sub-module, configured to, when an operation corresponding to previous conflicting access information of the current access information is in an execution state, if an access type of the previous conflicting access information is a write type, wait for completion of the operation corresponding to the previous conflicting access information, and execute the operation corresponding to the current access information.
Optionally, the apparatus further comprises:
a second determination module for determining coefficients representing concurrency capabilities of the process engine system;
and if the coefficient is in a preset concurrency interval, triggering the first determining module to determine current access information corresponding to the current access request according to the received current access request aiming at the process.
Optionally, the coefficient for representing the concurrency capability of the process engine system is determined by the following formula:
Figure BDA0002261291740000171
wherein Q is the coefficient used for expressing the concurrency capability of the process engine system;
p is the concurrency number of the process engine;
s is the number of CPU cores;
t is a coefficient for representing the computing power of the CPU core.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an electronic device 700 in accordance with an example embodiment. As shown in fig. 7, the electronic device 700 may include: a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the above flow access control method. The memory 702 is used to store various types of data to support operation at the electronic device 700, such as instructions for any application or method operating on the electronic device 700 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and the like. The Memory 702 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia components 703 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 702 or transmitted through the communication component 705. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, which is not limited herein. The corresponding communication component 705 may thus include: Wi-Fi module, Bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic Device 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described flow access control method.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the flow access control method described above is also provided. For example, the computer readable storage medium may be the memory 702 described above comprising program instructions that are executable by the processor 701 of the electronic device 700 to perform the flow access control method described above.
Fig. 8 is a block diagram illustrating an electronic device 1900 in accordance with an example embodiment. For example, the electronic device 1900 may be provided as a server. Referring to fig. 8, an electronic device 1900 includes a processor 1922, which may be one or more in number, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processor 1922 may be configured to execute the computer program to perform the flow access control method described above.
Additionally, electronic device 1900 may also include a power component 1926 and a communication component 1950, the power component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 1900. In addition, the electronic device 1900 may also include input/output (I/O) interfaces 1958. The electronic device 1900 may operate based on an operating system, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, etc., stored in memory 1932.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the flow access control method described above is also provided. For example, the computer readable storage medium may be the memory 1932 described above that includes program instructions that are executable by the processor 1922 of the electronic device 1900 to perform the flow access control method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned flow access control method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, various possible combinations will not be separately described in this disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (10)

1. A method for flow access control, the method comprising:
determining current access information corresponding to a current access request according to the received current access request aiming at a process, wherein the access information comprises an access type and an access range, and the access range comprises part of nodes in the process;
determining whether conflict access information corresponding to the current access information exists in each piece of existing access information of the process, wherein the existing access information corresponds to an access request earlier than the current access request, and the operation corresponding to the existing access information is not executed yet;
and if the conflict access information exists, executing the operation corresponding to the current access information according to the conflict access information and the current access information.
2. The method of claim 1, wherein the determining whether conflicting access information corresponding to the current access information exists in each existing access information of the flow comprises:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
3. The method according to claim 1, wherein each node in the flow corresponds to a one-bit binary number, and the access range is represented by a binary number corresponding to each node in the flow, wherein the binary number corresponding to the node belonging to the access range is 1, and the binary number corresponding to the node not belonging to the access range is 0;
the determining whether conflict access information corresponding to the current access information exists in each existing access information of the process includes:
and for each piece of the existing access information, performing and operation on the binary representation corresponding to the access range of the existing access information and the binary representation corresponding to the access range of the current access information, and if the and operation result is not 0, determining the existing access information as the conflict access information.
4. The method according to claim 1, wherein the performing, according to the conflicting access information and the current access information, an operation corresponding to the current access information includes:
when the operation corresponding to the previous conflict access information of the current access information is in an execution state:
if the access type of the previous conflict access information is a read type and the access type of the current access information is a read type, executing a reading operation on a node in the access range of the current access information, wherein the previous conflict access information is the conflict access information which is closest to the current access information in time in the conflict access information;
if the access type of the previous conflict access information is a read type and the access type of the current access information is a write type, generating a process copy according to the access range of the current access information, wherein the process copy comprises each node in the access range of the current access information; executing the operation corresponding to the current access information in the process copy; if the operation corresponding to the current access information in the process copy is completed and the operation corresponding to the conflict access information is completed, replacing the node in the process and in the access range of the current access information with the node of the process copy;
and if the access type of the previous conflict access information is a write type, executing the operation corresponding to the current access information after the operation corresponding to the previous conflict access information is finished.
5. The method of claim 1, further comprising:
determining coefficients representing concurrency capabilities of the process engine system;
and if the coefficient is in a preset concurrent interval, executing the step of determining current access information corresponding to the current access request according to the received current access request aiming at the process.
6. The method of claim 5, wherein the coefficient representing the concurrency capability of the process engine system is determined by the following formula:
Figure FDA0002261291730000031
wherein Q is the coefficient used for expressing the concurrency capability of the process engine system;
p is the concurrency number of the process engine;
s is the number of CPU cores;
t is a coefficient for representing the computing power of the CPU core.
7. A process access control apparatus, characterized in that the apparatus comprises:
the system comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining current access information corresponding to a current access request according to the received current access request aiming at a process, the access information comprises an access type and an access range, and the access range comprises part of nodes in the process;
a second determining module, configured to determine whether conflicting access information corresponding to the current access information exists in each piece of existing access information of the flow, where the existing access information corresponds to an access request earlier than the current access request, and an operation corresponding to the existing access information is not yet executed and completed;
and the execution module is used for executing the operation corresponding to the current access information according to the conflict access information and the current access information if the conflict access information is determined to exist.
8. The apparatus of claim 7, wherein the second determining module is configured to:
and comparing the access range of the existing access information with the access range of the current access information aiming at each piece of the existing access information, and determining the existing access information as the conflict access information if the access ranges are overlapped.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 6.
CN201911072168.2A 2019-11-05 2019-11-05 Flow access control method and device, storage medium and electronic equipment Active CN110851243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911072168.2A CN110851243B (en) 2019-11-05 2019-11-05 Flow access control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911072168.2A CN110851243B (en) 2019-11-05 2019-11-05 Flow access control method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110851243A CN110851243A (en) 2020-02-28
CN110851243B true CN110851243B (en) 2022-04-12

Family

ID=69598382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911072168.2A Active CN110851243B (en) 2019-11-05 2019-11-05 Flow access control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110851243B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5983225A (en) * 1998-01-26 1999-11-09 Telenor As Parameterized lock management system and method for conditional conflict serializability of transactions
CN101853279A (en) * 2010-05-13 2010-10-06 复旦大学 Improved lockout method of internal memory database
CN104077111A (en) * 2014-06-24 2014-10-01 用友优普信息技术有限公司 Concurrent access control method and device for service operations
JP2015215641A (en) * 2014-05-07 2015-12-03 富士通株式会社 Information processor, emulation program and emulation method
CN106802939A (en) * 2016-12-30 2017-06-06 华为技术有限公司 A kind of method and system of resolving data conflicts
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
CN108984312A (en) * 2017-06-02 2018-12-11 伊姆西Ip控股有限责任公司 The method and apparatus of reading and writing data
CN109634974A (en) * 2018-12-04 2019-04-16 郑州云海信息技术有限公司 A kind of data processing method, system and associated component

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7865485B2 (en) * 2003-09-23 2011-01-04 Emc Corporation Multi-threaded write interface and methods for increasing the single file read and write throughput of a file server
US7792805B2 (en) * 2006-05-30 2010-09-07 Oracle America, Inc. Fine-locked transactional memory
US20110302143A1 (en) * 2010-06-02 2011-12-08 Microsoft Corporation Multi-version concurrency with ordered timestamps
US9792294B2 (en) * 2014-07-02 2017-10-17 Panzura, Inc Using byte-range locks to manage multiple concurrent accesses to a file in a distributed filesystem

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5983225A (en) * 1998-01-26 1999-11-09 Telenor As Parameterized lock management system and method for conditional conflict serializability of transactions
CN101853279A (en) * 2010-05-13 2010-10-06 复旦大学 Improved lockout method of internal memory database
JP2015215641A (en) * 2014-05-07 2015-12-03 富士通株式会社 Information processor, emulation program and emulation method
CN104077111A (en) * 2014-06-24 2014-10-01 用友优普信息技术有限公司 Concurrent access control method and device for service operations
CN106802939A (en) * 2016-12-30 2017-06-06 华为技术有限公司 A kind of method and system of resolving data conflicts
CN108984312A (en) * 2017-06-02 2018-12-11 伊姆西Ip控股有限责任公司 The method and apparatus of reading and writing data
CN108683604A (en) * 2018-04-03 2018-10-19 平安科技(深圳)有限公司 concurrent access control method, terminal device and medium
CN109634974A (en) * 2018-12-04 2019-04-16 郑州云海信息技术有限公司 A kind of data processing method, system and associated component

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Speedy transactions in multicore in-memory databases;Stephen Tu 等;《SOSP "13: Proceedings of the Twenty-Fourth ACM Symposium on Operating Systems Principles》;20131130;18-32 *
Towards elastic transactional cloud storage with range query support;Hoang Tam Vo 等;《Proceedings of the VLDB Endowment》;20100930;第3卷(第1-2期);506-517 *
多核共享缓存bank冲突分析及其延迟最小化;张吉赞 等;《计算机学报 》;20160930;第39卷(第9期);1883-1899 *
片上多核处理器存储一致性验证;王朋宇 等;《软件学报》;20100415;第21卷(第4期);863-874 *

Also Published As

Publication number Publication date
CN110851243A (en) 2020-02-28

Similar Documents

Publication Publication Date Title
US7941688B2 (en) Managing timers in a multiprocessor environment
US10503671B2 (en) Controlling access to a shared resource
US10122598B2 (en) Subscription watch lists for event handling
CN109564566B (en) Discovery of calling applications for controlling file hydration behavior
CN110515871B (en) Interrupt method, interrupt device, FPGA (field programmable Gate array) and storage medium
EP2839369B2 (en) Information processing device and method for protecting data in a call stack
CN114580344A (en) Test excitation generation method, verification system and related equipment
WO2022199284A1 (en) Call stack backtrace method and apparatus, and device and medium
US11704139B2 (en) Service processing method and apparatus, electronic device, and storage medium
US10140166B2 (en) Message oriented middleware with integrated rules engine
US11489844B2 (en) On-the-fly creation of transient least privileged roles for serverless functions
CN116955044B (en) Method, device, equipment and medium for testing cache working mechanism of processor
CN106156050B (en) Data processing method and device
EP3566150B1 (en) Data consistency check in distributed system
US9535713B2 (en) Manipulating rules for adding new devices
CN110851243B (en) Flow access control method and device, storage medium and electronic equipment
CN109150993B (en) Method for obtaining network request tangent plane, terminal device and storage medium
CN113448585A (en) Optimization method and device for thread pool, electronic equipment and storage medium
CN110727666A (en) Cache assembly, method, equipment and storage medium for industrial internet platform
US9256851B2 (en) Intelligent cloning of a business object graph
US11789842B2 (en) System and method for advanced detection of potential system impairment
CN114385306A (en) Instruction sequence atomicity modification method and device and readable storage medium
US10783245B2 (en) Feedback-directed static analysis
US10628441B1 (en) System and method for selective storage transformation
CN108984450B (en) Data transmission method, device and equipment

Legal Events

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