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

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

Info

Publication number
CN112581288A
CN112581288A CN202011453166.0A CN202011453166A CN112581288A CN 112581288 A CN112581288 A CN 112581288A CN 202011453166 A CN202011453166 A CN 202011453166A CN 112581288 A CN112581288 A CN 112581288A
Authority
CN
China
Prior art keywords
information
taking
authorization
identification information
task
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
CN202011453166.0A
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 CN202011453166.0A priority Critical patent/CN112581288A/en
Publication of CN112581288A publication Critical patent/CN112581288A/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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/06Asset management; Financial planning or analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The embodiment of the application provides a task processing method, a task processing system, an electronic device and a storage medium, and the method comprises the steps of obtaining position-taking task information used for calculating position-taking indexes of investment portfolios, wherein the position-taking task information comprises identification information of the investment portfolios, generating an authorization request according to the identification information of the investment portfolios, sending the authorization request to a central server, enabling the central server to obtain a state indicated by authorization identification information related to the identification information of the investment portfolios, generating confirmation authorization information when the state indicated by the authorization identification information is an unlocking state, and processing the position-taking task information if the confirmation authorization information sent by the central server is received, so that only one position-taking server at the current moment is guaranteed to calculate the position-taking indexes of the investment portfolios, and information consistency of the position-taking indexes of the investment portfolios is achieved.

Description

Task processing method, system, electronic device and storage medium
Technical Field
The present application relates to the field of financial technology, and in particular, to a method and system for processing tasks, an electronic device, and a storage medium.
Background
In the asset management business system, the position taking server takes the position taking tasks of position taking calculation and bargaining derivation. The position-taking server adopts a single-thread serial processing position-taking task to ensure that only one thread calculates one investment combination at the same time, thereby realizing information consistency.
In the prior art, single-threaded serial computation is usually realized by writing code blocks by using java synchronized locks. Due to the fact that the processes of the servers simultaneously process data of the same investment portfolio, the single-thread synchronous lock cannot achieve information consistency in a distributed system. If the existing server for taking a position once reaches the performance bottleneck, that is, the processed data volume exceeds the capacity of the server, the problem caused by the increased data volume cannot be relieved by increasing the server for taking a position.
However, in the prior art, the position server adopts the synchronous lock to realize single-thread serial calculation, and cannot be used in a distributed system, so that the problem of the increase of data volume cannot be solved by increasing the position server.
Disclosure of Invention
The embodiment of the application provides a task processing method, a task processing system, electronic equipment and a storage medium, and aims to ensure information consistency when a plurality of position-taking servers compete to calculate position-taking indexes of the same investment portfolio.
In a first aspect, the present application provides a task processing method, where a task processing system includes a plurality of taken-position servers and a central server, and the method is applied to the central server, and the method includes:
acquiring position-taking task information, wherein the position-taking task information comprises identification information of an investment portfolio, and the position-taking task information is used for calculating position-taking indexes of the investment portfolio;
generating an authorization request according to the identification information of the investment portfolio, and sending the authorization request to a central server so that the central server acquires the state indicated by the authorization identification information associated with the identification information of the investment portfolio, and generates confirmation authorization information when the state indicated by the authorization identification information is an unlocking state;
and if the confirmation authorization information sent by the central server is received, processing the position taking task information.
Optionally, the acquiring the position-taken task information for calculating the position-taken index of the investment portfolio specifically includes:
determining a target cache queue from a plurality of cache queues according to the identification information of the investment portfolio;
storing the position holding task information into a target cache queue;
and when the thread corresponding to the target cache queue is idle, reading the position holding task information from the target cache queue.
Optionally, determining a target cache queue from the plurality of cache queues according to the identification information of the investment portfolio specifically includes:
carrying out Hash calculation on the identification information of the investment portfolio to obtain a Hash value;
and determining a target buffer queue with the queue number as the hash value from the plurality of buffer queues.
Optionally, acquiring the taken position task information further includes:
subscribing the position taking event and the transaction event published by the data server;
extracting position holding information from the position holding event and extracting transaction information from the transaction event;
generating position holding task information according to the position holding information, the transaction information and the attribute information of the investment portfolio;
wherein the attribute information of the portfolio includes identification information of the portfolio.
Optionally, acquiring the taken position task information further includes:
subscribing to a day-to-end clearing event issued by the data server;
extracting position information and transaction information from the daily terminal clearing event;
generating position holding task information according to the position holding information, the transaction information and the attribute information of the investment portfolio;
wherein the attribute information of the portfolio includes identification information of the portfolio.
Optionally, the method further comprises:
receiving authorization identification information sent by a central server;
generating a locking request when the state indicated by the authorization identification information is determined to be an unlocking state;
a lock request is sent to the central server.
In a second aspect, the present application provides a task processing method, where the method is applied to a central server, and the method includes:
receiving an authorization request sent by a position server, wherein the authorization request comprises identification information of an investment portfolio;
acquiring the state indicated by the authorization identification information associated with the identification information of the investment portfolio;
when the state indicated by the authorization identification information is an unlocking state, generating authorization confirmation information;
and sending confirmation authorization information to the position taking server.
Optionally, before generating the confirmation authorization information, the method further comprises:
sending the state indicated by the authorization identification information to a position taking server so that the position taking server generates a locking request when determining that the state indicated by the authorization identification information is an unlocking state;
receiving a locking request sent by a position taking server;
and switching the state indicated by the authorization identification information to a locking state.
In a third aspect, the present application provides a position taken server, comprising: a memory, a processor;
a memory; a memory for storing processor-executable instructions;
wherein the processor is configured to implement the task processing method according to the first aspect and the alternative.
In a fourth aspect, the present application provides a central server, comprising: a memory, a processor;
a memory; a memory for storing processor-executable instructions;
wherein the processor is configured to implement the task processing method according to the second aspect and the alternative.
In a fifth aspect, the present application provides a task processing system including a plurality of the position taken servers according to the fourth aspect and the central server according to the third aspect.
In a sixth aspect, the present application provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the task processing method according to the first aspect or the second aspect or the alternative when executed by a processor.
In a seventh aspect, the present application provides a computer program product comprising instructions which, when executed by a processor, implement the method for processing tasks according to the first aspect or the second aspect.
The embodiment of the application provides a task processing method, a task processing system, electronic equipment and a storage medium, which are applied to a distributed system comprising a plurality of position-taking servers, wherein when one position-taking server receives position-taking task information, identification information of an investment portfolio is extracted from the position-taking task information, an authorization request is generated according to the identification information, the authorization request is sent to a central server, when the condition that the authorization identification information associated with the identification information of the investment portfolio indicates an unlocking condition is determined, the central server sends confirmation authorization information to the position-taking servers, and then only one position-taking server is ensured to calculate the same investment portfolio at the same time, the consistency of position-taking indexes of the investment portfolio is ensured, and the distributed mode can be used for coping with the condition of rapid increase of data volume, and the processing capacity of the task processing system is improved.
In addition, when the position holding server continuously receives a plurality of position holding task information, the cache queue for caching the position holding task information is determined according to the identification information of the investment portfolio in the position holding task information, so that the position holding task information for calculating the same investment portfolio is cached in the same cache queue, the position holding task information for calculating the same investment portfolio is serially processed in one position holding server, and the task processing efficiency is improved on the basis of ensuring the information consistency.
In addition, through a publishing and subscribing mechanism, the data server publishes a position taking event, a transaction event or a daily end clearing event in real time, the position taking server subscribes the events, the position taking server is triggered to process position taking task information, the decoupling of the data server and the position taking server is realized, the influence on the normal operation of the data server after the position taking server is down is avoided, and the reliability of the service is improved.
Drawings
Fig. 1 is a schematic structural diagram of a task processing system according to an embodiment of the present application
FIG. 2 is a conceptual diagram of a task processing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a task processing method according to another embodiment of the present application;
fig. 4 is a schematic flowchart of a task processing method according to another embodiment of the present application;
fig. 5 is a schematic structural diagram of a task processing device according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a task processing device according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a server according to another embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present application. 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.
In the asset management business system, the position taking server takes the tasks of position taking calculation and bargaining derivation. The position taking calculation refers to calculating position taking indexes such as position taking change, position taking market value, net value, product scale and the like of the investment portfolio according to the volume of bargaining and the position taking amount. And the conclusion of the deal is to deduce position-holding indexes such as net value, deal change and the like of the investment portfolio according to the clearing data at the end of each day.
In the prior art, a position-taking server adopts a single-thread serial calculation position-taking index, so that only one thread is ensured to process the same investment portfolio at the same time. In order to realize single-thread serial computation, a java synchronous lock synchronized is used for writing a code block. Due to the fact that the processes of the servers simultaneously process data of the same investment portfolio, the single-thread synchronous lock cannot achieve information consistency in a distributed system. If the existing position server reaches the performance bottleneck once, and the processed data volume exceeds the capacity of the server, the problem caused by the rapidly increased data volume cannot be relieved by increasing the position server. In addition, other servers and the position-taking server adopt a Remote Procedure Call (RPC) interface, so that the servers are dependent on each other, and when the position-taking server goes down, other servers cannot operate normally.
The application provides a task processing method, a task processing system, electronic equipment and a storage medium, and aims to ensure information consistency when a plurality of position-taking servers compete to calculate position-taking indexes of the same investment portfolio, realize decoupling between a data server and the position-taking servers and ensure working reliability of the servers.
As shown in fig. 1, an embodiment of the present application provides a task processing system including a plurality of taken-position servers 101, a central server 102, and a plurality of data servers 103. Wherein, the data server 103 is used for issuing position taking events, transaction events or day-to-day clearing events. Each of the position-taking servers 101 subscribes to the event, each of the position-taking servers 101 generates position-taking task information after acquiring the event, requests the central server 102 for authorization information for calculating a position-taking index of the investment portfolio, and the central server 102 determines whether to send confirmation authorization information to the position-taking server 101 according to the state indicated by the authorization identifier information associated with the investment portfolio, so that the position-taking server 101 processes the position-taking task information after receiving the confirmation authorization information.
As shown in fig. 2, the inventive concept of the present application is: when each position-taking server receives position-taking task information, requesting the central server to calculate authorization information of position-taking indexes of the investment portfolio, determining whether to send confirmation authorization information to the position-taking servers or not according to the state of authorization marks corresponding to the investment portfolio so as to ensure that only one position-taking server calculates the position-taking indexes of the investment portfolio at the current moment, and processing the position-taking task information by the position-taking services after receiving the confirmation authorization information to achieve information consistency.
In addition, a cache queue for caching the position holding task information is determined according to the identification information of the investment portfolio in the position holding task information, so that the position holding task information for calculating the same investment portfolio is guaranteed to be cached in the same cache queue, the position holding task information for calculating the same investment portfolio is serially processed in a position holding server, and the task processing efficiency is improved on the basis of guaranteeing the information consistency. In addition, through a publishing and subscribing mechanism, the data server publishes an event in real time, the position holding server subscribes the event, the position holding server is triggered to process position holding task information, decoupling of the data server and the position holding server is achieved, and reliability of service is improved.
As shown in fig. 3, the task processing method provided in the embodiment of the present application is applied to the task processing system, and the task processing method includes the following steps:
s201, the position taking server acquires position taking task information.
Wherein the position taking task is used for calculating the position taking index of the investment portfolio. The position taking task can be to calculate the position taking index of the investment portfolio according to the trading volume or the position taking volume. The position taking task can also be to derive the position taking index of the investment portfolio according to daily final clearing data. The position-taking index comprises position-taking change of the investment portfolio, position-taking market value of the investment portfolio, net value of the investment portfolio, product scale of the investment portfolio and the like.
A portfolio refers to a collection of stocks, bonds, financial derivatives, etc., held by an investor or financial institution. The purpose of using portfolios is to spread the risk, and multiple portfolios can be obtained by randomly combining stocks, bonds and financial derivatives held by investors or financial institutions.
The investment portfolio is illustrated below: zhang III has four financial products of stock A, stock B, bond A and bond B. One or more constituent portfolios can be arbitrarily selected from the four financial products. Stock a and stock B constitute one portfolio, and stock a, stock B and bond a constitute another portfolio.
The taken position task information includes identification information of the investment portfolio, and the identification information is used for marking the investment portfolio calculated by the taken position task. The position taking task information also comprises one or more of position taking amount, transaction amount and day-to-day clearing data.
S202, the position taking server generates an authorization request according to the identification information of the investment portfolio.
The position taking server acquires position taking task information and extracts identification information of the investment portfolio from the position taking task information. And carrying out data coding and other operations on the identification information of the investment portfolio to generate an authorization request. The authorization request is used for requesting to process the position-taking task information, and the position-taking server can process the position-taking task information after obtaining the confirmation authorization.
S203, the position taking server sends an authorization request to the central server.
And S204, the central server acquires the state indicated by the authorized identification information associated with the identification information of the investment portfolio.
The central server analyzes the authorization request to obtain the identification information of the investment portfolio, determines the authorization identification information corresponding to the identification information of the investment portfolio according to the identification information of the investment portfolio, and obtains the state indicated by the authorization identification information.
The states indicated by the authorization identification information include a locked state and an unlocked state. The indication state can be switched between the locking state and the unlocking state by setting the authorization identification information.
S205, the central server generates the confirmation authorization information when the state indicated by the authorization identification information is the unlocking state.
When the state indicated by the authorization identification information is the unlocking state, it is determined that other position-taking servers do not calculate the position-taking index of the investment portfolio, and the confirmation authorization information can be generated so as to authorize the currently requested server to calculate the position-taking index of the investment portfolio, thereby ensuring the consistency of the position-taking index of the investment portfolio.
S206, the central server sends the confirmation authorization information to the position taking server.
And S207, the position taking server processes the position taking task information.
And after receiving the confirmation authorization information, the position taking server processes the position taking task information. Namely, the position index of the investment portfolio is calculated according to the trading volume or the position amount, or the position index of the investment portfolio is deduced according to daily final clearing data.
In the task processing method provided by the embodiment of the application, when position taking task information is obtained, an authorization request is generated according to the identification information of an investment portfolio, so that a central server determines the state indicated by the authorization identification information associated with the identification information of the investment portfolio, authorization information is generated when the indicated state is an unlocking state, and the position taking task information is processed by an authorization position taking server, so that the position taking index of one investment portfolio is calculated by only one server at the same time, and the consistency of the position taking index is ensured.
As shown in fig. 4, another embodiment of the present application provides a task processing method, where the task processing method includes the following steps:
s301, the position taking server acquires position taking task information.
Step S301 has already been described in detail in the above embodiments, and repeated portions are not described herein again.
The process of obtaining the taken position task information is described below in terms of processing two different taken position tasks.
And when the position taking task is to calculate the position taking index of the investment portfolio according to the trading volume or the position taking amount, subscribing the position taking event and the trading event published by the data server. Extracting position-taken information from the subscribed position-taken events, such as: the number of taken positions of each financial product, the unit price of each financial product, and the like. Extracting transaction information from the subscribed transaction events, such as: the transaction amount of each financial product, the purchase unit price of each financial product, the sale unit price of each financial product, and the like.
And when the position taking task is to deduce the position taking index of the investment portfolio according to daily final clearing data, subscribing a final day clearing event issued by the data server, and generating position taking information and transaction information according to the final day clearing event. And extracting day-to-day clearing data from the day-to-day clearing events, and extracting position holding information and transaction information from the day-to-day clearing data.
After the position holding information and the transaction information are obtained, position holding task information is generated according to the position holding information, the transaction information and the attribute information of the investment portfolio. Namely, the position holding task information is generated by processing position holding information, transaction information and attribute information of investment portfolio through packaging, data conversion and the like.
The attribute information of the investment portfolio comprises identification information of the investment portfolio, index information of the investment portfolio and the like, and the index information of the investment portfolio comprises index information of position change, position market value of the investment portfolio, net value of the investment portfolio, product scale of the investment portfolio and the like.
The following describes the process of reading the position holding task information from the buffer queue by the thread:
and each position holding server processes position holding task information in a multithreading mode, and each thread is provided with a cache queue. After the position holding task information is generated, determining a target cache queue from a plurality of cache queues according to the identification information of the investment portfolio, caching the position holding task information into the target cache queue, and waiting for a thread to read the position holding task information.
In order to determine the target cache queue, hash calculation is carried out on the identification information of the investment portfolio to obtain a hash value, a cache queue with a queue number being the hash value is determined from the plurality of cache queues, and the target cache queue is the cache queue with the queue number being the hash value.
The following illustrates the process of determining the target buffer queue:
each position server has 10 threads, which are marked as thread 1 to thread 10 in turn, and each thread is provided with a buffer queue, and the number of the buffer queue is the same as that of the thread.
And when the position holding task information is obtained, extracting the identification information of the investment portfolio from the position holding task information, and carrying out Hash operation on the identification information. Here, a remainder calculation method is adopted, and if the identification information of the investment portfolio is 5, a remainder calculation mod (5, 10) is performed, so that a hash value of 5 can be obtained, wherein mod () represents a remainder operation, the taken-in task information is allocated to a buffer queue with the number of 5 and is processed by a thread with the number of 5.
S302, the position taking server generates an authorization request according to the identification information of the investment portfolio.
Taking the thread with the number of 5 as an example, the thread reads the position holding task information from the cache queue, obtains the identifier information of the investment portfolio as 5, generates an authorization request by processing such as coding the identifier of the investment portfolio, and requests the central server to authorize the processing of the position holding task information.
S303, the position taking server sends an authorization request to the central server.
S304, the central server acquires the state indicated by the authorization identification information associated with the identification information of the investment portfolio.
And the central server analyzes the authorization request to obtain the position taking index of the investment portfolio of which the current position taking task is calculated and the identification information is 5. And determining authorized identification information associated with the investment portfolio with the identification information of 5 from the locally stored list, and acquiring the state indicated by the authorized identification information.
S305, the central server sends authorization identification information to the position taking server.
S306, the position taking server generates a locking request when determining that the state indicated by the authorization identification information is an unlocking state.
And the position server generates a locking request when determining that the state indicated by the authorization identification information corresponding to the investment portfolio with the identification information of 5 is an unlocking state. The lock request is used to switch the state indicated by the authorization identification information from the unlocked state to the locked state.
S307, the position taking server sends a locking request to the central server.
And S308, switching the state indicated by the authorization identification information to a locking state.
When the locking request is obtained, the identification information of the investment portfolio is extracted from the locking request, so that the authorization identification information of the switching state is determined according to the identification information of the investment portfolio.
S309, the central server generates the confirmation authorization information when the state indicated by the authorization identification information is the unlocking state.
When the condition that the authorization identification information indicates the unlocking condition is determined, the central server generates authorization confirmation information.
S310, the central server sends the confirmation authorization information to the position taking server.
And S311, the position taking server processes the position taking task information.
After receiving the confirmation authorization information, the position taking server processes the position taking task information, namely calculates the position taking index of the investment portfolio with the identification information of 5 according to the transaction information and the position taking information, and stores the calculated position taking index into the database.
Compared with the conventional mutual calling mode, the task processing method provided by the embodiment of the application triggers the position holding server to generate the corresponding position holding task information by subscribing the related affairs, can realize decoupling between the data server and the position holding server, and ensures the operation reliability of each server. In addition, the position holding task information is processed in a multithread mode, and if a plurality of position holding task information is used for calculating the position holding indexes of the same investment portfolio, the position holding task information is distributed to the same cache queue, so that the position holding task information is serially processed, the information consistency of the position holding indexes of the investment portfolio is guaranteed, and the position holding task information processing rate is improved.
As shown in fig. 5, an embodiment of the present application provides a task processing device, where the task processing device 400 includes:
a first obtaining module 401, configured to obtain position-taking task information, where the position-taking task information includes identification information of an investment portfolio, and the position-taking task information is used to calculate a position-taking index of the investment portfolio;
a first processing module 402, configured to generate an authorization request according to the identifier information of the investment portfolio, and send the authorization request to the central server, so that the central server obtains a state indicated by the authorization identifier information associated with the identifier information of the investment portfolio, and generates a confirmation authorization information when the state indicated by the authorization identifier information is an unlocked state;
the first processing module 402 is further configured to process the taken-position task information if receiving the confirmation authorization information sent by the central server.
Optionally, the first obtaining module 401 is specifically configured to:
determining a target cache queue from a plurality of cache queues according to the identification information of the investment portfolio;
storing the position holding task information into a target cache queue;
and when the thread corresponding to the target cache queue is idle, reading the position holding task information from the target cache queue.
Optionally, the first obtaining module 401 is specifically configured to:
carrying out Hash calculation on the identification information of the investment portfolio to obtain a Hash value;
and determining a target buffer queue with the queue number as the hash value from the plurality of buffer queues.
Optionally, the first obtaining module 401 is further configured to:
subscribing the position taking event and the transaction event published by the data server;
extracting position holding information from the position holding event and extracting transaction information from the transaction event;
and generating position-taking task information according to the position-taking information, the transaction information and the attribute information of the investment portfolio, wherein the attribute information of the investment portfolio comprises the identification information of the investment portfolio.
Optionally, the first obtaining module 401 is further configured to:
subscribing to a day-to-end clearing event issued by the data server;
extracting position information and transaction information from the daily terminal clearing event;
and generating position-taking task information according to the position-taking information, the transaction information and the attribute information of the investment portfolio, wherein the attribute information of the investment portfolio comprises the identification information of the investment portfolio.
Optionally, the first processing module 402 is further configured to:
receiving authorization identification information sent by a central server;
generates a lock request when it is determined that the state indicated by the authorization identification information is the unlock state,
a lock request is sent to the central server.
As shown in fig. 6, an embodiment of the present application provides a task processing device 500, where the task processing device 500 includes:
a receiving module 501, configured to receive an authorization request sent by a taken position server, where the authorization request includes identification information of an investment portfolio;
a second obtaining module 502, configured to obtain a status indicated by the authorization identifier associated with the identifier of the investment portfolio;
the second processing module 503 is configured to generate authorization confirmation information when the state indicated by the authorization identifier information is an unlocked state;
a sending module 504, configured to send the confirmation authorization information to the taken position server.
Optionally, the sending module 504 is further configured to send the state indicated by the authorization identifier information to the position taking server, so that the position taking server generates a locking request when determining that the state indicated by the authorization identifier information is an unlocked state;
the receiving module 501 is further configured to receive a locking request sent by the taken position server;
the second processing module 503 is further configured to switch the state indicated by the authorization identifier information to a locked state.
As shown in fig. 7, another embodiment of the present application provides a server 600 including: a transmitter 601, a receiver 602, a memory 603, and a processor 604. The server may be any one of a position server, a data server, and a central server.
The transmitter 601 is configured to transmit instructions and data, the receiver 602 is configured to receive instructions and data, the memory 603 is configured to store computer-executable instructions, and the processor 604 is configured to execute the computer-executable instructions stored in the memory, so as to implement the steps performed by the task processing method in the foregoing embodiments. Reference may be made specifically to the related description in the foregoing task processing method embodiment.
Alternatively, the memory 603 may be separate or integrated with the processor 604. When the memory 603 is separately provided, the processing device further includes a bus for connecting the memory 603 and the processor 604.
The embodiment of the application also provides a computer-readable storage medium, in which computer execution instructions are stored, and when the processor executes the computer execution instructions, the task processing method executed by the processing device is implemented.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A task processing method, wherein a task processing system comprises a plurality of position-taking servers, and the method is applied to the position-taking servers, and the method comprises the following steps:
acquiring position-taking task information, wherein the position-taking task information comprises identification information of an investment portfolio, and the position-taking task information is used for calculating position-taking indexes of the investment portfolio;
generating an authorization request according to the identification information of the investment portfolio, and sending the authorization request to a central server, so that the central server generates confirmation authorization information when determining that the state indicated by the authorization identification information associated with the identification information of the investment portfolio is an unlocking state;
and if the confirmation authorization information sent by the central server is received, processing the position taking task information.
2. The method according to claim 1, wherein obtaining the taken position task information specifically comprises:
determining a target cache queue from a plurality of cache queues according to the identification information of the investment portfolio;
storing the position holding task information into the target cache queue;
and when the thread corresponding to the target cache queue is idle, reading the position holding task information from the target cache queue.
3. The method according to claim 2, wherein determining a target buffer queue from a plurality of buffer queues according to the identification information of the portfolio specifically comprises:
performing hash calculation on the identification information of the investment portfolio to obtain a hash value;
and determining a target buffer queue with the queue number being the hash value from the plurality of buffer queues.
4. The method according to claim 2 or 3, wherein obtaining position taken task information further comprises:
subscribing the position taking event and the transaction event published by the data server;
extracting position holding information from the position holding event and extracting transaction information from the transaction event;
generating the position-taking task information according to the position-taking information, the transaction information and the attribute information of the investment portfolio;
wherein the attribute information of the portfolio comprises identification information of the portfolio.
5. The method according to claim 2 or 3, wherein obtaining position taken task information further comprises:
subscribing to a day-to-end clearing event issued by the data server;
extracting position information and transaction information from the end-of-day clearing event;
generating the position-taking task information according to the position-taking information, the transaction information and the attribute information of the investment portfolio;
wherein the attribute information of the portfolio comprises identification information of the portfolio.
6. The method of claim 1, further comprising:
receiving authorization identification information sent by the central server;
generating a locking request when the state indicated by the authorization identification information is determined to be an unlocking state;
sending the lock request to the central server.
7. A task processing method is applied to a central server, and comprises the following steps:
receiving an authorization request sent by a position server, wherein the authorization request comprises identification information of an investment portfolio;
acquiring a state indicated by authorization identification information associated with the identification information of the investment portfolio;
when the state indicated by the authorization identification information is an unlocking state, generating authorization confirmation information;
and sending the confirmation authorization information to the position taking server.
8. The method of claim 7, wherein prior to generating the validation authorization information, the method further comprises:
sending the authorization identification information to the position holding server so that the position holding server generates a locking request when determining that the state indicated by the authorization identification information is an unlocking state;
receiving a locking request sent by the position taking server;
and switching the state indicated by the authorization identification information to a locking state.
9. A position server, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to implement the task processing method according to any one of claims 1 to 6.
10. A central server, comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to implement the task processing method according to claim 7 or 8.
11. A task processing system comprising a plurality of the position server of claim 9 and the central server of claim 10.
12. A computer-readable storage medium having stored thereon computer-executable instructions for implementing a method of task processing according to any one of claims 1 to 6 or any one of claims 7 and 8 when executed by a processor.
13. A computer program product comprising instructions that, when executed by a processor, carry out the method of task processing of any one of claims 1 to 6 or any one of claims 7 and 8.
CN202011453166.0A 2020-12-11 2020-12-11 Task processing method, system, electronic device and storage medium Pending CN112581288A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011453166.0A CN112581288A (en) 2020-12-11 2020-12-11 Task processing method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011453166.0A CN112581288A (en) 2020-12-11 2020-12-11 Task processing method, system, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN112581288A true CN112581288A (en) 2021-03-30

Family

ID=75131302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011453166.0A Pending CN112581288A (en) 2020-12-11 2020-12-11 Task processing method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112581288A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1353842A (en) * 1999-03-31 2002-06-12 美国大通银行 Portfolio investment guideline compliance and financial fund administration system
US20020107770A1 (en) * 2000-05-12 2002-08-08 Meyer Chadwick M. System for allocating funds in a plurality of stock portfolios
US20130332324A1 (en) * 2012-06-12 2013-12-12 American Financial Group, Inc. Investment, trading and accounting management system
US20190066214A1 (en) * 2017-08-31 2019-02-28 FlexFunds Ltd. System for conducting and balancing a secure financial investment of a client and associated method
CN110473111A (en) * 2019-08-15 2019-11-19 上海东方证券资产管理有限公司 The analysis on Achievements method, apparatus of investment combination, readable storage medium storing program for executing
CN110503416A (en) * 2019-08-29 2019-11-26 腾讯科技(深圳)有限公司 Numeric value transfer, device, computer equipment and storage medium
CN110889690A (en) * 2015-02-01 2020-03-17 苹果公司 User interface for payment
CN111831385A (en) * 2020-07-23 2020-10-27 北京三快在线科技有限公司 Business credit information processing method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1353842A (en) * 1999-03-31 2002-06-12 美国大通银行 Portfolio investment guideline compliance and financial fund administration system
US20020107770A1 (en) * 2000-05-12 2002-08-08 Meyer Chadwick M. System for allocating funds in a plurality of stock portfolios
US20130332324A1 (en) * 2012-06-12 2013-12-12 American Financial Group, Inc. Investment, trading and accounting management system
CN110889690A (en) * 2015-02-01 2020-03-17 苹果公司 User interface for payment
US20190066214A1 (en) * 2017-08-31 2019-02-28 FlexFunds Ltd. System for conducting and balancing a secure financial investment of a client and associated method
CN110473111A (en) * 2019-08-15 2019-11-19 上海东方证券资产管理有限公司 The analysis on Achievements method, apparatus of investment combination, readable storage medium storing program for executing
CN110503416A (en) * 2019-08-29 2019-11-26 腾讯科技(深圳)有限公司 Numeric value transfer, device, computer equipment and storage medium
CN111831385A (en) * 2020-07-23 2020-10-27 北京三快在线科技有限公司 Business credit information processing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107395665A (en) A kind of block chain service handling and business common recognition method and device
CN104751566B (en) It monitors the method for pseudo- card risk and realizes the transaction processing system of this method
US20200320530A1 (en) Maintenance plant management method, system and data management server
CN115456773B (en) Payment control method, device, equipment and medium based on blockchain
CN110289999A (en) A kind of data processing method, system and device
CN111125786A (en) Bond distribution data storage method, device and system based on block chain
US20220342820A1 (en) Techniques For Multi-Tiered Data Storage In Multi-Tenant Caching Systems
CN110009476A (en) A kind of method and apparatus handling application of making loans
CN112581288A (en) Task processing method, system, electronic device and storage medium
CN113095935A (en) Transaction order processing method and device, computer equipment and storage medium
CN109118338A (en) Shared bicycle method for monitoring state and device
KR20120087063A (en) Customer calling system and method
CN106530084B (en) Information processing method and server
JPWO2018074027A1 (en) Abnormality detection apparatus, control method, and program
CN106874336B (en) Data matching method, data query method and device
CN108021597B (en) Parallel counter, server and counting method
RU2656720C2 (en) Asset inventory system
KR102086234B1 (en) Virtual currency trading system with block chain
AU2008201615A1 (en) Import/Export Transaction Facility
CN111476671A (en) Block chain rollback insurance method, equipment and storage medium
CN114189476B (en) Multi-element interface shunting calling method and terminal
CN110070429A (en) Interbank trader's transaction management method and system based on block chain
CN108614737B (en) Resource recovery method and device and server
CN113283889B (en) Decentralized exchange system, trading method, equipment and storage medium
JP2009086945A (en) File reception system, file reception method, and file reception program

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100176

Applicant before: Jingdong Digital Technology Holding Co., Ltd