A real-time data processing method based on microservices and related equipment
Through the microservice-based architecture, the problem of low efficiency in real-time data processing of ETF transactions under C/S mode is solved, high concurrency and fast update real-time data processing capabilities are achieved, and the data processing efficiency and flexibility of ETF transactions are improved.
Patent Information
- Application Number
- CN201910595267.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-03
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-07-03
AI Technical Summary
The existing C/S model cannot handle the data processing of a large number of clients in real-time data processing of ETF transactions, resulting in low efficiency, difficulty in updating client applications, and the inability to respond to multi-user concurrent operations in real time.
Adopting a microservice-based architecture, by receiving real-time data processing requests, obtaining and deploying microservice instances based on category information, forming a microservice cluster, and dynamically updating microservice instances to cope with high concurrency and business changes.
It improves the concurrency capability of real-time data processing for ETF transactions, realizes massive data processing, improves processing efficiency, and supports rapid update iterations to ensure the flexibility and real-time updates of real-time data processing.
Smart Images

Figure CN110489139B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention belong to the field of cloud technology, and in particular, relate to a real-time data processing method, device, computer equipment, and computer-readable storage medium based on microservices. Background Art
[0002] At present, for the processing of real-time data such as ETF (Exchange Traded Funds) transactions, the industry adopts the C / S mode application to operate. This mode requires the installation of applications on the user side, and the applications are separated from the server side. The operations related to real-time data processing are mainly completed in the client application, and the application and the server mainly interact with each other. This mode is generally established on a dedicated local area network, and data exchange is achieved between local area networks through a dedicated server. Affected by the network bandwidth and the client's local operating system, the C / S mode cannot carry the processing of a large number of clients' real-time data. At the same time, the server responds to the client's processing requests one by one, which results in the server being unable to perform multi-user operations in parallel when multiple users are operating concurrently, affecting the efficiency of real-time data processing. In addition, when the ETF business changes, the client application needs to be updated. At this time, the workload of updating all client applications is large, and it cannot be updated in real time. Summary of the invention
[0003] In view of this, the embodiments of the present invention provide a real-time data processing method, apparatus, computer equipment, and storage medium based on microservices to solve the problem that the existing ETF transaction type real-time data processing is unable to carry the real-time data processing of a large number of clients when the application is operated in C / S mode, thereby affecting the real-time data processing efficiency.
[0004] In a first aspect, an embodiment of the present invention provides a real-time data processing method based on microservices, comprising:
[0005] receiving at least one real-time data processing request, wherein the real-time data processing request includes category information to which the real-time data belongs;
[0006] According to the category information to which the real-time data belongs, multiple microservice instances for processing the real-time data processing request are acquired to form a microservice cluster;
[0007] Running multiple microservice instances in the microservice cluster to perform real-time data processing operations and output operation results.
[0008] As an implementable manner of the present invention, acquiring multiple microservice instances for processing the real-time data processing request according to the category information to which the real-time data belongs includes:
[0009] Access an address management center, obtain category information and a network address mapping table from the address management center, obtain corresponding network address information from the category information and the network address mapping table according to the category information to which the real-time data belongs, and obtain a microservice instance for processing the real-time data processing request according to the obtained network address information.
[0010] As an exemplified embodiment of the present invention, before receiving at least one real-time data processing request, the method further includes:
[0011] Acquire category information to which preset real-time data belongs, and determine operations to be performed when processing real-time data according to the category information to which the preset real-time data belongs, so as to deploy multiple microservices for implementing different operations in a preset cloud server;
[0012] At least one microservice instance is generated for each of the microservices, and the microservice instances include at least one category microservice instance for processing real-time data of a specific category.
[0013] As an exemplified manner of the present invention, after receiving at least one real-time data processing request, the method further includes:
[0014] Classifying the received real-time data processing request according to the category information to which the real-time data in the real-time data processing request belongs;
[0015] Get information about the number of real-time data processing requests in each category;
[0016] According to the quantity information, different quantities of the microservice instances are obtained for each category of real-time data processing requests, and system resources with different proportions are allocated.
[0017] As an exemplified embodiment of the present invention, the method further comprises:
[0018] Continuously receive real-time data processing requests;
[0019] When the number of real-time data processing requests received within a preset time period exceeds a preset threshold, determining the number exceeding the preset threshold, which is recorded as an excess amount;
[0020] According to the category information corresponding to the continuously received real-time data processing requests and the excess amount, confirming the type and quantity of new microservice instances to be added in the microservice cluster to update the microservice cluster;
[0021] According to the order in which the real-time data processing requests are received, the updated microservice instances in the microservice cluster are called in a polling manner.
[0022] As an exemplified embodiment of the present invention, after deploying a plurality of microservices for implementing different functions in a preset cloud server, the method further includes:
[0023] Dynamically update at least one microservice deployed in the cloud server.
[0024] As an implementable manner of the present invention, the dynamically updating at least one microservice deployed in the cloud server includes:
[0025] When there are more than two microservice instances of the microservice to be updated in the microservice cluster, and there is at least one idle microservice instance, the idle microservice instance is updated, and after the update, the real-time data processing operation currently executed by the non-updated microservice instance is transferred to the updated microservice instance to obtain a new idle microservice instance, and then the new idle microservice instance is updated, and so on until the microservice instance in the microservice cluster is completely updated;
[0026] When there is no idle microservice instance in the microservice cluster for the microservice to be updated, the microservice to be updated is determined, and the update content of the microservice to be updated is obtained, a preset number of new microservice instances are generated based on the microservice to be updated and the update content, and the new microservice instances are added to the microservice cluster, and the real-time data processing operations currently executed by the unupdated microservice instances in the microservice cluster are transferred to the newly generated microservice instances to obtain idle microservice instances, and then the idle microservice instances are updated, and so on until the microservice instances in the microservice cluster are completely updated.
[0027] In a second aspect, an embodiment of the present invention provides a real-time data processing device based on microservices, comprising:
[0028] A request receiving unit, configured to receive at least one real-time data processing request, wherein the real-time data processing request includes category information to which the real-time data belongs;
[0029] A microservice acquisition unit, configured to acquire, according to the category information to which the real-time data belongs, a plurality of microservice instances for processing the real-time data processing request, so as to form a microservice cluster;
[0030] A control unit is used to control the operation of multiple microservice instances in the microservice cluster to perform real-time data processing operations and output operation results.
[0031] In a third aspect, an embodiment of the present invention provides a computer device, including:
[0032] at least one processor; and,
[0033] a memory communicatively connected to the at least one processor; wherein,
[0034] The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor is enabled to perform the steps of the microservice-based real-time data processing method as described above.
[0035] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by at least one processor, the steps of the microservice-based real-time data processing method as described above are implemented.
[0036] According to the microservice-based real-time data processing method, device, computer equipment, and storage medium provided in the embodiments of the present invention, microservices are deployed based on cloud technology, and real-time data processing is performed through a microservice architecture. This can improve the ability to concurrently process real-time data such as ETF transactions, enable the processing of massive amounts of data, and effectively improve the efficiency of real-time data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the scheme of the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 A flowchart of a real-time data processing method based on microservices provided in an embodiment of the present invention;
[0039] Figure 2 A flowchart of deploying microservices provided in an embodiment of the present invention;
[0040] Figure 3 A flow chart of classifying and processing real-time data processing requests according to an embodiment of the present invention;
[0041] Figure 4 A structural block diagram of a microservice-based real-time data processing device provided in an embodiment of the present invention;
[0042] Figure 5 Another structural block diagram of a microservice-based real-time data processing device provided in an embodiment of the present invention;
[0043] Figure 6 A structural block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the technical staff of this technical field better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Unless otherwise defined, all technical and scientific terms used in this article have the same meaning as those commonly understood by the technical staff of the technical field of the present invention.
[0045] The phrase "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0046] The embodiment of the present invention provides a real-time data processing method based on microservices, such as Figure 1 As shown, the real-time data processing method based on microservices includes:
[0047] S1. Receive at least one real-time data processing request, where the real-time data processing request includes category information to which the real-time data belongs;
[0048] S2. Acquire multiple microservice instances for processing the real-time data processing request according to the category information to which the real-time data belongs, so as to form a microservice cluster;
[0049] S3. Run the multiple microservice instances in the microservice cluster to perform real-time data processing operations and output operation results.
[0050] Among them, the real-time data processing request in the above steps is initiated by users of different clients, and multiple microservice instances can be generated by different microservices, and multiple microservice instances have a collaborative and / or dependent relationship, and cooperate with each other to realize the real-time data processing operation. When the above method is applied to ETF trading, when conducting ETF trading, the client will initiate an ETF trading request containing real-time data to be processed, that is, the real-time data processing request. Correspondingly, the category information to which the real-time data belongs corresponds to the ETF category information. Performing a real-time data processing operation is corresponding to performing an ETF trading operation, and the output operation result is the trading operation result.
[0051] As an exemplified manner of the present invention, before receiving at least one real-time data processing request, the method further includes a step of deploying microservices, specifically, Figure 2 As shown, the steps of deploying microservices include:
[0052] S01. Obtain category information to which preset real-time data belongs, and determine the operations to be performed when processing real-time data according to the category information to which the preset real-time data belongs, so as to deploy multiple microservices for implementing different operations in a preset cloud server; different microservices implement different operations, that is, implement different functions.
[0053] S02. Generate at least one microservice instance for each of the microservices, wherein the microservice instances include at least one category microservice instance for processing real-time data of a specific category.
[0054] In the embodiment of the present invention, the multiple microservices deployed in the preset cloud server can be divided into two categories, namely, microservices that have interface interaction with users and microservices that do not have interface interaction with users. The microservices that have interface interaction with users can be used to connect the user end and the cloud server. In this embodiment, they can be called public microservices. Specifically, when the method provided in the embodiment of the present invention is applied to ETF trading, the category microservice instance corresponds to a specific ETF category. At this time, each public microservice corresponds to an ETF category, and the generated microservice instance is a category microservice instance for processing transactions of the corresponding ETF category, such as a single-market treasury bond ETF microservice instance, a single-market stock microservice instance, a cross-market stock microservice instance, etc. In some embodiments, the deployment of the microservice can also be based on location information, and targeted deployment is carried out for users in different regions. Taking ETF trading as an example, for example, the aforementioned single-market treasury bond ETF microservice, single-market stock microservice, cross-market stock microservice, etc. can be deployed for Shanghai and Shenzhen respectively; according to the characteristics of the microservice architecture, multiple public microservices corresponding to multiple ETF categories will be isolated from each other and will not affect each other. The microservices that do not interact with the user through an interface belong to the cloud server and can be called private microservices. Private microservices can provide functional services for public microservices, such as microservices with control functions and microservices with functions for managing public microservices.
[0055] In this embodiment, the microservice can be deployed in a physical server or a virtual server; specifically, multiple microservice instances generated by the same microservice can be distributed in a single or multiple cloud servers, and different types of microservice instances generated by different types of microservices can also be distributed in a single or multiple cloud servers. In a specific embodiment, the microservice instances can be distributed in a specific cloud server according to category, such as a group of cloud servers running private microservice instances and another group of cloud servers running public microservice instances; in other embodiments, the microservice instances can also be distributed in a specific cloud server according to user type. Taking ETF trading as an example, for example, users can include individual users or company users who invest in ETF trading, company users who issue ETFs, company users who provide ETF trading management, etc. The microservices called by each type of user when performing operations can be deployed in different cloud servers respectively; the classified deployment method can facilitate the management of microservices, and at the same time, it is beneficial to improve the calling efficiency of microservice instances, which helps to improve the processing efficiency of ETF transactions.
[0056] As an exemplified embodiment of the present invention, after receiving at least one real-time data processing request, Figure 3 As shown, the method also includes:
[0057] S31, classifying the received real-time data processing request according to the category information to which the real-time data in the real-time data processing request belongs;
[0058] S32, obtaining quantity information of real-time data processing requests in each category;
[0059] S33. Obtain different numbers of the microservice instances for each category of real-time data processing requests according to the quantity information, and allocate system resources with different proportions.
[0060] Taking ETF trading as an example, for example, the multiple real-time data processing requests received are classified into two different ETF categories, and the number of real-time data processing requests for each ETF category can be obtained. Different numbers of microservice instances are generated for the two types of real-time data processing requests, and different proportions of system resources are allocated to achieve balanced resource configuration, ensuring that the received real-time data processing requests can be quickly matched to the corresponding microservice instances. At the same time, the microservice instances that process the real-time data processing requests can match sufficient system resources to meet the requirements of multi-user concurrent operations and provide fast response when multiple users operate concurrently.
[0061] In some embodiments, after receiving a real-time data processing request, a step of determining the source of the real-time data processing request may also be included. Specifically, source identification may be achieved based on the IP address of the region where the client is located. After determining the source, the above steps S31 to S33 are performed on the real-time data processing requests from the same source. Source identification is performed before classification. More microservice instances and system resources may be configured for regions with a large number of real-time data processing requests to meet the requirements of concurrent operations of multiple users.
[0062] As an implementable manner of the present invention, the method also includes: continuously receiving real-time data processing requests, and when the number of real-time data processing requests received within a preset time period exceeds a preset threshold, determining the number exceeding the preset threshold, and recording it as the excess amount; based on the category information corresponding to the continuously received real-time data processing requests and the excess amount, confirming the type and number of new microservice instances added to the microservice cluster to update the microservice cluster; and calling the updated microservice instances in the microservice cluster in a polling manner according to the order in which each real-time data processing request is received.
[0063] Specifically, there is a situation where multiple users perform real-time data processing operations at the same time. At this time, multiple real-time data processing requests will be received. Multiple real-time data processing requests may call microservice instances with the same function. If the real-time data processing requests received per unit time exceed the preset threshold, there will be a delay in responding to the real-time data processing requests or the request cannot be processed. At this time, according to the category information corresponding to the continuously received real-time data processing requests, and according to the number of continuously received real-time data processing requests that exceed the preset threshold within a preset time period, the type and number of microservice instances to be added are determined respectively to meet the requirements of multi-user concurrent operations and provide a fast response when multiple users operate concurrently. Among them, the number of microservice instances to be added can also be determined in combination with the processing efficiency of each microservice instance processing a data processing request; at the same time, load balancing is achieved by calling multiple microservice instances with the same function one by one for multiple real-time data processing requests in the order of receipt. Taking ETF trading as an example, for example, real-time data processing request 1, real-time data processing request 2, ..., real-time data processing request N are received, and at the same time, these N transaction requests all need to call the payment microservice, and there are three microservice instances generated by the payment microservice in the existing microservice cluster, namely, payment microservice instance 1, payment microservice instance 2, and payment microservice instance 3. At this time, if the number of real-time data processing requests received within a preset time period exceeds a preset threshold, a new payment microservice instance needs to be added. Assume that it is now determined to add two payment microservice instances based on the excess amount and / or the processing efficiency of a single payment microservice instance. They are payment microservice instance 4 and payment microservice instance 5 respectively. After the addition is completed, the payment microservice instance is called in a polling manner, such as real-time data processing request 1 calls payment microservice instance 1, real-time data processing request 2 calls payment microservice instance 2, real-time data processing request 3 calls payment microservice instance 3, real-time data processing request 4 calls payment microservice instance 4, real-time data processing request 5 calls payment microservice instance 5, real-time data processing request 6 calls payment microservice instance 1 again, real-time data processing request 7 calls payment microservice instance 2 again, and so on, in turn, to cooperate in completing the ETF trading operation. Of course, in the process of continuously receiving real-time data processing requests, it may also be necessary to call microservice instances that do not exist in the microservice cluster. If the microservice instance required to process a request in the continuously received real-time data processing requests does not exist, the corresponding microservice instance can be added to the microservice cluster, and the number of increases can also be determined in conjunction with whether the number of requests exceeds the threshold.
[0064] As an exemplified embodiment of the present invention, the method further includes dynamically updating at least one microservice deployed in the cloud server; the updating process may occur in any working period of multiple microservice instances in the microservice cluster, such as when multiple microservice instances perform real-time data processing operations for a real-time data processing request, or before or after multiple microservice instances perform real-time data processing operations for a real-time data processing request. In this embodiment, updating the deployed microservices in the cloud server includes adding, deleting or modifying microservices, and modifying microservice instances in the microservice cluster. Taking ETF trading as an example, for example, when a new ETF category is launched, a microservice needs to be added, and when an ETF category is offline, a microservice needs to be deleted. If a business change occurs in the ETF category, the microservice needs to be modified based on the changed content. If there is a microservice instance for the microservice, the microservice processing ETF transaction and the corresponding microservice instance need to be adjusted and modified accordingly.
[0065] For the case where the operation of modifying a microservice is performed in real time without interrupting real-time data processing (such as the processing of transaction data of ETF transactions), in some embodiments, the dynamic update of at least one microservice deployed in the cloud server includes: determining the microservice to be updated, and when there are more than two microservice instances of the microservice to be updated in the microservice cluster, and there is at least one idle microservice instance, updating the idle microservice instance, and after the update, transferring the real-time data processing operation currently executed by the unupdated microservice instance to the updated microservice instance, obtaining a new idle microservice instance, and then updating the new idle microservice instance, and so on until the microservice instance in the microservice cluster is updated. In this way, the modification and update of all microservice instances in the microservice cluster can be completed in sequence, thereby realizing the upgrade of microservices. Taking updating the payment microservice instance as an example, now it is necessary to modify the payment microservice instance to add a new payment method. Assuming that the existing microservice cluster includes payment microservice instance 1, payment microservice instance 2, and payment microservice instance 3, and payment microservice instance 1 and payment microservice instance 2 are performing real-time data processing, while payment microservice instance 3 is idle. At this time, the dynamic update process of the payment microservice deployed in the cloud server is: obtain the update content, and inject it into payment microservice instance 3 to complete the update of payment microservice instance 3, and then transfer the real-time data processing operation currently executed by payment microservice instance 1 to the updated payment microservice instance 3 to obtain the idle payment microservice instance 1. At this time, the payment microservice instance 1 can be updated with reference to the update method of payment microservice instance 3, and the payment microservice instance 2 can be updated by analogy.
[0066] In other embodiments, updating at least one microservice deployed in the cloud server includes: when there is no idle microservice instance of the microservice to be updated in the microservice cluster, determining the microservice to be updated, and obtaining update content of the microservice to be updated, generating a preset number of new microservice instances based on the microservice to be updated and the update content, and adding the new microservice instances to the microservice cluster, transferring the real-time data processing operations currently executed by the unupdated microservice instances in the microservice cluster to the newly generated microservice instances, and updating the idle microservice instances. Taking the update of the payment microservice instance as an example, the payment microservice instance needs to be modified to add a new payment method. Assuming that the existing microservice cluster includes payment microservice instance 1, payment microservice instance 2, and payment microservice instance 3, and payment microservice instance 1, payment microservice instance 2, and payment microservice instance 3 are all performing real-time data processing, the payment microservice image and update content can be obtained at this time to generate payment microservice instance 4. At this time, payment microservice instance 4 is an updated payment microservice instance and is in an idle state. At this time, the payment microservice deployed in the cloud server is The dynamic update process is: the real-time data processing operation currently executed by the payment microservice instance 1 is transferred to the updated payment microservice instance 4, and the idle payment microservice instance 1 is obtained. The update content is obtained and injected into the payment microservice instance 1 to complete the update of the payment microservice instance 1, and then the real-time data processing operation currently executed by the payment microservice instance 2 is transferred to the updated payment microservice instance 1, and the idle payment microservice instance 2 is obtained. At this time, the payment microservice instance 2 can be updated with reference to the update method of the payment microservice instance 1, and the payment microservice instance 3 is updated by analogy. Adopting the update scheme provided by the above embodiment, for the situation where there is a microservice instance providing a service during the update process, all microservices to be modified can be modified and upgraded without interrupting the real-time data processing operation, which helps to ensure the processing efficiency of real-time data. In a specific embodiment, the microservice instances to be modified can also be grouped, and modified and updated by group, which can improve the update efficiency of the microservice.
[0067] As an implementable method of the present invention, the multiple microservice instances for processing the real-time data processing request according to the category information to which the real-time data belongs include: accessing the address management center, obtaining the category information and the network address mapping table from the address management center, obtaining the corresponding network address information from the category information and the network address mapping table according to the category information to which the real-time data belongs, and obtaining the microservice instance for processing the real-time data processing request according to the obtained network address information. The category information and the network address mapping table can be referred to in the form of the following Table 1:
[0068] Category information 1 Network address information 1 Category information 2 Network address information 2 Category information 3 Network address information 3 Category information 4 Network address information 4
[0069] Table 1
[0070] In some embodiments, during the process of performing real-time data processing operations, when one of the microservice instances needs to call other microservice instances with a dependency relationship, and the microservice instance is not in the microservice cluster, it also includes the step of adding a new microservice instance in the microservice cluster. Specifically, the network address of the microservice instance to be added is requested from the address management center, and the microservice instance to be added is called according to the obtained network address.
[0071] In other embodiments, during the process of performing real-time data processing operations, when one of the microservice instances runs incorrectly, the step of replacing the incorrectly running microservice instance in the microservice cluster is also included. Specifically, a network address of other microservice instances having the same function as the incorrectly running microservice instance is requested from an address management center, and the microservice instance for replacement is called according to the obtained network address. At the same time, the network address of the incorrectly running microservice instance is deleted at the address management center, thereby deleting the incorrectly running microservice instance.
[0072] In an embodiment of the present invention, when deploying a plurality of microservices to realize different functions in the cloud server, it also includes a step of configuring the database corresponding to the microservice, wherein configuring the database may include adding a new database or updating the database. Taking ETF trading as an example, the process of updating the database includes: aggregating the ETF trading data on the trading day, updating the aggregated data to the database of the cloud server, and uploading the aggregated data to the external clearing center for accounting processing; receiving the final data after the external clearing center has calculated the aggregated data, comparing the final data with the data in the database of the cloud server, and if there is a difference between the two, correcting the data in the database of the cloud server according to the received final data to complete the database update. For example, reading the data file fed back by the clearing center, the data file may include fund roster, settlement details, brokerage stock exchange data, manager results, manager details, exchange details, business return files, account adjustment files and other information, checking and calculating the read file data with the data in the database of the cloud server, and adding or correcting the data in the database according to the result of the checking and calculation.
[0073] According to the real-time data processing method based on microservices provided by the embodiment of the present invention, microservices are deployed based on cloud technology, and real-time data processing based on microservices is performed through a microservice architecture, which can improve the ability of concurrent processing of real-time data, can realize the processing of massive data, and effectively improve the efficiency of real-time data processing. In addition, the deployment of microservices for real-time data processing is relatively flexible, can meet the requirements of rapid update and iteration, and can be updated in real time. For example, for ETF transactions using the above method, when the ETF business changes, the deployment of microservices for processing ETF transactions can be quickly updated and iterated, and can be updated in real time.
[0074] The embodiment of the present invention provides a real-time data processing device based on microservices, such as Figure 4 As shown, the device includes a request receiving unit 41, a microservice acquiring unit 42 and a control unit 43, wherein:
[0075] The request receiving unit 41 is used to receive at least one real-time data processing request, and the real-time data processing request includes the category information to which the real-time data belongs; the microservice acquisition unit 42 is used to acquire multiple microservice instances for processing the real-time data processing request according to the category information to which the real-time data belongs, so as to form a microservice cluster; the control unit 43 is used to control the operation of multiple microservice instances in the microservice cluster to perform real-time data processing operations and output operation results. When the device is applied to ETF trading, when performing ETF trading, the real-time data processing request corresponds to an ETF trading request including real-time data to be processed, and correspondingly, the category information to which the real-time data belongs corresponds to ETF category information, and performing real-time data processing operations is corresponding to performing ETF trading operations, and the output operation results are trading operation results.
[0076] Among them, the real-time data processing request is initiated by users of different clients, multiple microservice instances can be generated by different microservices, and the multiple microservice instances have a collaborative and / or dependent relationship and cooperate with each other to realize real-time data processing operations.
[0077] As an exemplified embodiment of the present invention, Figure 5As shown, the device further includes a microservice deployment unit 40, which is used to obtain the category information of the preset real-time data before the request receiving unit 41 receives at least one real-time data processing request, and determine the operation to be performed when processing the real-time data according to the category information of the preset real-time data, so as to deploy multiple microservices for implementing different operations in the preset cloud server, and generate at least one microservice instance for each microservice, and the microservice instance includes at least one category microservice instance for processing real-time data of a specific category. In this embodiment, the microservice can be deployed in a physical server or a virtual server. Specifically, multiple microservice instances generated by the same microservice can be distributed in a single or multiple cloud servers, and different categories of microservice instances generated by different types of microservices can also be distributed in a single or multiple cloud servers; in a specific embodiment, the microservice instances can be distributed in a specific cloud server according to the category, and the classified deployment method can facilitate the management of microservices, and at the same time, it is conducive to improving the calling efficiency of microservice instances, which helps to improve the processing efficiency of real-time data (such as real-time trading data in ETF trading). The types of microservices deployed by the microservice deployment unit 40 can refer to the relevant technical contents in the above method embodiments, which will not be expanded here.
[0078] As an exemplified embodiment of the present invention, Figure 5 As shown, the device also includes a resource configuration unit 44, and the resource configuration unit 44 is used to classify the received real-time data processing request according to the category information to which the real-time data in the real-time data processing request belongs after receiving at least one real-time data processing request, obtain the quantity information of the real-time data processing request in each category, obtain different numbers of the microservice instances for the real-time data processing requests in each category according to the quantity information, and allocate system resources with different proportions. In this way, balanced configuration of resources can be achieved, ensuring that the received real-time data processing request can be quickly matched to the corresponding microservice instance, and at the same time, the microservice instance processing the real-time data processing request can be matched to sufficient system resources to meet the requirements of multi-user concurrent operation and provide fast response when multi-user concurrent operation is performed. In some embodiments, the resource configuration unit 44 can also perform resource configuration based on the location area according to the source of the real-time data processing request, and the relevant description in the above method embodiment can be referred to for details.
[0079] As an implementable method of the present invention, the request receiving unit 41 is also used to continuously receive the real-time data processing request; the microservice acquisition unit 42 is also used to determine the number exceeding the preset threshold when the number of the real-time data processing requests received by the request receiving unit 41 within a preset time period exceeds the preset threshold, and record it as the excess amount; according to the category information corresponding to the continuously received real-time data processing request and the excess amount, confirm the type and number of new microservice instances added to the microservice cluster to update the microservice cluster; the control unit 43 is also used to call the updated microservice instance in the microservice cluster in a polling manner according to the order of receiving each real-time data processing request, thereby achieving responsible balancing. For specific content, please refer to the relevant content in the above embodiment, which will not be expanded here.
[0080] As an implementable method of the present invention, the microservice deployment unit 40 is also used to dynamically update at least one microservice deployed in the cloud server. The update process can occur in any working period of multiple microservice instances in the microservice cluster, such as when multiple microservice instances perform real-time data processing operations for a real-time data processing request, or before or after multiple microservice instances perform real-time data processing operations for a real-time data processing request. In this embodiment, updating the deployed microservices in the cloud server includes adding, deleting or modifying microservices, and modifying microservice instances in the microservice cluster.
[0081] In the case where the operation of modifying a microservice is performed in real time without interrupting ETF trading, in some embodiments, when the microservice deployment unit 40 dynamically updates at least one microservice deployed in the cloud server, it is specifically used to determine the microservice to be updated. When there are more than two microservice instances of the microservice to be updated in the microservice cluster, and there is at least one idle microservice instance, the idle microservice instance is updated, and after the update, the real-time data processing operation currently executed by the unupdated microservice instance is transferred to the updated microservice instance to obtain a new idle microservice instance, and then the new idle microservice instance is updated, and so on until the microservice instance in the microservice cluster is updated. In this way, the modification and update of all microservice instances in the microservice cluster can be completed in sequence, thereby realizing the upgrade of microservices.
[0082] In other embodiments, when the microservice deployment unit 40 dynamically updates at least one microservice deployed in the cloud server, it is specifically used to determine the microservice to be updated and obtain the update content of the microservice to be updated when there is no idle microservice instance of the microservice to be updated in the microservice cluster, generate a preset number of new microservice instances based on the microservice to be updated and the update content, add the new microservice instances to the microservice cluster, transfer the real-time data processing operations currently executed by the unupdated microservice instances in the microservice cluster to the newly generated microservice instances, obtain idle microservice instances, and then update the idle microservice instances, and so on until the microservice instances in the microservice cluster are updated.
[0083] The exemplary process of updating the microservice by the microservice deployment unit 40 in the embodiment of the present invention can refer to the relevant content in the above method embodiment, which will not be expanded here.
[0084] By adopting the update scheme provided in the above embodiment, if there are microservice instances providing services during the update process, all microservices to be modified can be modified and upgraded without interrupting ETF trading, which helps to ensure real-time data processing efficiency. In a specific embodiment, the microservice deployment unit 40 is also used to group the microservice instances to be modified, and modify and update them by group, which can improve the update efficiency of the microservices.
[0085] As an implementable manner of the present invention, the microservice acquisition unit 42 is specifically used to access the address management center when acquiring multiple microservice instances for processing the real-time data processing request according to the category information to which the real-time data belongs, and acquire the category information and the network address mapping table from the address management center, and acquire the corresponding network address information from the category information and the network address mapping table according to the category information to which the real-time data belongs, and acquire the microservice instance for processing the real-time data processing request according to the acquired network address information, wherein the category information and the network address mapping table can be referred to Table 1 above.
[0086] In some embodiments, during the process of the control unit 43 controlling the microservice instances to perform real-time data processing operations, when one of the microservice instances needs to call other microservice instances with dependencies, and the microservice instance is not in the microservice cluster, the microservice acquisition unit 42 is also used to add a new microservice instance to the microservice cluster, specifically to request the network address of the microservice instance to be added from the address management center, and call the microservice instance to be added according to the obtained network address.
[0087] In other embodiments, during the process in which the control unit 43 controls the microservice instances to perform real-time data processing operations, when one of the microservice instances runs incorrectly, the microservice acquisition unit 42 is also used to replace the incorrectly running microservice instance in the microservice cluster, and is specifically used to request the address management center for the network addresses of other microservice instances that have the same functions as the incorrectly running microservice instance, call the microservice instance for replacement according to the obtained network address, and at the same time delete the network address of the incorrectly running microservice instance at the address management center, thereby deleting the incorrectly running microservice instance.
[0088] In the embodiment of the present invention, Figure 5 As shown, the device also includes a database configuration unit 45, which is used to configure the database corresponding to the microservice when multiple microservices implementing different functions are deployed in the cloud server, wherein configuring the database may include adding a new database or updating the database, and the process of updating the database by the database configuration unit 45 can refer to the relevant content in the above embodiment, which will not be expanded here.
[0089] According to the real-time data processing device based on microservices provided by the embodiment of the present invention, microservices are deployed based on cloud technology, and real-time data processing based on microservices is performed by means of a microservice architecture, which can improve the concurrent processing capability of real-time data, can realize the processing of massive data, and effectively improve the efficiency of real-time data processing. In addition, the deployment of microservices for real-time data processing is relatively flexible, can meet the requirements of rapid update and iteration, and can be updated in real time. For example, for ETF transactions using the above method, when the ETF business changes, the deployment of microservices for processing ETF transactions can be quickly updated and iterated, and can be updated in real time.
[0090] The embodiment of the present invention also provides a computer device, such as Figure 6 As shown, the computer device includes at least one processor 61 and a memory 62 that is communicatively connected to the at least one processor 61. Figure 6 A processor 61 is shown in the figure, and the memory 62 stores instructions that can be executed by the at least one processor 61. The instructions are executed by the at least one processor 61 so that the at least one processor 61 can perform the steps of the real-time data processing method based on microservices as described above.
[0091] Specifically, the memory 62 in the embodiment of the present invention is a non-volatile computer-readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the microservice-based real-time data processing method in the above-mentioned embodiment of the present application; the processor 61 executes various functional applications and performs data processing by running the non-volatile software programs, instructions and modules stored in the memory 62, that is, implements the microservice-based real-time data processing method described in the above-mentioned method embodiment.
[0092] In some embodiments, the memory 62 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created during the processing of the real-time data processing method based on microservices, etc. In addition, the memory 62 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device;
[0093] In some embodiments, the memory 62 may optionally include remote memories that are remotely arranged relative to the processor 61. These remote memories may be connected to a computer device that performs domain name filtering processing via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0094] In the embodiment of the present invention, the computer device executing the real-time data processing method based on microservices may further include an input device 63 and an output device 64; wherein the input device 63 may obtain the operation information of the user on the computer device, and the output device 64 may include a display device such as a display screen. In the embodiment of the present invention, the processor 61, the memory 62, the input device 63 and the output device 64 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0095] The computer device provided according to the embodiment of the present invention can execute the steps of the real-time data processing method based on microservices in the above-mentioned embodiment when the processor 61 executes the code in the memory 62, and has the technical effect of the above-mentioned method embodiment. For technical details not fully described in this embodiment, please refer to the technical content provided in the method embodiment of this application.
[0096] An embodiment of the present invention further provides a computer-readable storage medium, on which computer-readable instructions are stored. When the computer-readable instructions are executed by at least one processor, the steps of the real-time data processing method based on microservices as described above can be implemented. When the steps of the method are executed, the technical effects of the above-mentioned method embodiment are achieved. For technical details not described in detail in this embodiment, please refer to the technical content provided in the method embodiment of this application.
[0097] The embodiment of the present invention also provides a computer program product, which can execute the real-time data processing method based on microservices provided in the method embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not described in detail in this embodiment, please refer to the technical content provided in the method embodiment of the present application.
[0098] It should be noted that the functional modules in the above embodiments of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0099] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or an intelligent terminal device or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0100] In the above embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation, for example, at least two modules or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0101] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on at least two network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0102] Obviously, the embodiments described above are only some embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are given in the accompanying drawings, but they do not limit the patent scope of the present invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to perform equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.
Claims
1. A real-time data processing method based on microservices, used for processing real-time data of ETF transactions, characterized in that: The method comprises: Obtaining the ETF category information to which the preset real-time data belongs, and determining the operation to be performed when processing the real-time data according to the preset ETF category information to which the preset real-time data belongs, so as to deploy multiple microservices for realizing different functions in the preset cloud server; Generate at least one microservice instance for each of the microservices, wherein the at least one microservice instance includes at least one category microservice instance for processing real-time data of a specific ETF category; receiving a real-time data processing request for at least one ETF transaction, wherein the real-time data processing request includes ETF category information to which the real-time data belongs; According to the ETF category information to which the real-time data belongs, a plurality of microservice instances for processing the real-time data processing request are obtained to form a microservice cluster, wherein the real-time data processing request is classified according to the ETF category information to which the real-time data belongs, and each category of real-time data processing request is respectively configured with a different number of the microservice instances according to its quantity information, and is allocated with system resources of different proportions, the microservice instance includes a public microservice instance for connecting the client and the cloud service end, and a private microservice instance for providing functional services for the public microservice instance, and the public microservice instance and the private microservice instance are respectively run on different cloud server groups; Running a plurality of the microservice instances in the microservice cluster to simultaneously perform real-time data processing operations for ETF transactions for various categories of ETF products, and outputting operation results; Wherein, the method further comprises: Continuously receive real-time data processing requests; When the number of real-time data processing requests received within a preset time period exceeds a preset threshold, determining the number exceeding the preset threshold, which is recorded as an excess amount; According to the ETF category information corresponding to the continuously received real-time data processing requests and the excess amount, confirm the type and quantity of new microservice instances added to the microservice cluster to update the microservice cluster; According to the order in which the real-time data processing requests are received, the updated microservice instances in the microservice cluster are called in a polling manner.
2. The real-time data processing method based on microservices according to claim 1 is characterized in that: The acquiring, according to the ETF category information to which the real-time data belongs, multiple microservice instances for processing the real-time data processing request comprises: Access the address management center, obtain category information and a network address mapping table from the address management center, obtain corresponding network address information from the category information and the network address mapping table according to the ETF category information to which the real-time data belongs, and obtain a microservice instance for processing the real-time data processing request according to the obtained network address information.
3. The real-time data processing method based on microservices according to claim 1 or 2, characterized in that: After deploying a plurality of microservices for implementing different functions in the preset cloud server, the method further includes: Dynamically update at least one microservice deployed in the cloud server.
4. The real-time data processing method based on microservices according to claim 3 is characterized in that: The dynamically updating at least one microservice deployed in the cloud server includes: When there are more than two microservice instances of the microservice to be updated in the microservice cluster, and there is at least one idle microservice instance, the idle microservice instance is updated, and after the update, the real-time data processing operation currently executed by the non-updated microservice instance is transferred to the updated microservice instance to obtain a new idle microservice instance, and then the new idle microservice instance is updated, and so on until the microservice instance in the microservice cluster is completely updated; When there is no idle microservice instance in the microservice cluster for the microservice to be updated, the microservice to be updated is determined, and the update content of the microservice to be updated is obtained, a preset number of new microservice instances are generated based on the microservice to be updated and the update content, and the new microservice instances are added to the microservice cluster, and the real-time data processing operations currently executed by the unupdated microservice instances in the microservice cluster are transferred to the newly generated microservice instances to obtain idle microservice instances, and then the idle microservice instances are updated, and so on until the microservice instances in the microservice cluster are completely updated.
5. A real-time data processing device based on microservices, used to implement the real-time data processing method based on microservices according to any one of claims 1 to 4, characterized in that: The device comprises: A request receiving unit, configured to receive at least one real-time data processing request, wherein the real-time data processing request includes ETF category information to which the real-time data belongs; A microservice acquisition unit, configured to acquire, according to the ETF category information to which the real-time data belongs, a plurality of microservice instances for processing the real-time data processing request, so as to form a microservice cluster; A control unit is used to control the operation of multiple microservice instances in the microservice cluster to perform real-time data processing operations and output operation results.
6. A computer device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. When the instructions are executed by the at least one processor, the at least one processor executes the real-time data processing method based on microservices as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by at least one processor, the real-time data processing method based on microservices according to any one of claims 1 to 4 is implemented.
