CN111078419A - Message queue-based computing method and device, computer equipment and storage medium - Google Patents

Message queue-based computing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111078419A
CN111078419A CN201910968919.2A CN201910968919A CN111078419A CN 111078419 A CN111078419 A CN 111078419A CN 201910968919 A CN201910968919 A CN 201910968919A CN 111078419 A CN111078419 A CN 111078419A
Authority
CN
China
Prior art keywords
combined
combined product
information
product
message queue
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
CN201910968919.2A
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201910968919.2A priority Critical patent/CN111078419A/en
Publication of CN111078419A publication Critical patent/CN111078419A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • 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/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Economics (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • Marketing (AREA)
  • Educational Administration (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Technology Law (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a message queue-based computing method and device, computer equipment and a storage medium. The method comprises the following steps: if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and correspondingly generating a calculation thread according to the combined dimension of the combined product; sequentially acquiring combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node; inputting the combined product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node; and calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and the preset position information table. Based on the data processing technology, the invention can carry out batch calculation on the combined products through the message queue and the generated calculation thread, thereby improving the efficiency of carrying out asset accounting by enterprises.

Description

Message queue-based computing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a message queue-based computing method and apparatus, a computer device, and a storage medium.
Background
During asset accounting, an enterprise needs to adopt a plurality of consecutive computing links to compute mass data, and the computing efficiency of the previous link affects the next link, so that the computing efficiency of the upstream link needs to be optimized to improve the overall accounting speed. When mass data is calculated, calculation of multiple pieces of data is involved, and in each calculation link, the existing technical method acquires data item by item and calculates item by item, so that the calculation efficiency of an upstream link is low, and the whole calculation process is influenced. Therefore, the existing calculation method has the problem of low calculation efficiency.
Disclosure of Invention
The embodiment of the invention provides a message queue-based computing method, a message queue-based computing device, computer equipment and a storage medium, and aims to solve the problem of low computing efficiency of a computing method in the prior art.
In a first aspect, an embodiment of the present invention provides a message queue-based computing method, which includes:
if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes;
sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node;
inputting the combined product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node;
and calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
In a second aspect, an embodiment of the present invention provides a message queue-based computing apparatus, which includes:
the computing thread generating unit is used for acquiring a combined product stored in a preset message queue and correspondingly generating a computing thread according to the combined dimension of the combined product if a preset computing time point is reached, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes;
the combined product cache unit is used for sequentially acquiring combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node;
the combined product input unit is used for inputting the combined product into a corresponding computing thread and synchronizing information of other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node;
and the combined product position holding calculation unit is used for calculating the latest position holding information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the processor implements the message queue based computing method according to the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the message queue-based computing method according to the first aspect.
The embodiment of the invention provides a message queue-based computing method and device, computer equipment and a storage medium. And generating a corresponding calculation thread according to the combined product stored in the preset message queue, writing the combined product stored in the read-only storage node into the random access storage node, inputting the combined product stored in the random access storage node into the corresponding calculation thread, and calculating to obtain the latest position holding information of the combined product. By the method, the combined products can be calculated in batch through the message queue and the generated calculation thread, and the asset accounting efficiency of enterprises is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a message queue-based computing method according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow chart of a message queue-based computing method according to an embodiment of the present invention;
fig. 3 is another sub-flow diagram of a message queue-based computing method according to an embodiment of the present invention;
fig. 4 is a schematic sub-flow chart of a message queue-based computing method according to an embodiment of the present invention;
fig. 5 is a schematic sub-flow chart of a message queue-based computing method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a message queue based computing device provided by an embodiment of the present invention;
FIG. 7 is a schematic block diagram of sub-units of a message queue based computing device according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of another subunit of a message queue based computing device provided by an embodiment of the present invention;
FIG. 9 is a schematic block diagram of another sub-unit of a message queue based computing device provided by an embodiment of the present invention;
FIG. 10 is a schematic block diagram of another subunit of a message queue based computing device provided by an embodiment of the present invention;
FIG. 11 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a flowchart illustrating a message queue-based computing method according to an embodiment of the present invention. The calculation method based on the message queue is applied to a user terminal, and is executed through application software installed in the user terminal, wherein the user terminal is a terminal device, such as a desktop computer, a notebook computer, a tablet computer or a mobile phone and the like, for executing the calculation method based on the message queue to calculate the position of a position taken by a large number of position taken products.
As shown in fig. 1, the method includes steps S110 to S140.
S110, if the preset calculation time point is reached, acquiring the combined products stored in the preset message queue and correspondingly generating a calculation thread according to the combined dimensions of the combined products.
And if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and correspondingly generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes. Specifically, the calculation time point is a time point set by the user for calculating the combined product, the combined product may be a financial product such as a stock, a bond, a fund and the like, the calculation time point may be set to a fixed time or a time period, and if the calculation time point is a fixed time, the fixed time is reached to perform one calculation on the position of the taken position; and if the calculation time point is a time period, periodically calculating the position of the position holding bin according to the time period. The method comprises the steps that a plurality of combined products are stored in a read-only storage node of a preset message queue, each combined product comprises information such as a combined code, a combined name, combined dimensions, daily transaction information and position holding product information, specific information of all position holding products contained in one combined product is position holding product information of the combined product, each combined product is formed by combining a plurality of position holding products, each position holding product comprises information such as position holding product numbers and position holding product names, the combined products with different dimensions can be classified according to the combined dimensions, and each combined dimension corresponds to a combination of financial products such as stocks, bonds and funds. The message queue is a queue for storing and recording combined products, the read-only storage node (ROM node) is used for storing information permanently, the random access storage node (RAM node) is used for storing information temporarily, batch reading of the combined products can be achieved through the position holding queue, further the computing efficiency can be greatly improved, and the influence on the downstream computing efficiency due to the fact that a computing efficiency bottleneck occurs in a certain computing link is avoided.
For example, a certain combination product contains information as shown in table 1.
Figure BDA0002231433080000041
TABLE 1
In one embodiment, as shown in FIG. 2, step S110 includes sub-steps S111 and S112.
And S111, acquiring the combination dimension of each combination product and counting to obtain combination dimension information containing a plurality of combination dimensions.
And acquiring the combination dimension of each combination product and counting to obtain combination dimension information containing a plurality of combination dimensions. Each combination product corresponds to one combination dimension, the combination dimensions of all the combination products can be obtained and counted to obtain combination dimension information, and the combination products with the same combination dimension can be calculated in the same mode.
And S112, generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information.
And generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information. The calculation thread is a task unit used for calculating the position of the position taken by the combined product, the combined product with the same combination dimension can be calculated through the same calculation thread, and a calculation formula corresponding to the combination dimension is also configured in the calculation thread.
Specifically, each combined product is formed by combining a plurality of position holding products, the position holding products can be divided into single coupon varieties and non-single coupon varieties according to the coupon varieties, if the position holding products are the single coupon varieties, the position holding products only correspondingly contain one transaction data in the transaction information of the day, and if the position holding products are the non-single coupon varieties, the position holding products correspondingly contain a plurality of transaction data in the transaction information of the day.
For example, for a bin taken product of a singlets variety, the formula may be used: f ═ F0×(1+x%)+F1Calculating the latest position F of the position holding product, wherein F0The historical position data of the position-taken product in the historical position information is shown, x is the interest rate, F1The current day transaction data of the position-taken product in the current day transaction information; for a bin taken product of a non-stock variety, the formula may be used: c ═ C0+C1×(1-x1%)-C2×(1+x2%)+C3-C4Calculating the latest position C of the position-holding product, wherein C0For the history of the taken position product in the historical position informationPosition data, C1For the roll-in transaction data, x, of the taken-in product in the daily transaction information1To shift into cost ratio, C2Roll-out transaction data, x, for the taken-position product in the current day's transaction information2To roll out the cost ratio, C3For the transaction data of the products in position in the daily transaction information, C4The data of the taken-position product in the current day transaction information is the transaction data.
For a plurality of combined products with the same combined dimension, a formula of a single coupon variety and a formula of a non-single coupon variety can be combined based on the combined dimension to obtain a calculation formula corresponding to the combined dimension, and the calculation formula is configured in a calculation thread corresponding to the combined dimension.
And S120, sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node.
And sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node. The message queue comprises one or more read-only storage nodes, and if only one read-only storage node is included, the information of all combined products needing to be calculated is stored in the read-only storage node; if the combined product comprises a plurality of read-only storage nodes, information of the combined product needing to be calculated is dispersedly stored in the plurality of read-only storage nodes, the information stored in the read-only storage nodes can be input by a user in advance, the user can input the information of a plurality of combined products in a plurality of batches, and the read-only storage nodes process the input information of the plurality of combined products according to a first-in first-out principle. The message queue comprises a plurality of random access storage nodes, each random access storage node can write information in any read-only storage node, one combined product stored by the read-only storage node is written in at least one random access storage node, if a certain random access storage node goes down, other random access storage nodes can still normally run without interrupting the calculation process, the plurality of random access storage nodes are mutually backed up, the reliability of bin calculation can be improved, and the combined product can be read in batch by the cooperative cooperation of the plurality of random access storage nodes contained in the message queue, so that the requirement of parallel calculation on the combined product is met.
S130, according to the combination dimension of one combination product stored in any random access storage node, inputting the combination product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes.
And inputting the combined product into a corresponding computing thread according to the combined dimension of one combined product stored in any random access storage node, and synchronizing other random access storage nodes. All the random access storage nodes can input the combined product into any one computing thread, and one random access storage node inputs one combined product into the corresponding computing thread, so that information synchronization needs to be carried out on other random access storage nodes according to the input combined product, and the same combined product is prevented from being subjected to multiple times of computing. The combined products of the corresponding grouping dimensions are respectively calculated by the multiple calculation threads, the multi-thread parallel calculation is realized, and the calculation efficiency of the position holding bin can be greatly improved compared with the traditional position holding calculation method.
In one embodiment, as shown in fig. 3, step S130 includes sub-steps S131 and S132.
S131, inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product, and recording input information.
Inputting the combined product into a calculation thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information, wherein the input information comprises input time, whether the input is successful, a combined code, a combined name and other information, specifically, the input time is the time information for inputting the combined product into the calculation thread, if the input of the combined product is fed back by the calculation thread to be successful, whether the input is successful is yes, otherwise, whether the output is successful is no, and the combined code and the combined name are serial number and name information for identifying the combined product.
S132, deleting the corresponding combined products stored in the other random access storage nodes according to the input information to finish information synchronization.
And deleting the corresponding combined products stored in other random access storage nodes according to the input information to finish information synchronization. Specifically, if the input success in a certain input message is yes, the combined product corresponding to the input message is deleted from other random access storage nodes; if the input success in a certain input message is "no", the combined product stored in other random access storage nodes and corresponding to the input message is not deleted, that is, the combined product can be input to the corresponding computing thread again by other random access storage nodes.
And S140, calculating according to the calculation thread of the input combined product and by combining a preset bin position information table to obtain the latest bin position information of the combined product.
And calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table. The bin position information table is a data table used for recording the last calculation result, historical bin position information corresponding to the current combined product can be obtained from the bin position information table according to specific information of the current combined product input into a calculation thread, the combined products with the same combination dimension can be calculated through a calculation formula in the same calculation thread, and the latest bin position information of the current combined product can be obtained through calculation according to a calculation formula which is configured in the calculation thread and corresponds to the combination dimension of the current combined product.
In an embodiment, as shown in fig. 4, step S140 includes sub-steps S141 and S142.
S141, obtaining historical bin information corresponding to the current combined product in the bin information table.
And acquiring historical bin information corresponding to the current combined product in the bin information table. The historical position information is the calculation result of the last calculation of the current combined product, and if the period of calculating the position of the position taken is one day, the acquired historical position information is the position information of yesterday calculated by yesterday.
And S142, calculating to obtain the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product.
And calculating the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product. The combined product comprises the current day transaction information, and specifically, according to a calculation formula and the current day transaction information, the positions of the corresponding financial products are increased or decreased in the historical position information, so that the latest position information of the current combined product can be calculated. And after the calculation thread finishes the calculation of the current combined product and outputs the latest position holding information, releasing the current combined product and calculating the input next combined product.
In one embodiment, as shown in fig. 5, step S143 is further included after step S142.
S143, updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table.
And updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table. After the latest position information of all the combined products is obtained, the position information table can be updated, that is, the historical position information of each combined product in the position information table is updated to the calculated latest position information.
In the message queue-based calculation method provided by the embodiment of the invention, a corresponding calculation thread is generated according to a combined product stored in a preset message queue, the combined product stored in a read-only storage node is written into a random access storage node, the combined product stored in the random access storage node is input into the corresponding calculation thread, and the latest position holding information of the combined product is obtained through calculation. By the method, the combined products can be calculated in batch through the message queue and the generated calculation thread, and the asset accounting efficiency of enterprises is improved.
The embodiment of the invention also provides a message queue-based computing device, which is used for executing any embodiment of the message queue-based computing method. Specifically, referring to fig. 6, fig. 6 is a schematic block diagram of a message queue-based computing device according to an embodiment of the present invention. The message queue based computing device may be configured in a user terminal.
As shown in fig. 6, the message queue-based computing device 100 includes a computing thread generating unit 110, a combined product caching unit 120, a combined product input unit 130, and a combined product taken position computing unit 140.
And the calculation thread generating unit 110 is configured to, if the preset calculation time point is reached, acquire a combined product stored in a preset message queue and generate a calculation thread according to a combined dimension of the combined product.
And if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and correspondingly generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes. Specifically, the calculation time point is a time point set by the user for calculating the combined product, the combined product may be a financial product such as a stock, a bond, a fund and the like, the calculation time point may be set to a fixed time or a time period, and if the calculation time point is a fixed time, the fixed time is reached to perform one calculation on the position of the taken position; and if the calculation time point is a time period, periodically calculating the position of the position holding bin according to the time period. The method comprises the steps that a plurality of combined products are stored in a read-only storage node of a preset message queue, each combined product comprises information such as a combined code, a combined name, combined dimensions, daily transaction information and position holding product information, specific information of all position holding products contained in one combined product is position holding product information of the combined product, each combined product is formed by combining a plurality of position holding products, each position holding product comprises information such as position holding product numbers and position holding product names, the combined products with different dimensions can be classified according to the combined dimensions, and each combined dimension corresponds to a combination of financial products such as stocks, bonds and funds. The message queue is a queue for storing and recording combined products, the read-only storage node (ROM node) is used for storing information permanently, the random access storage node (RAM node) is used for storing information temporarily, batch reading of the combined products can be achieved through the position holding queue, further the computing efficiency can be greatly improved, and the influence on the downstream computing efficiency due to the fact that a computing efficiency bottleneck occurs in a certain computing link is avoided.
In other embodiments of the present invention, as shown in fig. 7, the calculation thread generating unit 110 includes sub-units: a combined dimension statistics unit 111 and a calculation thread generation unit 112.
A combination dimension statistical unit 111, configured to obtain a combination dimension of each combination product and obtain combination dimension information including multiple combination dimensions through statistics.
And acquiring the combination dimension of each combination product and counting to obtain combination dimension information containing a plurality of combination dimensions. Each combination product corresponds to one combination dimension, the combination dimensions of all the combination products can be obtained and counted to obtain combination dimension information, and the combination products with the same combination dimension can be calculated in the same mode.
A computing thread generating unit 112, configured to generate the same number of computing threads according to the number of combined dimensions in the combined dimension information.
And generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information. The calculation thread is a task unit used for calculating the position of the position taken by the combined product, the combined product with the same combination dimension can be calculated through the same calculation thread, and a calculation formula corresponding to the combination dimension is also configured in the calculation thread.
Specifically, each combined product is formed by combining a plurality of position holding products, the position holding products can be divided into single coupon varieties and non-single coupon varieties according to the coupon varieties, if the position holding products are the single coupon varieties, the position holding products only correspondingly contain one transaction data in the transaction information of the day, and if the position holding products are the non-single coupon varieties, the position holding products correspondingly contain a plurality of transaction data in the transaction information of the day.
For a plurality of combined products with the same combined dimension, a formula of a single coupon variety and a formula of a non-single coupon variety can be combined based on the combined dimension to obtain a calculation formula corresponding to the combined dimension, and the calculation formula is configured in a calculation thread corresponding to the combined dimension.
The combined product caching unit 120 is configured to sequentially obtain combined products stored by the rom nodes and write each combined product into at least one random access storage node.
And sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node. The message queue comprises one or more read-only storage nodes, and if only one read-only storage node is included, the information of all combined products needing to be calculated is stored in the read-only storage node; if the combined product comprises a plurality of read-only storage nodes, information of the combined product needing to be calculated is dispersedly stored in the plurality of read-only storage nodes, the information stored in the read-only storage nodes can be input by a user in advance, the user can input the information of a plurality of combined products in a plurality of batches, and the read-only storage nodes process the input information of the plurality of combined products according to a first-in first-out principle. The message queue comprises a plurality of random access storage nodes, each random access storage node can write information in any read-only storage node, one combined product stored by the read-only storage node is written in at least one random access storage node, if a certain random access storage node goes down, other random access storage nodes can still normally run without interrupting the calculation process, the plurality of random access storage nodes are mutually backed up, the reliability of bin calculation can be improved, and the combined product can be read in batch by the cooperative cooperation of the plurality of random access storage nodes contained in the message queue, so that the requirement of parallel calculation on the combined product is met.
And the combined product input unit 130 is configured to input a combined product into a corresponding computing thread according to a combined dimension of one combined product stored in any one of the random access storage nodes, and perform information synchronization on the other random access storage nodes.
And inputting the combined product into a corresponding computing thread according to the combined dimension of one combined product stored in any random access storage node, and synchronizing other random access storage nodes. All the random access storage nodes can input the combined product into any one computing thread, and one random access storage node inputs one combined product into the corresponding computing thread, so that information synchronization needs to be carried out on other random access storage nodes according to the input combined product, and the same combined product is prevented from being subjected to multiple times of computing. The combined products of the corresponding grouping dimensions are respectively calculated by the multiple calculation threads, the multi-thread parallel calculation is realized, and the calculation efficiency of the position holding bin can be greatly improved compared with the traditional position holding calculation method.
In another embodiment of the present invention, as shown in fig. 8, the combined product input unit 130 includes sub-units: a combination product information input unit 131 and an information synchronization unit 132.
And the combined product information input unit 131 is used for inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information.
Inputting the combined product into a calculation thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information, wherein the input information comprises input time, whether the input is successful, a combined code, a combined name and other information, specifically, the input time is the time information for inputting the combined product into the calculation thread, if the input of the combined product is fed back by the calculation thread to be successful, whether the input is successful is yes, otherwise, whether the output is successful is no, and the combined code and the combined name are serial number and name information for identifying the combined product.
And an information synchronization unit 132, configured to delete the corresponding combination product stored in the other random access storage nodes according to the input information to complete information synchronization.
And deleting the corresponding combined products stored in other random access storage nodes according to the input information to finish information synchronization. Specifically, if the input success in a certain input message is yes, the combined product corresponding to the input message is deleted from other random access storage nodes; if the input success in a certain input message is "no", the combined product stored in other random access storage nodes and corresponding to the input message is not deleted, that is, the combined product can be input to the corresponding computing thread again by other random access storage nodes.
And the combined product position holding calculation unit 140 is used for calculating the latest position holding information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
And calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table. The bin position information table is a data table used for recording the last calculation result, historical bin position information corresponding to the current combined product can be obtained from the bin position information table according to specific information of the current combined product input into a calculation thread, the combined products with the same combination dimension can be calculated through a calculation formula in the same calculation thread, and the latest bin position information of the current combined product can be obtained through calculation according to a calculation formula which is configured in the calculation thread and corresponds to the combination dimension of the current combined product.
In other embodiments of the invention, as shown in fig. 9, the combined product position taking calculation unit 140 includes sub-units: a history bin information acquiring unit 141 and a latest taken position information calculating unit 142.
A historical bin information obtaining unit 141, configured to obtain historical bin information corresponding to the current combination product in the bin information table.
And acquiring historical bin information corresponding to the current combined product in the bin information table. The historical position information is the calculation result of the last calculation of the current combined product, and if the period of calculating the position of the position taken is one day, the acquired historical position information is the position information of yesterday calculated by yesterday.
And the latest position information calculating unit 142 is configured to calculate the latest position information of the current combination product according to the historical position information and the current day transaction information of the current combination product.
And calculating the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product. The combined product comprises the current day transaction information, and specifically, according to a calculation formula and the current day transaction information, the positions of the corresponding financial products are increased or decreased in the historical position information, so that the latest position information of the current combined product can be calculated. And after the calculation thread finishes the calculation of the current combined product and outputs the latest position holding information, releasing the current combined product and calculating the input next combined product.
In other embodiments of the present invention, as shown in fig. 10, the combined product position taking calculation unit 140 further includes a sub-unit: bin information table updating unit 143.
A bin position information table updating unit 143, configured to update the bin position information table according to the latest taken position information of all the combined products to obtain an updated bin position information table.
And updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table. After the latest position information of all the combined products is obtained, the position information table can be updated, that is, the historical position information of each combined product in the position information table is updated to the calculated latest position information.
The message queue-based computing device provided in the embodiment of the present invention is configured to execute the message queue-based computing method, and generate a corresponding computing thread according to a combined product stored in a preset message queue, write the combined product stored in a read-only storage node into a random access storage node, input the combined product stored in the random access storage node into the corresponding computing thread, and compute to obtain latest position holding information of the combined product. By the method, the combined products can be calculated in batch through the message queue and the generated calculation thread, and the asset accounting efficiency of enterprises is improved.
The above-described message queue-based computing apparatus may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Referring to fig. 11, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a message queue based computing method.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute the message queue-based calculation method.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 11 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following functions: if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes; sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node; inputting the combined product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node; and calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
In an embodiment, when the processor 502 executes the step of acquiring the combined product stored in the preset message queue and generating the calculation thread according to the combined dimension of the combined product if the preset calculation time point is reached, the following operations are executed: acquiring the combination dimension of each combination product and counting to obtain combination dimension information comprising a plurality of combination dimensions; and generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information.
In one embodiment, the processor 502, when executing the step of inputting a combination product into a corresponding computing thread and synchronizing information of other random access storage nodes according to a combination dimension of the combination product stored in any one of the random access storage nodes, performs the following operations: inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information; and deleting the corresponding combined products stored in other random access storage nodes according to the input information to finish information synchronization.
In one embodiment, the processor 502 performs the following operations when executing the step of calculating the latest position information of the combined product according to the calculation thread of the input combined product and combining the preset position information table: acquiring historical bin information corresponding to the current combined product in the bin information table; and calculating the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product.
In one embodiment, the processor 502, when executing the step of calculating the latest position information of the combined product according to the calculation thread of the input combined product and combining the preset position information table, further performs the following operations: and updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 11 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 11, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a non-volatile computer readable storage medium. The computer-readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the steps of: if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes; sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node; inputting the combined product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node; and calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
In an embodiment, the step of obtaining a combined product stored in a preset message queue and generating a calculation thread according to a combined dimension of the combined product if a preset calculation time point is reached includes: acquiring the combination dimension of each combination product and counting to obtain combination dimension information comprising a plurality of combination dimensions; and generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information.
In an embodiment, the step of inputting a combination product into a corresponding computing thread and synchronizing information of other random access storage nodes according to a combination dimension of a combination product stored in any one of the random access storage nodes includes: inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information; and deleting the corresponding combined products stored in other random access storage nodes according to the input information to finish information synchronization.
In one embodiment, the step of calculating the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table includes: acquiring historical bin information corresponding to the current combined product in the bin information table; and calculating the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product.
In an embodiment, the step of calculating the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table further includes: and updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A message queue-based computing method, comprising:
if the preset calculation time point is reached, acquiring a combined product stored in a preset message queue and generating a calculation thread according to the combined dimension of the combined product, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes;
sequentially acquiring the combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node;
inputting the combined product into a corresponding computing thread and carrying out information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node;
and calculating to obtain the latest position information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
2. The message queue-based computing method according to claim 1, wherein the obtaining of the combined product stored in the preset message queue and the corresponding generation of the computing thread according to the combined dimension of the combined product comprises:
acquiring the combination dimension of each combination product and counting to obtain combination dimension information comprising a plurality of combination dimensions;
and generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information.
3. The message queue-based computing method according to claim 1, wherein the inputting the combined product into a corresponding computing thread and performing information synchronization on other random access storage nodes according to the combined dimension of one combined product stored in any one of the random access storage nodes comprises:
inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information;
and deleting the corresponding combined products stored in other random access storage nodes according to the input information to finish information synchronization.
4. The message queue-based computing method according to claim 1, wherein the calculating the latest position information of the combined product according to the computing thread of the input combined product and by combining a preset position information table comprises:
acquiring historical bin information corresponding to the current combined product in the bin information table;
and calculating the latest position information of the current combined product according to the historical position information and the current day transaction information of the current combined product.
5. The message queue-based computing method of claim 4, further comprising:
and updating the bin position information table according to the latest position information of all the combined products to obtain an updated bin position information table.
6. A message queue-based computing device, comprising:
the computing thread generating unit is used for acquiring a combined product stored in a preset message queue and correspondingly generating a computing thread according to the combined dimension of the combined product if a preset computing time point is reached, wherein the message queue comprises at least one read-only memory node and a plurality of random access storage nodes;
the combined product cache unit is used for sequentially acquiring combined products stored by the read-only memory nodes and writing each combined product into at least one random access storage node;
the combined product input unit is used for inputting the combined product into a corresponding computing thread and synchronizing information of other random access storage nodes according to the combined dimension of one combined product stored in any random access storage node;
and the combined product position holding calculation unit is used for calculating the latest position holding information of the combined product according to the calculation thread of the input combined product and by combining a preset position information table.
7. The message queue-based computing device of claim 6, wherein the computing thread generation unit comprises:
the combined dimension counting unit is used for acquiring the combined dimension of each combined product and counting to obtain combined dimension information comprising a plurality of combined dimensions;
and the calculation thread generation unit is used for generating the same number of calculation threads according to the number of the combined dimensions in the combined dimension information.
8. The message queue-based computing device of claim 6, wherein the combination product input unit comprises:
the combined product information input unit is used for inputting the combined product into a computing thread corresponding to the combined dimension according to the combined dimension of the combined product and recording input information;
and the information synchronization unit is used for deleting the corresponding combined products stored in other random access storage nodes according to the input information so as to finish information synchronization.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the message queue based computation method according to any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to perform the message queue-based computation method of any one of claims 1 to 5.
CN201910968919.2A 2019-10-12 2019-10-12 Message queue-based computing method and device, computer equipment and storage medium Pending CN111078419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910968919.2A CN111078419A (en) 2019-10-12 2019-10-12 Message queue-based computing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910968919.2A CN111078419A (en) 2019-10-12 2019-10-12 Message queue-based computing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111078419A true CN111078419A (en) 2020-04-28

Family

ID=70310328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910968919.2A Pending CN111078419A (en) 2019-10-12 2019-10-12 Message queue-based computing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111078419A (en)

Similar Documents

Publication Publication Date Title
US7937257B2 (en) Estimating performance of application based on automatic resizing of shared memory for messaging
CN107679081B (en) Information modification method and device, computer equipment and computer readable storage medium
CN109634819B (en) Alarm root cause positioning method and device and electronic equipment
CN111026774A (en) Data sequence synchronization method and device, computer equipment and storage medium
US20230205745A1 (en) History of slowly changing dimensions
CN112506978A (en) Big data real-time processing method, device and equipment
CN113256355B (en) Method, device, medium, equipment and system for determining integral rights and interests in real time
US20150120613A1 (en) Real-time trade forecaster
CN111078419A (en) Message queue-based computing method and device, computer equipment and storage medium
CN113837878B (en) Data comparison method, device, equipment and storage medium
CN106971339B (en) Service processing method and device
CN110148044B (en) Method and device for setting buffering threshold for accounting
WO2020034752A1 (en) Floating income calculation method, apparatus and device, and computer-readable storage medium
CN107025266B (en) Service data processing method and device
CN110837537A (en) Order data synchronization method and device, computer readable storage medium and server
CN115329733B (en) Report form statistical method and device, computer equipment and storage medium
US11941593B2 (en) Blockchain payment notification system
CN115357367B (en) Expense payment task scheduling method and computer equipment
CN110442587B (en) Service information upgrading method and terminal equipment
JP2006251891A (en) Data collection device and data collection program
CN115756884A (en) Cross-center real-time flow calculation method and system
CN115408128A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN115422296A (en) Block chaining-out method, device and storage medium
CN117745481A (en) House source heat determining method and device, electronic equipment and storage medium
JP2011108293A (en) Data tabulation device and data tabulation 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