CN115952010A - Business operation control method, device, equipment and storage medium - Google Patents

Business operation control method, device, equipment and storage medium Download PDF

Info

Publication number
CN115952010A
CN115952010A CN202211139259.5A CN202211139259A CN115952010A CN 115952010 A CN115952010 A CN 115952010A CN 202211139259 A CN202211139259 A CN 202211139259A CN 115952010 A CN115952010 A CN 115952010A
Authority
CN
China
Prior art keywords
locking
condition
information
locked
retry
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.)
Pending
Application number
CN202211139259.5A
Other languages
Chinese (zh)
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.)
Xiamen Stone City Software Technology Co ltd
Original Assignee
Xiamen Stone City Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Stone City Software Technology Co ltd filed Critical Xiamen Stone City Software Technology Co ltd
Priority to CN202211139259.5A priority Critical patent/CN115952010A/en
Publication of CN115952010A publication Critical patent/CN115952010A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

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

Abstract

The invention relates to a method, a device, equipment and a storage medium for controlling business operation. The control method of the business operation comprises the following steps: receiving a first service request sent by a user terminal; responding to the first service request, and acquiring a first service operation corresponding to the first service request; under the condition that the first business operation has a locking identifier, acquiring an object identifier of a locking object under the first business operation from locking information corresponding to the locking identifier; locking the locked object according to the object identifier; after the locking is successful, executing a first business operation; and after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition.

Description

Business operation control method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for controlling a service operation.
Background
Currently, when a computer program processes a service processing request from a user terminal, a processing method corresponding to a partial processing request is locked, and only the locked processing method is processed, so as to ensure that the processing method is not repeatedly run at the same time. The existing locking mode can lock certain operation of the same service single number by adding a distributed redis lock inside the java service interface, and then execute the self logic of the service method. However, the existing locking method has high code intrusiveness and large coupling with the business code, which results in high code complexity, and when there are new features, the business method needs to be modified, which is a high risk. In addition, the locking logic in the program has various problems such as realization rationality and the like due to different development levels.
Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a new technical solution regarding a control method of a business operation.
According to a first aspect of the present disclosure, there is provided a method for controlling a service operation, the method including: receiving a first service request sent by a user terminal; responding to the first service request, and acquiring a first service operation corresponding to the first service request; under the condition that the first business operation has a locking identifier, acquiring an object identifier of a locking object under the first business operation from locking information corresponding to the locking identifier; locking the locked object according to the object identifier; after the locking is successful, executing a first business operation; and after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition.
Optionally, the lock release condition comprises at least one of a first lock release condition and a second lock release condition; the first lock release condition is: releasing the added lock in the event of detecting a completion event for completing the first business operation; the second lock release condition is: and releasing the added lock under the condition that the locking time reaches the locking validity period.
Optionally, after locking the locked object, the method further includes: under the condition of locking failure, acquiring locking retry information from the locking information; and when the locking retry information indicates that retry is needed, repeatedly executing the step of locking the locked object according to the object identification according to the locking retry information.
Optionally, the locking retry information includes a locking retry condition and a locking time interval, and the step of repeatedly executing locking for the locked object according to the object identifier according to the locking retry information includes: obtaining a condition object value corresponding to a locking retry condition; under the condition that the condition object value meets the locking retry condition, the step of locking the locking object according to the object identification is executed again according to the locking time interval; and under the condition that the value of the condition object does not meet the locking retry condition, stopping executing the locking operation for locking the locking object.
Optionally, after locking the locked object according to the object identifier, the method further includes: under the condition of locking failure, acquiring prompt information of the locking failure in the locking information; and informing the user terminal to output prompt information.
Optionally, after obtaining the object identifier of the locked object under the first service operation, the method further includes: acquiring locking enabling information of the object identifier in the locking information; if the locking enabling information indicates that locking is allowed, executing a step of locking the locked object according to the object identification; in the case where the locking enable information indicates that locking is not permitted, execution of a locking operation for locking the locking object is prohibited.
Optionally, before receiving the first service request sent by the user terminal, the method further includes: configuring locking information for a first service operation corresponding to the first service request according to a set configuration template; the configuration template comprises an operation type configuration item of business operation, an object identification configuration item of a locking object, a lock release condition configuration item, an enabling configuration item of the locking object and a locking retry configuration item.
According to a second aspect of the present disclosure, there is provided an apparatus for controlling a service operation, the apparatus comprising: the request receiving module is used for receiving a first service request sent by a user terminal; the service response module is used for responding to the first service request and acquiring a first service operation corresponding to the first service request; the data acquisition module is used for acquiring object identification data locking module of the locking object under the first business operation from the locking information corresponding to the locking identification under the condition that the first business operation has the locking identification, and is used for locking the locking object according to the object identification; and the operation execution module is used for executing the first service operation after the locking is successful. And the locking release module is used for acquiring a lock release condition in the locking information after the locking is successful, and releasing the locked lock for the locked object according to the lock release condition.
According to a third aspect of the present disclosure, there is provided a business operation control apparatus comprising at least one processor and at least one memory for storing a computer program, the processor being configured to perform the business operation control method of any one of the first aspect under the control of the computer program.
According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the control method of the business operation as in any one of the first aspects.
According to the control method of the service operation provided by the disclosure, a first service request sent by a user terminal is received; responding to the first service request, and acquiring a first service operation corresponding to the first service request; under the condition that the first business operation has a locking identifier, acquiring an object identifier of a locking object under the first business operation from locking information corresponding to the locking identifier; locking the locked object according to the object identifier; after the locking is successful, executing a first service operation; and after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition. By the method, pluggable locking can be performed on the data needing repeated submission prevention control in the system, the problem of data exception caused by repeated submission of services is solved, and zero intrusion on codes is realized.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments of the invention, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a block diagram of a hardware configuration of a control device that may be used to implement business operations of an embodiment;
FIG. 2 is a flow diagram of a method of controlling business operations according to one embodiment;
FIG. 3 is a flow diagram of a method of controlling business operations according to yet another embodiment;
fig. 4 is a schematic diagram of a control method of a traffic operation according to yet another embodiment;
FIG. 5 is a schematic diagram of a control device for business operations according to yet another embodiment;
FIG. 6 is a schematic diagram of a control device for business operations according to yet another embodiment;
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be discussed further in subsequent figures.
< implementation Environment and hardware configuration >
Fig. 1 is a hardware configuration structure diagram of a service operation control device 1000 to which the service operation control method according to the embodiment of the present invention can be applied.
As shown in fig. 1, the business operation control apparatus 1000 may include a processor 1100, a memory 1200, an interface device 1300, a display device 1400, an input device 1500, and the like. Processor 1100 is configured to execute a computer program, which may employ an instruction set of architectures such as x86, arm, RISC, MIPS, SSE, and the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 is a physical interface, such as a USB interface or a headset interface. The display device 1400 may be a display screen, which may be a touch display screen. The input device 1500 may include a keyboard, a mouse, etc., and may also include a touch device.
In this embodiment, the memory 1200 of the business operation controlling apparatus 1000 is used to store a computer program for controlling the processor 1100 to operate to implement the business operation controlling method according to any of the embodiments. A skilled person can design a computer program according to the solution disclosed in the present specification. How the computer program controls the operation of the processor 1100 is well known in the art and will not be described in detail herein.
It should be understood by those skilled in the art that although a plurality of devices of the business operation control apparatus 1000 are illustrated in fig. 1, the business operation control apparatus 1000 according to the embodiment of the present disclosure may only refer to some of the devices, and may also include other devices, which are not limited herein.
< method examples >
Fig. 2 shows a control method of a service operation according to an embodiment, which may be implemented, for example, by the control device 1000 of the service operation shown in fig. 1.
The control method of the business operation may include the following steps S1000 to S2000:
step S1000, configuring locking information for a first service operation corresponding to a first service request according to a set configuration template; the configuration template comprises an operation type configuration item of business operation, an object identification configuration item of a locking object, a lock release condition configuration item, an enabling configuration item of the locking object and a locking retry configuration item.
As shown in fig. 3, locking information is configured for a first service operation corresponding to a first service request sent by a user terminal according to a preset configuration template. The configuration template comprises an operation type configuration item of the business operation, an object identification configuration item of a locking object, a lock release condition configuration item, an enabling configuration item of the locking object and a locking retry configuration item. After configuring the locking information for the first service operation according to the preset configuration template, the locking information for the first service operation may include the operation type of the service operation, the object identifier of the locked object, the lock release condition, the locking enable information of the locked object, the locking retry information, and other related information. It should be noted that the preset configuration template may be set according to actual situations, and the configuration items included therein may also be set according to actual requirements, which is not limited herein.
Step S1100, receiving a first service request sent by a user equipment.
In an embodiment of the present disclosure, the user terminal may send a first service request to the control device for the service operation. The first service request may be received after the user terminal sends the first service request.
Step S1200, in response to the first service request, obtaining a first service operation corresponding to the first service request.
In the embodiment of the present disclosure, as shown in fig. 4, in response to a first service request sent by a user terminal, a service operation corresponding to the first service request may be obtained and taken as the first service operation.
Step 1300, under the condition that the first service operation has the locking identifier, acquiring the object identifier of the locking object under the first service operation from the locking information corresponding to the locking identifier.
In the embodiment of the present disclosure, a corresponding locking identifier may be added to the first service operation. The first business operation with the locking identifier may perform the locking operation on the locked object through the configured locking information, and then perform the first business operation on the locked object. In addition, when the first business operation has the locking identifier, the object identifier of the locking object may be acquired from the locking information configured in the first business operation. It should be noted that the object identifier of the locked object may be a unique identifier that marks the locked object. That is, through the object identifier in the locking information configured by the first business operation, the corresponding locking object can be accurately and uniquely determined. The object identifiers of the locking objects in the locking information can be set according to actual conditions, but it is required to ensure that only one locking object is determined according to the object identifiers. The locking object may be business data or other types of data, and is not limited herein. The locking identifier may be implemented by a code, or may be implemented by other methods, which are not limited herein.
It should be noted that, in the case that the first business operation performs the locking operation on the locked object, it is not possible to perform other business operations on the locked object that is successfully locked. That is to say, only after the first business operation is executed on the locked object and the lock of the locked object is released, the other business operations may re-execute the locking operation on the locked object and then execute the corresponding other business operations. After the first service operation successfully locks the locked object, if the user terminal sends a repeated service request again, a message prompt can be returned to the user terminal at this time to remind the user using the user terminal that the current service request is being processed, and the service request is not submitted repeatedly.
In the embodiment of the present disclosure, in step S1300, in the case that the first business operation has a locking identifier, after the object identifier of the locking object in the locking information corresponding to the locking identifier is obtained, steps S1310 to S1330 are included. The specific contents are as follows:
in step S1310, locking enabling information of the object identifier is obtained in the locking information.
In the embodiment of the present disclosure, the locking enabling information of the object identifier may be obtained from the locking information configured in the first service operation, and the locking enabling information may be analyzed. That is, before performing a locking operation on a locked object, it is also necessary to determine whether the locked object is allowed to be locked according to the locking enable information. The locking enabling information includes a locking condition of the locked object. The locking condition is set to determine that the current locking object contains specific parameter information, and the locking condition may be set according to an actual situation, which is not limited herein. Under the condition that the locking condition of the locking enabling information is met, the locking operation can be executed on the locking object; and if the locking condition of the locking enabling information is not met, the locking operation is not executed on the locked object.
Exemplarily, when the received first service request is to perform locking processing on the commodity sales data of a specified commodity and perform corresponding first service operation, the commodity sales data may be used as a locking object here, or the commodity sales label of the commodity may be used as an object identifier of the locking object, and the first service operation is performed on the locking object, that is, the commodity sales data. It should be noted that the locked object, i.e., the sales data of the merchandise, can be accurately and uniquely determined by the sales label of the merchandise. It should be noted that the commodity sales data may include related data such as trade orders and commodity stocks. The trade order may include information such as an order ID, a quantity placed, and a shipping address.
On this basis, whether the locking process can be performed on the commodity sales data can be judged by the locking enabling information in the locking information configured by the first business operation. That is, the locking condition in the locking enable information at this time may be set to data for determining whether or not there is a trade order in the commodity sales data. When the commodity sales data contains the relevant data of the trade order, locking processing can be executed on the commodity sales data; and when the related data of the trade order does not exist in the commodity sales data, forbidding to execute locking processing on the commodity sales data.
In step S1320, if the locking enable information indicates that locking is allowed, the step of locking the locked object according to the object identifier is executed.
In the case where it is determined from the locking enable information that the locking object can be subjected to the locking operation, the locking process can be performed on the locking object by the object identification of the locking object in the locking information. On this basis, the type of locking may be a pessimistic lock. The type of locking may be set according to practical situations, and is not limited herein.
In step S1330, in the case where the locking enable information indicates that locking is not permitted, the locking operation to lock the locking object is prohibited from being performed.
If it is determined that the locking object is not permitted to be subjected to the locking operation based on the locking enable information, the locking process is not performed on the locking object. And if the locking operation is not executed, directly executing the first business operation on the locking object which does not meet the locking condition.
And step S1400, locking the locked object according to the object identification.
In the embodiment of the present disclosure, whether to allow the locking operation to be performed on the locked object may be determined by the locking enable information. And under the condition that the locking operation is determined to be allowed to be performed on the locking object, performing the locking operation on the locking object corresponding to the object identification in the locking information.
Specifically, the class may be implemented by com, sxc, component, common, lock, idistributeLocker, and injected into the anti-duplicate submission section, so as to implement locking or unlocking operations on the locked object. The repeated submission prevention section can control the execution of the first business operation in a spring aop mode. It will be understood by those skilled in the art that the detailed description is omitted here.
It should be further noted that a locking specifying parameter may also be included in the locking information of the first service data configuration. Through the locking specifying parameter, the locking operation can be executed on the specific data in the locking object. That is, in the process of performing the locking operation on the locking object, the locking operation may be performed only on the data corresponding to the locking specifying parameter in the locking object. The locking specifying parameter may be a field, and the field value may be an initiator expression. Through the expression, the key needing to be locked can be obtained by the method of the first business operation, such as the order ID in the transaction order. And executing locking operation on the specific service data associated with the key in the locking object through the acquired key needing locking.
Exemplarily, when the received first service request is to perform locking processing on the commodity sales data of a specified commodity and perform a corresponding first service operation, the commodity sales data may be used as a locking object here, and a commodity sales label of the commodity may also be used as an object identifier of the locking object. In addition, the commodity sales data may include related data such as trade orders, commodity inventory, and business scenarios. The trade order may include information such as an order ID, a quantity placed, and a shipping address. Further, the order ID in the trade order may be used here as a locking specification parameter. It should be noted that the locking specifying parameter may include one order ID or may include a plurality of order IDs, which is not limited herein. That is, when a locking operation is performed on a locked object, the locking operation may be performed only for data in the locked object that is associated with the locking specifying parameter.
On this basis, the locking information configured in the first service data may further include a locking specification scenario. And the locking specified scene corresponds to the locking specified parameter. Further, with the lock specifying parameter and the lock specifying scenario, the lock operation can be performed only on specific data in the lock object. That is, in the process of performing a locking operation on a locking object, the locking operation may be performed only on a portion of data that exists in a locking object in a locking-specifying scene and is associated with a locking-specifying parameter.
Exemplarily, when the received first service request is to perform locking processing on the commodity sales data of a specified commodity and perform corresponding first service operation, the commodity sales data may be used as a locking object here, and the commodity sales label of the commodity may also be used as an object identifier of the locking object. The commodity sales data may include related data such as trade orders, commodity inventory, and business scenarios. The service scenario may include a plurality of scenarios, such as an order submission scenario, an order modification scenario, and an order cancellation scenario. The trade order may include information such as an order ID, the number of orders placed, and the shipping address. Further, here, the order ID in the transaction order may be used as a locking specifying parameter, and an order submission scenario included in the business scenario may be used as a locking specifying scenario. That is, when a locking operation is performed on a locking object, the locking operation may be performed only for specific data that exists in the order submission scenario and is associated with the order ID in the locking object. Here, one order ID in the trade order may be used as the locking specifying parameter, or a plurality of order IDs in the trade order may be used as the locking specifying parameter. When a plurality of order IDs in the transaction order are selected as the locking specifying parameters, when the locking operation is performed on the locked object, the locking operation may be performed with respect to specific data existing in the order submission scene in the locked object and associated with the selected plurality of order IDs.
In step S1500, when the locking fails, locking retry information is acquired from the locking information.
After the locking operation is performed on the locking object that allows locking, there may be a case where the locking operation performed on the locking object that is determined to allow locking fails due to an internal reason such as a locking conflict or a system error. In this case, the locking retry information may be acquired from the locking information of the first service operation configuration. In other words, the locking operation can be re-executed on the locked object whose locking has failed, by the locking retry information in the locking information.
And step S1600, repeatedly executing the step of locking the locked object according to the object identification according to the locking retry information under the condition that the locking retry information indicates that retry is needed.
In the embodiment of the present disclosure, when the locking retry information indicates that the locking operation can be performed again on the locking object that has failed to be locked, the locking operation can be performed again on the locking object corresponding to the object identifier in the locking information. Similarly, when the locking retry information indicates that the locking operation cannot be performed again on the locked object that has failed to be locked, the locking operation is prohibited from being performed again on the locked object corresponding to the object identifier in the locking information.
In an embodiment of the present disclosure, the locking retry information includes a locking retry condition and a locking time interval.
In an embodiment of the present disclosure, the locking retry information may include a locking retry condition and a locking time interval. The locking retry condition may be used to determine whether to re-execute the locking operation on the locking object that has failed locking. The locking time interval may be the interval between each re-execution of the locking operation. The locking time interval may be set according to practical situations, and is not limited herein.
In the embodiment of the present disclosure, step S1600 repeatedly executes the step of locking the locked object according to the object identification according to the locking retry information, including step S1610 to step S1630. The specific contents are as follows:
step S1610, a condition object value corresponding to the locking retry condition is obtained.
In the embodiment of the present disclosure, the locking retry condition included in the locking retry information has a condition object corresponding thereto, and a boolean value may be taken on the condition object. On the basis, when the Boolean value of the condition object is 0, the locking operation is prohibited from being executed again on the locking object which fails to be locked; when the boolean value of the condition object is 1, it indicates that the locking operation can be performed again on the locking object that has failed to lock. That is, after obtaining the condition object value corresponding to the locking retry condition, it can be determined whether to re-execute the locking operation on the locking object that has failed in locking.
Step S1620, when the condition object value satisfies the locking retry condition, locking the locking object according to the object identifier again according to the locking time interval.
In the embodiment of the present disclosure, when the boolean value of the condition object is 1, it means that the condition object value satisfies the locking retry condition. In this case, the locking operation may be performed again on the locking object that is allowed to be locked but fails to be locked, according to the preset locking time interval. It should be noted that the locking information of the first service operation configuration further includes a locking validity period. During the period of re-executing the locking operation on the locking object which has failed in the previous locking according to the preset locking time interval, the time regulation of the locking validity period is required to be met, and in the process of re-executing the locking operation on the locking object, if the specified time of the locking validity period is reached, the locking operation on the locking object is stopped.
Exemplarily, in the case that the condition object value satisfies the locking retry condition, the locking time interval is set to 1 second, and the locking validity period is set to 60 seconds. In the locking validity period, locking operation can be performed on a locking object which is allowed to be locked but fails to be locked every 1 second until the locking operation is successful; if the locking of the locking object is not successful all the time within the locking validity period, stopping executing the locking operation on the locking object after the locking validity period expires, and simultaneously indicating that the locking of the locking object fails.
In step S1630, when the condition object value does not satisfy the locking retry condition, the locking operation performed to lock the locking object is stopped.
In the embodiment of the present disclosure, when the boolean value of the condition object is 0, it indicates that the value of the condition object does not satisfy the locking retry condition. In this case, the locking operation is prohibited from being performed on the locked object again.
In step S1700, in the case of a locking failure, a prompt message of the locking failure is obtained from the locking information.
In embodiments of the present disclosure, a locking failure may include a variety of conditions. According to the above content, when the locking object does not conform to the locking condition of the locking enabling information, the locking operation will not be executed on the locking object, and meanwhile, the locking failure of the locking object is also indicated; and when the condition object value of the locking retry information in the first service operation corresponding to the locking object does not meet the locking retry condition, stopping executing the locking operation for locking the locking object, and similarly indicating that the locking of the locking object fails. On this basis, other locking failures may also occur. The locking information configured by the first service operation also comprises prompt information of locking failure. When the locking fails, corresponding prompt information can be acquired from the locking information configured by the first service operation.
Step S1800, informing the user terminal to output the prompt message.
In the disclosed embodiment, after the corresponding prompt message is obtained from the locking information of the first service operation configuration, a notification message may be sent to the user terminal. The notification message includes a command to control the user terminal to output the prompt message. On the basis, the user terminal can accept the notification message and display the prompt information contained in the notification message on a display screen of the user terminal. The specific content of the prompt message may be set according to the actual situation, and is not limited here.
In step S1900, after the locking is successful, the first service operation is executed.
In an embodiment of the present disclosure, after the locking of the locked object is successful, a first business operation may be performed on the locked object. The first service operation may be an operation of adding, modifying, or deleting data in the locking object, or an operation of summarizing, sorting, or exporting data therein. The specific processing manner for the locking object for the first business operation may be set according to practical situations, and is not limited herein.
In addition, it should be noted that, according to the above, only the data corresponding to the locking specifying parameter in the locking object may be locked by the locking specifying parameter. On the basis, the locking processing can be executed on the data corresponding to the locking object in the locking object according to the locking specified parameter. After the locking is successful, a first business operation can be executed for the data corresponding to the locking specified parameter.
Further, according to the above, by the lock specifying parameter and the lock specifying scene, the lock operation can be performed with respect to the specific data in the lock object. On the basis, according to the locking specified parameter and the locking specified scene, the locking operation can be performed on the part of the data which exists in the locking specified scene in the locking object and is associated with the locking specified parameter. After the locking is successful, a first business operation may be performed on the portion of data that exists in the lock specification scenario and that is associated with the lock specification parameter.
And step S2000, after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition.
In an embodiment of the present disclosure, after the locking of the locked object is successful, a first business operation may be performed on the locked object. After the first business operation is executed, the operation of releasing the lock on the locked object can be executed according to the lock releasing condition included in the locking information configured by the first business operation.
In one embodiment of the present disclosure, the lock release condition includes at least one of a first lock release condition and a second lock release condition; the first lock release condition is: releasing the added lock in the event of detecting a completion event for completing the first business operation; the second lock release condition is: and releasing the added lock under the condition that the locking time reaches the locking validity period.
In an embodiment of the present disclosure, the lock release condition may include a first lock release condition and a second lock release condition. And the first lock release condition is that the added lock is automatically released when the first business operation is detected to be completed. The second lock releasing condition is that after the first service operation is completed, the added lock is not released immediately, but the added lock is released when the locking duration reaches the locking validity period. It should be noted that, for the specific selection of the lock release condition, one of the first lock release condition and the second lock release condition may be selected according to actual conditions.
According to the control method of the business operation of the embodiment of the disclosure, a first business request sent by a user terminal is received; responding to the first service request, and acquiring a first service operation corresponding to the first service request; under the condition that the first business operation has a locking identifier, acquiring an object identifier of a locking object under the first business operation from locking information corresponding to the locking identifier; locking the locked object according to the object identifier; after the locking is successful, executing a first business operation; and after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition. By the method, pluggable locking can be performed on the data needing repeated submission prevention control in the system, the problem of data abnormity caused by repeated service submission is solved, and zero invasion to codes is realized.
< apparatus embodiment >
Referring to fig. 5, the control device 3000 for business operation includes a request receiving module 3100, a business response module 3200, a data obtaining module 3300, a data locking module 3400, an operation executing module 3500, and a locking releasing module 3600. Wherein:
a request receiving module 3100, configured to receive a first service request sent by a user terminal;
the service response module 3200 is configured to, in response to the first service request, obtain a first service operation corresponding to the first service request;
the data obtaining module 3300 is configured to, in a case that the first service operation has a locking identifier, obtain an object identifier of a locking object in the first service operation from locking information corresponding to the locking identifier;
the data locking module 3400 is used for locking the locked object according to the object identifier;
an operation executing module 3500, configured to execute a first service operation after the locking is successful;
and a locking release module 3600, configured to obtain a lock release condition in the locking information after the locking is successful, and release the locked lock for the locked object according to the lock release condition.
In the control device 3000 for business operations provided in this embodiment, the data locking module 3400 includes a first obtaining module and a retry execution module. The first obtaining module is used for obtaining locking retry information in the locking information under the condition of locking failure; and the retry execution module is used for repeatedly executing the step of locking the locked object according to the object identifier according to the locking retry information under the condition that the locking retry information indicates that retry is needed.
In the control device 3000 for business operations provided in this embodiment, the retry execution module includes a condition evaluation module, a first execution module, and a second execution module. The system comprises a condition dereferencing module, a locking retry module and a locking retry module, wherein the condition dereferencing module is used for acquiring a condition object dereferencing corresponding to a locking retry condition; the first execution module is used for executing the step of locking the locking object according to the object identification again according to the locking time interval under the condition that the value of the condition object meets the locking retry condition; and the second execution module is used for stopping executing the locking operation of locking the locking object under the condition that the condition object value does not meet the locking retry condition.
In the control device 3000 for business operations provided in this embodiment, the control device 3000 further includes a prompt acquiring module and a prompt notifying module. The prompt acquisition module is used for acquiring prompt information of locking failure from the locking information under the condition of locking failure; and the prompt notification module is used for notifying the user terminal to output prompt information.
In the control device 3000 for business operations provided in this embodiment, the control device 3000 further includes a second obtaining module, a third executing module, and a fourth executing module. The second obtaining module is used for obtaining locking enabling information of the object identifier from the locking information; a third execution module, configured to execute the step of locking the locked object according to the object identifier when the locking enabling information indicates that locking is allowed; and the fourth execution module is used for forbidding to execute the locking operation of locking the locking object under the condition that the locking enabling information shows that the locking is not allowed.
In the control device 3000 for business operation provided in the present embodiment, the control device 3000 further includes an information configuration module. The information configuration module is used for configuring locking information for a first service operation corresponding to the first service request according to a set configuration template; the configuration template comprises an operation type configuration item of business operation, an object identification configuration item of a locking object, a lock release condition configuration item, an enabling configuration item of the locking object and a locking retry configuration item.
According to the control device for business operation provided by the embodiment of the disclosure, a first business request sent by a user terminal is received through a request receiving module; the service response module responds to the first service request and acquires a first service operation corresponding to the first service request; the data acquisition module acquires an object identifier of a locked object under the first service operation from locking information corresponding to the locking identifier under the condition that the first service operation has the locking identifier; the data locking module locks the locked object according to the object identifier; the operation execution module executes a first service operation after the locking is successful; and the locking releasing module acquires the lock releasing condition in the locking information after the locking is successful, and releases the locked lock for the locked object according to the lock releasing condition. By the method, pluggable locking can be performed on the data needing repeated submission prevention control in the system, the problem of data abnormity caused by repeated service submission is solved, and zero invasion to codes is realized.
It should be noted that although in the above detailed description several modules or units of the system for action execution are mentioned, such a division is not mandatory. In fact, the characteristics and functions of two or more modules or units described above may be embodied in one module or unit according to the implementation method of the present application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
< apparatus embodiment >
In the embodiment of the present disclosure, a control device 7000 for business operation is also provided. As shown in fig. 6, the control device 7000 for business operations may include a processor 7100 and a memory 7200, wherein the memory 7200 stores computer instructions, and the computer instructions are executed by the processor 7100 to perform the steps of the control method for business operations according to any of the embodiments of the present disclosure.
< media examples >
In this embodiment, a computer readable storage medium is further provided, on which computer instructions are stored, and when the computer instructions are executed by a processor, the steps of the method for controlling service operation according to any method embodiment of the present invention are implemented.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing the processor 1100 to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device over a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
Computer program instructions for carrying out operations of the present invention may be assembler instructions, instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein 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 block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer-readable program instructions may be provided to a processor 1100 of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor 1100 of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A method for controlling a service operation, comprising:
receiving a first service request sent by a user terminal;
responding to the first service request, and acquiring a first service operation corresponding to the first service request;
under the condition that the first business operation has a locking identifier, acquiring an object identifier of a locking object under the first business operation from locking information corresponding to the locking identifier;
locking the locking object according to the object identification;
after the locking is successful, executing the first business operation;
and after the locking is successful, acquiring a lock release condition in the locking information, and releasing the locked lock for the locked object according to the lock release condition.
2. The method of claim 1, wherein the lock release condition comprises at least one of a first lock release condition and a second lock release condition; the first lock release condition is: releasing the added lock if a completion event is detected to complete the first business operation; the second lock release condition is: and releasing the added lock when the locking time reaches the locking validity period.
3. The method for controlling business operations according to claim 1, wherein after locking the locked object, the method further comprises:
under the condition of locking failure, acquiring locking retry information in the locking information;
and under the condition that the locking retry information indicates that retry is needed, repeatedly executing the step of locking the locked object according to the object identification according to the locking retry information.
4. The method according to claim 3, wherein the locking retry information includes a locking retry condition and a locking time interval, and the step of repeatedly performing the locking of the locked object according to the object identifier according to the locking retry information comprises:
acquiring a condition object value corresponding to the locking retry condition;
under the condition that the value of the condition object meets the locking retry condition, the step of locking the locking object according to the object identification is executed again according to the locking time interval;
and stopping executing the locking operation for locking the locking object under the condition that the condition object value does not meet the locking retry condition.
5. The control method according to claim 1, wherein after the locking the locked object according to the object identifier, the method further comprises:
under the condition of locking failure, acquiring prompt information of the locking failure in the locking information;
and informing the user terminal to output the prompt information.
6. The method according to claim 1, wherein after obtaining the object identifier of the locked object under the first business operation, the method further comprises:
acquiring locking enabling information of the object identifier from the locking information;
if the locking enabling information indicates that locking is allowed, executing the step of locking the locking object according to the object identification;
and when the locking enabling information indicates that locking is not allowed, prohibiting execution of a locking operation for locking the locking object.
7. The control method according to any one of claims 1 to 6, wherein before the receiving the first service request sent by the user terminal, the method further comprises:
according to a set configuration template, configuring the locking information for a first service operation corresponding to the first service request; the configuration template comprises an operation type configuration item of business operation, an object identification configuration item of a locking object, a lock release condition configuration item, an enabling configuration item of the locking object and a locking retry configuration item.
8. A control apparatus for business operations, comprising:
the request receiving module is used for receiving a first service request sent by a user terminal;
the service response module is used for responding to the first service request and acquiring a first service operation corresponding to the first service request;
a data obtaining module, configured to, when the first service operation has a locking identifier, obtain, in locking information corresponding to the locking identifier, an object identifier data locking module of a locked object under the first service operation, and lock the locked object according to the object identifier;
and the operation execution module is used for executing the first service operation after the locking is successful.
And the locking and releasing module is used for acquiring a lock releasing condition in the locking information after the locking is successful, and releasing the locked lock for the locked object according to the lock releasing condition.
9. A control device of business operations, characterized by comprising at least one processor and at least one memory for storing a computer program, the processor being configured to execute a control method of business operations according to any one of claims 1 to 7 under the control of the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of controlling a business operation according to any one of claims 1 to 7.
CN202211139259.5A 2022-09-19 2022-09-19 Business operation control method, device, equipment and storage medium Pending CN115952010A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211139259.5A CN115952010A (en) 2022-09-19 2022-09-19 Business operation control method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211139259.5A CN115952010A (en) 2022-09-19 2022-09-19 Business operation control method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115952010A true CN115952010A (en) 2023-04-11

Family

ID=87284759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211139259.5A Pending CN115952010A (en) 2022-09-19 2022-09-19 Business operation control method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115952010A (en)

Similar Documents

Publication Publication Date Title
US9268672B1 (en) Automated test case generation for applications
US10171315B2 (en) Orchestration process template for generation of orchestration process to tolerate errors
US20180217921A1 (en) System and method for generating and executing automated test cases
AU2021206497B2 (en) Method and apparatus for authority control, computer device and storage medium
CN105550585B (en) Application program security testing method, device and system
CN109684795B (en) Method and device for anti-debugging of application program and electronic equipment
CN112306568A (en) Service instance configuration method and device, electronic equipment and storage medium
US10831642B2 (en) Detecting potential class loader problems using the class search path sequence for each class loader
CN114637496A (en) Configuration data processing system, method and electronic equipment
US20100125830A1 (en) Method of Assuring Execution for Safety Computer Code
CN112416757B (en) Component development method, device, storage medium and electronic equipment
US10360403B2 (en) Cognitive API policy manager
CN115952010A (en) Business operation control method, device, equipment and storage medium
CN116149749A (en) Retry method, device, equipment and storage medium for business operation
US20200192967A1 (en) Page objects library
CN111242731B (en) Service execution method and device
WO2022054101A1 (en) Method and system for automated software accessibility testing
CN108255667B (en) Service monitoring method and device and electronic equipment
CN114073039A (en) Method and device for safety control automation
CN111475400A (en) Verification method of service platform and related equipment
CN113377467B (en) Information decoupling method and device, server and storage medium
CN111833161A (en) Inventory reconciliation method, device and storage medium
CN116541253B (en) Application detection method, system, terminal equipment and readable storage medium
JP6382610B2 (en) Simulator system, gateway system test apparatus, and gateway system test method
CN112866306B (en) Resource management method and cloud service platform

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