Methods, devices, equipment and media for determining profits and losses in securities trading

The profit and loss scheduler obtains and judges the status of the profit and loss processor, creates and calls the tasks to be run, and uses multiple processors to process the profit and loss tasks of securities trading in parallel, solving the problem of inefficiency in the existing technology and achieving efficient profit and loss calculations.

CN114820177BActive Publication Date: 2025-08-22HUNAN FUMI INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110065193.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-18
Publication Date
2025-08-22
Estimated Expiration
2041-01-18

AI Technical Summary

Technical Problem

In the prior art, securities trading profit and loss calculation efficiency is inefficient, especially when the number of users and transaction volume increases, it is impossible to efficiently handle the dependence relationship between various profit and loss, resulting in long-term calculation and inefficient efficiency.

Method used

Obtain the profit and loss processor information table through the profit and loss scheduler, judge the status of the profit and loss processor, create and call the profit and loss processing tasks to be run, and use multiple profit and loss processors to process the same task in parallel to improve processing efficiency.

Benefits of technology

It realizes efficient processing of securities trading profit and loss tasks within the preset period, improves processing efficiency and reduces calculation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114820177B_ABST
    Figure CN114820177B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for determining profit and loss in securities trading. The method includes: obtaining a profit and loss processor information table corresponding to a profit and loss scheduler at a preset period; determining whether the profit and loss processor corresponding to each profit and loss processor information is a pending profit and loss processor; if so, creating a profit and loss processing task corresponding to the pending profit and loss processor; and invoking the pending profit and loss processor to execute the profit and loss processing task. This method solves the problem of inefficient profit and loss determination in securities trading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to the field of data processing, and specifically to a method, apparatus, device, and medium for determining profit and loss in securities trading. Background Art

[0002] In the process of securities trading, profit and loss analysis is a project that all parties, including the market and users, pay close attention to. The profits and losses involved in securities trading generally include the daily profits and losses of different categories of targets, the cumulative profits and losses over a certain period of time, the total daily profits and losses of a certain account, or the total profits and losses over a certain period of time.

[0003] After the end of each trading day, various types of profits and losses are usually calculated. However, due to the dependency between the profits and losses of most categories of underlying assets, and between account profits and losses and various categories of underlying assets, for example, the determination of stock profits and losses depends on the calculation results of options profits and losses, and the determination of account profits and losses depends on the profit and loss calculation results of categories such as stocks, options, digital currencies, and funds.

[0004] In related technologies, various types of profit and loss can be defined as separate task executions. Since there are dependencies between various profit and loss calculations, for a certain type of profit and loss processing task, it is usually necessary to complete the profit and loss processing tasks of all users before executing another type of profit and loss processing task that depends on its calculation results. When the number of users gradually increases and the transaction volume gradually rises, this profit and loss calculation method is time-consuming and inefficient. Summary of the Invention

[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a method, apparatus, device and medium for determining profit and loss in securities trading that can improve the efficiency of profit and loss determination.

[0006] In a first aspect, the present application provides a method for determining profits and losses in securities trading, comprising:

[0007] Acquire a profit and loss processor information table corresponding to the profit and loss scheduler according to a preset period, wherein the profit and loss processor information table includes at least one profit and loss processor information;

[0008] Determine whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run;

[0009] If so, create a profit and loss processing task corresponding to the profit and loss processor to be run;

[0010] Call the pending profit and loss processor to execute the profit and loss processing task;

[0011] In a second aspect, the present application provides a device for determining profit and loss in securities trading, comprising:

[0012] an acquisition module configured to acquire a profit and loss processor information table corresponding to the profit and loss scheduler according to a preset period, wherein the profit and loss processor information table includes at least one profit and loss processor information;

[0013] a judgment module configured to judge whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run;

[0014] A creation module is configured to create a profit and loss processing task corresponding to the profit and loss processor to be run if yes;

[0015] A calling module is configured to call the profit and loss processor to be run to execute the profit and loss processing task;

[0016] In a third aspect, the present application provides a computer device, comprising:

[0017] processor;

[0018] a memory for storing executable instructions for the processor;

[0019] The processor is configured to execute the method for determining profit and loss in securities trading according to the first aspect;

[0020] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon.

[0021] When the computer program is executed by a processor, the method for determining profit and loss in securities trading according to the first aspect is implemented.

[0022] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:

[0023] The securities trading profit and loss determination method, apparatus, device, and medium provided in embodiments of the present application can obtain a profit and loss processor information table corresponding to a profit and loss scheduler at a preset period; determine whether the profit and loss processor corresponding to each profit and loss processor information is a pending profit and loss processor; if so, create a profit and loss processing task corresponding to the pending profit and loss processor; and call the pending profit and loss processor to execute the profit and loss processing task. Multiple profit and loss processors can be used to simultaneously process the same profit and loss processing task, thereby improving the processing efficiency of profit and loss processing tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0025] Figure 1 A flowchart of a method for determining profit and loss in securities trading provided in an embodiment of the present application;

[0026] Figure 2A flowchart of another method for determining profit and loss in securities trading provided in an embodiment of the present application;

[0027] Figure 3 A schematic diagram of the structure of a device for determining profit and loss in securities trading provided in an embodiment of the present application;

[0028] Figure 4 A schematic diagram of the structure of another device for determining profit and loss in securities trading provided in an embodiment of the present application;

[0029] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the invention are shown in the accompanying drawings.

[0031] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0032] The embodiment of the present application provides a method for determining profit and loss in securities trading, which can be applied to a terminal device with data processing capabilities to perform various profit and loss processing tasks in the securities trading process. The terminal device can be a server, a computer, or a server cluster. Figure 1 As shown, the method includes:

[0033] Step 101: Obtain a profit and loss processor information table corresponding to a profit and loss scheduler according to a preset period.

[0034] In an embodiment of the present application, various profit and loss determination events are determined as profit and loss processing tasks, for example, stock profit and loss processing tasks, option profit and loss processing tasks, account profit and loss processing tasks, etc. The execution process of the profit and loss processing tasks is implemented based on the scheduler and the profit and loss processor, wherein, for each profit and loss processing task, at least one profit and loss processor and a profit and loss scheduler can be allocated, and the at least one profit and loss processor is scheduled to execute the profit and loss processing task by the profit and loss scheduler corresponding to it, wherein the allocation results of the profit and loss scheduler and the profit and loss processor corresponding to each profit and loss processing task can be saved in the database in the form of a profit and loss processor information table, and the profit and loss processor information table includes the profit and loss processor information of at least one profit and loss scheduler used to execute the profit and loss processing task.

[0035] In this step, when the terminal device is in operation, the profit and loss scheduler for each profit and loss processing task can obtain the corresponding profit and loss processor information table from the database according to a preset period. It is understood that different profit and loss information table acquisition periods can be set for different types of profit and loss schedulers. The specific period can be determined based on actual needs and is not limited in this embodiment of the present application.

[0036] Step 102: Determine whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run.

[0037] In an embodiment of the present application, the profit and loss processor information table generally includes basic information and status information of the profit and loss processor. The basic information may include the name of the profit and loss processor, the current processing date of the profit and loss processing task, and the shard number of each profit and loss processor corresponding to the profit and loss processor name, where the shard number is the identifier of each profit and loss processor with the same name; the status information includes the running status, task execution status, and the account identifier currently being processed of each profit and loss processor. The scheduler can determine whether to call the profit and loss processor to execute the profit and loss processing task based on the status information. Among them, the profit and loss processing task generally needs to be performed after the transaction is completed. Therefore, during the transaction, the profit and loss processor is generally set to a disabled state to prevent the execution of invalid profit and loss processing tasks and waste of computing resources; after the transaction is completed, the profit and loss processor can be set to an enabled state, and the scheduler can determine whether to call the profit and loss processor to execute the profit and loss processing task based on the running status of the profit and loss processor; the account identifier currently being processed can ensure that after the profit and loss processor that is executing the profit and loss processing task is interrupted, it can continue to process the profit and loss processing task corresponding to the account identifier currently being processed when it is called next time.

[0038] For example, Table 1 is a profit and loss processor information table provided in an embodiment of the present application, including two account profit and loss processors (AccountPLHandler) corresponding to account profit and loss processing tasks, and two stock profit and loss processors (EquityPLHandler) corresponding to stock profit and loss processing tasks. For the task execution status, the number 0 indicates that the profit and loss processor is in a disabled state, and the number 1 indicates that the profit and loss processor is in an enabled state; for the task execution status, the number 0 indicates that the profit and loss processor is in a non-task execution state, and the number 1 indicates that the profit and loss processor is in a task execution state.

[0039] Table 1

[0040]

[0041] In this step, the process of the profit and loss scheduler determining whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run may include: determining whether the running status corresponding to the profit and loss processor is an enabled status based on each profit and loss processor information; if not, determining that the profit and loss processor is in a disabled status and cannot execute the profit and loss processing task; if so, determining that the profit and loss processor is a valid profit and loss processor; determining whether the task execution status corresponding to the valid profit and loss processor is a task being executed status; if so, determining that the valid profit and loss processor is executing the profit and loss processing task and there is no need to reallocate the profit and loss processing task to it; if not, determining that the valid profit and loss processor is a profit and loss processor to be run and can execute the corresponding profit and loss processing task.

[0042] Step 103: If yes, create a profit and loss processing task corresponding to the profit and loss processor to be run, so that the profit and loss processor to be run executes the profit and loss processing task.

[0043] In an embodiment of the present application, since some profit and loss processing tasks need to be based on the profit and loss calculation results of other profits and losses before they can be performed, and some profits and losses do not need to be based on the profit and loss calculation results of other profits and losses, the profit and loss processors that execute profit and loss processing tasks are divided into task-dependent processors and non-task-dependent processors. The task-dependent processors are used to execute profit and loss processing tasks that need to be based on the profit and loss calculation results of other profit and loss processing tasks, and the non-task-dependent processors are used to execute profit and loss processing tasks that do not need to be based on the profit and loss calculation results of other profit and loss processing tasks. For the task-dependent processors, a processor dependency table between the task-dependent profit and loss processor and the profit and loss processor it depends on can be established in advance, and the processor dependency can be stored in a database.

[0044] For example, as shown in Table 2, Table 2 shows a processor dependency table, which includes the profit and loss processor name of the task-dependent profit and loss processor, the name of the dependent profit and loss processor corresponding to the task-dependent profit and loss processor, and the execution date of the profit and loss processing task corresponding to the task-dependent profit and loss processor, wherein the task-dependent account profit and loss processor with shard number 0 depends on the stock profit and loss processor with shard number 0, the task-dependent account profit and loss processor with shard number 1 depends on the stock profit and loss processor with shard number 2, the task-dependent stock profit and loss processor with shard number 0 depends on the option profit and loss processor (OptionPLHandler) with shard number 0, and the task-dependent stock profit and loss processor with shard number 1 depends on the option profit and loss processor with shard number 1. The execution date of the profit and loss processing task is 2020 / 9 / 2.

[0045] Table 2

[0046] Profit and Loss Processor Name Dependency on the name of the profit and loss processor Execution Date AccountPLHandler-0 EquityPLHandler-0 2020 / 9 / 2 AccountPLHandler-1 EquityPLHandler-2 2020 / 9 / 2 EquityPLHandler-0 OptionPLHandler-0 2020 / 9 / 2 EquityPLHandler-1 OptionPLHandler-1 2020 / 9 / 2

[0047] In this step, the process of the profit and loss scheduler creating a profit and loss processing task corresponding to the profit and loss processor to be run includes: judging the processor type of the profit and loss processor to be run; if the profit and loss processor to be run is a task-dependent processor, based on the task execution status of the dependent profit and loss processor corresponding to the profit and loss processor to be run, determining whether to create a profit and loss processing task corresponding to the profit and loss processor to be run; if the profit and loss processor to be run is a non-task-dependent processor, creating a profit and loss processing task corresponding to the profit and loss processor to be run.

[0048] Wherein, based on the task execution status of the dependent profit and loss processor corresponding to the profit and loss processor to be run, the process of determining whether to create a profit and loss processing task corresponding to the profit and loss processor to be run includes: obtaining the processor dependency table corresponding to the profit and loss processor to be run; searching the processor dependency table to determine the dependent profit and loss processor corresponding to the profit and loss processor to be run; obtaining the task execution status corresponding to the dependent profit and loss processor; if the task execution status corresponding to the dependent profit and loss processor is a task execution completed state, creating a profit and loss processing task corresponding to the profit and loss processor to be run; if the task execution status corresponding to the dependent profit and loss processor is a non-task execution completed state, then waiting for a preset time and then re-obtaining and judging the task execution status corresponding to the dependent profit and loss processor until it is determined that the task execution status corresponding to the dependent profit and loss processor is a task execution completed state, and creating a profit and loss processing task corresponding to the profit and loss processor to be run. Wherein, the preset time can be determined based on actual needs, and the embodiment of the present application does not limit this. It can be understood that if there are multiple dependent profit and loss processors corresponding to the profit and loss processor to be run, it is necessary to determine that the task execution status corresponding to each dependent profit and loss processor is the task execution completion status before the profit and loss processing task corresponding to the profit and loss processor to be run can be created. Otherwise, the profit and loss processing task corresponding to the profit and loss processor to be run cannot be executed.

[0049] Step 104: Call the profit and loss processor to be run to execute the profit and loss processing task.

[0050] In this step, the profit and loss scheduler can call the profit and loss processor to be run to execute the profit and loss processing task, such as Figure 2 As shown, the process of executing the profit and loss processing task by the profit and loss processor to be run may include:

[0051] Step S1: Acquire batch user data according to preset rules.

[0052] In an embodiment of the present application, user data generally includes user accounts and data to be processed corresponding to the user accounts. Profit and loss processing tasks are generally faced with a large amount of user data. Therefore, user accounts can be divided into different batches and user data can be processed in batches. Among them, for at least one profit and loss processor used to perform the same profit and loss processing task, the number of user data obtained each time by the at least one profit and loss processor when performing the profit and loss processing task can be pre-set, wherein the number of user data can be determined based on actual needs, and the embodiment of the present application does not limit this. For example, the number of user data can be the product of a reference value and the number of profit and loss processors used to perform the same profit and loss processing task. For example, there are 5 stock profit and loss processors used to perform stock profit and loss processing tasks, and the reference value can be 500. If any stock profit and loss processor is a stock profit and loss processor to be run, the batch of user data obtained each time by the stock profit and loss processor to be run can include 1,000 user data.

[0053] It is understandable that in the embodiments of the present application, in order to prevent user data from being missed, generally, in each batch of user data obtained, multiple user accounts are arranged in ascending order, and the batch of user data obtained each time is different from the previous and next batch of user data obtained.

[0054] In this step, the profit and loss processor to be run obtains batch user data according to the preset rules corresponding to the profit and loss processor to be run.

[0055] Step S2: Filter at least one irrelevant user data in the batch user data to obtain at least one target user data.

[0056] In the embodiment of the present application, since multiple profit and loss processors are set up for each profit and loss processing task to execute the profit and loss processing task, not only is the parallel execution of the profit and loss processing tasks achieved, but each profit and loss processor can also process the target user data corresponding to the profit and loss processor's shard number, facilitating the storage and search of the profit and loss processing task results. The target user data is the user data in the batch user data corresponding to the profit and loss processor to be executed, and the target user data includes the target user account and the data to be processed corresponding to the target user account.

[0057] In this step, filtering irrelevant user data from the batch user data to obtain the target user data may include: determining the number of profit and loss processors corresponding to the profit and loss scheduler; determining the remainder of the ratio of each user account to the number of profit and loss processors; determining whether the remainder is consistent with the shard number of the profit and loss processor to be run; if they are consistent, determining that the user data corresponding to the user account is the target user data; if they are inconsistent, determining that the user data corresponding to the user account is irrelevant user data. The profit and loss scheduler is the profit and loss scheduler corresponding to the profit and loss processor to be run.

[0058] Step S3: Process the data to be processed corresponding to each target user account according to the profit and loss calculation rule corresponding to the profit and loss processor to be run, and obtain the profit and loss value corresponding to each target user account.

[0059] In this step, for each profit and loss processing task, there is a corresponding profit and loss calculation rule. The profit and loss processor to be run can process the data to be processed corresponding to each target user account based on the profit and loss calculation rule of the profit and loss processing task corresponding to it, and obtain the profit and loss value corresponding to each target user account. It can be understood that if the profit and loss processor to be run is a task-dependent profit and loss processor, the data to be processed of the target user account corresponding to the profit and loss processor to be run includes the profit and loss processing task result of the dependent profit and loss processor corresponding to the profit and loss processor to be run. For example, as shown in Table 2, if the profit and loss processor to be run is a stock profit and loss processor with a shard number of 0, the data to be processed of the target user account corresponding to the stock profit and loss processor includes the option profit and loss value determined by the option profit and loss processor with a shard number of 0.

[0060] Step S4: Repeat the above operations until the profit and loss value of each target user account corresponding to the profit and loss processor to be run in all user data is obtained.

[0061] Optionally, in an embodiment of the present application, after the profit and loss processor to be run completes execution of the profit and loss processing task corresponding to it, the method further includes: updating the execution date of the profit and loss processing task corresponding to the profit and loss processor to be run, wherein, if the profit and loss processor to be run is a non-task-dependent processor, then updating the execution date of the profit and loss processing task corresponding to the non-task-dependent processor; if the profit and loss processor to be run is a task-dependent processor, it can be determined that the target profit and loss processor is about to execute the profit and loss processing task corresponding to the target profit and loss processor, and the profit and loss processing task processing time of the profit and loss processor to be run and the target profit and loss processor are both updated and stored to facilitate viewing of the profit and loss processing task processing results, wherein the target profit and loss processor is a profit and loss processor that depends on the profit and loss processor to be run.

[0062] At the same time, the profit and loss scheduler corresponding to the target profit and loss processor can detect that the task execution status of the task-dependent processor is the task execution completion state, and establish a corresponding profit and loss processing task for the target profit and loss processor so that the target profit and loss processor executes the corresponding profit and loss processing task.

[0063] For example, taking the stock profit and loss processing task as an example, the method for determining the profit and loss of securities trading is explained. It is assumed that the stock profit and loss processor information table corresponding to the stock profit and loss processing task is as shown in Table 1, and the processor dependency table corresponding to the stock profit and loss processor is as shown in Table 2. The acquisition cycle of the stock profit and loss processor information table of the pre-set stock profit and loss scheduler is: the stock profit and loss processor information table is obtained once every 10 minutes.

[0064] Assuming that in the stock profit and loss processor information table obtained by the stock profit and loss scheduler at a certain time, the stock profit and loss processors with shard numbers 0 and 1 have a running status of 1 and a task execution status of 0, then it can be determined that the stock profit and loss processors with shard numbers 0 and shard number 1 are the stock profit and loss processors to be run.

[0065] Furthermore, the stock profit and loss scheduler can obtain the task execution status of the profit and loss processing tasks corresponding to the option profit and loss processors with shard number 0 and shard number 1, respectively, and determine that both are in the task execution completion state. Then, it creates stock profit and loss processing tasks for stock profit and loss processor 0 and stock profit and loss processor 1, respectively, and calls stock profit and loss processor 0 and stock profit and loss processor 1 to execute the corresponding stock profit and loss processing tasks. Among them, since the account profit and loss processor with shard number 0 depends on the profit and loss processing results of stock profit and loss processor 0, after the stock profit and loss processing task is completed, the processing time of the dependent profit and loss processing tasks corresponding to stock profit and loss processor 0 and account profit and loss processor 0 can be updated to 2020 / 9 / 2.

[0066] At the same time, the account profit and loss scheduler corresponding to the account profit and loss processor with shard number 0 can determine that the task execution status of the stock profit and loss processor 0 is the task execution completion status, and establish a corresponding account profit and loss processing task for the account profit and loss processor 0, so that the account profit and loss processor 0 executes the corresponding account profit and loss processing task.

[0067] In summary, the method for determining profit and loss in securities trading provided in the embodiments of the present application can obtain a profit and loss processor information table corresponding to a profit and loss scheduler according to a preset period; determine whether the profit and loss processor corresponding to each profit and loss processor information is a pending profit and loss processor; if so, create a profit and loss processing task corresponding to the pending profit and loss processor; and call the pending profit and loss processor to execute the profit and loss processing task. Multiple profit and loss processors can be used to simultaneously process the same profit and loss processing task, thereby improving the processing efficiency of the profit and loss processing task.

[0068] The embodiment of the present application provides a device for determining profit and loss in securities trading, such as Figure 3 As shown, the device 20 includes:

[0069] An acquisition module 201 is configured to acquire a profit and loss processor information table corresponding to a profit and loss scheduler according to a preset period, wherein the profit and loss processor information table includes at least one profit and loss processor information;

[0070] The judgment module 202 is configured to judge whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run;

[0071] The creation module 203 is configured to create a profit and loss processing task corresponding to the profit and loss processor to be run if yes;

[0072] The calling module 204 is configured to call the profit and loss processor to be run to execute the profit and loss processing task.

[0073] Optionally, the judgment module 202 is configured to:

[0074] Based on each profit and loss processor information, determining whether the operation state corresponding to the profit and loss processor is an enabled state;

[0075] If so, determine that the profit and loss processor is a valid profit and loss processor;

[0076] Determine whether the task execution state corresponding to the valid profit and loss processor is the task execution state;

[0077] If not, determine the active profit and loss processor as the profit and loss processor to be run.

[0078] Optionally, the creation module 203 is configured to:

[0079] Determine the processor type of the profit and loss processor to be run;

[0080] If the profit and loss processor to be run is a task-dependent processor, determining whether to create a profit and loss processing task corresponding to the profit and loss processor to be run based on the task execution status of the dependent profit and loss processor corresponding to the profit and loss processor to be run;

[0081] If the profit and loss processor to be run is a non-task-dependent processor, a profit and loss processing task corresponding to the profit and loss processor to be run is created.

[0082] Optionally, the creation module 203 is configured to:

[0083] Obtain a processor dependency table corresponding to the profit and loss processor to be run;

[0084] Searching the processor dependency table to determine the dependent profit and loss processor corresponding to the profit and loss processor to be run;

[0085] Get the task execution status corresponding to the dependent profit and loss processor;

[0086] If the task execution status corresponding to the dependent profit and loss processor is the task execution completion status, create a profit and loss processing task corresponding to the profit and loss processor to be run.

[0087] Optionally, the calling module 204 is configured to:

[0088] Obtain batch user data according to preset rules;

[0089] Filtering at least one irrelevant user data in the batch user data to obtain at least one target user data, where the target user data is user data corresponding to the profit and loss processor to be run, and the target user data includes a target user account and data to be processed corresponding to the target user account;

[0090] Processing the data to be processed corresponding to each target user account according to the profit and loss calculation rules corresponding to the profit and loss processor to be run, and obtaining the profit and loss value corresponding to each target user account;

[0091] Repeat the above operation until the profit and loss value of each target user account corresponding to the profit and loss processor to be run in all user data is obtained.

[0092] Optionally, the calling module 204 is configured to:

[0093] Determine the number of profit and loss processors corresponding to the profit and loss scheduler;

[0094] Determine the remainder of the ratio of each user account to the number of profit and loss processors;

[0095] Determine whether the remainder is consistent with the shard number of the profit and loss processor to be run;

[0096] If they are consistent, the user data corresponding to the user account is determined to be the target user data;

[0097] If there is inconsistency, it is determined that the user data corresponding to the user account is irrelevant user data.

[0098] Optional, such as Figure 4 As shown, the apparatus 20 further includes an updating module 205 configured to:

[0099] Update the execution date of the profit and loss processing task corresponding to the profit and loss processor to be run.

[0100] In summary, the securities trading profit and loss determination device provided by the embodiment of the present application can obtain the profit and loss processor information table corresponding to the profit and loss scheduler according to a preset period; determine whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run; if so, create a profit and loss processing task corresponding to the profit and loss processor to be run; and call the profit and loss processor to be run to execute the profit and loss processing task. Multiple profit and loss processors can be used to process the same profit and loss processing task at the same time, thereby improving the processing efficiency of the profit and loss processing task.

[0101] Figure 5 1 is a computer device according to an exemplary embodiment. The computer device includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a storage unit into a random access memory (RAM) 303. RAM 303 also stores various programs and data required for system operation. CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.

[0102] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, and the like; an output section including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 308 including devices such as a hard disk; and a communication section 309 including a network interface card such as a LAN card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 310 as needed, so that computer programs read therefrom can be installed into the storage section 308 as needed.

[0103] In particular, according to the embodiments of the present application, the above Figures 1 to 2 The described process can be implemented as a computer software program. For example, various embodiments of the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication portion, and / or installed from a removable medium. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the system of the present application are performed.

[0104] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0105] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods, devices and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0106] The units involved in the embodiments described in the present application may be implemented by software or by hardware, and the described units may also be provided in a processor. The names of these units do not, in some cases, constitute a limitation on the units themselves. The described units or modules may also be provided in a processor, for example, they may be described as: a processor including an acquisition module, a judgment module, a creation module, and a call module. The names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves, for example, the acquisition module may also be described as "an acquisition module for obtaining a profit and loss processor information table corresponding to a profit and loss scheduler according to a preset period."

[0107] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments, or may exist independently and not incorporated into the electronic device. The computer-readable medium carries one or more programs, and when executed by the electronic device, the electronic device implements the method for detecting securities trading profit and loss as described in the above embodiments.

[0108] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the inventive concept. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features having similar functions disclosed in this application.

Claims

1. A method for determining profits and losses in securities trading, characterized in that: include: Acquire a profit and loss processor information table corresponding to the profit and loss scheduler according to a preset period, wherein the profit and loss processor information table includes at least one piece of profit and loss processor information; wherein different types of the profit and loss schedulers correspond to different profit and loss information table acquisition periods, and the profit and loss processor information includes an operating status and a task execution status corresponding to the profit and loss processor; determining whether the profit and loss processor corresponding to each of the profit and loss processor information is a profit and loss processor to be run; If so, creating a profit and loss processing task corresponding to the profit and loss processor to be run, wherein the profit and loss processing task is created based on the processor type of the profit and loss processor to be run; The profit and loss processor to be run is called to execute the profit and loss processing task.

2. The method according to claim 1, characterized in that The determining whether the profit and loss processor corresponding to each profit and loss processor information is a profit and loss processor to be run includes: Determining, based on each of the profit and loss processor information, whether the operation state corresponding to the profit and loss processor is an enabled state; If so, determining that the profit and loss processor is a valid profit and loss processor; Determining whether the task execution state corresponding to the valid profit and loss processor is a task executing state; If not, it is determined that the effective profit and loss processor is the profit and loss processor to be run.

3. The method according to claim 1, characterized in that The step of creating a profit and loss processing task corresponding to the profit and loss processor to be run includes: Determining the processor type of the profit and loss processor to be run; If the profit and loss processor to be run is a task-dependent processor, determining whether to create a profit and loss processing task corresponding to the profit and loss processor to be run based on the task execution status of the dependent profit and loss processor corresponding to the profit and loss processor to be run; If the profit and loss processor to be run is a non-task-dependent processor, a profit and loss processing task corresponding to the profit and loss processor to be run is created.

4. The method according to claim 3, characterized in that The determining whether to create a profit and loss processing task corresponding to the profit and loss processor to be run based on the task execution status of the dependent profit and loss processor corresponding to the profit and loss processor to be run includes: Obtaining a processor dependency table corresponding to the profit and loss processor to be run; Searching the processor dependency table to determine a dependent profit and loss processor corresponding to the profit and loss processor to be run; Obtaining the task execution status corresponding to the dependent profit and loss processor; If the task execution status corresponding to the dependent profit and loss processor is a task execution completion status, a profit and loss processing task corresponding to the profit and loss processor to be run is created.

5. The method according to claim 1, wherein The executing of the profit and loss processing task includes: Obtain batch user data according to preset rules; filtering at least one irrelevant user data in the batch user data to obtain at least one target user data, wherein the target user data is user data corresponding to the profit and loss processor to be run, and the target user data includes a target user account and data to be processed corresponding to the target user account; Processing the data to be processed corresponding to each target user account according to the profit and loss calculation rule corresponding to the profit and loss processor to be run, to obtain a profit and loss value corresponding to each target user account; Repeat the above operation until the profit and loss value of each target user account corresponding to the profit and loss processor to be run in all user data is obtained.

6. The method according to claim 5, characterized in that The user data includes user accounts, and filtering irrelevant user data in the batch user data to obtain target user data includes: determining the number of profit and loss processors corresponding to the profit and loss scheduler; determining a remainder of a ratio of each of the user accounts to the number of profit and loss processors; Determining whether the remainder is consistent with the shard number of the profit and loss processor to be run; If they are consistent, determining that the user data corresponding to the user account is the target user data; If they are inconsistent, it is determined that the user data corresponding to the user account is irrelevant user data.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: An execution date of the profit and loss processing task corresponding to the profit and loss processor to be executed is updated.

8. A device for determining profit and loss in securities trading, characterized in that: include: an acquisition module configured to acquire a profit and loss processor information table corresponding to a profit and loss scheduler according to a preset period, wherein the profit and loss processor information table includes at least one profit and loss processor information; wherein different types of profit and loss schedulers correspond to different profit and loss information table acquisition periods, and the profit and loss processor information includes an operating status and a task execution status corresponding to the profit and loss processor; a judgment module configured to judge whether the profit and loss processor corresponding to each of the profit and loss processor information is a profit and loss processor to be run; A creating module configured to, if yes, create a profit and loss processing task corresponding to the profit and loss processor to be run, wherein the profit and loss processing task is created based on a processor type of the profit and loss processor to be run; The calling module is configured to call the profit and loss processor to be run to execute the profit and loss processing task.

9. A computer device, characterized in that: The computer device comprises: processor; a memory for storing executable instructions for the processor; The processor is configured to execute the method for determining profit and loss in securities trading as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining profits and losses in securities trading as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Task scheduling method and apparatus, computer device, and storage medium

    WO2020140683A1