Asynchronous order data transmission method, system and device
By sorting and asynchronously dividing data request packets in terms of packaging time, waiting time and processing time, the problem of low efficiency of asynchronous order processing in the existing technology is solved, and more efficient data processing and system performance improvement are achieved.
Patent Information
- Application Number
- CN202410910094.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The existing technology has problems of low efficiency and inability to effectively optimize the data processing process when processing a large number of asynchronous order requests. In particular, performance decreases under high load conditions, and it fails to fully utilize the computing power and resource allocation mechanism of modern heterogeneous systems.
By calculating and sorting the packaging time, waiting time and processing time of the data request packet, the processing sequence is obtained, and asynchronous segmentation is performed according to the table directivity of the data request packet, and the processing sequence is optimized to improve efficiency.
It improves the efficiency of data request processing and the response speed of the database, optimizes the data processing process, and enhances the robustness and overall performance of the system.
Smart Images

Figure CN118503334B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of distributed big data processing, and specifically relates to an asynchronous order data transmission method, system and device. Background Art
[0002] The existing system is implemented by multiple microservices. When the number of user data requests suddenly increases, the distributed database system often has performance bottlenecks in one or more places. It is necessary to accept the user's request order first and then process it step by step. If problems such as network jitter are encountered during the processing, a retry mechanism is required, and the system needs to achieve data consistency in the end.
[0003] In previous engineering experience, a small functional program can be developed on the front end to quickly implement the collection, and then the underlying distribution system, payment system and other processing logic can be completed through the decoupling method of Kafka queue, and finally the collection operation can be completed. After that, the compensation program is started regularly to compensate and correct the data inconsistency. However, previous technologies usually only process data request packages according to simple rules or sequences, without comprehensive consideration of the packaging time, waiting time and processing time. They are only processed according to the order of data requests, and fail to effectively optimize the data processing process. Existing technologies often only focus on the data request package itself, while ignoring the correlation between data requests and the flux between data tables. When processing asynchronous requests, there may be inefficiency or inability to effectively handle the priority relationship between different requests, and it may not be possible to effectively distinguish the priorities between different requests.
[0004] In terms of the optimization and segmentation of the data request packet processing sequence, the existing technology often simply processes the data request packets in sequence, failing to fully utilize the computing power and resource allocation mechanism of modern heterogeneous systems. In addition, when processing a large number of order requests, the traditional technology fails to effectively segment and optimize the data request packets, resulting in a decrease in system performance under high load conditions. For example, the data consistency processing method, device, and system provided in the patent document with publication number CN105468718B fail to reasonably segment and optimize the request packets according to the characteristics and priority of the order, resulting in delays in the processing of some high-priority orders, affecting the real-time and stability of the system.
[0005] At the calculation and analysis level of data tables, traditional technologies can only provide simple statistical analysis when calculating and analyzing the flux of data tables, and fail to make full use of modern big data processing technologies and algorithms. Traditional technologies fail to effectively calculate and analyze the flux of data tables in real time, and fail to quickly discover data processing bottlenecks and bottleneck causes. For example, the method and computer-readable storage medium for analyzing the relationship between multiple data tables described in the patent document with publication number CN111143370B fail to use real-time data analysis technology to dynamically monitor and analyze the flux of data tables, resulting in the inability to timely discover data processing bottlenecks and take corresponding optimization measures.
[0006] For the optimization and processing of asynchronous processing sequences, previous technical solutions can only provide simple asynchronous processing mechanisms in terms of asynchronous processing sequences, and fail to fully utilize the advantages of modern message queues and event-driven. Sometimes, traditional technologies fail to provide effective optimization and processing mechanisms in terms of asynchronous processing sequences, and fail to meet the needs of large-scale asynchronous processing. For example, the system wake-up method for asynchronous sequence transmission mentioned in the patent document with publication number CN101114189B fails to fully utilize technologies such as message queues to optimize and manage asynchronous processing sequences, resulting in a decrease in system performance when processing large-scale asynchronous requests, and fails to meet the requirements of real-time and stability. Summary of the invention
[0007] The purpose of the present invention is to propose an asynchronous order data transmission method, system and device to solve one or more technical problems existing in the prior art and at least provide a beneficial choice or create conditions.
[0008] In order to achieve the above object, according to one aspect of the present invention, a method for asynchronous order data transmission is provided, the method comprising the following steps:
[0009] The data request packets are sorted by calculating the packing time, waiting time and processing time thereof to obtain a data request packet processing sequence;
[0010] For each data request packet in the data request packet processing sequence, according to the table directivity of the adjacent data request packet, the data request packet processing sequence is asynchronously divided to obtain a plurality of asynchronous division sequences;
[0011] The database processes the asynchronous segmentation sequence.
[0012] Furthermore, the data request packets are sorted by calculating their packaging time, waiting time and processing time to obtain a data request packet processing sequence, which is specifically:
[0013] Among them, the calculation according to its packing time, waiting time and processing time means: arranging the packing time of each data request packet in the order of time to obtain the ranking value of each data request packet, subtracting the ranking value of each data request packet from the total number of data request packets to obtain the ranking inverse value of each data request packet, and comparing the ranking inverse value of each data request packet with the total number of data request packets to obtain the percentage obtained as the ranking inverse value ratio of each data request packet; or, arranging the packing time of each data request packet in the order from the back to the front, directly obtaining the ranking inverse value of each data request packet, and then calculating the ranking inverse value ratio of each data request packet.
[0014] Preferably, the waiting time of each data request packet is added to obtain a total waiting time, and the ratio of the waiting time of each data request packet to the total waiting time is used as the waiting ratio factor of each data request packet.
[0015] Preferably, the processing time of each data request packet is added to obtain a total processing time, and the ratio of the processing time of each data request packet to the total processing time is used as the processing ratio factor of each data request packet.
[0016] Furthermore, the event packet processing index is calculated by subtracting the waiting ratio factor corresponding to the data request packet and the processing ratio factor from the sorting inverse ratio of each data request packet to obtain the event packet processing index of each data request packet.
[0017] The event packet processing index represents a numerical value that can be used to measure the inverse linear relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor and can be used to perform serial sorting for each data request packet.
[0018] In this way, firstly, according to the calculation of the packing time, the waiting time and the processing time, each data request packet is sorted using the event packet processing index of each data request packet to obtain a data request packet processing sequence: In some embodiments, the sequence obtained by sorting each data request packet according to the value of its event packet processing index from large to small is used as the data request packet processing sequence;
[0019] In some embodiments, each data request packet may be clustered according to the value of its event packet processing indicator to obtain several data request packet processing subsequences, and the data request packet processing subsequences may be sorted from large to small according to the average number of event packet processing indicators of the data request packets in each data request packet processing subsequence. The data request packet processing subsequences may then be concatenated according to the sorting results, and the resulting sequence may be used as the data request packet processing sequence.
[0020] Furthermore, each data request packet in the data request packet processing sequence is asynchronously segmented according to the table directivity of the adjacent data request packet, to obtain a plurality of asynchronous segmentation sequences, specifically:
[0021] Analyze each data request packet in the data request packet processing sequence: Analyze the tables in the database pointed to by each data request in each data request packet, and analyze whether there are common data items between the tables in the database pointed to by each data request through foreign keys and references.
[0022] An array consisting of the data packet fluxes of a data request in each data request packet of the data request packet processing sequence is used as the processing sequence flux of the data request, wherein the number of dimensions corresponds to the number of data request packets in the data request packet processing sequence.
[0023] In each data request packet, the processing sequence flux corresponding to each data request is compressed into a compressed processing sequence flux, and the dimension size of the compressed processing sequence flux is consistent with the processing sequence flux corresponding to each data request in the data request packet.
[0024] Furthermore, the database processes the asynchronous segmentation sequence as follows:
[0025] The similarity of the compression processing sequence flux corresponding to each data request packet with respect to the compression processing sequence flux corresponding to each data request packet in the data request packet processing sequence is calculated respectively as the flux similarity corresponding to the data request packet. In some embodiments, the cosine similarity calculation method is used to obtain the similarity of the compression processing sequence flux corresponding to each data request packet in the data request packet processing sequence.
[0026] If the flux similarities corresponding to two adjacent data request packets in the data request packet processing sequence are positive or negative, then an asynchronous split is required between the two adjacent data request packets with positive or negative flux similarities. Through several asynchronous splits, the data request packet processing sequence is split into several data request packet processing subsequences as asynchronous split sequences. It is found in many experiments that the use of cosine similarity is conducive to evenly distributing the flux similarities of each data request packet processing subsequence in the asynchronous split sequence for observation on the numerical distribution cycle of the trigonometric function. Such observation is very helpful in judging the data situation of each data request packet processing subsequence. First, the data request packet processing sequence is well sorted according to the calculation of its packaging time, waiting time and processing time to effectively divide the batch of data requests according to the importance. The following asynchronous split is more finely divided according to the connectivity of the data items in the numerous tables in the database. This is conducive to making priority data request judgment optimization for smaller-scale data sets. In addition, in similar calculations of data table flux in the past, there are paths of fully connected graphs of nodes of external links between tables for calculation. However, in practice, it is found that such calculations often perform full node traversal of tables used in the database in the underlying code, and in actual experiments, this often aggravates the server downtime. Therefore, the method described in the present invention is preferably used because the method does not perform too many full node traversal calculations on implicit, second-degree, and third-degree potentially overlapping tables, and only focuses on the flux similarity of each data request packet processing subsequence in the asynchronous segmentation sequence, and can run smoothly even when the computing memory is extremely limited.
[0027] The database responds to the obtained asynchronous segmentation sequence and performs synchronous or asynchronous processing.
[0028] Furthermore, the method for asynchronously processing the obtained asynchronous segmentation sequence is:
[0029] The cumulative sum of the flux similarities corresponding to the data request packets in each data request packet processing subsequence is accumulated respectively, and each data request packet processing subsequence is arranged from large to small according to the value of the cumulative sum of the flux similarities therein. The larger the value of the cumulative sum of the flux similarities is, the higher the priority is for processing.
[0030] The present invention also provides an asynchronous order data transmission system, the asynchronous order data transmission system comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor implementing the steps in the asynchronous order data transmission method when executing the computer program, the asynchronous order data transmission system can be run in computing devices such as desktop computers, notebook computers, PDAs, and cloud data centers, and the executable system may include, but is not limited to, a processor, a memory, and a server cluster, and the processor executing the computer program runs in the following system units:
[0031] A serialization unit, used to sort the data request packets by calculating the packing time, waiting time and processing time thereof, so as to obtain a data request packet processing sequence;
[0032] an asynchronous segmentation unit, configured to asynchronously segment each data request packet in the data request packet processing sequence according to the table directivity of the adjacent data request packet, to obtain a plurality of asynchronous segmentation sequences;
[0033] The distributed processing unit is used by the database to process asynchronous segmentation sequences.
[0034] Correspondingly, the present invention also provides an electronic device, a readable storage medium and a computer program product:
[0035] An electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the asynchronous order data transmission method and the steps therein.
[0036] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the asynchronous order data transmission method and the steps therein.
[0037] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the method for transmitting asynchronous order data and the steps thereof are implemented.
[0038] The beneficial effects of the present invention are as follows: the present invention provides an asynchronous order data transmission method, system and device, which optimizes and segments the processing sequence by sorting and segmenting the packaging time, waiting time and processing time of the data request packet, thereby improving the efficiency of data request processing. The method described in the present invention introduces the concept of data table flux, and performs similarity calculation and analysis based on the processing sequence flux of the data request packet, so as to better understand and process the relationship between the data request packets, thereby optimizing the data processing method and efficiency.
[0039] The method also proposes a processing method for asynchronous segmentation sequence, and realizes optimization and effective processing of asynchronous processing sequence by calculating flux similarity and cumulative sum, thereby improving the response speed and overall performance of the database. Thus, technical effects are achieved in the optimization of data request packet processing sequence, analysis of data table flux and processing of asynchronous processing sequence, and the processing efficiency and robustness of the database are improved. In the optimization and segmentation of data request packet processing sequence, traditional technology usually only processes data request packets according to simple rules or sequences, without comprehensive consideration of packaging time, waiting time and processing time. In contrast, the technical solution of the present invention can more accurately determine the priority and processing order of data request packets by comprehensively considering these factors. The prior art may only process according to the order of data requests, while the method of the present invention can determine the processing order according to the packaging time and waiting time of the data request packet, thereby more effectively optimizing the data processing process. In the calculation and analysis of data table flux, the prior art often only focuses on the data request packet itself, while ignoring the correlation between data requests and the flux between data tables. The technical solution of the present invention introduces the concept of data table flux and analyzes the relationship between data request packets by calculating flux similarity. In terms of optimizing and processing asynchronous processing sequences, traditional technologies may be inefficient or unable to effectively process the priority relationship between different requests when processing asynchronous requests. In contrast, the technical solution can better understand and process asynchronous processing sequences by calculating flux similarity and cumulative sum, and can determine the processing order based on the cumulative sum of flux similarity, thereby improving the response speed and overall performance of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The above and other features of the present invention will become more obvious by describing in detail the embodiments shown in the accompanying drawings. The same reference numerals in the accompanying drawings of the present invention represent the same or similar elements. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work. In the accompanying drawings:
[0041] Figure 1Shown is a flow chart of an asynchronous order data transmission method;
[0042] Figure 2 Shown is a system structure diagram of an asynchronous order data transmission system. DETAILED DESCRIPTION
[0043] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of this application can be combined with each other without conflict.
[0044] In the description of the present invention, "several" means one or more, "more" means more than two, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0045] like Figure 1 The flowchart of an asynchronous order data transmission method according to the present invention is shown below. Figure 1 To illustrate an asynchronous order data transmission method, system and device according to an embodiment of the present invention.
[0046] The present invention provides an asynchronous order data transmission method, which specifically comprises the following steps:
[0047] The data request packets are sorted by calculating the packing time, waiting time and processing time thereof to obtain a data request packet processing sequence;
[0048] For each data request packet in the data request packet processing sequence, according to the table directivity of the adjacent data request packet, the data request packet processing sequence is asynchronously divided to obtain a plurality of asynchronous division sequences;
[0049] The database processes the asynchronous segmentation sequence.
[0050] In some embodiments, based on a distributed database (such as Hadoop, etc.) and its corresponding programming language (such as Scala and Scala, etc.), a data request refers to a network request (request) for adding, deleting, modifying, and querying data in a table in a distributed database. Each data request has a table directivity in the corresponding database (which can be reflected by the query header of the SQL statement), and each data request has a corresponding user ID for sending the request (which can be represented by a string of the user's network address IP). The table name of each table in the database has a unique identifier. The table directivity in the database indicates that the data of each table is linked to each other through foreign keys and references, including information about the situation that the data items of rows and columns in a table in the database can exist in another table at the same time through foreign keys and references. Several data requests can be packaged into a data request package as a batch, and the time when each data request package is packaged and sent is recorded as its packaging time, and the estimated time from the packaging time to the time when each data request package is received and processed is recorded as its waiting time, and the estimated time from the time when each data request package is received and processed to the time when the database completes the data request is recorded as the processing time. The estimation method can be obtained by statistically analyzing or predicting the existing time records of the previous data request packages in the current time period.
[0051] Furthermore, the data request packets are sorted by calculating their packaging time, waiting time and processing time to obtain a data request packet processing sequence, which is specifically:
[0052] In some embodiments, the packing time of each data request packet is arranged in the order of time to obtain the ranking value of each data request packet, the ranking value of each data request packet is subtracted from the total number of data request packets to obtain the ranking inverse value of each data request packet, and the ranking inverse value of each data request packet is compared with the total number of data request packets to obtain the percentage as the ranking inverse value ratio of each data request packet; or, optionally, the packing time of each data request packet is arranged in the order from the last to the first time, the ranking inverse value of each data request packet is directly obtained, and then the ranking inverse value ratio of each data request packet is calculated. For example, a data request packet is ranked third according to the order of its packing time, then its ranking value is 3, when the total number of data request packets in the data request packet processing sequence is 100, then the ranking inverse value ratio of the data request packet is (100-3) / 100, which is about 0.97. The reverse calculation is done to highlight the positive linear rule that the earlier the packaging time of each data request packet, the greater the priority. In the past, if the sorting value is directly used in the order from first to last, the earlier the packaging time, the smaller the value.
[0053] In some embodiments, the waiting time of each data request packet is added to obtain a total waiting time, and the ratio of the waiting time of each data request packet to the total waiting time is used as the waiting ratio factor of each data request packet.
[0054] In some sub-preferred embodiments, the waiting time of each data request packet can be compared with the average value of the waiting time as the waiting ratio factor of each data request packet. However, it was later found that the prominence of the data features obtained by the calculation method of the ratio compared to the average value was very weak, which was not enough to quickly respond to the reverse linear law between the waiting time of each data request packet and the packaging time of each data request packet on a smaller data set. Later, it was found that the ratio of the waiting time of each data request packet to the sum of the waiting times was used as the waiting ratio factor of each data request packet. In this preferred implementation, when the numerical fluctuation of the waiting time of each data request packet is very small or the size of the data set is insufficient, the sensitivity of responding to the reverse linear law between the waiting time of each data request packet and the packaging time of each data request packet can be maintained. Similarly, the calculation of the processing ratio factor of each data request packet is also the same. Therefore, after the experiment, it is recommended to use the preferred calculation method.
[0055] In some embodiments, the processing time of each data request packet is added to obtain a total processing time, and the ratio of the processing time of each data request packet to the total processing time is used as a processing ratio factor of each data request packet.
[0056] Furthermore, the event packet processing index is calculated by subtracting the waiting ratio factor corresponding to the data request packet and the processing ratio factor from the sorting inverse ratio of each data request packet to obtain the event packet processing index of each data request packet.
[0057] The event packet processing index represents a numerical value that can be used to measure the inverse linear relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor and can be used to perform serial sorting for each data request packet.
[0058] In some embodiments, the inverse linear relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor includes but is not limited to the linear negative correlation between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor. Suboptimally, it is not excluded that the correlation coefficient between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor is used to represent the linear negative correlation between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor when computing resources are limited. However, it is worth noting that the correlation coefficient, taking the Pearson correlation coefficient as an example, will also aggravate the situation of decreased sensitivity when calculating the inverse linear relationship between the packing time, waiting time and processing time of the data request packet targeted by the technical solution of the present invention when the data set is small. It can only be used suboptimally in those cases where the sensitivity requirement is not high. In addition, the inverse linear relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor cannot be understood as being limited to a linear negative correlation relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor. In some embodiments, it should also include a multivariate linear regression relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor.
[0059] The event packet processing index of each data request packet is used to sort each data request packet to obtain a data request packet processing sequence. In some embodiments, the sequence obtained by sorting each data request packet according to the value of its event packet processing index from large to small is used as the data request packet processing sequence.
[0060] In some embodiments, each data request packet may be clustered according to the value of its event packet processing indicator to obtain several data request packet processing subsequences, and the data request packet processing subsequences may be sorted from large to small according to the average number of event packet processing indicators of the data request packets in each data request packet processing subsequence. The data request packet processing subsequences may then be concatenated according to the sorting results, and the resulting sequence may be used as the data request packet processing sequence.
[0061] Furthermore, each data request packet in the data request packet processing sequence is asynchronously segmented according to the table directivity of the adjacent data request packet, to obtain a plurality of asynchronous segmentation sequences, specifically:
[0062] Analyze each data request packet in the data request packet processing sequence: Analyze the tables in the database pointed to by each data request in each data request packet, and analyze whether there are common data items between the tables in the database pointed to by each data request through foreign keys and references.
[0063] For example, when there are 5 data request packets in the data request packet processing sequence, if there are 3 data requests in the first data request packet batch1, and the data items in table A pointed to by the first data request batch1(1) in batch1 and the data items in table B pointed to by the second data request batch1(2) in batch1, there are m data items in common between the data items in table A and the data items in table B through foreign keys and references. Let the number of data items included in table A be nA and the number of data items included in table B be nB. Then the data table flux between the data request batch1(1) and the data request batch1(2) is the ratio of m to the sum of nA and nB. Therefore, the data table flux between the two data requests can be the ratio of the number of data items in common between the data tables pointed to by the two data requests through foreign keys and references to the sum of the number of data items in the data tables pointed to by the two data requests. The data table flux between the two data requests can represent the measurement of the connectivity between the data items in the data tables pointed to by the two data requests.
[0064] In some embodiments, the data table flux between each data request in each data request packet and each data request in the data request packet is calculated respectively, and the average value of the data table flux between a data request in a data request packet and each data request therein can be used as the data packet flux of the data request in the data request packet, and the data packet flux of a data request in the data request packet to which it belongs is the average value of the data table flux between the data request and the remaining data requests in the data request packet to which it belongs, thereby calculating the data packet flux of each data request in each data request packet in the data request packet processing sequence. For example, for batch1(1), the average value of the data table flux between batch1(1) and the remaining data requests in the data request packet batch1 to which it belongs is first calculated as the data packet flux of batch1(1) in batch1, and then the average value of the data table flux between batch1(1) and each data request in the other data request packets is calculated, thereby obtaining the data packet flux of batch1(1) in a total of 5 data request packets, and the number of dimensions in the processing sequence flux of batch1(1) is 5;
[0065] An array consisting of the data packet fluxes of a data request in each data request packet of the data request packet processing sequence is used as the processing sequence flux of the data request, wherein the number of dimensions corresponds to the number of data request packets in the data request packet processing sequence.
[0066] In each data request packet, the processing sequence flux corresponding to each data request is compressed into a compressed processing sequence flux, and the dimension size of the compressed processing sequence flux is consistent with the processing sequence flux corresponding to each data request in the data request packet.
[0067] In some embodiments, the processing sequence flux corresponding to each data request in a data request packet can be mapped into a vector with the same dimension size as the processing sequence flux corresponding to each data request in the data request packet through auto-encoding as the compressed processing sequence flux in the data request packet; in some embodiments, the processing sequence flux corresponding to each data request in a data request packet can be output through a dense neural network as a vector with the same dimension size as the processing sequence flux corresponding to each data request in the data request packet as the compressed processing sequence flux in the data request packet; and in some embodiments, preferably, the processing sequence flux corresponding to each data request in a data request packet can be dot-multiplied by dimension to obtain a vector with the same dimension size as the processing sequence flux corresponding to each data request in the data request packet, which is more convenient and can speed up the processing time through parallel dimensional linear operations for distributed computing.
[0068] Furthermore, the database processes the asynchronous segmentation sequence as follows:
[0069] The similarity of the compression processing sequence flux corresponding to each data request packet with respect to the compression processing sequence flux corresponding to each data request packet in the data request packet processing sequence is calculated respectively as the flux similarity corresponding to the data request packet. In some embodiments, the cosine similarity calculation method is used to obtain the similarity of the compression processing sequence flux corresponding to each data request packet in the data request packet processing sequence.
[0070] If the flux similarities corresponding to two adjacent data request packets in the data request packet processing sequence are positive or negative (for example, the values on both sides are one positive and one negative), then an asynchronous split is required between the two adjacent data request packets with different flux similarities. Through several asynchronous splits, the data request packet processing sequence is divided into several data request packet processing subsequences as asynchronous split sequences. In many experiments, it was found that the use of cosinesimilarity is conducive to evenly amortizing the flux similarities of each data request packet processing subsequence in the asynchronous split sequence for observation on the numerical distribution cycle of the trigonometric function. Such observation is very helpful for judging the data situation of each data request packet processing subsequence. First, the data request packet processing sequence is well sorted according to the calculation of its packaging time, waiting time and processing time to effectively divide the batch of data requests according to the importance. The subsequent asynchronous split is more finely divided according to the continuity of the data items in the numerous tables of the database. This is conducive to making priority data request judgment optimization for smaller-scale data sets. In addition, in similar calculations of data table flux in the past, there are paths of fully connected graphs of nodes of external links between tables for calculation. However, in practice, it is found that such calculations often perform full node traversal of tables used in the database in the underlying code, and in actual experiments, this often aggravates the server downtime. Therefore, the method described in the present invention is preferably used because the method does not perform too many full node traversal calculations on implicit, second-degree, and third-degree potentially overlapping tables, and only focuses on the flux similarity of each data request packet processing subsequence in the asynchronous segmentation sequence, and can run smoothly even when the computing memory is extremely limited.
[0071] The database responds to the obtained asynchronous segmentation sequence and performs synchronous or asynchronous processing.
[0072] In some optional embodiments, each flash sale request can be stored in a message queue, such as RabbitMQ. After being placed in the message queue, the synchronous method in the message queue can be to first allow a large number of requests to quickly fill up the database connection pool opened by the database framework, and at the same time, the data requests of the data request packets in each data request packet processing subsequence are queued in parallel for response to modify the database; and the asynchronous method in the message queue can be to allow the data requests of the data request packets in each data request packet processing subsequence to be written into the database in sequence one by one, but keep the number of database connection threads unchanged.
[0073] Furthermore, the method for asynchronously processing the obtained asynchronous segmentation sequence is:
[0074] The cumulative sum of the flux similarities corresponding to the data request packets in each data request packet processing subsequence is accumulated respectively, and each data request packet processing subsequence is arranged from large to small according to the value of the cumulative sum of the flux similarities therein. The larger the value of the cumulative sum of the flux similarities is, the higher the priority is for processing.
[0075] The asynchronous order data transmission system runs in any computing device such as a desktop computer, a laptop computer, a PDA or a cloud data center. The computing device includes: a processor, a memory and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps in the asynchronous order data transmission method are implemented. The executable system may include, but is not limited to, a processor, a memory, and a server cluster.
[0076] An embodiment of the present invention provides an asynchronous order data transmission system, such as Figure 2 As shown, an asynchronous order data transmission system of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned asynchronous order data transmission method embodiment are implemented. The processor executes the computer program to run in the following system units:
[0077] A serialization unit, used to sort the data request packets by calculating the packing time, waiting time and processing time thereof, so as to obtain a data request packet processing sequence;
[0078] an asynchronous segmentation unit, configured to asynchronously segment each data request packet in the data request packet processing sequence according to the table directivity of the adjacent data request packet, to obtain a plurality of asynchronous segmentation sequences;
[0079] The distributed processing unit is used by the database to process asynchronous segmentation sequences.
[0080] Among them, in order to better unify the numerical linear relationship and probabilistic connection between physical quantities of different units of measurement, different physical quantities can be dimensionally processed.
[0081] Among them, preferably, all undefined variables in the present invention, if not clearly defined, can be manually set thresholds.
[0082] The asynchronous order data transmission system can be run in computing devices such as desktop computers, laptop computers, PDAs, and cloud data centers. The asynchronous order data transmission system includes, but is not limited to, a processor and a memory. Those skilled in the art can understand that the example is only an example of an asynchronous order data transmission method, system, and device, and does not constitute a limitation of an asynchronous order data transmission method, system, and device, and may include more or less components than the example, or combine certain components, or different components. For example, the asynchronous order data transmission system may also include input and output devices, network access devices, buses, etc.
[0083] The present invention also provides an electronic device, a readable storage medium and a computer program product:
[0084] An electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the asynchronous order data transmission method and the steps therein.
[0085] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the asynchronous order data transmission method and the steps therein.
[0086] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the method for transmitting asynchronous order data and the steps thereof are implemented.
[0087] Wherein, electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0088] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0090] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0091] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0092] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0093] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0094] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete component gate circuits or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the asynchronous order data transmission system, and uses various interfaces and lines to connect the various sub-areas of the entire asynchronous order data transmission system.
[0095] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the asynchronous order data transmission method, system and device by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0096] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document is not limited here.
[0097] The present invention provides an asynchronous order data transmission method, system and device, which obtains a data request packet processing sequence by sorting data request packets according to their packing time, waiting time and processing time, and asynchronously splits the data request packet processing sequence according to the table directivity of the adjacent data request packets for each data request packet in the data request packet processing sequence to obtain a plurality of asynchronous split sequences, and then the database processes the asynchronous split sequences, thereby improving the database processing efficiency and robustness.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An asynchronous order data transmission method, characterized in that: The method comprises: The data request packets are sorted by calculating the packing time, waiting time and processing time thereof to obtain a data request packet processing sequence; For each data request packet in the data request packet processing sequence, according to the table directivity of the adjacent data request packet, the data request packet processing sequence is asynchronously divided to obtain a plurality of asynchronous division sequences; The database processes the asynchronous segmentation sequence; Wherein, each data request packet in the data request packet processing sequence is asynchronously segmented according to the table directivity of the adjacent data request packet, to obtain a plurality of asynchronous segmentation sequences, specifically: Analyze each data request packet in the data request packet processing sequence: analyze the table in the database pointed to by each data request in each data request packet, and analyze whether there are common data items between the tables in the database pointed to by each data request through foreign keys and references; the data table flux between two data requests is the ratio of the number of common data items between the data tables pointed to by the two data requests through foreign keys and references to the sum of the number of data items in the data tables pointed to by the two data requests, and the data table flux between two data requests represents the measurement of the connection between the data items of the data tables pointed to by the two data requests; Among them, an array composed of the data packet fluxes in each data request packet of the data request packet processing sequence for a data request is used as the processing sequence flux of the data request, and the number of dimensions in the processing sequence flux corresponds to the number of data request packets in the data request packet processing sequence; in each data request packet, the processing sequence flux corresponding to each data request is compressed into a compressed processing sequence flux, and the dimension size of the compressed processing sequence flux is consistent with that of the processing sequence flux corresponding to each data request in the data request packet.
2. The asynchronous order data transmission method according to claim 1, characterized in that: in, The data request packets are sorted by calculating their packing time, waiting time and processing time to obtain a data request packet processing sequence, which is specifically: Arrange the packaging time of each data request packet in the order of time to obtain the ranking value of each data request packet, subtract the ranking value of each data request packet from the total number of data request packets to obtain the ranking inverse value of each data request packet, and compare the ranking inverse value of each data request packet with the total number of data request packets to obtain the percentage as the ranking inverse value ratio of each data request packet; Adding the waiting time of each data request packet to obtain a total waiting time, and using the ratio of the waiting time of each data request packet to the total waiting time as a waiting ratio factor of each data request packet; Adding the processing time of each data request packet to obtain a total processing time, and using the ratio of the processing time of each data request packet to the total processing time as a processing ratio factor of each data request packet; Each data request packet is sorted using its event packet processing index to obtain a data request packet processing sequence, wherein the event packet processing index represents a numerical value that can be used to measure the inverse linear relationship between the sorting inverse ratio of each data request packet and its corresponding waiting ratio factor and processing ratio factor and can be used to serialize and sort each data request packet.
3. The asynchronous order data transmission method according to claim 2, characterized in that: in, The calculation of the event packet processing index is: The order inverse ratio of each data request packet is respectively subtracted from the waiting ratio factor corresponding to the data request packet and the processing ratio factor thereof, so as to obtain the event packet processing index of each data request packet.
4. The asynchronous order data transmission method according to claim 1, characterized in that: in, The database processes the asynchronous segmentation sequence as follows: Calculate the similarity of the compression processing sequence flux corresponding to each data request packet with respect to the compression processing sequence flux corresponding to each data request packet in the data request packet processing sequence as the flux similarity corresponding to the data request packet; Wherein, when the flux similarities corresponding to two adjacent data request packets in the data request packet processing sequence are different in positive and negative, an asynchronous split is required between the two adjacent data request packets with different flux similarities. Through several asynchronous splits, the data request packet processing sequence is split into several data request packet processing subsequences as asynchronous split sequences; The database responds to the obtained asynchronous segmentation sequence and performs synchronous or asynchronous processing.
5. The asynchronous order data transmission method according to claim 4, characterized in that: in, The method for asynchronously processing the obtained asynchronous segmentation sequence is: The cumulative sum of the flux similarities corresponding to the data request packets in each data request packet processing subsequence is accumulated respectively, and each data request packet processing subsequence is arranged from large to small according to the value of the cumulative sum of the flux similarities therein. The larger the value of the cumulative sum of the flux similarities is, the higher the priority is for processing.
6. An asynchronous order data transmission system, characterized in that: The asynchronous order data transmission system runs in any computing device such as a desktop computer, a laptop computer or a cloud data center. The computing device includes: a processor, a memory and a computer program stored in the memory and running on the processor. When the processor executes the computer program, the steps of the asynchronous order data transmission method as described in any one of claims 1 to 3 are implemented.
7. An electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 3.
