CN110852776A - Task processing method and device, storage medium and electronic device - Google Patents

Task processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN110852776A
CN110852776A CN201910907722.8A CN201910907722A CN110852776A CN 110852776 A CN110852776 A CN 110852776A CN 201910907722 A CN201910907722 A CN 201910907722A CN 110852776 A CN110852776 A CN 110852776A
Authority
CN
China
Prior art keywords
target
target task
task
target object
request
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
CN201910907722.8A
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.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201910907722.8A priority Critical patent/CN110852776A/en
Publication of CN110852776A publication Critical patent/CN110852776A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/08Auctions

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Game Theory and Decision Science (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a task processing method and device, a storage medium and an electronic device. Wherein, the method comprises the following steps: receiving a first request, wherein the first request is used for requesting to execute a target task, and the target task comprises replacing a target object with a virtual resource; executing the target task and acquiring an execution result of the target task, wherein the target task is configured with a starting time for allowing the target task to be executed and the number of objects of the target object for allowing the target object to be exchanged by using virtual resources, and the execution result is used for representing an operation result for exchanging the target object by using the virtual resources; and returning the execution result. The method and the device solve the technical problem that the operation complexity of the platform activity in the related technology is high.

Description

Task processing method and device, storage medium and electronic device
Technical Field
The application relates to the field of internet, in particular to a task processing method and device, a storage medium and an electronic device.
Background
With the rapid development of the internet, the second killing gradually becomes a new mode of online auction, so-called "second killing" is a selling mode in which a network seller issues some commodities with ultra-low prices and all buyers buy on the internet at the same time, and colloquially speaking, is an online time-limited shopping campaign organized by network merchants for the purposes of sales promotion and the like.
When a task is active each time, program codes such as killing-by-second logic and the like need to be written in the background of the auction platform so as to meet the killing-by-second requirement of the task; similarly, in other tasks (e.g., timing out merchandise that is online), the relevant code also needs to be written in the background each time.
In the process of implementing the invention, the inventor finds that data consistency is problematic because relevant logic needs to be rewritten for each task, and the complexity of the task is increased because relevant program codes need to be written before each task is executed.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a task processing method and device, a storage medium and an electronic device, and aims to at least solve the technical problem that the operation complexity of platform activities in the related art is high.
According to an aspect of an embodiment of the present application, there is provided a method for processing a task, including:
receiving a first request, wherein the first request is used for requesting to execute a target task, and the target task comprises replacing a target object with a virtual resource; executing the target task and acquiring an execution result of the target task, wherein the target task is configured with a starting time for allowing the target task to be executed and the number of objects of the target object for allowing the target object to be exchanged by using virtual resources, and the execution result is used for representing an operation result for exchanging the target object by using the virtual resources; and returning the execution result.
According to another aspect of the embodiments of the present application, there is also provided a processing apparatus for a task, including:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a first request, the first request is used for requesting to execute a target task, and the target task comprises the use of virtual resources for replacing a target object; the processing unit is used for executing the target task and acquiring an execution result of the target task, wherein the target task is internally configured with a starting time for allowing the target task to be executed and the number of objects of the target object for allowing virtual resources to be used, and the execution result is used for representing an operation result for replacing the target object by using the virtual resources; and the feedback unit is used for returning the execution result.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, the target task is executed according to the received first request, the target task is used for exchanging the target object with the virtual resource, the target task can be executed by simply configuring the target task each time, and the logic related to the activity does not need to be rewritten, so that the technical problem that the operation complexity of the platform activity in the related technology is high can be solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic diagram of a hardware environment for a method of processing tasks according to an embodiment of the application;
FIG. 2 is a flow chart of an alternative method of processing tasks according to an embodiment of the application;
FIG. 3 is a schematic diagram of a framework of a processing scheme of tasks according to an embodiment of the application;
FIG. 4 is a schematic illustration of a processing scheme of a task according to an embodiment of the application;
FIG. 5 is a flow chart of an alternative method of processing tasks according to an embodiment of the application;
FIG. 6 is a schematic diagram of a processing device for an alternative task according to an embodiment of the present application;
and
fig. 7 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, aiming at different activities, each time (such as killing activity) needs to rewrite related logic, and more or less problems are brought about in data consistency, so that goods are over-sold or under-sold.
According to an aspect of embodiments of the present application, a method embodiment of a method for processing a task is provided.
Alternatively, in this embodiment, the processing method of the task may be applied to a hardware environment formed by the terminal 101 (e.g., the first terminal) and the server 103 (e.g., the server where the target platform is located) as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The task processing method in the embodiment of the present application may be executed by the server 103, or may be executed by both the server 103 and the terminal 101.
Fig. 2 is a flowchart of an alternative task processing method according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, receiving a first request, where the first request is used to request execution of a target task, and the target task includes replacing a target object with a virtual resource.
According to the method and the device, the target platform receives the first request, the first request is initiated by the first terminal, the target task is executed on the target platform, and the target platform uses the virtual resource to replace the target object.
The target platform is a platform that allows virtual resources to be used for object exchange, such as a game platform, a social platform, and a shopping platform, the virtual resources may be currency, virtual currency, points, account numbers, and the like, the target object may be skin on the social platform, props in a game, commodities on the shopping platform, and the like, and for the convenience of understanding of readers, the following description will be given by taking the target platform as a shopping platform and the target object as commodities on the shopping platform as an example.
Step S204, executing the target task and obtaining the execution result of the target task, wherein the starting time of the target task allowed to be executed and the object number of the target objects allowed to be exchanged by using the virtual resources are configured in the target task, and the execution result is used for representing the operation result of exchanging the target objects by using the virtual resources.
In this embodiment, the target task is executed through middleware of the target platform, where the middleware refers to an independent system software or service program of the target platform, and is located on an operating system of the target platform, and may connect two independent applications or independent systems, and the connected systems may still exchange information with each other through the middleware even though they have different interfaces.
The middleware integrates various required logics, and can be used only by simple configuration when used each time, such as the starting time and the ending time of each activity, and the object quantity of the target object, such as the total quantity, the residual quantity and the like.
Step S206, returns the execution result.
In the embodiment of the application, the execution result is returned to the first terminal.
Through the steps S202 to S206, the reusable middleware is provided, and can be used with simple configuration each time without rewriting activity-related logic, so that the technical problem of high operation complexity of platform activities in the related art can be solved.
The framework of the technical solution of the present application is shown in fig. 3, and includes three aspects of data processing, service interface, and data configuration, and the technical solution of the present application is further detailed below with a second killing as an example in conjunction with fig. 3.
In the above embodiment, before receiving the first request of the first terminal on the target platform, a configuration file may be obtained, where the configuration file is used to configure the middleware according to the requirement of the target platform; the configuration file is loaded in the middleware to configure the middleware, and the writing function of the configuration file is closed after the configuration file is loaded by the middleware.
Optionally, before obtaining the configuration file, configuration information of at least one of an exchange activity and a service account may be written in a configuration template of the target platform, where the exchange activity is an activity configured on the target platform to exchange for the target object by executing the target task, and the service account is an account from which the first request is initiated by the first terminal. Writing configuration information for the switching activity in the configuration template may include: writing at least one of the total number of exchange activities, the number of exchange activities in a unit time (the unit time can be configured according to requirements, such as day unit, hour unit, etc.), the object identification of the target object, the total number of the target objects, and the exchange number of the target object in the unit time in the configuration template. The writing of configuration information for the account number in the configuration template may include: and configuring account types which allow the target task to be initiated or account types which do not allow the target task to be initiated in the configuration template.
In the data configuration process, the data configuration is divided into commodity information configuration (i.e. configuration information of exchange activities) and customized extensible rule configuration (i.e. configuration information of business accounts). Taking the second killing as an example, the total activity participation times and daily participation times related to the second killing, the total commodity inventory amount related to the commodity information, the daily commodity inventory amount and the unique identification code of the commodity are used as basic data of the second killing business for account book verification.
The rule configuration information supports one or more rule customized configurations, the part of data can be used as a preposed rule for ordering second killing activities to perform verification interception, the rule verification is filtered by a rule engine, the rule engine performs high abstraction on the definition of the rule information, and the rule matching is performed according to the rule definition to perform high-efficiency filtering.
In the above embodiment, in the process of executing the target task through the middleware, the number of objects of the target object is operated through the service interface provided by the middleware. The service interface supports loading, inquiring, deducting and recovering of inventory data. The data loading completes the initialization of the middleware; inventory inquiry can support real-time reference of activity data, inventory, participation times and customized configuration information; the inventory deduction and the inventory restoration can carry out accurate deduction and restoration operation of the inventory. Taking the deduction operation as an example, a first sequence segment in an object sequence in a state of not being locked may be obtained, and a locking operation is performed on the first sequence segment, so as to store that the object sequences of all target objects include a plurality of sequence segments, and a second sequence segment in the object sequence in a state of being locked is a sequence segment that is not allowed to be used; inquiring whether the residual quantity of the target objects in the first sequence segment is more than or equal to the exchange quantity of the target objects required by the target task; deducting the exchange number from the residual number of the first sequence section under the condition that the residual number is greater than or equal to the exchange number; and switching the state of the first sequence segment from locked to unlocked.
When the target task is executed through the middleware, namely data processing is performed, the functions of account book checking, rule filtering, inventory processing and the like are included.
The account book checking is that the account book is compiled according to the second killing activity and the configuration information of the commodities, the second killing activity is inquired according to the total amount dimension and the date dimension, and the overview of basic information such as the current total participation times, the daily participation times, the total inventory, the daily inventory, the activity date effective interval and the like is summarized.
The rule filtering comprises filtering an account book, customizing the rule filtering, and filtering the account book, namely performing global check on information provided by the account book, and judging whether participation times meet requirements, whether stock inventory remains, whether activity dates are effective and the like; and (3) customized rule filtering, namely filtering the pre-loaded rule data, such as whether the crowd label is met, whether the grade is met, whether the distribution area is allowed, whether the wind control grade is up to the standard and the like, intercepting and rejecting the current request if the crowd label is not met, and releasing to finish the stock deduction if all the crowd label is met.
The inventory processing is divided into inventory operation pre-processing and post-processing. Pre-processing and post-processing are interspersed before and after the business processing logic. The pre-processing firstly tries to reduce the stock, if the storage fails, the request is interrupted, otherwise, the stock lock identifier is generated according to the stock to obtain the stock lock, if the storage fails, the request is interrupted, otherwise, the complex business logic processing is continuously carried out. And the post-processing judges whether to perform stock rollback according to the success or failure of the result of the business logic processing, and finally completes the task of releasing the stock lock.
As an alternative example, as shown in fig. 4, the following further details the technical solution of the present application with reference to specific embodiments.
The data can be preloaded in advance to complete initialization:
optionally, the middleware may be configured in the following manner: the middleware defines the structure of the configuration document through xsd (XML schema definition), supports general configuration files such as XML and properties for data loading, performs preloading to complete initialization of data items, and simultaneously performs database and cache double writing. In view of the strong dependence of the second killing on data such as inventory, participation times and the like, once the data preloading is completed, only the data invalidation operation is supported, and any modification and adjustment are not supported, so that the phenomenon that the data are inconsistent and the overbilling or overbilling phenomenon is caused due to the damage to the transaction atomicity in the service execution process is prevented.
The middleware provides two modes of preloading and lazy loading for selection, and calling a data loading interface can perform lazy loading on each data item of the configuration file to complete initialization. Generally, a preloading mode is recommended to be used, all initialization operations are completed before service calling starts so as to improve the response speed of a service interface, and if the service volume is large and a scene needs, a lazy loading mode can be flexibly selected.
For middleware, the middleware can be called by service users in the form of SDK. And the service user can introduce the middleware jar package through the map configuration pom file and operate the middleware according to the method provided by the service interface.
And the external service calls the interface method to complete service interaction. The service interface supports the instant query of each data item of the configuration file, and can instantly look up data silence values and change conditions, such as participation times, used times, remaining times, total inventory, used inventory, remaining inventory and the like of a total amount dimension and a date dimension. The activity participation times and the commodity inventory can be deducted according to the rule configuration, and the activity participation times and the commodity inventory can be rolled back according to the requirement.
The inventory control process is shown in FIG. 5:
step S502, a deduction request is sent to the cache Redis.
Step S504, determining whether the inventory decr is successfully deducted, if so, executing step S506 and step S508, otherwise, ending with failure.
In step S506, an operation of deducting the inventory is added to the queue MO, and the operation may be automatically retried in failure.
In step S508, it is determined whether the acquisition of the inventory lock is successful, if so, step S516 is executed, otherwise, step S518 is executed.
The inventory lock adopts Redis to realize globally unique distributed lock, and utilizes the single-thread operating characteristic to ensure the atomicity of command execution and realize reliable inventory operation and change control. The inventory lock firstly deducts inventory, the inventory lock identifier with the segmented lock effect is formed by using the lock identifier number according to the inventory surplus of the service attribute combination, the expiration time far longer than the service processing time is set, namely, under a high concurrency environment, a large number of requests do not need to wait for the global unique lock, the inventory deduction is ensured by utilizing the Redis atomic operation without the concurrency problem, the inventory lock identifiers requested by a plurality of threads in the same time dimension are consistent, the lock competition is carried out under the inventory lock, the granularity of the inventory lock is reduced, and the system throughput and the response speed are greatly improved. The inventory lock is designed in such a way, so that the problem that the lock is not correctly released in the service processing due to abnormal conditions to cause the global service to be unavailable is avoided.
In step S510, an operation of recovering the inventory is added to the queue MO, and the operation may be automatically retried in failure.
Step S512, updating the stock.
The inventory operation comprises inventory deduction and recovery, inventory control is performed through Redis, atomicity of operation is guaranteed by using a single-thread characteristic of Redis, inventory change of a database is updated through asynchronous messages, and final consistency of data is achieved. The method can ensure the atomicity of operation, reduce response time and improve throughput by utilizing the high-performance bottom layer operation characteristic of Redis multiplexing, can asynchronously carry out peak clipping through a message mechanism, reduces request peaks caused by instantaneous high-frequency operation on a database, avoids the problems of compensation and the like of large-batch updating failure, and nodes related to inventory operation carry out alarm information push in a bypass monitoring mode.
Step S514, determining whether the stock recovery is successful, if so, executing step S510, otherwise, ending with failure.
Step S516, determining whether the service processing is successful, if so, performing step S518, otherwise, ending with failure.
Step S518 determines whether releasing the inventory lock is successful, if so, it is successfully completed, otherwise, it is failed to complete.
By adopting the technical scheme, the service abstraction is carried out on the stock deduction of the second killing scene, the middleware service which is uniformly adapted and called is formed, the code redundancy under the same scene is reduced, the maintenance is convenient, and the reliability and the consistency of the data operation are also ensured. Aiming at inventory control, a segmented lock design of an inventory identification is formed according to the active business attribute and the inventory, so that the resource consumption caused by lock competition is reduced, and the effective request and the throughput of the system are greatly improved. Controllable lock acquisition, expiration invalidation and active release processing are provided for distributed lock control. The second killing related logic can be repeatedly used for different second killing activities, and the data configuration is supported, so that the data consistency is ensured.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a processing apparatus for a task that implements the processing method for the task described above. Fig. 6 is a schematic diagram of a processing device for an optional task according to an embodiment of the present application, and as shown in fig. 6, the device may include:
a receiving unit 601, configured to receive a first request of a first terminal, where the first request is used to request to execute a target task, and the target task includes replacing a target object with a virtual resource;
a processing unit 603, configured to execute a target task and obtain an execution result of the target task, where a start time for allowing execution of the target task and the number of objects of the target object for allowing replacement by using a virtual resource are configured in the target task, and the execution result is used to represent an operation result for replacing the target object by using the virtual resource;
and a feedback unit 605 for returning the execution result.
It should be noted that the receiving unit 601 in this embodiment may be configured to execute step S202 in this embodiment, the processing unit 603 in this embodiment may be configured to execute step S204 in this embodiment, and the feedback unit 605 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the modules, reusable middleware is provided, the middleware can be used by simple configuration every time without rewriting activity-related logic, the technical problem that the operation complexity of platform activity in the related technology is high can be solved, the second killing activity is taken as an example, the second killing logic is extracted into the middleware, customized configuration can be provided, service is provided for inventory control, and the technical effect of simplifying the operation of the activity is further achieved.
Optionally, the apparatus of the present application may further include a configuration unit, configured to obtain a configuration file before receiving the first request of the first terminal, where the configuration file is used to configure the target task according to a requirement; and configuring the target task by loading the configuration file.
The configuration unit of the present application may further be configured to write configuration information of at least one of an exchange activity and a service account before obtaining the configuration file, where the exchange activity is an activity configured to exchange for a target object by executing a target task, and the service account is an account from which a first request is initiated by a first terminal.
Optionally, the configuration information of the write exchange activity includes: at least one of a total number of write swap campaigns, a number of swap campaigns per unit time, an object identification of the target object, a total number of target objects, and a swap number of the target object per unit time.
Optionally, the configuration information written into the account includes: and configuring the account type which allows the target task to be initiated or the account type which does not allow the target task to be initiated.
Optionally, in the process of executing the target task, the processing unit operates the number of objects of the target object through the service interface. The service interface may be provided by middleware.
Optionally, the processing unit may be further operable to: acquiring a first sequence segment of which the state is unlocked in an object sequence, and performing locking operation on the first sequence segment, wherein the object sequence used for storing all target objects comprises a plurality of sequence segments, and a second sequence segment of which the state is locked in the object sequence is a sequence segment which is not allowed to be used; inquiring whether the residual quantity of the target objects in the first sequence segment is more than or equal to the exchange quantity of the target objects required by the target task; deducting the exchange number from the residual number of the first sequence section under the condition that the residual number is greater than or equal to the exchange number; and switching the state of the first sequence segment from locked to unlocked.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the application, a server or a terminal for implementing the processing method of the task is also provided.
Fig. 7 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 7, the terminal may include: one or more processors 701 (only one of which is shown in fig. 7), a memory 703, and a transmission means 705. as shown in fig. 7, the terminal may further include an input-output device 707.
The memory 703 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for processing tasks in the embodiment of the present application, and the processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 703, that is, implements the processing method of the tasks described above. The memory 703 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory. In some examples, the memory 703 may further include memory located remotely from the processor 701, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 705 is used for receiving or transmitting data via a network, and may also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 705 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 705 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Among other things, the memory 703 is used to store application programs.
The processor 701 may call the application program stored in the memory 703 through the transmission means 705 to perform the following steps:
receiving a first request, wherein the first request is used for requesting to execute a target task, and the target task comprises replacing a target object with a virtual resource;
executing the target task and acquiring an execution result of the target task, wherein the target task is internally configured with starting time for allowing the target task to be executed and the number of objects of the target object for allowing the virtual resource to be used for replacing, and the execution result is used for expressing an operation result for replacing the target object by using the virtual resource;
and returning an execution result.
The processor 701 is further configured to perform the following steps:
acquiring a first sequence segment of which the state is unlocked in an object sequence, and performing locking operation on the first sequence segment, wherein the object sequence used for storing all target objects comprises a plurality of sequence segments, and a second sequence segment of which the state is locked in the object sequence is a sequence segment which is not allowed to be used;
inquiring whether the residual quantity of the target objects in the first sequence segment is more than or equal to the exchange quantity of the target objects required by the target task;
deducting the exchange number from the residual number of the first sequence section under the condition that the residual number is greater than or equal to the exchange number;
and switching the state of the first sequence segment from locked to unlocked.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 7 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in the present embodiment, the storage medium may be used for a program code of a processing method for executing a task.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
receiving a first request, wherein the first request is used for requesting to execute a target task, and the target task comprises replacing a target object with a virtual resource;
executing the target task and acquiring an execution result of the target task, wherein the target task is internally configured with starting time for allowing the target task to be executed and the number of objects of the target object for allowing the virtual resource to be used for replacing, and the execution result is used for expressing an operation result for replacing the target object by using the virtual resource;
and returning an execution result.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
acquiring a first sequence segment of which the state is unlocked in an object sequence, and performing locking operation on the first sequence segment, wherein the object sequence used for storing all target objects comprises a plurality of sequence segments, and a second sequence segment of which the state is locked in the object sequence is a sequence segment which is not allowed to be used;
inquiring whether the residual quantity of the target objects in the first sequence segment is more than or equal to the exchange quantity of the target objects required by the target task;
deducting the exchange number from the residual number of the first sequence section under the condition that the residual number is greater than or equal to the exchange number;
and switching the state of the first sequence segment from locked to unlocked.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for processing a task, comprising:
receiving a first request, wherein the first request is used for requesting to execute a target task, and the target task comprises replacing a target object with a virtual resource;
executing the target task and acquiring an execution result of the target task, wherein the target task is configured with a starting time for allowing the target task to be executed and the number of objects of the target object for allowing the target object to be exchanged by using virtual resources, and the execution result is used for representing an operation result for exchanging the target object by using the virtual resources;
and returning the execution result.
2. The method of claim 1, wherein prior to receiving the first request, the method further comprises:
acquiring a configuration file, wherein the configuration file is used for configuring the target task according to requirements;
and configuring the target task by loading the configuration file.
3. The method of claim 2, wherein prior to obtaining the configuration file, the method further comprises:
writing configuration information of at least one of an exchange activity and a service account, wherein the exchange activity is an activity configured to exchange the target object by executing the target task, and the service account is an account initiating the first request.
4. The method of claim 3, wherein writing configuration information for a swap activity comprises:
writing at least one of a total number of the exchange activities, a number of the exchange activities per unit time, an object identification of the target object, a total number of the target objects, and an exchange number of the target objects per unit time.
5. The method of claim 3, wherein writing configuration information for the service account comprises:
and configuring the account type which allows the target task to be initiated or the account type which does not allow the target task to be initiated.
6. The method according to any one of claims 1 to 5, wherein in the process of executing the target task, the method further comprises:
and operating the object number of the target object through a service interface.
7. The method of claim 6, wherein operating on the number of objects of the target object through a business interface comprises:
acquiring a first sequence segment of which the state is unlocked in an object sequence, and performing locking operation on the first sequence segment, wherein the object sequence used for storing all the target objects comprises a plurality of sequence segments, and a second sequence segment of which the state is locked in the object sequence is a sequence segment which is not allowed to be used;
inquiring whether the residual quantity of the target objects in the first sequence segment is larger than or equal to the exchange quantity of the target objects required by the target task;
deducting the swap number from the remaining number of the first sequence segment when the remaining number is greater than or equal to the swap number;
and switching the state of the first sequence segment from locked to unlocked.
8. A task processing apparatus, comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a first request, the first request is used for requesting to execute a target task, and the target task comprises the use of virtual resources for replacing a target object;
the processing unit is used for executing the target task and acquiring an execution result of the target task, wherein the target task is internally configured with a starting time for allowing the target task to be executed and the number of objects of the target object for allowing virtual resources to be used, and the execution result is used for representing an operation result for replacing the target object by using the virtual resources;
and the feedback unit is used for returning the execution result.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 7 by means of the computer program.
CN201910907722.8A 2019-09-24 2019-09-24 Task processing method and device, storage medium and electronic device Pending CN110852776A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910907722.8A CN110852776A (en) 2019-09-24 2019-09-24 Task processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910907722.8A CN110852776A (en) 2019-09-24 2019-09-24 Task processing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN110852776A true CN110852776A (en) 2020-02-28

Family

ID=69596055

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910907722.8A Pending CN110852776A (en) 2019-09-24 2019-09-24 Task processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN110852776A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522834A (en) * 2020-07-06 2020-08-11 南京梦饷网络科技有限公司 Method for information processing, electronic device, and storage medium
CN112330458A (en) * 2021-01-07 2021-02-05 深圳华锐金融技术股份有限公司 Wind control processing method, device, equipment and storage medium based on wind control platform
CN113238860A (en) * 2021-04-29 2021-08-10 北京达佳互联信息技术有限公司 Task request processing method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228175A (en) * 2017-12-29 2018-06-29 深圳乐信软件技术有限公司 Movable backstage development approach, device, server and medium
CN109710228A (en) * 2018-11-09 2019-05-03 安徽同徽信息技术有限公司 A kind of middleware engine frame system can be applied to electric business B2B transaction platform
CN110245153A (en) * 2019-05-20 2019-09-17 平安银行股份有限公司 Product data processing method, system, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228175A (en) * 2017-12-29 2018-06-29 深圳乐信软件技术有限公司 Movable backstage development approach, device, server and medium
CN109710228A (en) * 2018-11-09 2019-05-03 安徽同徽信息技术有限公司 A kind of middleware engine frame system can be applied to electric business B2B transaction platform
CN110245153A (en) * 2019-05-20 2019-09-17 平安银行股份有限公司 Product data processing method, system, computer equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522834A (en) * 2020-07-06 2020-08-11 南京梦饷网络科技有限公司 Method for information processing, electronic device, and storage medium
CN112330458A (en) * 2021-01-07 2021-02-05 深圳华锐金融技术股份有限公司 Wind control processing method, device, equipment and storage medium based on wind control platform
CN112330458B (en) * 2021-01-07 2021-06-18 深圳华锐金融技术股份有限公司 Wind control processing method, device, equipment and storage medium based on wind control platform
CN113238860A (en) * 2021-04-29 2021-08-10 北京达佳互联信息技术有限公司 Task request processing method and device, electronic equipment and storage medium
CN113238860B (en) * 2021-04-29 2024-03-26 北京达佳互联信息技术有限公司 Task request processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110852776A (en) Task processing method and device, storage medium and electronic device
CN102609813B (en) based on the master data management architecture of cloud
US9020949B2 (en) Method and system for centralized issue tracking
US20060184569A1 (en) Data processing systems and methods
CN104699712A (en) Method and device for updating stock record information in database
US20120254118A1 (en) Recovery of tenant data across tenant moves
WO2013059797A1 (en) Service based information technology platform
CN111314238A (en) Token management method and device, storage medium and electronic device
CN110347692B (en) Inventory management method and device based on cache
CN113467824B (en) Data processing method, device, equipment and storage medium
US20150287009A1 (en) Systems, methods, and devices for a common application architecture on multiple point-of-sale hardware platforms to support multiple applications
CN110532041A (en) Regulation engine method for parameter configuration, device, computer equipment and storage medium
CN106096926B (en) Event processing method, device, electronic device and storage medium
CN102135895A (en) System upgrading method and system
CN113179301A (en) File downloading method and device, storage medium and electronic device
US20080262881A1 (en) Logically centralized scrap management using planning operations
CN111311360A (en) Resource return method and device, storage medium and electronic device
CN110472881A (en) Based on the state machine workflow engine of block chain and the working method of distributed storage
CN113342863A (en) Business document processing method and device, computer equipment and storage medium
EP2543160B1 (en) Method and system for operations management in a telecommunications terminal with a state machine
CN111461599B (en) Mode state switching method and device, storage medium and electronic device
CN109901933B (en) Operation method and device of business system, storage medium and electronic device
CN114201166A (en) Message information generation method and device, electronic equipment and storage medium
CN107608690B (en) Configuration management method and device
CN113034165A (en) Data processing method and device, storage medium and electronic 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200228