CN117112237A - Real-time data acquisition method based on pure object multipath concurrence - Google Patents
Real-time data acquisition method based on pure object multipath concurrence Download PDFInfo
- Publication number
- CN117112237A CN117112237A CN202311369535.1A CN202311369535A CN117112237A CN 117112237 A CN117112237 A CN 117112237A CN 202311369535 A CN202311369535 A CN 202311369535A CN 117112237 A CN117112237 A CN 117112237A
- Authority
- CN
- China
- Prior art keywords
- data
- external system
- thread
- data processing
- communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000012545 processing Methods 0.000 claims abstract description 148
- 238000004891 communication Methods 0.000 claims abstract description 108
- 238000009825 accumulation Methods 0.000 claims abstract description 17
- 238000004458 analytical method Methods 0.000 claims abstract description 5
- 238000009432 framing Methods 0.000 claims abstract description 5
- 238000001514 detection method Methods 0.000 claims abstract description 4
- 230000005540 biological transmission Effects 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 9
- 230000007958 sleep Effects 0.000 claims description 8
- 230000005059 dormancy Effects 0.000 claims description 5
- 238000007781 pre-processing Methods 0.000 claims description 4
- 230000006378 damage Effects 0.000 claims description 3
- 230000003139 buffering effect Effects 0.000 claims description 2
- 238000007405 data analysis Methods 0.000 claims description 2
- 238000013480 data collection Methods 0.000 claims description 2
- 230000000977 initiatory effect Effects 0.000 claims description 2
- 238000012544 monitoring process Methods 0.000 claims description 2
- 238000012546 transfer Methods 0.000 claims description 2
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000015556 catabolic process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
- G06F9/5055—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5018—Thread allocation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a real-time data acquisition method based on multipath concurrency of pure objects, which comprises the steps of setting the number and communication modes of external systems to be acquired through configuration files, wherein the external systems are all objects; according to the number of external systems to be acquired at present, a one-to-one external system communication thread and a data processing scheduling thread are respectively and dynamically established for each external system, the number of the data processing threads is dynamically adjusted by the data processing scheduling thread according to the accumulation state of the detection data, the external system communication thread is responsible for external system data receiving and internal system data transmitting, and the data processing thread is responsible for the identification and analysis of external system data and the framing of internal system data. The application ensures the compatibility of the acquisition object and the data acquisition speed on one hand, saves the resources of the computer on the other hand, and ensures the stability of the system.
Description
Technical Field
The application mainly relates to the technical field of data acquisition, in particular to a real-time data acquisition method based on real-object multipath concurrence.
Background
At present, most of objects acquired in a data acquisition software framework are semi-physical or simulation software, the semi-physical or simulation software has simple data and small data volume, and an upper computer adopts single-path serial or parallel data acquisition of a lower computer.
The traditional data acquisition software framework is oriented to object diversification and comprises semi-physical objects, simulation software and pure physical objects. Meanwhile, the data acquired by the traditional data acquisition software framework is complex, and the data acquisition software framework is mainly characterized by large data volume, long data acquisition period and the like. Due to the existence of the factors, the traditional data acquisition software framework has the problems of data loss, serious software crash caused by low data processing efficiency, and the like.
The semi-physical object and the simulation software are different in that the semi-physical object allows the access of part of the physical object in the system to perform real-time simulation, and the simulation is performed by adopting a unified model basically, so that expected data is output. And the pure object outputs data according to the actual running state of the equipment. The data generated by the pure objects are different from the data generated by the semi-physical objects and the simulation software:
1) The semi-physical and software simulation data sources are single, the pure physical data sources are various, and the problem of data concurrency exists;
2) The generation speed of semi-physical and software simulation data is low, manual operation exists in the middle, pure physical data is completely and autonomously generated, and the generation speed is high;
3) The semi-physical and software simulation data are stable, the pure physical is influenced by equipment and sensors, messy codes and invalid data can be generated, and the data are uncontrollable.
Because of the above differences, real-time data acquisition of a pure object is more difficult and more demanding than that of a semi-object and software simulation data acquisition. Therefore, designing a pure object data acquisition scheme is a technical problem to be solved in the field.
Disclosure of Invention
Aiming at the technical problems existing in the prior art, the application provides a real-time data acquisition method based on real-time object multipath concurrency, which can be widely applied to various fields, in particular to the field of automatic assembly, and comprises the steps of acquiring real-time data acquisition of real-time object multipath concurrency such as intelligent electric batch, production line state, product assembly and the like.
In order to achieve the above purpose, the technical scheme adopted by the application is as follows:
on one hand, the application provides a real-time data acquisition method based on real-object multipath concurrence, which comprises the following steps:
setting the number and communication modes of external systems to be acquired through configuration files, wherein the external systems are real objects;
according to the number of external systems to be acquired at present, a one-to-one external system communication thread and a data processing scheduling thread are respectively and dynamically established for each external system, the number of the data processing threads is dynamically adjusted by the data processing scheduling thread according to the accumulation state of the detection data, the external system communication thread is responsible for external system data receiving and internal system data transmitting, and the data processing thread is responsible for the identification and analysis of external system data and the framing of internal system data.
Further, in the present application: when the external system has data input, the communication thread of the external system automatically receives and processes the data; when the internal system data needs to be sent outwards, a data sending buffer area is built, and the external system communication thread sends the data when polling.
Further, the data processing scheduling threads are in one-to-one correspondence with the communication threads of the external system, the number of the data processing threads under the data processing scheduling threads is dynamically changed according to the received communication data condition of the external system, whether the data processing threads with empty data cache areas exist is detected when the threads are polled, and destruction is carried out when the data processing threads with empty data cache areas exist.
Further, the data processing thread performs preprocessing according to the data transmitted by the data processing scheduling thread according to a preset protocol, unqualified data are discarded, and the data conforming to the protocol are stored in the data buffer area to wait for thread polling processing.
Compared with the prior art, the application has the technical effects that:
aiming at a plurality of external systems of a pure object, the application can dynamically create one-to-one external system communication threads for each external system according to the number of the external systems to be acquired at present, and can automatically add data processing threads according to the data accumulation condition of a data cache area to help to improve the data processing efficiency; and if the data is accumulated in a reasonable state, the data processing thread is automatically destroyed, so that computer resources are saved.
The whole scheme provided by the application ensures the compatibility of the acquisition object and the data acquisition speed, saves the resources of the computer and ensures the stability of the system.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of a real-time data acquisition method based on real-object multiplexing and concurrency according to an embodiment;
FIG. 2 is a flow chart of a method for processing an external system communication thread according to one embodiment;
FIG. 3 is a flow chart of a method of processing a data processing dispatch thread according to one embodiment;
FIG. 4 is a flow chart of a method for processing a data processing thread according to one embodiment.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Aiming at a plurality of external systems of the pure objects, the real-time data acquisition method based on the multipath concurrence of the pure objects is provided. Because the object is a plurality of external systems of pure objects, the data of the external systems are various, and the data among the external systems are often unordered, so that a plurality of external system data concurrency problems exist. In addition, the pure object data is generated automatically when being completely operated, the generation speed is high, messy codes and invalid data can be generated when the pure object is influenced by equipment and sensors, and the data is uncontrollable. In view of the above, the real-time data acquisition method based on real-object multiplexing provided by an embodiment of the present application includes:
setting the number and communication modes of external systems to be acquired through configuration files, wherein the external systems are all pure object systems;
referring to fig. 1, a frame diagram of a real-time data collection method based on real-time object multiplexing and concurrency is provided in an embodiment, according to the number of external systems to be collected currently, a one-to-one external system communication thread and a data processing scheduling thread are dynamically created for each external system, the number of the data processing threads is dynamically adjusted by the data processing scheduling thread according to a detected data accumulation state, the external system communication thread is responsible for external system data receiving and internal system data sending, and the data processing thread is responsible for external system data identification and analysis and internal system data framing.
According to the scheme, one-to-one external system communication threads are dynamically created for each external system according to the number of the external systems to be acquired at present, and the diversity of data sources is solved. On the other hand, the data processing scheduling thread is used as the core of the scheme, the number of the data processing threads can be dynamically adjusted according to the accumulation state of the detected data, and when the accumulation condition of the detected data exists or the accumulation of the data exceeds the limit, a new data processing thread is added, so that the data processing efficiency is improved. When the data is detected to have no accumulation condition or the data accumulation does not exceed the limit, the idle data processing thread is automatically destroyed when the data accumulation is in a reasonable state, and the computer resource can be saved. On one hand, the compatibility of the acquired objects and the data acquisition speed are ensured, on the other hand, the resources of a computer are saved, and the stability of the system is ensured.
Specifically, an embodiment proposes that when an external system has data input, the external system communication thread automatically receives and processes the data; when the internal system data needs to be sent outwards, a data sending buffer area is built, and the external system communication thread sends the data when polling.
According to the application, the data processing scheduling threads are in one-to-one correspondence with the communication threads of the external system, the number of the data processing threads under the data processing scheduling threads is dynamically changed according to the received communication data condition of the external system, whether the data processing threads with empty data cache areas exist is detected when the threads are polled, and destruction is carried out when the data processing threads exist.
And the data processing thread performs preprocessing according to the data transmitted by the data processing scheduling thread and a preset protocol, unqualified data is discarded, and the data conforming to the protocol is stored in the data buffer area to wait for thread polling processing.
It can be understood that the task of the external system communication thread is mainly responsible for receiving and sending data, and the external system communication thread corresponding to each external system is dynamically created to perform one-to-one exclusive communication work according to the current situation of the external system to be acquired. In order to avoid conflict between data transmission and data reception in the external system communication thread, a response mechanism is adopted for data reception, and when data from an external system is transmitted, the corresponding external system communication thread automatically receives and processes the data; and when the internal system data needs to be sent out through the corresponding external system communication thread, a data buffer area is built, and the external system communication thread transmits the data when polling. The final data of the two are transmitted to a computer for unified scheduling transmission, and the problem of conflict between data transmission and data reception is avoided theoretically.
In one embodiment, a method for processing an external system communication thread is provided, and a flowchart of the method is shown in fig. 2, and the method includes the following steps:
(1.1) reading the configuration file to obtain communication parameters;
(1.2) establishing corresponding external system communication threads according to the communication parameters;
(1.3) initiating an external system communication thread;
(1.4) establishing a data transmission buffer area for storing internal system data to be transmitted outwards;
(1.5) judging whether data needing to be sent outwards currently exist in the data sending buffer area, if so, sending the data to an external system for a backward transfer step (1.6), and if not, transferring the data needing to be sent outwards currently to the step (1.6);
and (1.6) monitoring whether the external system transmits data, if the external system does not monitor the transmission data of the external system currently, switching to the step (1.6) after the communication thread of the external system is dormant for the first set time, and if the external system does monitor the transmission data of the external system currently, reading the communication data from the external system, and transmitting the communication data into the corresponding data processing dispatching thread along with the corresponding communication parameters (including but not limited to the communication address) of the external system, wherein the step (1.6) is switched to the step after the communication thread of the external system is dormant for the first set time currently.
In this embodiment, the first set time is set to 5ms, and it will be understood that those skilled in the art may set other lengths of time based on practical situations, that is, the present application is not limited to the first set time specifically.
The processing method of the external system communication thread provided by the above embodiment is that the external system communication thread is used for receiving communication data from an external system and transmitting internal system data to the external system. When the software is started, an external system communication thread is established and started, and when the transmitted data from an external system is monitored, the communication data is transmitted into the corresponding data processing scheduling thread along with the corresponding external system communication parameters by the vertical horse. The internal system data is transmitted into the external system communication thread by the data processing thread through the data processing scheduling thread, and when the external system communication thread receives the data which needs to be transmitted to the external system, the internal system data which needs to be transmitted to the external system is put into the data buffer area and then is polled and transmitted.
The processing method of the external system communication thread provided by the embodiment has the advantages that the logic processing is simple, the data processing efficiency is high, and the thread adopts dormancy processing, so that the occurrence of dead loop program breakdown caused by the excessively high thread polling speed is prevented.
In one embodiment, a method for processing a data processing scheduling thread is provided, and a flowchart of the method is shown in fig. 3, and includes the following steps:
(2.1) initializing a data processing scheduling thread according to the configured communication parameters and starting.
And then, dividing the data processing scheduling thread into two synchronous parallel branch lines, wherein one branch line comprises the steps (2.2) to (2.8) and is used for reasonably creating and starting the data processing thread according to the current situation of communication data from the external system communication thread, the situation of whether the corresponding data processing thread exists or not and the data accumulation situation of the data processing thread, and transmitting the current communication data from the external system communication thread into the corresponding data processing thread, so that the data processing efficiency is improved. The other branch line comprises the steps (2.2.1) to (2.2.3) and is used for detecting whether a data processing thread with an empty data cache area exists or not when the thread polls, and destroying the thread when the thread exists to release computer resources.
Specifically, the flow of steps (2.2) to (2.8) is as follows:
(2.2) establishing a data buffer area in the data processing scheduling thread for buffering communication data from the external system communication thread and corresponding external system communication parameters;
(2.3) judging whether a data buffer area in the current data processing scheduling thread is empty, if so, enabling the data processing scheduling thread to sleep for a second set time, turning to the step (2.3), and if not, turning to the step (2.4);
(2.4) judging whether a data processing thread corresponding to the currently received external system communication data exists or not according to the communication address in the currently received external system communication parameters, if so, turning to the step (2.6), and if not, turning to the step (2.5);
(2.5) creating and starting a data processing thread of an external system corresponding to the currently received external system communication parameters, transmitting the currently received external system communication parameters and communication data into the data processing thread of the corresponding external system, and enabling the data processing scheduling thread to sleep for a second set time, and turning to the step (2.3);
(2.6) judging whether the data accumulation condition of the data processing thread corresponding to the currently received external system communication data exceeds a limit value, if so, turning to the step (2.7); if not, turning to the step (2.8);
(2.7) dynamically creating and starting a data processing thread of an external system corresponding to the new currently received external system communication parameters, and turning to the step (2.8);
and (2.8) transmitting the currently received external system communication data and the corresponding external system communication parameters into the data processing thread of which the data accumulation condition does not exceed the limit value.
After step (2.1), the processes from step (2.2.1) to step (2.2.3) are synchronously performed, and specifically the method comprises the following steps:
(2.2.1) traversing all current data processing threads, judging whether the data buffer areas in the current data processing threads are empty, if the data buffer areas in the current data processing threads are empty, turning to the step (2.2.2), and if the data buffer areas in the current data processing threads are not empty, turning to the step (2.2.3);
(2.2.2) destroying the data processing thread with the data buffer area empty, and turning to the step (2.2.3);
(2.2.3) the data processing scheduling thread sleeps for a third set time, and the step (2.2.1) is shifted.
In this embodiment, the second set time is set to 5ms, and the third set time is set to 100ms. It will be appreciated that those skilled in the art may set other lengths of time based on the actual situation, that is, the present application is not limited to the second setting time and the third setting time.
In the above embodiment, the proposed data processing scheduling thread is a dynamically managed data processing thread, which aims to improve software processing efficiency, and improve efficiency and embody data acquisition efficiency and processing efficiency. When software is started, a data processing scheduling thread is established and started, the data processing scheduling thread corresponds to an external system communication thread one by one, the number of the data processing threads under the data processing scheduling thread is not fixed, the data processing threads are changed according to the data condition, whether the data processing threads with empty data cache areas exist is detected when the threads are polled, and if the data processing threads exist, the data processing threads are destroyed, so that computer resources are released. The final aim is to fully utilize the performance of the computer to improve the data processing efficiency on the premise of ensuring the stability of the system and the software.
In one embodiment, a method for processing a data processing thread is provided, and a flowchart of the method is shown in fig. 4, and includes the following steps:
initializing a data processing thread, starting the data processing thread, and establishing a data cache area in the data processing thread;
(3.2) receiving communication data from the data processing scheduling thread, checking whether the communication data meets the protocol requirements, if not, discarding invalid data, and if so, storing the communication data into a data buffer area;
(3.3) judging whether the current data cache area has data, if not, dormancy of the data processing thread is performed for a fourth set time, and turning to the step (3.3); if so, turning to the step (3.4);
and (3.4) reading data from the data cache area, and after data analysis and data application processing, dormancy of the data processing thread is performed for a fourth set time, and the step (3.3) is performed.
In this embodiment, the fourth setting time is set to 5ms, and it will be understood that those skilled in the art may set other lengths of time based on practical situations, that is, the present application is not limited to the fourth setting time specifically.
The data processing thread in the above embodiment is mainly used for analyzing communication data, the data processing thread performs preprocessing according to a predetermined protocol according to data transmitted by the data processing scheduling thread, unqualified data is discarded, and data conforming to the protocol is stored in the data buffer area to wait for thread polling processing. Furthermore, a special data buffer area is built in the data processing thread, and the data buffer area is hooked with the memory of the computer, so that software breakdown caused by too small data buffer area is well avoided.
In another embodiment, an apparatus for real-time data acquisition based on real-object multiplexing is provided, including:
the first module is used for setting the number of external systems to be acquired and the communication mode through configuration files, wherein the external systems are all real objects;
the second module is used for dynamically creating one-to-one external system communication threads for each external system according to the number of the external systems to be acquired at present, each data processing thread comprises an external system communication thread, a data processing scheduling thread and a data processing thread, the external system communication thread is responsible for external system data receiving and internal system data sending, the data processing scheduling thread is responsible for dynamically adjusting the number of the data processing threads according to the detection data accumulation state, and the data processing thread is responsible for identification and analysis of external system data and framing of internal system data.
The implementation method of each module may be the method described in any of the foregoing embodiments, which is not described herein.
The application is not a matter of the known technology.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. The real-time data acquisition method based on the multipath concurrence of the pure objects is characterized by comprising the following steps of:
setting the number and communication modes of external systems to be acquired through configuration files, wherein the external systems are real objects;
according to the number of external systems to be acquired at present, respectively dynamically creating one-to-one external system communication threads and data processing scheduling threads for each external system, wherein the data processing scheduling threads dynamically adjust the number of the data processing threads according to the accumulation state of detection data, the external system communication threads are responsible for external system data receiving and internal system data transmitting, and the data processing threads are responsible for identification and analysis of external system data and framing of internal system data;
the working process of the data processing scheduling thread comprises the following steps:
(2.1) initializing a data processing scheduling thread according to the configured communication parameters and starting the thread;
(2.2) establishing a data buffer area in the data processing scheduling thread for buffering communication data from the external system communication thread and corresponding external system communication parameters;
(2.3) judging whether a data buffer area in the current data processing scheduling thread is empty, if so, enabling the data processing scheduling thread to sleep for a second set time, turning to the step (2.3), and if not, turning to the step (2.4);
(2.4) judging whether a data processing thread corresponding to the currently received external system communication data exists or not according to the communication address in the currently received external system communication parameters, if so, turning to the step (2.6), and if not, turning to the step (2.5);
(2.5) creating and starting a data processing thread of an external system corresponding to the currently received external system communication parameters, transmitting the currently received external system communication parameters and communication data into the data processing thread of the corresponding external system, and enabling the data processing scheduling thread to sleep for a second set time, and turning to the step (2.3);
(2.6) judging whether the data accumulation condition of the data processing thread corresponding to the currently received external system communication data exceeds a limit value, if so, turning to the step (2.7); if not, turning to the step (2.8);
(2.7) dynamically creating and starting a data processing thread of an external system corresponding to the new currently received external system communication parameters, and turning to the step (2.8);
and (2.8) transmitting the currently received external system communication data and the corresponding external system communication parameters into the data processing thread of which the data accumulation condition does not exceed the limit value.
2. The real-time data acquisition method based on real-object multiplexing concurrency according to claim 1, wherein when the external system has data input, the external system communication thread automatically receives and processes the data; when the internal system data needs to be sent outwards, a data sending buffer area is built, and the external system communication thread sends the data when polling.
3. The real-time data acquisition method based on pure object multipath concurrency according to claim 1, wherein the data processing scheduling threads are in one-to-one correspondence with external system communication threads, the number of the data processing threads under the data processing scheduling threads is dynamically changed according to the received communication data condition of the external system, and when the threads are polled, whether the data processing threads with empty data cache areas exist is detected, and when the data processing threads with empty data cache areas exist, destruction is performed.
4. The real-time data acquisition method based on real-time object multiplexing concurrency according to claim 1, wherein the data processing thread performs preprocessing according to a preset protocol on the data transmitted by the data processing scheduling thread, unqualified data are discarded, and the data conforming to the protocol are stored in the data buffer area to wait for thread polling processing.
5. The real-time data acquisition method based on real-object multipath concurrency according to claim 1, wherein the working process of the external system communication thread comprises the following steps:
(1.1) reading the configuration file to obtain communication parameters;
(1.2) establishing corresponding external system communication threads according to the communication parameters;
(1.3) initiating an external system communication thread;
(1.4) establishing a data transmission buffer area for storing internal system data to be transmitted outwards;
(1.5) judging whether data needing to be sent outwards currently exist in the data sending buffer area, if so, sending the data to an external system for a backward transfer step (1.6), and if not, transferring the data needing to be sent outwards currently to the step (1.6);
and (1.6) monitoring whether the external system transmits data, if the external system does not monitor the transmission data of the external system currently, switching to the step (1.6) after the communication thread of the external system sleeps for a first set time, and if the external system monitors the transmission data of the external system currently, reading the communication data from the external system and transmitting the communication data to the corresponding data processing scheduling thread together with the corresponding external system communication parameters, and switching to the step (1.6) after the communication thread of the external system sleeps for the first set time currently.
6. The real-time data collection method based on real-time object multiplexing concurrency according to any one of claims 1 to 5, wherein during the working process of the data processing scheduling thread, after step (2.1), the following steps are performed synchronously:
(2.2.1) traversing all current data processing threads, judging whether the data buffer areas in the current data processing threads are empty, if the data buffer areas in the current data processing threads are empty, turning to the step (2.2.2), and if the data buffer areas in the current data processing threads are not empty, turning to the step (2.2.3);
(2.2.2) destroying the data processing thread with the data buffer area empty, and turning to the step (2.2.3);
(2.2.3) the data processing scheduling thread sleeps for a third set time, and the step (2.2.1) is shifted.
7. The real-time data acquisition method based on real-object multiplexing concurrency according to claim 6, wherein the working process of the data processing thread comprises the following steps:
initializing a data processing thread, starting the data processing thread, and establishing a data cache area in the data processing thread;
(3.2) receiving communication data from the data processing scheduling thread, checking whether the communication data meets the protocol requirements, if not, discarding invalid data, and if so, storing the communication data into a data buffer area;
(3.3) judging whether the current data cache area has data, if not, dormancy of the data processing thread is performed for a fourth set time, and turning to the step (3.3); if so, turning to the step (3.4);
and (3.4) reading data from the data cache area, and after data analysis and data application processing, dormancy of the data processing thread is performed for a fourth set time, and the step (3.3) is performed.
8. The real-time data acquisition method based on real-time object multiplexing as described in claim 7, wherein the first set time, the second set time and the fourth set time are equal.
9. The real-time data acquisition method based on real-time object multiplexing and concurrency according to claim 8, wherein the first set time, the second set time and the fourth set time are all 5ms.
10. The real-time data acquisition method based on real-object multiplexing as claimed in claim 8 or 9, wherein the third set time is set to 100ms.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311369535.1A CN117112237B (en) | 2023-10-23 | 2023-10-23 | Real-time data acquisition method based on pure object multipath concurrence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311369535.1A CN117112237B (en) | 2023-10-23 | 2023-10-23 | Real-time data acquisition method based on pure object multipath concurrence |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117112237A true CN117112237A (en) | 2023-11-24 |
CN117112237B CN117112237B (en) | 2023-12-29 |
Family
ID=88800495
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311369535.1A Active CN117112237B (en) | 2023-10-23 | 2023-10-23 | Real-time data acquisition method based on pure object multipath concurrence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117112237B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080313637A1 (en) * | 2007-06-13 | 2008-12-18 | Hee Yong Youn | Prediction-based dynamic thread pool management method and agent platform using the same |
US20110231854A1 (en) * | 2009-09-01 | 2011-09-22 | International Business Machines Corporation | Method and Infrastructure for Optimizing the Utilization of Computer System's Resources |
CN102307369A (en) * | 2011-09-13 | 2012-01-04 | 北京科技大学 | Device and method for supporting parallel simulation and physical simulation of wireless sensor network |
US20120017217A1 (en) * | 2010-07-13 | 2012-01-19 | Fujitsu Limited | Multi-core processing system and computer readable recording medium recorded thereon a schedule management program |
CN103810048A (en) * | 2014-03-11 | 2014-05-21 | 国家电网公司 | Automatic adjusting method and device for thread number aiming to realizing optimization of resource utilization |
US20170116030A1 (en) * | 2015-10-22 | 2017-04-27 | International Business Machines Corporation | Low latency scheduling on simultaneous multi-threading cores |
US20180276046A1 (en) * | 2017-03-21 | 2018-09-27 | Arm Limited | Hardware thread scheduling |
CN112445615A (en) * | 2020-11-12 | 2021-03-05 | 广州海鹚网络科技有限公司 | Thread scheduling system, computer equipment and storage medium |
CN115098220A (en) * | 2022-06-17 | 2022-09-23 | 西安电子科技大学 | Large-scale network node simulation method based on container thread management technology |
CN116456216A (en) * | 2023-02-13 | 2023-07-18 | 杭州西力智能科技股份有限公司 | Multi-path low-pressure meter reading system and method based on HPLC and dual-mode communication |
US20230276483A1 (en) * | 2019-10-24 | 2023-08-31 | Peking University | Multipath-scheduling-based relay device |
-
2023
- 2023-10-23 CN CN202311369535.1A patent/CN117112237B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080313637A1 (en) * | 2007-06-13 | 2008-12-18 | Hee Yong Youn | Prediction-based dynamic thread pool management method and agent platform using the same |
US20110231854A1 (en) * | 2009-09-01 | 2011-09-22 | International Business Machines Corporation | Method and Infrastructure for Optimizing the Utilization of Computer System's Resources |
US20120017217A1 (en) * | 2010-07-13 | 2012-01-19 | Fujitsu Limited | Multi-core processing system and computer readable recording medium recorded thereon a schedule management program |
CN102307369A (en) * | 2011-09-13 | 2012-01-04 | 北京科技大学 | Device and method for supporting parallel simulation and physical simulation of wireless sensor network |
CN103810048A (en) * | 2014-03-11 | 2014-05-21 | 国家电网公司 | Automatic adjusting method and device for thread number aiming to realizing optimization of resource utilization |
US20170116030A1 (en) * | 2015-10-22 | 2017-04-27 | International Business Machines Corporation | Low latency scheduling on simultaneous multi-threading cores |
US20180276046A1 (en) * | 2017-03-21 | 2018-09-27 | Arm Limited | Hardware thread scheduling |
US20230276483A1 (en) * | 2019-10-24 | 2023-08-31 | Peking University | Multipath-scheduling-based relay device |
CN112445615A (en) * | 2020-11-12 | 2021-03-05 | 广州海鹚网络科技有限公司 | Thread scheduling system, computer equipment and storage medium |
CN115098220A (en) * | 2022-06-17 | 2022-09-23 | 西安电子科技大学 | Large-scale network node simulation method based on container thread management technology |
CN116456216A (en) * | 2023-02-13 | 2023-07-18 | 杭州西力智能科技股份有限公司 | Multi-path low-pressure meter reading system and method based on HPLC and dual-mode communication |
Non-Patent Citations (1)
Title |
---|
陈小辉, 刘心松, 左朝树, 陈建英: "分布式并行数据库中基于调度的多线程通信模型之研究", 小型微型计算机系统, no. 04 * |
Also Published As
Publication number | Publication date |
---|---|
CN117112237B (en) | 2023-12-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101150809B (en) | Method for arousing and stream control of mobile terminal processor serial port | |
CN111580995A (en) | Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene | |
WO2015184866A1 (en) | Monitoring method and device, and first monitoring unit in power source system | |
CN110445683B (en) | Server, equipment, method and system for monitoring survival state of server | |
CN109219074B (en) | Monitoring method, monitor and detection device of sensor network | |
CN117112237B (en) | Real-time data acquisition method based on pure object multipath concurrence | |
CN105050129B (en) | Data interaction method and device | |
CN113904893A (en) | Modbus protocol-based slave device intelligent discovery and management method and device | |
CN103353750B (en) | A kind of microwave metallurgical control method based on multibus | |
CN104486188A (en) | Method and setting device for setting receiving and sending detached threads | |
CN112506154A (en) | Internet of things monitoring system for domestic sewage treatment station | |
CN106685764A (en) | Communication system and communication method based on data acquisition transmission | |
CN114268670B (en) | Ethernet asynchronous message processing system and method based on time triggering | |
CN109672728A (en) | A kind of large-scale distributed clustered node information fast acquiring method | |
CN102693434B (en) | Communication apparatus and method for interface layer of radio frequency identification device | |
CN111901214B (en) | Power monitoring serial communication method and system based on optimized polling mechanism | |
CN113918640A (en) | ETL flow execution method based on asynchronous mode | |
CN211293728U (en) | Data interaction system between PLC remote modules | |
CN103309840A (en) | Connection establishment method and device | |
CN114090493A (en) | Data transmission control method based on RS485 bus and related device | |
CN114257655A (en) | IEC104 protocol processing method and device based on 5G communication | |
CN114647448A (en) | Method, device, equipment and storage medium for awakening communication among multiple single-chip microcomputers | |
CN206363516U (en) | A kind of concentrator for receiving terminal monitor signal | |
US20150137995A1 (en) | Communication apparatus, system, and communication method | |
CN112765212A (en) | Data processing method and device for transfer equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |