A business data processing method, device and medium for industrial Internet
Through sharding processing and multi-thread pool management in the industrial Internet, the problem of high data processing pressure on intelligent equipment is solved, data processing efficiency and system stability are improved, and the risk of system downtime is avoided.
Patent Information
- Application Number
- CN202210180085.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-02-25
AI Technical Summary
With the deepening of intelligence and the increase in the number of intelligent networked devices, the pressure of data processing in the industrial Internet has increased, resulting in a reduction in data processing efficiency, and may even cause system downtime, affecting industrial production.
By obtaining the business information uploaded by industrial equipment, using the IP protocol stack for sharding, determining multiple logical processing nodes and thread pools, calling the corresponding sub-threads for business logic processing, and managing the processing process through the process engine, optimizing the main processing process and sub-processing processes. Division of threads to improve concurrent processing capabilities.
It reduces the pressure on the main processing process, improves the processing performance of business data, enhances the stability and processing capabilities of the system, and avoids the risk of system downtime.
Smart Images

Figure CN114579303B
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and specifically to a method, device and medium for processing business data of the industrial Internet. Background Art
[0002] With the continuous development of big data technology, more and more factories have also undergone intelligent transformation. However, with the continuous deepening of intelligence and the increasing number of intelligent networked devices, the data processing pressure faced by application platforms such as intelligent monitoring and intelligent production has also increased, which can easily lead to blockages in the data processing process, reduce data processing efficiency, and in severe cases cause system downtime and other problems, bringing inconvenience to industrial production. Summary of the invention
[0003] In order to solve the above problems, the present application proposes a business data processing method of the industrial Internet, including: obtaining business information uploaded by industrial equipment, and slicing the business information through the IP protocol stack to obtain a number of data blocks after slicing;
[0004] According to the preset process engine, multiple logical processing nodes corresponding to the business information and a main processing flow composed of multiple logical processing nodes are determined; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool;
[0005] According to the number of data blocks, determine the number of sub-threads that need to be called currently;
[0006] According to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each logical processing node in turn;
[0007] The target sub-thread is executed to perform corresponding business logic processing on several data blocks corresponding to the business information.
[0008] In one implementation of the present application, after determining the multiple logical processing nodes corresponding to the business information, the method further includes:
[0009] For each logical processing node, establish a main thread corresponding to the logical processing node;
[0010] The main thread and the multiple sub-threads included in the corresponding logic processing node are bound in sequence to generate a corresponding mapping relationship.
[0011] In one implementation of the present application, according to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are determined from the thread pool corresponding to each logical processing node in turn, specifically including:
[0012] Determine a first main thread corresponding to the business logic thread pool, and distribute the data blocks corresponding to the business information to multiple first target sub-threads in the business logic thread pool according to the mapping relationship corresponding to the first main thread;
[0013] After the multiple first target sub-threads have completed their corresponding business logic processing, the first data processing results of the multiple first target sub-threads are transferred to the second main thread corresponding to the network connection thread pool through the first main thread, and the data processing results of the multiple first target sub-threads are distributed to the multiple second target sub-threads in the network connection thread pool according to the mapping relationship corresponding to the second main thread;
[0014] After the multiple second target sub-threads have completed their corresponding business logic processing, the second data processing results of the multiple second target sub-threads are transferred to the third main thread corresponding to the database connection thread pool through the second main thread, and the data processing results of the multiple second target sub-threads are distributed to the multiple third target sub-threads in the database connection thread pool according to the mapping relationship corresponding to the third main thread;
[0015] The number of the first target sub-thread, the second target sub-thread and the third target sub-thread corresponds to the number of threads, and each of them corresponds to at least one data block.
[0016] In one implementation of the present application, after determining a plurality of target sub-threads corresponding to the number of threads, the method further includes:
[0017] For the logical processing node, generate a progress flag corresponding to the business information, and assign a corresponding default value to the progress flag;
[0018] After any target sub-thread corresponding to the logic processing node completes its corresponding business logic processing, the progress flag is increased by one based on the default value;
[0019] When the progress flag is equal to the number of data blocks, it is determined that the target sub-thread has completed the business logic processing of the business information.
[0020] In one implementation of the present application, after executing the target sub-thread to perform corresponding business logic processing on a number of data blocks corresponding to the business information, the method further includes:
[0021] Get the start execution time of the target child thread;
[0022] According to the start execution time, the execution time of the target sub-thread is determined. If the execution time is longer than the preset execution time, a timeout prompt message is sent to the process engine to deactivate the currently executing target sub-thread according to the timeout prompt message.
[0023] In one implementation of the present application, before obtaining the service information uploaded by the service device, the method further includes:
[0024] When the processing task corresponding to the business information is a non-real-time task, determining the task priority corresponding to the business information;
[0025] In the order of task priority, the business information is added to the corresponding task queue, and a priority identifier corresponding to the business information is generated, so that according to the priority identifier, the business information to be processed is obtained from the task queue according to the task priority at the preset processing time.
[0026] In one implementation of the present application, before obtaining the service information uploaded by the service device, the method further includes:
[0027] Determine the server hardware indicators for process engine deployment; the hardware indicators include the number of central processing units and the number of cores of a single central processing unit;
[0028] According to the number of central processing units and the number of cores of a single central processing unit, multiple central processing unit cores corresponding to the process engine are determined.
[0029] In one implementation of the present application, for each logical processing node, a main thread corresponding to the logical processing node is established, specifically including:
[0030] Determining, from the plurality of central processing unit cores, a plurality of first central processing unit cores matching the number of each logical processing node;
[0031] Establishing a main thread corresponding to the logical processing node, and binding the main thread to the first central processing unit core;
[0032] Before sequentially binding the main thread and the multiple sub-threads included in the corresponding logic processing node, the method further includes:
[0033] For each logical processing node, multiple corresponding sub-threads are established;
[0034] A plurality of second central processing unit cores other than the plurality of first central processing unit cores are determined from the plurality of central processing unit cores, and the plurality of second central processing unit cores are sequentially bound to the plurality of sub-threads.
[0035] The present application provides a business data processing device for the industrial Internet, the device comprising:
[0036] at least one processor; and,
[0037] a memory communicatively connected to at least one processor; wherein,
[0038] The memory stores instructions executable by at least one processor, the instructions being executed by at least one processor to enable the at least one processor to:
[0039] Obtain the business information uploaded by the industrial equipment, and fragment the business information through the IP protocol stack to obtain several fragmented data blocks;
[0040] According to the preset process engine, multiple logical processing nodes corresponding to the business information and a main processing flow composed of multiple logical processing nodes are determined; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool;
[0041] According to the number of data blocks, determine the number of sub-threads that need to be called currently;
[0042] According to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each logical processing node in turn;
[0043] The target sub-thread is executed to perform corresponding business logic processing on several data blocks corresponding to the business information.
[0044] The embodiment of the present application provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0045] Obtain the business information uploaded by the industrial equipment, and fragment the business information through the IP protocol stack to obtain several fragmented data blocks;
[0046] According to the preset process engine, multiple logical processing nodes corresponding to the business information and a main processing flow composed of multiple logical processing nodes are determined; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool;
[0047] According to the number of data blocks, determine the number of sub-threads that need to be called currently;
[0048] According to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each logical processing node in turn;
[0049] The target sub-thread is executed to perform corresponding business logic processing on several data blocks corresponding to the business information.
[0050] The business data processing method of the industrial Internet provided in the embodiment of the present application can bring the following beneficial effects:
[0051] The business information is segmented to obtain several data blocks, which are circulated through the main processing flow determined by the preset process engine, and the corresponding business logic processing is performed on the data blocks through the sub-threads corresponding to each logical processing node, so that the multiple logical processing nodes contained in the main processing flow are only used for the flow between processing flows, and the specific logical processing functions are assigned to the sub-threads. While reducing the processing pressure of the main processing flow, it also provides stronger concurrent processing capabilities and improves the processing performance of business data. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0053] Figure 1 A flowchart of a business data processing method for the industrial Internet provided in an embodiment of the present application;
[0054] Figure 2 An example diagram of a general business data processing flow provided in an embodiment of the present application;
[0055] Figure 3 An example diagram of an optimized business data processing flow provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of the structure of a business data processing device for the Industrial Internet provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0058] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0059] like Figure 1As shown, an industrial Internet business data processing method provided by an embodiment of the present application includes:
[0060] S101: Obtain business information uploaded by industrial equipment, and segment the business information through the IP protocol stack to obtain a number of segmented data blocks.
[0061] Business information refers to the business request information uploaded to the process engine during the operation of industrial equipment connected to the Industrial Internet, such as requests to query equipment status data, requests to write production data, etc. The process engine is a lightweight business process engine written in a programming language (such as Java) under the microservice architecture, which can drive the flow between business processes according to the set fixed process. After receiving the business information, the process engine needs to parse and process the uploaded business information to realize the execution and flow of the corresponding business logic.
[0062] The server needs to obtain the business information uploaded by the industrial equipment from the task queue, and the processing tasks corresponding to the business information include real-time tasks and non-real-time tasks. For real-time tasks, when the device uploads the business information to the process engine, the server immediately obtains the business information to be processed from the task queue, and then performs subsequent processing on the business information. For non-real-time tasks, the processing time of the task is fixed. Therefore, after receiving the business information, the server must first determine the task priority corresponding to the business information, and then add the business information to the corresponding task queue in the order of task priority, and generate the priority identifier corresponding to the business information, so that according to the priority identifier, when the preset processing time is reached, the business information to be processed can be obtained from the task queue according to the task priority. Setting the task queue can wait for the data processing task to be executed until the preset time, which can avoid blocking the main processing flow, and setting the priority takes into account the actual business needs, which is more practical.
[0063] Most of the business information in the factory is large-volume data. In order to reduce the processing pressure of the process engine, the server deployed by the process engine needs to shard the business information through the IP protocol stack after receiving the uploaded business information to obtain several data blocks after sharding. It should be noted that the sharding can be uniform sharding, or the business information can be divided into data blocks of different sizes according to the number of idle threads in the current process engine.
[0064] S102: According to a preset process engine, determine multiple logical processing nodes corresponding to the business information, and a main processing flow composed of multiple logical processing nodes; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool.
[0065] The business processing flow can be roughly divided into the following steps: business logic processing, network connection, and database connection. After the server parses the business logic corresponding to the business information, it needs to call different I / O interfaces by determining the network connection logic in the process of executing the business logic, and implement the interaction with the database through the database call logic, and finally complete the processing of the business information. Therefore, after the server receives the business information uploaded by the device and segments the business information, it needs to determine the logical processing flow (that is, the main processing flow) and the corresponding multiple logical processing nodes for the current business information according to the business process preset in the process engine.
[0066] The above main processing flow is only the process flow logic driven by the process engine, which does not include the actual business data processing logic. The specific business logic processing is handled by the thread, which can reduce the processing pressure of the main processing flow and improve the concurrent processing capability of the process engine.
[0067] In one embodiment, a data processing process is running on the server deployed by the process engine. The process engine can determine the hardware indicators of the deployed server, such as the number of central processing units (CPUs) and the number of cores of a single CPU, and determine the corresponding number of central processing unit cores based on the product of the number of CPUs and the number of cores of a single CPU. One central processing unit core is used to run one thread, so the number of central processing unit cores determines the number N of data processing threads that can be run by the process engine. Data processing threads are divided into main threads and sub-threads. The main thread corresponds to the logic processing node, is responsible for the process flow of business information, and is driven by the process engine according to specific trigger conditions. The sub-thread is the thread that each logic processing node needs to call when processing its corresponding business logic, is responsible for specific business logic processing, and can execute multiple tasks concurrently.
[0068] In one embodiment, after the server determines the multiple logical processing nodes corresponding to the business information, it is necessary to determine multiple first central processing unit cores matching the number A of each logical processing node from multiple central processing unit cores. After determining the multiple first central processing unit cores, a main thread corresponding to each logical processing node is established, and the main thread is bound to the first central processing unit core in sequence, so that the main thread can run on the first central processing unit core. The main threads established above correspond to the logical processing nodes of business logic processing, network connection and database connection respectively, which can realize the process flow between different logical processing nodes.
[0069] After establishing the main thread, the server needs to further establish corresponding sub-threads for the main thread for each logic processing node, so that when receiving a data flow request, it can distribute the business information to the corresponding sub-thread for corresponding logic processing. Specifically, the server can determine multiple second central processing unit cores other than multiple first central processing unit cores from multiple central processing unit cores, and then bind the multiple second central processing unit cores to multiple sub-threads in turn, so that the sub-threads can run on the second central processing unit cores to perform corresponding business logic processing.
[0070] After establishing the main thread and sub-threads, the server needs to bind the main thread and the multiple sub-threads contained in the corresponding logic processing node in sequence to generate the corresponding mapping relationship. Since the main processing flow of business information is separated from the specific business logic processing, in order to achieve a complete data processing process, after the business information flows to the logic processing node, it is also necessary to determine the sub-thread corresponding to the logic processing node, and the mapping relationship can match the corresponding sub-thread according to the main thread corresponding to the logic processing node.
[0071] S103: Determine the number of sub-threads currently required to be called according to the number of data blocks.
[0072] A single thread is responsible for processing the data carried in a single data block. Therefore, after sharding the business information, the server needs to determine the number of sub-threads to be called according to the number of data blocks. Each sub-thread corresponds to at least one data block.
[0073] S104: according to the flow logic between the logical processing nodes included in the main processing flow, a plurality of target sub-threads corresponding to the number of threads are called in sequence from the thread pool corresponding to each logical processing node.
[0074] After the main thread and sub-threads are established, the server can transfer data to the corresponding logic processing nodes in sequence according to the flow logic between the logic processing nodes, and perform corresponding business logic processing at each logic processing node by calling the target sub-thread in the corresponding thread pool. It should be noted that the number of target sub-threads to be called by each logic processing node is the same.
[0075] S105: Execute the target sub-thread to perform corresponding business logic processing on a number of data blocks corresponding to the business information.
[0076] In one embodiment, the thread pools corresponding to the logic processing nodes are business logic thread pools, network connection thread pools, and database connection thread pools in order according to the flow logic. After determining the target sub-threads corresponding to each logic processing node, the server can sequentially transfer the data blocks to the corresponding logic processing nodes according to the flow logic of the main processing flow, and perform corresponding business logic processing on multiple data blocks concurrently by executing the target sub-threads corresponding to the above logic processing nodes.
[0077] Specifically, after obtaining the number of sub-threads to be called, the server first determines the first main thread corresponding to the business logic thread pool, and distributes the data blocks corresponding to the business information to multiple first target sub-threads in the business logic thread pool according to the mapping relationship corresponding to the first main thread. Then, after the multiple first target sub-threads have completed their corresponding business logic processing, the first data processing results of the multiple first target sub-threads are transferred to the second main thread corresponding to the network connection thread pool through the first main thread, and the data processing results of the multiple first target sub-threads are distributed to the multiple second target sub-threads in the network connection thread pool according to the mapping relationship corresponding to the second main thread. Finally, after the multiple second target sub-threads have completed their corresponding business logic processing, the second data processing results of the multiple second target sub-threads are transferred to the third main thread corresponding to the database connection thread pool through the second main thread, and the data processing results of the multiple second target sub-threads are distributed to the multiple third target sub-threads in the database connection thread pool according to the mapping relationship corresponding to the third main thread.
[0078] To determine whether the target sub-thread has completed data processing for all data blocks, it is necessary to use the progress flag carried in the business information. After determining the target sub-thread corresponding to the business information, the server can generate a progress flag corresponding to the business information for the logical processing node, and assign a corresponding default value to the progress flag, which is usually set to 0. The progress flag is used to record the processing progress of the current business information. After any target sub-thread corresponding to the logical processing node completes its corresponding business logic processing, the progress flag is increased by one based on the default value. If the progress flag is equal to the number of data blocks, it is determined that the current target sub-thread has completed the business logic processing of the business information, and its processing result can be transferred to the next logical processing node for the next stage of business logic processing.
[0079] In one embodiment, the server can monitor the status of the currently executing target sub-thread by setting a monitoring event. After the target sub-thread starts to execute, the server needs to obtain its start execution time, and then determine the execution time of the target sub-thread based on the start execution time and the current time. If the execution time is longer than the preset execution time, it means that within the preset thread execution time, the target sub-thread did not send a response message to the process engine in time. At this time, the target sub-thread should have an exception and needs to send a timeout prompt message to the process engine. In this way, after receiving the timeout prompt message, the process engine can deactivate the currently executing target sub-thread to prevent it from occupying processing resources and causing resource waste.
[0080] Figure 2 An example diagram of a general business data processing flow provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the general business data processing flow generally adopts the method that each logic processing node is responsible for the flow function of the business processing flow on the basis of being responsible for business logic processing. Figure 3 An example diagram of an optimization process flow provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, through the optimized business data processing flow provided by the embodiment of the present application, the process flow logic can be separated from the business logic. The main processing flow is responsible for the flow function of the business processing flow, while the specific business logic processing function is performed by the sub-threads in the thread pool. The thread pool includes a business logic thread pool, a network I / O thread pool (i.e., a network connection thread pool), and a database I / O connection pool (i.e., a database connection pool). Each thread pool is composed of multiple corresponding sub-threads. In the process of processing business data, the corresponding business logic processing can be performed by calling the sub-threads in the business logic thread pool, the network I / O thread pool, and the database I / O connection pool in turn.
[0081] The above are embodiments of the method proposed in this application. Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.
[0082] Figure 4 A schematic diagram of the structure of a business data processing device for the industrial Internet provided in an embodiment of the present application. Figure 4 As shown, including:
[0083] at least one processor; and,
[0084] at least one processor is communicatively connected to a memory; wherein,
[0085] The memory stores instructions executable by at least one processor, the instructions being executed by at least one processor to enable the at least one processor to:
[0086] Obtain the business information uploaded by the industrial equipment, and fragment the business information through the IP protocol stack to obtain several fragmented data blocks;
[0087] According to the preset process engine, multiple logical processing nodes corresponding to the business information and a main processing flow composed of multiple logical processing nodes are determined; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool;
[0088] According to the number of data blocks, determine the number of sub-threads that need to be called currently;
[0089] According to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each logical processing node in turn;
[0090] The target sub-thread is executed to perform corresponding business logic processing on several data blocks corresponding to the business information.
[0091] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0092] Obtain the business information uploaded by the industrial equipment, and fragment the business information through the IP protocol stack to obtain several fragmented data blocks;
[0093] According to the preset process engine, multiple logical processing nodes corresponding to the business information and a main processing flow composed of multiple logical processing nodes are determined; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool and a database connection thread pool;
[0094] According to the number of data blocks, determine the number of sub-threads that need to be called currently;
[0095] According to the flow logic between the logical processing nodes included in the main processing flow, multiple target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each logical processing node in turn;
[0096] The target sub-thread is executed to perform corresponding business logic processing on several data blocks corresponding to the business information.
[0097] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0098] The devices and media provided in the embodiments of the present application correspond one-to-one to the methods. Therefore, the devices and media also have similar beneficial technical effects as the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.
[0099] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0100] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0103] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0104] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0105] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0107] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A business data processing method for industrial Internet, characterized in that: The method comprises: Obtaining business information uploaded by industrial equipment, and slicing the business information through an IP protocol stack to obtain a number of slicing data blocks; According to a preset process engine, determine multiple logical processing nodes corresponding to the business information, and a main processing flow composed of the multiple logical processing nodes; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool, and a database connection thread pool; Determine the number of sub-threads currently to be called according to the number of data blocks; According to the flow logic between the logical processing nodes included in the main processing flow, a plurality of target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each of the logical processing nodes in sequence; Executing the target sub-thread to perform corresponding business logic processing on a number of data blocks corresponding to the business information; After determining the multiple logical processing nodes corresponding to the business information, the method further includes: For each logical processing node, establish a main thread corresponding to the logical processing node; The main thread is sequentially bound to a plurality of sub-threads included in its corresponding logic processing node to generate a corresponding mapping relationship.
2. The method for processing business data of the industrial Internet according to claim 1, characterized in that: According to the flow logic between the logical processing nodes included in the main processing flow, a plurality of target sub-threads corresponding to the number of threads are determined from the thread pools corresponding to the logical processing nodes in sequence, specifically including: Determine a first main thread corresponding to the business logic thread pool, and distribute the data blocks corresponding to the business information to multiple first target sub-threads in the business logic thread pool according to the mapping relationship corresponding to the first main thread; After the multiple first target sub-threads have completed their corresponding business logic processing, the first data processing results of the multiple first target sub-threads are transferred to the second main thread corresponding to the network connection thread pool through the first main thread, and the data processing results of the multiple first target sub-threads are distributed to the multiple second target sub-threads in the network connection thread pool according to the mapping relationship corresponding to the second main thread; After the multiple second target sub-threads have completed their corresponding business logic processing, the second data processing results of the multiple second target sub-threads are transferred to the third main thread corresponding to the database connection thread pool through the second main thread, and the data processing results of the multiple second target sub-threads are distributed to the multiple third target sub-threads in the database connection thread pool according to the mapping relationship corresponding to the third main thread; The number of the first target sub-thread, the second target sub-thread and the third target sub-thread corresponds to the number of threads, and each of them corresponds to at least one data block.
3. The method for processing business data of the industrial Internet according to claim 1, characterized in that: After determining a plurality of target sub-threads corresponding to the number of threads, the method further includes: For the logic processing node, generate a progress flag corresponding to the business information, and assign a corresponding default value to the progress flag; After any target sub-thread corresponding to the logic processing node completes its corresponding business logic processing, the progress flag is increased by one based on the default value; When the progress flag is equal to the number of the data blocks, it is determined that the target sub-thread has completed the business logic processing of the business information.
4. The method for processing business data of the industrial Internet according to claim 1, characterized in that: After executing the target sub-thread to perform corresponding business logic processing on a plurality of data blocks corresponding to the business information, the method further includes: Obtaining the start execution time of the target child thread; According to the start execution time, the execution time of the target sub-thread is determined. If the execution time is greater than the preset execution time, a timeout prompt message is sent to the process engine to deactivate the currently executing target sub-thread according to the timeout prompt message.
5. The method for processing business data of the industrial Internet according to claim 1, characterized in that: Before obtaining the business information uploaded by the industrial equipment, the method further includes: In the case where the processing task corresponding to the business information is a non-real-time task, determining the task priority corresponding to the business information; In the order of the task priorities, the business information is added to the corresponding task queue, and a priority identifier corresponding to the business information is generated, so that according to the priority identifier, the business information to be processed is obtained from the task queue according to the task priority at the preset processing time.
6. The method for processing business data of the industrial Internet according to claim 1, characterized in that: Before obtaining the business information uploaded by the industrial equipment, the method further includes: Determine the server hardware indicators for the process engine deployment; wherein the hardware indicators include the number of central processing units and the number of cores of a single central processing unit; According to the number of central processing units and the number of cores of the single central processing unit, a plurality of central processing unit cores corresponding to the process engine are determined.
7. The method for processing business data of the industrial Internet according to claim 6, characterized in that: For each logical processing node, a main thread corresponding to the logical processing node is established, specifically including: Determining, from the plurality of central processing unit cores, a plurality of first central processing unit cores matching the number of the logical processing nodes; Establishing a main thread corresponding to the logical processing node, and binding the main thread to the first central processing unit core; Before sequentially binding the main thread and the multiple sub-threads included in the corresponding logical processing node, the method further includes: For each of the logic processing nodes, establish a plurality of corresponding sub-threads; A plurality of second central processing unit cores other than the plurality of first central processing unit cores are determined from the plurality of central processing unit cores, and the plurality of second central processing unit cores are sequentially bound to the plurality of sub-threads.
8. A business data processing device for the industrial Internet, characterized in that the device include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtaining business information uploaded by industrial equipment, and slicing the business information through an IP protocol stack to obtain a number of slicing data blocks; According to a preset process engine, determine multiple logical processing nodes corresponding to the business information, and a main processing flow composed of the multiple logical processing nodes; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool, and a database connection thread pool; Determine the number of sub-threads currently to be called according to the number of data blocks; According to the flow logic between the logical processing nodes included in the main processing flow, a plurality of target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each of the logical processing nodes in sequence; Executing the target sub-thread to perform corresponding business logic processing on a number of data blocks corresponding to the business information; After determining the multiple logical processing nodes corresponding to the business information, the method further includes: For each logical processing node, establish a main thread corresponding to the logical processing node; The main thread is sequentially bound to a plurality of sub-threads included in its corresponding logic processing node to generate a corresponding mapping relationship.
9. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions are configured to: Obtaining business information uploaded by industrial equipment, and slicing the business information through an IP protocol stack to obtain a number of slicing data blocks; According to a preset process engine, determine multiple logical processing nodes corresponding to the business information, and a main processing flow composed of the multiple logical processing nodes; wherein each logical processing node corresponds to a different thread pool, the thread pool is composed of multiple sub-threads, and the thread pool includes a business logic thread pool, a network connection thread pool, and a database connection thread pool; Determine the number of sub-threads currently to be called according to the number of data blocks; According to the flow logic between the logical processing nodes included in the main processing flow, a plurality of target sub-threads corresponding to the number of threads are called from the thread pool corresponding to each of the logical processing nodes in sequence; Executing the target sub-thread to perform corresponding business logic processing on a number of data blocks corresponding to the business information; After determining the multiple logical processing nodes corresponding to the business information, the method further includes: For each logical processing node, establish a main thread corresponding to the logical processing node; The main thread is sequentially bound to a plurality of sub-threads included in its corresponding logic processing node to generate a corresponding mapping relationship.
Citation Information
Patent Citations
Work flow processing method and device, computer equipment and storage medium
CN108665239A
Task scheduling method, device and equipment
CN113326117A
