Data processing method, system, terminal device and storage medium
By configuring priorities for computing units and adopting a tree-like architecture, the problems of time-consuming and resource-wasting data processing systems are solved, and efficient data processing and real-time result return are achieved.
Patent Information
- Application Number
- CN202111564674.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-20
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-12-20
AI Technical Summary
Existing data processing systems take a long time to process data and fail to utilize resources effectively, resulting in resource waste.
Data processing resources are configured according to the priority of the computing unit, and data packets are sent to each computing unit for calculation at the same time. The calculation results are returned in real time, and a tree-like computing unit architecture is used to reduce coupling.
It improves data processing efficiency, rationally utilizes resources, reduces user waiting time and reduces latency.
Smart Images

Figure CN114237898B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer application technology, and in particular relates to a data processing method, system, terminal device and computer-readable storage medium. Background Art
[0002] Financial businesses, such as securities, are characterized by their diverse scope and enormous data processing volumes, placing high demands on data processing systems. Current data processing systems typically perform serial calculations based on data packets sent from trading terminals, returning the results to users only after completing all required data.
[0003] However, serial calculations based on data packets sent by the transaction terminal cannot effectively utilize the data processing resources of the data processing system, and the entire data processing process is time-consuming. Summary of the Invention
[0004] The embodiments of the present application provide a data processing method, system, terminal device and computer-readable storage medium, which can solve the problem that the current data processing process is time-consuming and cannot effectively utilize data processing resources, resulting in resource waste.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, comprising:
[0006] Allocate data processing resources based on the priority of each computing unit;
[0007] When a data packet is received, the data packet is simultaneously sent to each computing unit in the first layer computing module for calculation, and the calculation results output by each computing unit are obtained; and the calculation results are returned in real time.
[0008] Optionally, before allocating data processing resources according to the priorities of the computing units, the following steps may also be included:
[0009] The priority of each calculation unit is set according to the user's real-time requirements for calculation results.
[0010] Optionally, configuring data processing resources according to the priority of each computing unit includes:
[0011] Get the configuration file;
[0012] Data processing resources are configured for each computing unit according to the configuration file.
[0013] Optionally, when a data packet is received, the data packet is simultaneously sent to each computing unit in the first-layer computing module for computing, and computing results output by each computing unit are obtained; and the computing results are returned in real time, including:
[0014] When a data packet is received, a random natural number is generated;
[0015] determining a target data processing unit of a computing unit according to the random natural number;
[0016] The data packet is distributed to the target data processing unit for processing.
[0017] Optionally, when a data packet is received, the data packet is simultaneously sent to each computing unit in the first-layer computing module for computing, and computing results output by each computing unit are obtained; and the computing results are returned in real time, including:
[0018] When a data packet is received, the data packet is parsed to obtain an identification code of the target object;
[0019] determining a target data processing unit of a computing unit according to an identification code of the target object;
[0020] The data packet is distributed to the target data processing unit for processing.
[0021] Optionally, when a data packet is received, the data packet is simultaneously sent to each computing unit in the first-layer computing module for computing, and computing results output by each computing unit are obtained; and after the computing results are returned in real time, the method further includes:
[0022] If there is an M+1th layer computing module, the calculation result calculated by the calculation unit in the Mth layer computing module is sent to the calculation unit in the M+1th layer computing module, and the calculation unit in the M+1th layer computing module calculates the calculation result calculated by the calculation unit in the Mth layer computing module to obtain the calculation result, and returns the calculation result in real time, where M is a positive integer greater than or equal to 1.
[0023] In a second aspect, an embodiment of the present application provides a data processing system, the data processing system comprising N layers of computing modules, each layer of computing modules comprising a plurality of computing units, the computing results of each computing unit in each layer of computing modules being independent of each other; the computing results of the computing units in the computing modules in the M+1th layer being dependent on the computing results output by the computing units in the computing modules in the Mth layer;
[0024] The data processing system configures data processing resources corresponding to the priority level for each computing unit according to the priority level of each computing unit.
[0025] In a third aspect, an embodiment of the present application provides a data processing system, including:
[0026] A configuration unit, configured to configure data processing resources according to the priority of each computing unit;
[0027] The processing unit is used to send the data packet to each computing unit in the first-layer computing module for calculation when the data packet is received, obtain the calculation results output by each computing unit; and return the calculation results in real time.
[0028] In a third aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the data processing method as described in any one of the first aspects above are implemented.
[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the data processing method as described in any one of the first aspects above.
[0030] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the data processing method described in any one of the above-mentioned first aspects.
[0031] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0032] The data processing method provided in the embodiments of the present application can allocate data processing resources to each computing unit based on its priority, rationally utilizing data processing resources and improving system resource utilization. Furthermore, multiple computing units can simultaneously process financial data and transmit calculation results in real time, thereby improving data processing efficiency and reducing latency. This method solves the problem of current data processing processes being time-consuming and unable to effectively utilize data processing resources, resulting in wasted resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0034] Figure 1 This is a schematic diagram of an application scenario of a data processing method provided in one embodiment of the present application;
[0035] Figure 2 This is a schematic diagram of the architecture of a data processing system provided by an embodiment of the present application;
[0036] Figure 3 This is a schematic diagram of an implementation flow of a data processing method provided in one embodiment of the present application;
[0037] Figure 4 A schematic diagram showing a specific implementation flow of S11 in the data processing method provided in one embodiment of the present application is shown;
[0038] Figure 5 A schematic diagram showing a specific implementation flow of S12 in the data processing method provided in one embodiment of the present application is shown;
[0039] Figure 6 FIG2 is a flow chart showing another specific implementation of step S12 in the data processing method provided in one embodiment of the present application;
[0040] Figure 7 This is a schematic diagram of an implementation flow of another data processing method provided in one embodiment of the present application;
[0041] Figure 8 is a structural diagram of a data processing system provided in one embodiment of the present application;
[0042] Figure 9 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0043] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0044] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0045] It should also be understood that the term "and / or" used in this specification and the appended claims refers to the items listed in the associated list.
[0046] Any and all possible combinations of one or more of, and including these combinations.
[0047] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0049] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0050] See also Figure 1 , Figure 1 This is a schematic diagram of an application scenario of the data processing method provided in one embodiment of the present application. Figure 1 As shown, the execution subject of the above data processing method can be Figure 1 The data processing system 10 in the embodiment can be communicatively connected to the transaction terminal 20 on the user side. Specifically, the data processing system 10 can be a terminal device or server with data processing resources capable of processing large amounts of data. The terminal device can be an electronic device such as a computer with multiple CPUs, a mobile phone, a tablet computer, a desktop computer, or a smart wearable device. The server can be a traditional server or a cloud server, without specific limitation herein.
[0051] In some implementations, the user can communicate with the above-mentioned data processing system 10 through an application (such as an application (APP) or a mini-program (an application that can be used without installation)) of the transaction terminal 20 on the user side, thereby sending data packets that require data processing / data calculation by the data processing system 10 to the above-mentioned data processing system.
[0052] The user can operate on the application of the transaction terminal 20 on the user side, for example, select the target object for which the calculation result needs to be obtained. At this time, the transaction terminal 20 will send the data packet corresponding to the target object to the data processing system 10 according to the user's selection, and the data processing system 10 will calculate the calculation result of the target object required by the user based on the data packet.
[0053] In an implementation of the present application, the target objects may be different securities products or other products that require multiple calculation results. The user may select the securities product for which he or she wants to obtain information / quotes (view) by clicking or other operations in the display interface of the application through the application of the trading terminal 20. When the trading terminal 20 detects that the user has selected a certain securities product, it will respond to the operation and switch the display interface of the application to a page displaying information related to the securities product so that the user can view the information / quotes he or she needs. In the specific implementation process, the trading terminal 20 needs to first send the data packet related to the securities product to the data processing system 10. The data processing system 10 will calculate the calculation results related to the securities product based on the data packet, and then return the calculation results to the trading terminal 20, which will be displayed by the trading terminal 20 for the user to view. The above calculation results include but are not limited to the current price, current gear, trend change curve, transaction price, time-sharing chart, etc.
[0054] See also Figure 2 , Figure 2 FIG. 1 shows a schematic diagram of the architecture of a data processing system 10 provided in an embodiment of the present application. Figure 2 As shown, in one embodiment of the present application, the above-mentioned data processing system 10 may include N layers of computing modules 11, and each layer of computing module may include several computing units.
[0055] The calculation results of the calculation units in the first-layer calculation module 11A do not need to rely on the calculation results of other calculation units. Different calculation units are used to calculate different calculation results, and the calculation results of each calculation unit are independent of each other. Each calculation unit can independently calculate the calculation result of the calculation unit based on the data packet, effectively reducing the coupling between the calculation units. When the calculation unit calculates the calculation result, the calculation result is sent to the transaction terminal in real time, allowing users to view the corresponding calculation result.
[0056] It should be noted that the data processing system 10 will configure data processing resources corresponding to the priority of each computing unit based on the priority of the computing unit.
[0057] For example, assume that the first-layer computing module 11A includes computing unit 1, computing unit 2, computing unit 3, and computing unit 4. Computing unit 1 is used to calculate a first calculation result based on a data packet, computing unit 2 is used to calculate a second calculation result based on a data packet, computing unit 3 is used to calculate a third calculation result based on a data packet, and computing unit 4 is used to calculate a fourth calculation result based on a data packet. The first, second, third, and fourth calculation results are independent of each other, that is, they are independent of each other. When computing unit 1 calculates the first calculation result, it immediately returns the first calculation result to the transaction terminal. When computing unit 2 calculates the second calculation result, it also immediately returns the second calculation result to the transaction terminal. When computing unit 3 calculates the third calculation result, it also immediately returns the third calculation result to the transaction terminal. When computing unit 4 calculates the fourth calculation result, it also immediately returns the fourth calculation result to the transaction terminal. Each computing unit can perform parallel calculations, effectively reducing the coupling between the computing units and shortening user waiting time.
[0058] The second-layer computing module 11B also includes several computing units. The computing units in the second computing module 11B can process the computing results output by the computing units in the upper-layer computing module (i.e., the first-layer computing module 11A) connected to it to obtain the computing results corresponding to the computing units in the computing module of this layer.
[0059] For example, assuming that the second-layer computing module 11B includes computing units 5 and 6, where the fifth calculation result of computing unit 5 depends on the first calculation result output by computing unit 1, then computing unit 1 will output the first calculation result to computing unit 5 after calculating the first calculation result. Computing unit 5 can then calculate the fifth calculation result based on the first calculation result and return the fifth calculation result to the transaction terminal in real time. If the sixth calculation result of computing unit 6 depends on the fourth calculation result output by computing unit 4, then computing unit 4 will output the fourth calculation result to computing unit 6 after calculating the fourth calculation result. Computing unit 6 can then calculate the sixth calculation result based on the fourth calculation result and return the sixth calculation result to the transaction terminal in real time.
[0060] It is understood that the M+1th layer computing module 11M+1 also includes a plurality of computing units, each of which is capable of performing a secondary calculation on the calculation results of the computing units in the connected upper layer computing module (i.e., the Mth layer computing module 11M) to obtain the calculation results of the computing units in the Mth layer computing module. Here, M is a positive integer greater than or equal to 1.
[0061] Through the tree-like computing unit architecture, when calculating data packets, the coupling degree of each computing unit in the data processing system can be reduced to the greatest extent, effectively improving the timeliness of the data processing system in data calculation, reducing the user's waiting time, and reasonably utilizing the data processing resources of the data processing system, reducing the waste of data processing resources of the data processing system.
[0062] It should be noted that the above application scenarios are only examples for ease of understanding. It should be understood that the embodiments of the present application are not limited to the above application scenarios.
[0063] The data processing method provided in the embodiment of the present application will be described in detail below. In the embodiment of the present application, the execution subject of the above-mentioned data processing method can be the above-mentioned data processing system.
[0064] See also Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of an implementation flow of a data processing method provided in an embodiment of the present application. Figure 3 As shown, the data processing method provided in one embodiment of the present application may include S11 to S12, which are described in detail as follows:
[0065] S11: Allocate data processing resources according to the priority of each computing unit.
[0066] In an embodiment of the present application, the data processing system may include several calculation units, each of which is used to calculate different calculation results based on a data packet. For example, the data processing system may include a current price calculation unit, a current gear calculation unit, a trend change curve calculation unit, a transaction price calculation unit, and a time-sharing chart calculation unit, wherein the current price calculation unit is used to calculate the real-time price of the target object based on the data packet; the current gear calculation unit is used to determine the gear position of the target object based on the data packet; the trend change curve calculation unit is used to determine the trend change of the target object based on the data packet and represent the trend change through a curve; the transaction price calculation unit is used to determine the transaction price of each transaction based on the data packet; and the time-sharing chart calculation unit is used to determine the time-sharing chart of the target object based on the data packet.
[0067] In the embodiment of the present application, the priority of each computing unit can be set according to the user's real-time requirements for the calculation results. The higher the priority of the computing unit, the more data processing resources are allocated.
[0068] It should be noted that since users have different real-time requirements for different calculation results, the priority of each calculation unit can be set based on the user's real-time requirements for different calculation results. The higher the real-time requirement, the higher the priority of the calculation unit.
[0069] Here, the first priority can be set higher than the second priority, the second priority can be set higher than the third priority, or the third priority can be set higher than the second priority, and the second priority can be set higher than the first priority. This application does not limit this. For the convenience of description, the following takes the first priority higher than the second priority and the second priority higher than the third priority as an example:
[0070] For example, assuming that the user has a high real-time requirement for the real-time price of the target object, the priority of the current price calculation unit is set to the first priority, and the user has a low real-time requirement for the trend change of the target object, the priority of the trend change curve calculation unit can be set to the second priority.
[0071] In an embodiment of the present application, the user's real-time requirement for the calculation result can be determined based on the user's expected response time. The shorter the user's expected response time, the higher the user's real-time requirement for the calculation result.
[0072] In an embodiment of the present application, different user expected response time ranges can also be set, each range corresponds to a real-time requirement level, and each real-time requirement level corresponds to a priority. In this way, the priority of each calculation unit can be determined based on the user's expected response time for each calculation result.
[0073] In the embodiment of the present application, since the computing resources of the data processing system are limited, in order to ensure that the computing results with higher real-time requirements can be returned first, more data processing resources can be allocated to computing units with higher priorities.
[0074] In specific applications, the data processing system will first determine the priority of each computing unit and then allocate corresponding data processing resources to each computing unit.
[0075] The aforementioned data processing resources refer to the hardware resources available for data processing within a data processing system, such as CPUs. It should be noted that priority is correlated with allocated data processing resources: the higher the priority, the more data processing resources are allocated, ensuring sufficient computing power for computations requiring high real-time performance.
[0076] In specific applications, the aforementioned priorities and allocated data processing resources can be implemented using a mapping table. Specifically, the mapping relationship between priorities and allocated data processing resources is stored in the mapping table, and a computing unit of a certain priority level can be directly mapped to the number of data processing resources corresponding to that priority level. For example, a computing unit of the first priority level can be allocated 4 CPU resources, while a computing unit of the second priority level can be allocated 2 CPU resources.
[0077] In a specific implementation, the total number of data processing resources that can be allocated by the data processing system may be determined first, and then the data processing resources that can be allocated to the computing unit of each priority level may be determined based on the total number of data processing resources that can be allocated.
[0078] For example, assuming that the data processing system includes three data processing units, namely, a current price calculation unit, a current gear calculation unit, and a trend change curve calculation unit, wherein the priority of the current price calculation unit is the first priority, the priority of the current gear calculation unit is the first priority, the priority of the trend change curve calculation unit is the second priority, and the total number of data processing resources that can be allocated by the data processing system is 8 CPUs, then it can be determined that the data processing resources that can be allocated by the calculation unit of the first priority are 3 CPUs, and the data processing resources that can be allocated by the calculation unit of the second priority are 2 CPUs.
[0079] See also Figure 4 , Figure 4 FIG. 5 shows a schematic diagram of a specific implementation flow of S11 in the data processing method provided in the embodiment of the present application. Figure 4 As shown, in one embodiment of the present application, the above S11 may include the following steps:
[0080] S41: Obtain a configuration file.
[0081] S42: configuring data processing resources for each computing unit according to the configuration file.
[0082] In an embodiment of the present application, the above-mentioned data processing system can configure data processing resources for each computing unit based on a configuration file.
[0083] It should be noted that the above-mentioned configuration file can be pre-saved in the data processing system, and the configuration file contains relevant information of the computing unit that needs to configure data processing resources. The above-mentioned relevant information may include the name of the computing unit, the priority of the computing unit, and the data processing resources to be allocated to the computing unit. The data processing system can obtain these relevant information when reading the configuration file, and then allocate data processing resources to each computing unit based on these relevant information.
[0084] For example, assume that the configuration file contains two computing units: a current price computing unit and a trend change curve computing unit. The current price computing unit has a first priority level, while the trend change curve computing unit has a second priority level. The current price computing unit is allocated four CPUs for data processing, while the trend change curve computing unit is allocated two CPUs for data processing. After determining the number of data processing resources for each computing unit, the data processing system can initialize and configure the computing units, thereby allocating the data processing resources to the corresponding computing units. Specifically, the system allocates four CPUs to the current price computing unit and two CPUs to the trend change curve computing unit.
[0085] In specific applications, the data processing system can initialize the data processing resources according to the number of data processing resources. Specifically, each data processing resource can be configured into a data processing unit. For example, when the data processing system initializes the current price calculation unit, the data processing resources can be divided into 4 parts, 4 data processing units can be set up, and a data processing resource (i.e., a CPU) can be allocated to each data processing unit. The 4 data processing units can be marked as data processing unit 0, data processing unit 1, data processing unit 2, and data processing unit 3 respectively.
[0086] As another example, when the data processing system initializes the trend change curve calculation unit, the data processing resources can be divided into two parts, two data processing units can be set up, and one data processing resource can be allocated to each data processing unit. The two data processing units can be marked as data processing unit 0 and data processing unit 1.
[0087] S12: When a data packet is received, the data packet is simultaneously sent to each computing unit in the first-layer computing module for calculation, and the calculation results output by each computing unit are obtained; and the calculation results are returned in real time.
[0088] In the embodiment of the present application, the above-mentioned data packet is sent by the transaction terminal on the client side, and the above-mentioned data packet may include relevant information of the target object, such as the identification code of the target object.
[0089] In a specific implementation, when the data processing system receives a data packet sent by the transaction terminal, it will simultaneously send the data packet to each computing unit in the first-layer computing module for calculation.
[0090] Here, the computing unit included in the above-mentioned first-layer computing module refers to a computing unit that can output the computing results required by the user without relying on the computing results of other computing units. When the first-layer computing module contains multiple computing units, after the data processing system receives the data packet sent by the transaction terminal, it will simultaneously send the data packet to these computing units for data processing and calculation.
[0091] For example, assuming that the first-layer calculation module includes four calculation units, namely, a current price calculation unit, a current gear calculation unit, a transaction price calculation unit, and a trend change calculation unit, when the data processing system receives a data packet sent by the trading terminal, it will simultaneously send the received data packet to the current price calculation unit, the current gear calculation unit, the transaction price calculation unit, and the trend change calculation unit. The current price calculation unit calculates the real-time price of the target object based on the data packet, and sends the calculated real-time price of the target object to the trading terminal in real time; the current gear calculation unit determines the gear of the target object based on the data packet, and sends the calculated gear of the target object to the trading terminal in real time; the transaction price calculation unit determines the transaction price of each transaction based on the data packet, and sends the calculated transaction price of each transaction to the trading terminal in real time; the trend change curve calculation unit determines the trend change of the target object based on the data packet, and sends the obtained trend change of the target object to the trading terminal in real time.
[0092] By processing and calculating data packets in parallel, different computing units can calculate different calculation results, and the calculation results of each computing unit can be output to the transaction terminal in parallel, effectively reducing the user's waiting time.
[0093] See also Figure 5 , Figure 5 FIG. 5 shows a schematic diagram of a specific implementation flow of S12 in the data processing method provided in the embodiment of the present application. Figure 5 As shown, the above S12 may include the following steps:
[0094] S51: When a data packet is received, a random natural number is generated;
[0095] S52: Determine a target data processing unit of a computing unit according to the random natural number;
[0096] S53: Distribute the data packet to the target data processing unit for processing.
[0097] In an embodiment of the present application, it has been introduced in S11 that each calculation unit includes N data processing units allocated with data processing resources. For example, the current price calculation unit includes four data processing units, namely data processing unit 0, data processing unit 1, data processing unit 2, and data processing unit 3. When performing calculations, the current price calculation unit needs to first determine which data processing unit to send the data packet to for processing, and then distribute the data.
[0098] In this embodiment, the target data processing unit (i.e., the distribution object) can be determined by generating random natural data. For example, taking the current price calculation unit as an example, when the current price calculation unit receives a data packet, it generates a random natural number (which can be implemented by calling a random natural data generation function). For example, the generated random natural number is 14098. The random natural number is modulo 4 to obtain 2, which determines that the target data processing unit is data processing unit 2. Then, the data packet is sent to data processing unit 2 for processing and calculation.
[0099] See also Figure 6 , Figure 6 FIG. 2 shows another implementation flow diagram of S12 in the data processing method provided in the embodiment of the present application. Figure 6 As shown, the above S12 may include the following steps:
[0100] S61: When a data packet is received, the data packet is parsed to obtain an identification code of the target object;
[0101] S62: Determine a target data processing unit of the computing unit according to the identification code of the target object;
[0102] S63: Distribute the data packet to the target data processing unit for processing.
[0103] In an embodiment of the present application, the process of determining the target data processing unit based on the identification code of the target object can be to obtain a hash value of the identification code of the target object, then take the hash value modulo 4, and then obtain the corresponding numerical value, and determine the data processing unit with the same numerical value as the target data processing unit.
[0104] In a specific implementation, when the data processing system receives a data packet, it can first parse the data packet to obtain the data in the data packet. After that, the data processing system will send the data in the data packet to each calculation unit. Here, taking the current price calculation unit as an example, when the current price calculation unit receives the data, the current price calculation unit will determine the identification code of the target object based on the identification code field of the target object contained in the data. For example, if the identification code obtained is "600000", the current price calculation unit will take the hash value of "600000". Assuming that the hash value obtained is 29281922, 29281922 is modulo 4 to obtain 2, then the target data processing unit is determined to be data processing unit 2, and then the data is sent to data processing unit 2 for processing and calculation.
[0105] It should be noted that the above operation of determining the identification code of the target object based on the field containing the identification code of the target object in the data may also be performed by a data processing system, and this embodiment does not impose any limitation on this.
[0106] It should also be noted that when the first-layer computing module of the above-mentioned data processing system contains multiple computing units, each computing unit will perform data processing synchronously. For example, the first-layer computing module contains a current price calculation unit and a trend change curve calculation unit. The above description only describes in detail the data distribution during the data calculation process of the current price calculation unit. At the same time, the trend change curve calculation unit will also determine its corresponding target data processing unit based on the data packet, and then send the financial data / data packet to the corresponding target data processing unit for processing, and immediately send the calculated results to the transaction terminal. The two computing units will not affect each other.
[0107] As can be seen from the above, the data processing method provided by the embodiments of the present application can allocate data processing resources to each computing unit based on its priority, rationally utilize data processing resources, and improve system resource utilization. Furthermore, multiple computing units can simultaneously process financial data and transmit calculation results back in real time, thereby improving data processing efficiency and reducing latency. This solves the problem of current data processing processes being time-consuming and unable to effectively utilize data processing resources, resulting in resource waste.
[0108] See also Figure 7 , Figure 7 FIG. 1 shows a schematic diagram of an implementation flow of another data processing method provided in an embodiment of the present application, such as Figure 7 As shown, different from Figure 3 In the embodiment shown, the data processing method provided in the embodiment of the present application further includes, after S11:
[0109] As an embodiment, after step S12, step S13 is further included, specifically:
[0110] S13: If there is an M+1-th layer computing module, the calculation result calculated by the calculation unit in the M-th layer computing module is sent to the calculation unit in the M+1-th layer computing module, and the calculation unit in the M+1-th layer computing module calculates the calculation result calculated by the calculation unit in the M-th layer computing module to obtain the calculation result, and returns the calculation result in real time.
[0111] Wherein, M is a positive integer greater than or equal to 1.
[0112] In an embodiment of the present application, the calculation result of the calculation unit in the M+1th layer calculation module needs to depend on the calculation result of a calculation unit in the Mth layer calculation module. For example, the price statistics result of the price statistics unit needs to depend on the current price calculated by the current price calculation unit. Then, after the current price calculation unit calculates the current price, it will not only send the calculated current price to the client, but also send the calculation result to the price statistics unit at the same time. The price statistics unit determines the corresponding price statistics result based on the current price, and then returns the price statistics result to the client.
[0113] From the above, it can be seen that through the tree-like computing unit architecture, when calculating data packets, the coupling degree of each computing unit in the data processing system can be reduced to the greatest extent, effectively improving the timeliness of the data processing system in data calculation, reducing the user's waiting time, and being able to reasonably utilize the data processing resources of the data processing system and reduce the waste of data processing resources of the data processing system.
[0114] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0115] Corresponding to a data processing method described in the above embodiment, Figure 8 The structural block diagram of the data processing system provided by an embodiment of the present application is shown. For the sake of convenience, only the parts related to the embodiment of the present application are shown. Figure 8 The data processing system 80 includes: a configuration unit 81 and a processing unit 82.
[0116] The configuration unit 81 is used to configure data processing resources according to the priority of each computing unit.
[0117] The processing unit 82 is used to send the data packet to each computing unit in the first-layer computing module for calculation when the data packet is received, obtain the calculation results output by each computing unit, and return the calculation results in real time.
[0118] In one embodiment of the present application, the data processing system 80 further includes a priority setting unit.
[0119] The priority setting unit is used to set the priority of each calculation unit according to the user's real-time requirements for the calculation results.
[0120] In one embodiment of the present application, the configuration unit 81 specifically includes: an acquisition unit and an allocation unit.
[0121] The acquisition unit is used to obtain the configuration file;
[0122] The allocation unit is used to configure data processing resources for each computing unit according to the configuration file.
[0123] In one embodiment of the present application, the processing unit 82 specifically includes: a random number generation unit, a first target determination unit, and a first distribution unit.
[0124] The random number generation unit is used to generate a random natural number when receiving a data packet;
[0125] The first target determination unit is used to determine the target data processing unit of the calculation unit according to the random natural number;
[0126] The first distribution unit is used to distribute the data packet to the target data processing unit for processing.
[0127] In one embodiment of the present application, the processing unit 82 specifically includes: an identification unit, a second target determination unit, and a second distribution unit.
[0128] The identification unit is used to parse the data packet when receiving the data packet to obtain the identification code of the target object;
[0129] The second target determination unit is used to determine the target data processing unit of the calculation unit according to the identification code of the target object;
[0130] The second distribution unit is used to distribute the data packet to the target data processing unit for processing.
[0131] In one embodiment of the present application, the above-mentioned processing unit 82 is also used to send the calculation result calculated by the calculation unit in the M-th layer calculation module to the calculation unit in the M+1-th layer calculation module if there is an M+1-th layer calculation module, and the calculation unit in the M+1-th layer calculation module calculates the calculation result calculated by the calculation unit in the M-th layer calculation module to obtain the calculation result, and returns the calculation result in real time, where M is a positive integer greater than or equal to 1.
[0132] As can be seen from the above, the data processing system provided by the embodiments of the present application can allocate data processing resources to each computing unit based on its priority, rationally utilize data processing resources, and improve system resource utilization. Furthermore, multiple computing units can simultaneously process financial data and transmit calculation results back in real time, thereby improving data processing efficiency and reducing latency. This solves the problem of current data processing processes being time-consuming and unable to effectively utilize data processing resources, resulting in resource waste.
[0133] Figure 9 This is a schematic diagram of the structure of a terminal device provided in one embodiment of the present application. Figure 9 As shown, the terminal device 9 of this embodiment includes: at least one processor 90 ( Figure 9 Only one is shown in the figure) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, wherein the processor 90 implements the steps of any one of the above-mentioned data processing method embodiments when executing the computer program 92.
[0134] Those skilled in the art will understand that Figure 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0135] The processor 90 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0136] In some embodiments, the memory 91 may be an internal storage unit of the terminal device 9, such as a hard disk or memory of the terminal device 9. In other embodiments, the memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 9. Furthermore, the memory 91 may also include both an internal storage unit of the terminal device 9 and an external storage device. The memory 91 is used to store an operating system, application programs, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 may also be used to temporarily store data that has been output or is about to be output.
[0137] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned data processing method embodiments can be implemented.
[0138] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps of any of the above-mentioned data processing method embodiments when executing the computer program product.
[0139] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0140] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned data processing method embodiments can be implemented.
[0141] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps of any of the above-mentioned data processing method embodiments when executing the computer program product.
[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a first processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0143] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0144] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0145] In the embodiments provided in this application, it should be understood that the disclosed data processing systems and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0146] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0147] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: include: Set the priority of each calculation unit according to the user's real-time requirements for calculation results; Allocate data processing resources based on the priority of each computing unit; When a data packet is received, the data packet is simultaneously sent to each computing unit in the first layer computing module for calculation, and the calculation results output by each computing unit are obtained; And return the calculation results in real time; The data packet is sent by the transaction terminal on the client side, and the data packet is processed and calculated in a parallel manner. Different calculation units can calculate different calculation results, and the calculation results of each calculation unit are output to the transaction terminal in parallel. The calculation results of each calculation unit in the first-layer calculation module do not need to depend on the calculation results of other calculation units.
2. The data processing method according to claim 1, wherein: The configuring of data processing resources according to the priority of each computing unit includes: Get the configuration file; Data processing resources are configured for each computing unit according to the configuration file.
3. The data processing method according to claim 1, wherein: When a data packet is received, the data packet is simultaneously sent to each computing unit in the first layer computing module for computing, and a computing result output by each computing unit is obtained; And return the calculation results in real time, including: When a data packet is received, a random natural number is generated; determining a target data processing unit of a computing unit according to the random natural number; The data packet is distributed to the target data processing unit for processing.
4. The data processing method according to claim 1, wherein: When a data packet is received, the data packet is simultaneously sent to each computing unit in the first layer computing module for computing, and a computing result output by each computing unit is obtained; And return the calculation results in real time, including: When a data packet is received, the data packet is parsed to obtain an identification code of the target object; determining a target data processing unit of a computing unit according to an identification code of the target object; The data packet is distributed to the target data processing unit for processing.
5. The data processing method according to any one of claims 1 to 4, characterized in that: When a data packet is received, the data packet is simultaneously sent to each computing unit in the first layer computing module for calculation, and the calculation results output by each computing unit are obtained; After returning the calculation results in real time, it also includes: If there is an M+1th layer computing module, the calculation result calculated by the calculation unit in the Mth layer computing module is sent to the calculation unit in the M+1th layer computing module, and the calculation unit in the M+1th layer computing module calculates the calculation result calculated by the calculation unit in the Mth layer computing module to obtain the calculation result, and returns the calculation result in real time, where M is a positive integer greater than or equal to 1.
6. A data processing system, characterized in that: The data processing system includes N layers of computing modules, each layer of computing modules includes a plurality of computing units, and the computing results of the computing units in each layer of computing modules are independent of each other; the computing results of the computing units in the M+1th layer of computing modules depend on the computing results output by the computing units in the Mth layer of computing modules; The data processing system configures data processing resources corresponding to the priority level for each computing unit according to the priority level of each computing unit; The priority of each calculation unit is set according to the user's real-time requirements for the calculation results; The data packet is sent by the transaction terminal on the client side, and the several computing units included in each layer of computing module process and calculate the data packet in a parallel manner. The different computing units included in the M-th layer computing module can calculate different calculation results, and the calculation results of each computing unit are output in parallel to the transaction terminal and the computing units in the M+1-th layer computing module. The calculation results of each computing unit in the first layer computing module do not need to depend on the calculation results of other computing units.
7. A data processing system, characterized in that: include: A priority setting unit is used to set the priority of each calculation unit according to the user's real-time requirements for calculation results; A configuration unit, configured to configure data processing resources according to the priority of each computing unit; The processing unit is configured to, upon receiving a data packet, simultaneously send the data packet to each computing unit in the first-layer computing module for computing, and obtain computing results output by each computing unit; And return the calculation results in real time; In which, the data packet is sent by the transaction terminal on the client side, and the data packet is processed and calculated in a parallel manner. Different calculation units can calculate different calculation results, and the calculation results of each calculation unit are output to the transaction terminal in parallel. The calculation results of each calculation unit in the first-layer calculation module do not need to depend on the calculation results of other calculation units.
8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the data processing method according to any one of claims 1 to 5 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Rail traffic train operating control system based on cloud computing
CN110027596A
Data processing system and method, computer equipment and readable storage medium
CN110209506A
Multi-user multi-priority distributed cooperative processing method based on cloud computing
CN111367630A