CN114066370A - Inventory service calling method, device, equipment, storage medium and program product - Google Patents
Inventory service calling method, device, equipment, storage medium and program product Download PDFInfo
- Publication number
- CN114066370A CN114066370A CN202111408859.2A CN202111408859A CN114066370A CN 114066370 A CN114066370 A CN 114066370A CN 202111408859 A CN202111408859 A CN 202111408859A CN 114066370 A CN114066370 A CN 114066370A
- Authority
- CN
- China
- Prior art keywords
- inventory
- operations
- inventory service
- service
- executing
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/08—Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
- G06Q10/087—Inventory or stock management, e.g. order filling, procurement or balancing against orders
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Economics (AREA)
- Marketing (AREA)
- Development Economics (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Entrepreneurship & Innovation (AREA)
- Human Resources & Organizations (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method, a device, equipment, a storage medium and a program product for invoking an inventory service, wherein the method comprises the following steps: receiving an inventory service calling request sent by a user terminal, wherein the inventory service calling request comprises an inventory service calling type and inventory service object information; determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type; acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data; if the plurality of checking operations are determined to be executed completely and successfully, executing inventory operation corresponding to the inventory service calling request; and sending the inventory service calling result to the user terminal. The time consumed by calling the inventory service can be effectively reduced, the efficiency of calling the inventory service is improved, and the experience of calling the inventory service by a user is improved.
Description
Technical Field
The embodiment of the invention relates to the field of electronic inventory warehousing, in particular to an inventory service calling method, device, equipment, storage medium and program product.
Background
With the development of the internet, online shopping has become the most popular new shopping mode at present. Inventory services play a very important role as a data support for online shopping.
At present, when a user terminal needs to invoke inventory service, a general inventory server first sequentially performs a plurality of verification operations for inventory service objects before invoking inventory service. And after the various checks are successful, performing inventory operation for calling inventory service. And after the inventory operation is successful, executing subsequent operation after the inventory operation, and finally feeding back an inventory service calling result to the user terminal.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the time consumed by the user terminal for calling the inventory service is long, the efficiency for calling the inventory service is low, and the experience of calling the inventory service by the user is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment, a storage medium and a program product for calling inventory service, which are used for solving the technical problems that a user terminal has long time for calling inventory service, the efficiency for calling inventory service is low, and the experience of calling inventory service by a user is poor.
In a first aspect, the present invention provides an inventory service invoking method, including:
receiving a stock service calling request sent by a user terminal, wherein the stock service calling request comprises a stock service calling type and stock service object information;
determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type;
acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data;
if the plurality of checking operations are determined to be executed completely and successfully, executing inventory operations corresponding to the inventory service calling request;
and sending the inventory service calling result to the user terminal.
In a second aspect, the present invention provides an inventory service invoking device, including:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a stock service calling request sent by a user terminal, and the stock service calling request comprises a stock service calling type and stock service object information;
the determining module is used for determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type;
the parallel execution module is used for acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data;
the inventory operation module is used for executing inventory operation corresponding to the inventory service calling request if the completion and success of the execution of the plurality of verification operations are determined;
and the sending module is used for sending the inventory service calling result to the user terminal.
In a third aspect, the present invention provides an electronic device comprising: at least one processor, memory, and transceiver;
the processor, the memory, and the transceiver circuitry are interconnected;
the memory stores computer-executable instructions; the transceiver is used for receiving and transmitting data with a user terminal;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of the first aspects.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the method according to any one of the first aspect when executed by a processor.
In a fifth aspect, the invention provides a computer program product comprising a computer program that, when executed by a processor, performs the method according to any one of the first aspect.
According to the inventory service calling method, device, equipment, storage medium and program product provided by the embodiment of the invention, the inventory service calling request sent by the user terminal is received, and the inventory service calling request comprises the inventory service calling type and the inventory service object information; determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type; acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data; if the plurality of checking operations are determined to be executed completely and successfully, executing inventory operation corresponding to the inventory service calling request; and sending the inventory service calling result to the user terminal. Since the plurality of verification operations are executed in parallel before the stock operation is executed, the time for executing the plurality of original verification operations in series can be reduced to the time taken to execute the verification operation which consumes the longest time. It is possible to perform the stock operation after the execution of the verification operation that consumes the longest time is finished. And after the inventory operation is executed, the inventory service calling result is sent to the user terminal, so that the time for executing the subsequent operation of the inventory operation is saved. Therefore, the time consumed by calling the inventory service can be effectively reduced, the efficiency of calling the inventory service is improved, and the experience of calling the inventory service by a user is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram illustrating a method for invoking inventory services provided in the prior art;
FIG. 2 is a diagram of a network architecture in which the inventory service invocation method of embodiments of the present invention may be implemented;
FIG. 3 is a diagram of an application scenario in which a method for inventory service invocation may be implemented in accordance with an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for invoking inventory services according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for invoking inventory services according to another embodiment of the present invention;
FIG. 6 is a flowchart illustrating step 204 of the inventory service invocation method according to another embodiment of the present invention;
FIG. 7 is a flowchart illustrating step 205 of a method for invoking inventory services according to another embodiment of the present invention;
FIG. 8 is a flowchart illustrating step 210 of a method for invoking inventory services according to another embodiment of the present invention;
FIG. 9 is a flowchart illustrating a method for invoking inventory services according to yet another embodiment of the present invention;
FIG. 10 is a block diagram of an inventory service invocation device according to an embodiment of the present invention;
FIG. 11 is a block diagram of an electronic device for implementing the inventory service invocation method of an embodiment of the present invention;
FIG. 12 is another block diagram of an electronic device for implementing the inventory service invocation method of embodiments of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
For a clear understanding of the technical solution of the present invention, the prior art solution will be described in detail first.
Fig. 1 is a flowchart illustrating a method for invoking inventory services in the prior art, where as shown in fig. 1, when a user terminal needs to invoke an inventory service, a general inventory server first sequentially performs a plurality of verification operations on inventory service objects before invoking the inventory service. And after the various checks are successful, performing inventory operation for calling inventory service. And after the inventory operation is successful, executing subsequent operation after the inventory operation, and finally feeding back an inventory service calling result to the user terminal.
If the time consumed for executing the ith verification operation is Ti, the time consumed for executing the inventory operation for calling the inventory service is Tc, and the time for executing the subsequent operation after the jth inventory operation is successful is Tj. Then, since the checking operation, the inventory operation and the subsequent operations of the inventory operation are performed serially, the total time consumed for the user terminal to invoke the inventory service is as follows: t1+ T2+ Ti + … … + Tn + Tc + Tj + … … + Tm. Wherein n is the number of the check operations. m is the number of subsequent operations.
Therefore, in the prior art, the time consumed by the high-end user to call the inventory service is long, the efficiency of calling the inventory service is low, and the experience of calling the inventory service by the user is poor.
In view of the technical problems in the prior art, the inventor of the present invention has found through creative research that when a user terminal calls an inventory service, most of the plurality of verification operations for an inventory service object have no dependency relationship, so that the plurality of verification operations can be executed in parallel. The time for executing the original plurality of verification operations in series is reduced to the time for executing the verification operation which consumes the longest time. It is possible to perform the stock operation after the execution of the verification operation that consumes the longest time is finished. And the subsequent operation of the inventory operation and the inventory service calling result sent to the user terminal have no direct incidence relation, so that the inventory service calling result can be fed back to the user terminal after the inventory operation is finished, and the time for executing the subsequent operation of the inventory operation is further saved. Therefore, the time consumed by calling the inventory service can be effectively reduced, the efficiency of calling the inventory service is improved, and the experience of calling the inventory service by a user is improved.
Therefore, the inventor proposes a technical scheme of the embodiment of the invention based on the above creative discovery. The following describes a network architecture of the inventory service calling method provided by the embodiment of the present invention.
Fig. 2 is a network architecture diagram for implementing the inventory service calling method according to the embodiment of the present invention, and as shown in fig. 2, in this embodiment, different users communicate with an inventory server 2 loaded with inventory services through corresponding user terminals 1. The type of the user terminal 1 is not limited. Such as a smart phone, a computer, a tablet computer, etc. The inventory server 2 has access to an inventory database 3. The user terminal 1 calls the inventory service by communicating with the inventory server 2, i.e., sends an inventory service call request to the inventory server. The inventory server 2 acquires inventory data corresponding to the inventory service object from the inventory database 3, performs inventory operation matched with the inventory service calling request by using the inventory service calling method provided by the embodiment of the invention, and then sends an inventory service calling result to the user terminal.
FIG. 3 is a diagram of an application scenario in which an inventory service invocation method of an embodiment of the invention may be implemented. As shown in fig. 3, the user terminal may initiate a request for inventory service invocation in any scenario related to inventory services. Such as a sales scenario, a purchase scenario, or an inventory scenario. The inventory service object may be medicine, clothing, cosmetics, living goods, home appliances, etc. In each scenario related to inventory services, the user terminal sends an inventory service call request to the inventory server, including the corresponding inventory service call type and inventory service object information. And the inventory service calling type is consistent with the corresponding inventory service related scene. And after receiving the inventory service calling request through the inventory service calling interface, the inventory server parallelly executes a plurality of corresponding checking operations on the inventory service object according to the inventory data.
If the plurality of checking operations are determined to be executed completely and successfully, feeding back inventory operations corresponding to the inventory service calling request; and sending the inventory service calling result to the user terminal as a result of successful inventory service calling.
And if the plurality of checking operations are determined to be completed and at least one checking operation fails, sending the inventory service calling result to the user terminal as the inventory service calling failure result. Optionally, in a scenario related to the inventory service, after the inventory operation corresponding to the inventory service call request is executed, at least one inventory subsequent operation is asynchronously executed according to the inventory operation.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 4 is a flowchart illustrating an inventory service invoking method according to an embodiment of the present invention. As shown in fig. 4, an execution subject of the inventory service invoking method provided in this embodiment is an inventory service invoking device, which is located in an electronic device, which may be an inventory server. The inventory service calling method provided by the embodiment includes the following steps:
step 101, receiving a stock service call request sent by a user terminal, wherein the stock service call request comprises a stock service call type and stock service object information.
In this embodiment, a purchase-sale-stock system is loaded on the user terminal. The presentation may be in the form of a client or a web page. The purchase, sale and storage system can be a purchase, sale and storage system dedicated to a certain type of inventory service object, such as a medicine purchase, sale and storage system, a clothing purchase, sale and storage system, a household appliance purchase, sale and storage system, a living goods purchase, sale and storage system and the like. Or may also serve the inventory of objects for multiple categories of inventory. Such as a purchase-sale-stock system of a unified online shopping platform.
In this embodiment, after entering the purchase, sales and inventory system through the user terminal, the user terminal is triggered to generate an inventory service invocation request by clicking a certain operation component on the inventory service object on an operation interface of the purchase, sales and inventory system. Wherein, the operation component can be ordering operation component, return goods operation component, purchase operation component, inventory operation component, etc.
The inventory service object information and the inventory service call type are carried in the inventory service call request. The inventory service object information may be identification information of the inventory service object. The inventory service calling type can be a placing order calling type, a return goods calling type, a purchase calling type, an inventory checking calling type and the like.
Step 102, determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type.
In this embodiment, a mapping relationship between each inventory service invocation type and a plurality of corresponding check operations may be pre-constructed. And determining a plurality of checking operations to be executed on the inventory service object corresponding to the inventory service calling type in the inventory service calling request according to the mapping relation.
For example, when the inventory service call type is a purchase call type or a place order call type, the plurality of checking operations for the inventory service object may include: checking whether the user can place an order or purchase an inventory service object; checking whether an inventory service object exists in an inventory database; checking whether the stock service object is off-sale; checking whether the stock service object is forbidden to be sold; and checking whether the inventory service object is repeatedly issued or purchased, checking whether the inventory service object is sufficient, and the like.
When the inventory service call type is a return call type, the plurality of checking operations on the inventory service object may include: checking whether the user can return the stock service object; and checking whether the inventory service object is repeatedly put in storage, and the like.
When the inventory service call type is an inventory count call type, the plurality of verification operations for the inventory service object may include: checking whether the user can inventory service objects; checking whether an inventory service object exists in an inventory database; checking whether the inventory service object is sufficient, and the like.
Step 103, acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data.
In this embodiment, the inventory data is stored in a preset database, which may be an inventory database, and a plurality of verification operations may be executed in parallel according to the inventory data corresponding to the accessed inventory service object by accessing the inventory data corresponding to the inventory service object in the inventory database.
In particular, when multiple check operations are performed in parallel, multiple threads may be turned on, with each thread being responsible for performing one check operation. The threads are not affected by each other and are executed in parallel. The result of the check operation is fed back by each thread. The result of the checking operation may be a checking success or a checking failure.
It should be noted that, after a plurality of verify operations are executed in parallel, the time consumed by the verify operation that consumes the longest time is consumed. If there are n verify operations, the time spent can be denoted as max (T1+ T2+ Ti + … … + Tn). Where Ti is the time consumed by the ith verify operation performed in parallel.
And step 104, if the plurality of checking operations are determined to be executed completely and successfully, executing the inventory operation corresponding to the inventory service calling request.
In this embodiment, it is monitored whether all the verification operations are executed and whether all the verification operations are successful. If the verification operations are determined to be all executed and all verification operations are successful, the method indicates that the user terminal can be authorized to call the inventory service, and the inventory operation is executed on the inventory data corresponding to the inventory service object in the inventory database.
For example, if the inventory service call type is a purchase call type or a place order call type, the inventory operation performed on the inventory data corresponding to the inventory service object is a deduction inventory operation. And if the inventory service calling type is a return calling type, performing inventory operation on the inventory data corresponding to the inventory service object to increase the inventory operation. If the inventory service calling type is an inventory checking calling type, the inventory operation performed on the inventory data corresponding to the inventory service object may be a deduction inventory operation or an increase inventory operation. If a damaged inventory service object is found during inventory checking and subsequent purchase and sales cannot be performed, the inventory operation performed by the inventory data corresponding to the inventory service object is a deduction inventory operation. If at least one inventory service object is obtained due to the excessive previous inventory error during inventory check, the inventory operation performed by the inventory data corresponding to the inventory service object is an inventory increase operation.
Step 105, sending the inventory service calling result to the user terminal.
In this embodiment, after the inventory operation corresponding to the inventory service invocation request is performed, if it is described that the inventory service is successfully invoked, the inventory service invocation result sent to the user terminal is the result of successful inventory service invocation.
Optionally, the inventory service call result may further include information such as the deduction amount or the addition amount of the inventory service object.
In the inventory service calling method provided by the embodiment, an inventory service calling request sent by a user terminal is received, wherein the inventory service calling request comprises an inventory service calling type and inventory service object information; determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type; acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data; if the plurality of checking operations are determined to be executed completely and successfully, executing inventory operation corresponding to the inventory service calling request; and sending the inventory service calling result to the user terminal. Since the plurality of verification operations are executed in parallel before the stock operation is executed, the time for executing the plurality of original verification operations in series can be reduced to the time taken to execute the verification operation which consumes the longest time. It is possible to perform the stock operation after the execution of the verification operation that consumes the longest time is finished. And after the inventory operation is executed, the inventory service calling result is sent to the user terminal, so that the time for executing the subsequent operation of the inventory operation is saved. Therefore, the time consumed by calling the inventory service can be effectively reduced, the efficiency of calling the inventory service is improved, and the experience of calling the inventory service by a user is improved.
Fig. 5 is a flowchart of an inventory service invoking method according to another embodiment of the present invention, and as shown in fig. 5, the inventory service invoking method according to this embodiment further refines steps 102 to 103 on the basis of the inventory service invoking method according to the first embodiment, and further includes other steps, so that the inventory service invoking method according to this embodiment includes the following steps:
In this embodiment, a mapping relationship between each inventory service invocation type and the corresponding check operation is pre-constructed and may be stored locally.
The mapping relationship may be stored in a table form.
In this embodiment, there is no dependency relationship between all or most of the plurality of checking operations corresponding to each inventory service call type, and these checking operations may be executed in parallel. However, for a plurality of checking operations corresponding to some inventory service calling types, at least two checking operations may have a dependency relationship therebetween, and the checking operations having the dependency relationship are marked. If the two check operations with dependency relationship are check operation A and check operation B, the two check operations can be marked as check operation A dependent on check operation B.
It should be noted that, the steps 201 to 202 do not need to be executed each time before the step 203 or the step 204 is executed, but need only be executed once before the step 203 or the step 204 is executed for the first time.
Step 203, receiving a stock service call request sent by the user terminal, where the stock service call request includes a stock service call type and stock service object information.
In this embodiment, the implementation manner of step 203 is similar to that of step 101 in the first embodiment, and is not described in detail here.
Step 204, determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type.
As an alternative implementation, in this embodiment, as shown in fig. 6, step 204 includes the following steps:
step 2041, obtain a mapping relationship.
The mapping relation represents the mapping relation between each inventory service calling type and the corresponding checking operation.
In this embodiment, the mapping relationship is obtained from a local preset storage area. The mapping may be in the form of a mapping table.
Step 2042, determine a plurality of verification operations having a mapping relationship with the inventory service invocation type.
Step 2043, determine the plurality of check operations with mapping relationships as a plurality of check operations to be executed.
In this embodiment, the inventory service invocation type is obtained from the inventory service invocation request, and a plurality of verification operations having a mapping relationship with the inventory service invocation type in the service invocation request are obtained from the mapping relationship by searching the mapping relationship. And determining the plurality of check operations with the mapping relation as a plurality of check operations to be executed.
Step 205, obtaining inventory data and performing a plurality of verification operations on the inventory service object in parallel according to the inventory data.
As an alternative implementation manner, in this embodiment, as shown in fig. 7, the performing a plurality of verification operations on the inventory service object in parallel according to the inventory data in step 205 includes the following steps:
step 2051, determining whether a dependency relationship exists among the plurality of checking operations, if so, executing step 2052, otherwise, executing step 2053.
Optionally, step 2051 includes the steps of:
step 2051a determines whether the plurality of verification operations have a dependency flag, if not, step 2051b is executed, otherwise, step 2051c is executed.
Step 2051b, it is determined that no dependency exists between the plurality of check operations.
Step 2051c, determining that at least two of the plurality of check operations have a dependency relationship.
In this embodiment, since the check operation having the dependency relationship is marked in the mapping relationship between each inventory service invocation type and the corresponding check operation. Therefore, when determining whether the dependency relationship exists among the plurality of check operations, whether the dependency relationship exists among the plurality of check operations is determined by judging whether the plurality of check operations have the flag of the dependency relationship. And if the at least two check operation marks in the plurality of check operations are determined to have the dependency relationship, determining that the at least two check operations have the dependency relationship. And if the plurality of checking operations are determined not to be marked with the dependency relationship, determining that the plurality of checking operations do not have the dependency relationship.
In the inventory service calling method provided by this embodiment, when determining whether a dependency relationship exists between a plurality of checking operations, by determining whether the plurality of checking operations have a flag of the dependency relationship, if it is determined that none of the plurality of checking operations have the flag of the dependency relationship, it is determined that the dependency relationship does not exist between the plurality of checking operations, and if it is determined that at least two checking operations have the flag of the dependency relationship, it is determined that at least two checking operations in the plurality of checking operations have the dependency relationship. Whether the dependency relationship exists among the plurality of checking operations can be determined accurately by fast reading through the mark whether the dependency relationship exists or not.
Step 2052, perform multiple verification operations in parallel on the inventory service object based on the inventory data.
And step 2053, serially executing a checking operation with dependency relationship on the inventory service object according to the inventory data, and parallelly executing a checking operation without dependency relationship on the inventory service object according to the inventory data.
In this embodiment, the inventory data corresponding to the inventory service object is obtained from the inventory database. And if the fact that the dependency relationship does not exist among the plurality of checking operations is determined, executing the plurality of checking operations in parallel by adopting a plurality of threads according to the inventory data corresponding to the inventory service object. If it is determined that a dependency relationship exists between at least two of the plurality of check operations, the check operations having the dependency relationship may be executed using one thread. Each check operation without dependency relationship corresponds to one thread. And executing the verification operation without the dependency relationship in parallel by adopting a plurality of threads. And the threads corresponding to the check operation with the dependency relationship and the threads corresponding to the check operation without the dependency relationship are executed in parallel.
In the inventory service calling method provided by the embodiment, when a plurality of verification operations are executed in parallel on an inventory service object according to inventory data, whether a dependency relationship exists among the plurality of verification operations is determined; if the dependency relationship does not exist among the plurality of checking operations, the plurality of checking operations are executed in parallel on the inventory service object according to the inventory data, if the dependency relationship exists among at least two checking operations, the checking operations with the dependency relationship are executed in series, and therefore time consumed by calling the inventory service can be reduced as far as possible by executing the checking operations without the dependency relationship in parallel in the process of ensuring smooth execution of the checking operations.
And step 208, executing inventory operation corresponding to the inventory service calling request.
Step 209, sending the inventory service calling result to the user terminal.
In this embodiment, whether all the verification operations are performed can be periodically monitored. And if the verification operations are all executed, further determining whether each verification operation is verified successfully. If the verification is successful, the user terminal is authorized to call the inventory service, corresponding inventory operation is executed on inventory data corresponding to the inventory service object in the inventory database, and the result of successful inventory service call is fed back to the user terminal. If it is determined that the execution of some verification operations is not completed, after the monitoring period is reached, further monitoring whether the execution of the verification operations which are not completed is completed or not until it is monitored that the execution of all the verification operations is completed. And after all the verification operations are executed, if at least one verification operation is determined to fail to be verified, the request of the user terminal for calling the inventory service cannot be authorized. The feedback of the result of the inventory service invocation failure to the user terminal is performed.
At step 210, at least one inventory follow-up operation is performed asynchronously with respect to the inventory operation.
As an optional implementation manner, in this embodiment, step 210 specifically includes:
and when the inventory service calling result is sent to the user terminal, at least one inventory subsequent operation is executed according to the inventory operation.
Wherein the inventory follow-up operation may include: and generating an inventory operation record. And may also include generating other compliance data records. As for drugs, all inventory operation records of the inventory service object from the purchase are generated. It is understood that the inventory follow-up operation may also include other follow-up operations, which is not limited in this embodiment.
Specifically, in this embodiment, in order to ensure timeliness of execution of the inventory follow-up operation, and in order to ensure that the inventory follow-up operation does not affect sending of the inventory service invocation result to the user terminal. At least one inventory follow-up operation may be performed according to the inventory operation while transmitting the inventory service invocation result to the user terminal.
As another alternative, in this embodiment, as shown in fig. 8, step 210 includes the following operations:
step 2101, generating at least one message corresponding to the inventory follow-up operation according to the inventory operation, and storing the messages in the corresponding message queues respectively.
In step 2102, if it is monitored that the execution condition of the subsequent inventory operation is satisfied, the corresponding subsequent inventory operation is executed according to the message in the at least one message queue.
Whether the monitoring meets the execution condition of the inventory subsequent operation may be whether the call volume of the monitoring user terminal to the inventory service is smaller than a preset call volume, or may be in other manners, which is not limited in this embodiment.
In this embodiment, in order to preferentially ensure timeliness of the inventory service invocation, the priority of the inventory subsequent operation processing may be reduced. Specifically, after each inventory operation, a message corresponding to at least one inventory follow-up operation may be generated, and the message records information required by the inventory follow-up operation. Then, according to different types of subsequent operations of the inventory, corresponding messages are respectively placed in a message queue. And periodically monitors the volume of inventory service calls. And if the calling amount of the inventory service is determined to be smaller than the preset calling amount, acquiring the message from at least one message queue, and executing corresponding inventory subsequent operation according to the sequence of the message queue.
In the inventory service calling method provided by this embodiment, when at least one inventory subsequent operation is asynchronously executed according to the inventory operation, a message corresponding to the at least one inventory subsequent operation is generated according to the inventory operation and is respectively stored in the corresponding message queues, and if it is monitored that the execution condition of the inventory subsequent operation is satisfied, the corresponding inventory subsequent operation is executed according to the message in the at least one message queue. The method and the system can ensure the smooth execution of the subsequent operation of the inventory under the condition of preferentially ensuring the timeliness of the inventory service calling.
EXAMPLE III
Fig. 9 is a flowchart of an inventory service invoking method according to still another embodiment of the present invention, and as shown in fig. 9, the inventory service invoking method according to this embodiment further refines step 103 on the basis of the inventory service invoking method according to any one of the embodiments, and then step 103 includes the following steps:
step 301, obtain inventory data from a memory.
Step 302, a plurality of verification operations are executed in parallel on the inventory service object according to the inventory data in the memory.
In this embodiment, the inventory data is pre-stored in the preset database, but by accessing the preset database to query the inventory data corresponding to the inventory service object and perform the verification operation, network communication may occur due to access to the preset database, which may cause a time delay in network communication, resulting in a long time consumption for each verification operation. Therefore, all inventory data including inventory data corresponding to the inventory service object is obtained from the preset database in advance. And then loaded into memory. When a plurality of verification operations are executed in parallel, the inventory data corresponding to the inventory service object is directly obtained from the memory, and the plurality of verification operations are executed in parallel, so that the time delay on network communication is reduced, and the efficiency of each verification operation can be effectively improved.
It should be noted that after the current inventory service call is executed, the inventory data may still be stored in the memory. And updating the stock data in the memory. An update period can be preset, and after the update period is reached, the stock data in the memory is updated to the preset database.
In the inventory service calling method provided by this embodiment, when acquiring the inventory data and performing a plurality of verification operations on the inventory service object in parallel according to the inventory data, the inventory data is acquired from the memory, and the plurality of verification operations are performed on the inventory service object in parallel according to the inventory data in the memory. The inventory data is loaded into the memory in advance, so that the inventory data corresponding to the inventory service object is directly obtained from the memory when a plurality of verification operations are executed in parallel, and the time delay in network communication is reduced by executing the plurality of verification operations in parallel, thereby effectively improving the efficiency of each verification operation.
Example four
Fig. 10 is a schematic structural diagram of an inventory service invoking device according to an embodiment of the present invention, and as shown in fig. 10, the inventory service invoking device according to this embodiment is located in an electronic device. The inventory service invoking device 40 provided by the present embodiment includes: a receiving module 41, a determining module 42, a parallel executing module 43, an inventory operating module 44 and a sending module 45.
The receiving module 41 is configured to receive an inventory service invocation request sent by a user terminal, where the inventory service invocation request includes an inventory service invocation type and inventory service object information. And the determining module 42 is configured to determine, according to the inventory service call type, a plurality of checking operations to be performed on the inventory service object. And a parallel execution module 43, configured to obtain the inventory data and execute a plurality of verification operations in parallel on the inventory service object according to the inventory data. And the inventory operation module 44 is configured to execute the inventory operation corresponding to the inventory service call request if it is determined that the plurality of verification operations are executed completely and successfully. And a sending module 45, configured to send the inventory service invocation result to the user terminal.
The inventory service invoking device provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 4, and the implementation principle and technical effect thereof are similar to those of the method embodiment shown in fig. 4, and are not described in detail herein.
Optionally, the parallel execution module 43 is specifically configured to:
determining whether a dependency relationship exists between a plurality of check operations; and if the plurality of checking operations are determined not to have the dependency relationship, executing the plurality of checking operations on the inventory service object in parallel according to the inventory data.
Optionally, the inventory service invoking device provided in this embodiment further includes: a building module and a marking module.
Correspondingly, the building module is used for building the mapping relation between the inventory service calling type and the plurality of checking operations. And the marking module is used for marking the check operation with the dependency relationship if the dependency relationship is determined to exist between at least two check operations in the plurality of check operations corresponding to the certain inventory service calling type.
Optionally, the determining module 42 is specifically configured to:
acquiring a mapping relation; determining a plurality of checking operations having a mapping relation with the inventory service calling type; and determining the plurality of check operations with the mapping relation as a plurality of check operations to be executed.
Optionally, when determining whether a dependency relationship exists between multiple checking operations, the parallel execution module 43 is specifically configured to:
judging whether the plurality of checking operations have a mark of dependency relationship; if the plurality of checking operations are determined not to have the mark of the dependency relationship, determining that the dependency relationship does not exist among the plurality of checking operations; and if the at least two check operations are determined to have the mark of the dependency relationship, determining that the dependency relationship exists between the at least two check operations in the plurality of check operations.
Optionally, the inventory service invoking device provided in this embodiment further includes: and a serial execution module.
Correspondingly, the serial execution module is used for serially executing the verification operation with the dependency relationship if the dependency relationship between at least two verification operations is determined.
Optionally, the inventory service invoking device provided in this embodiment further includes: and an asynchronous execution module.
Accordingly, the asynchronous execution module is configured to asynchronously execute at least one inventory follow-up operation based on the inventory operation.
Optionally, the asynchronous execution module is specifically configured to:
and when the inventory service calling result is sent to the user terminal, at least one inventory subsequent operation is executed according to the inventory operation.
Optionally, the asynchronous execution module is specifically configured to:
generating at least one message corresponding to the subsequent inventory operation according to the inventory operation, and respectively storing the messages into corresponding message queues; and if the condition that the execution condition of the subsequent inventory operation is met is monitored, executing the corresponding subsequent inventory operation according to the message in the at least one message queue.
Optionally, the parallel execution module 43 is specifically configured to:
acquiring inventory data from a memory; and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data in the memory.
The inventory service calling device provided in this embodiment may execute the technical solution of the method embodiments shown in fig. 5 to 9, and the implementation principle and technical effect thereof are similar to those of the method embodiments shown in fig. 5 to 9, and are not described in detail herein.
EXAMPLE five
Fig. 11 is a block diagram of an electronic device for implementing the inventory service calling method according to the embodiment of the present invention, and as shown in fig. 11, the electronic device 50 provided in this embodiment may be an inventory server. Including at least one processor 52, memory 51, and transceiver 53.
Wherein the processor 52, the memory 51 and the transceiver 53 are electrically interconnected.
The memory 51 stores computer-executable instructions; the transceiver 53 is used for transmitting and receiving data with the user terminal.
The at least one processor 52 executes the memory-stored computer-executable instructions to cause the at least one processor to perform the method as provided in any one of the fourth to third embodiments.
EXAMPLE six
FIG. 12 is another block diagram of an electronic device, which may be an inventory server, used to implement the inventory service invocation method of an embodiment of the invention. The inventory server may be in the form of a blade server, or a cluster of servers.
The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the electronic device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 604 may be implemented by any type or combination of volatile or non-volatile memory devices 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 or optical disks.
The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 600 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 614 includes one or more sensors for providing status assessment of various aspects of the electronic device 600. For example, the sensor component 614 may detect an open/closed state of the electronic device 600, the relative positioning of components, such as a display and keypad of the electronic device 600, the sensor component 614 may also detect a change in position of the electronic device 600 or a component of the electronic device 600, the presence or absence of user contact with the electronic device 600, orientation or acceleration/deceleration of the electronic device 600, and a change in temperature of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the electronic device 600 and other devices in a wired or wireless manner. The electronic device 600 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 600 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the electronic device 600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a server, enable a computing node device or parameter server to perform the inventory service invocation methods provided by the corresponding embodiments described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (14)
1. An inventory service calling method, comprising:
receiving a stock service calling request sent by a user terminal, wherein the stock service calling request comprises a stock service calling type and stock service object information;
determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type;
acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data;
if the plurality of checking operations are determined to be executed completely and successfully, executing inventory operations corresponding to the inventory service calling request;
and sending the inventory service calling result to the user terminal.
2. The method of claim 1, wherein performing a plurality of verification operations in parallel on inventory service objects based on inventory data comprises:
determining whether a dependency relationship exists between a plurality of check operations;
and if the plurality of checking operations are determined not to have the dependency relationship, executing the plurality of checking operations on the inventory service object in parallel according to the inventory data.
3. The method of claim 2, wherein prior to determining a plurality of verification operations to be performed on the inventory service object based on the inventory service call type, further comprising:
constructing a mapping relation between the inventory service calling type and a plurality of checking operations;
and if the dependency relationship exists between at least two checking operations in the plurality of checking operations corresponding to the certain inventory service calling type, marking the checking operations with the dependency relationship.
4. The method of claim 3, wherein determining a plurality of verification operations to be performed on the inventory service object based on the inventory service call type comprises:
acquiring the mapping relation;
determining a plurality of checking operations having a mapping relation with the inventory service calling type;
and determining the plurality of check operations with the mapping relation as a plurality of check operations to be executed.
5. The method of claim 3, wherein determining whether a dependency exists between the plurality of check operations comprises:
judging whether the plurality of checking operations have a mark of dependency relationship;
if the plurality of checking operations are determined not to have the mark of the dependency relationship, determining that the dependency relationship does not exist among the plurality of checking operations;
and if the at least two check operations are determined to have the mark of the dependency relationship, determining that the dependency relationship exists between the at least two check operations in the plurality of check operations.
6. The method of claim 2, further comprising:
and if the dependency relationship exists between at least two verification operations, serially executing the verification operations with the dependency relationship.
7. The method according to any one of claims 1-6, wherein after the executing the inventory operation corresponding to the inventory service call request, further comprising:
asynchronously performing at least one inventory follow-up operation based on the inventory operation.
8. The method of claim 7, wherein said asynchronously performing at least one inventory follow-up operation in accordance with the inventory operation comprises:
and when sending the inventory service calling result to the user terminal, executing at least one inventory subsequent operation according to the inventory operation.
9. The method of claim 7, wherein said asynchronously performing at least one inventory follow-up operation in accordance with the inventory operation comprises:
generating at least one message corresponding to the subsequent inventory operation according to the inventory operation, and respectively storing the messages into corresponding message queues;
and if the condition that the execution condition of the subsequent inventory operation is met is monitored, executing the corresponding subsequent inventory operation according to the message in the at least one message queue.
10. The method of any of claims 1-6, wherein obtaining inventory data and performing a plurality of verification operations on inventory service objects in parallel based on the inventory data comprises:
acquiring inventory data from a memory;
and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data in the memory.
11. An inventory service invocation device, characterized by comprising:
the system comprises a receiving module, a sending module and a processing module, wherein the receiving module is used for receiving a stock service calling request sent by a user terminal, and the stock service calling request comprises a stock service calling type and stock service object information;
the determining module is used for determining a plurality of checking operations to be executed on the inventory service object according to the inventory service calling type;
the parallel execution module is used for acquiring inventory data and executing a plurality of verification operations on the inventory service object in parallel according to the inventory data;
the inventory operation module is used for executing inventory operation corresponding to the inventory service calling request if the completion and success of the execution of the plurality of verification operations are determined;
and the sending module is used for sending the inventory service calling result to the user terminal.
12. An electronic device, comprising: at least one processor, memory, and transceiver;
the processor, the memory, and the transceiver circuitry are interconnected;
the memory stores computer-executable instructions; the transceiver is used for receiving and transmitting data with a user terminal;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of claims 1-10.
13. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, perform the method of any one of claims 1-10.
14. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-10 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111408859.2A CN114066370A (en) | 2021-11-24 | 2021-11-24 | Inventory service calling method, device, equipment, storage medium and program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111408859.2A CN114066370A (en) | 2021-11-24 | 2021-11-24 | Inventory service calling method, device, equipment, storage medium and program product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114066370A true CN114066370A (en) | 2022-02-18 |
Family
ID=80276122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111408859.2A Pending CN114066370A (en) | 2021-11-24 | 2021-11-24 | Inventory service calling method, device, equipment, storage medium and program product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114066370A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114610511A (en) * | 2022-03-07 | 2022-06-10 | 北京百度网讯科技有限公司 | Input verification method and device, electronic equipment and storage medium |
-
2021
- 2021-11-24 CN CN202111408859.2A patent/CN114066370A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114610511A (en) * | 2022-03-07 | 2022-06-10 | 北京百度网讯科技有限公司 | Input verification method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110515709B (en) | Task scheduling system, method, device, electronic equipment and storage medium | |
CN107370772B (en) | account login method and device and computer readable storage medium | |
US20170171321A1 (en) | Methods and devices for managing accounts | |
CN105955766A (en) | Method and device for application preloading | |
CN109429102A (en) | For showing the electronic device and its operating method of application | |
CN106598677A (en) | Installation package downloading method and device | |
CN110704030A (en) | Interface configuration information generation method and device, electronic equipment and storage medium | |
CN107395624B (en) | Information processing method and device | |
CN114237784A (en) | User interface generation method and device, electronic equipment and storage medium | |
CN106708967B (en) | Page display method and device | |
CN114066370A (en) | Inventory service calling method, device, equipment, storage medium and program product | |
CN106204191A (en) | Method and device submitted to by order | |
CN113238881A (en) | Page communication method and device | |
CN112632184A (en) | Data processing method and device, electronic equipment and storage medium | |
CN107247735A (en) | Document transmission method and device | |
CN110908814A (en) | Message processing method and device, electronic equipment and storage medium | |
CN116166514A (en) | Multi-channel data linkage processing method, device, computer equipment and storage medium | |
CN116048757A (en) | Task processing method, device, electronic equipment and storage medium | |
CN113778687B (en) | Memory allocation information processing method and device, electronic equipment and storage medium | |
CN114430410A (en) | System access method, device and equipment based on virtual domain name | |
CN114896165A (en) | Testing method and device of conversation robot system, electronic equipment and storage medium | |
CN110995767B (en) | Request processing method and device | |
CN107391128B (en) | Method and device for monitoring virtual file object model vdom | |
CN112306566A (en) | Data processing method and device | |
CN107894902B (en) | Equipment control method and device |
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 |