CN112003761A - Data acquisition method, device and storage medium - Google Patents

Data acquisition method, device and storage medium Download PDF

Info

Publication number
CN112003761A
CN112003761A CN202010779721.2A CN202010779721A CN112003761A CN 112003761 A CN112003761 A CN 112003761A CN 202010779721 A CN202010779721 A CN 202010779721A CN 112003761 A CN112003761 A CN 112003761A
Authority
CN
China
Prior art keywords
data acquisition
execution
execution object
priority
data
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.)
Pending
Application number
CN202010779721.2A
Other languages
Chinese (zh)
Inventor
尤东
袁晓勇
肖利平
张嘉鑫
谢尔康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhongwu Internet Technology Development Co ltd
Original Assignee
Shenzhen Zhongwu Internet Technology Development Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhongwu Internet Technology Development Co ltd filed Critical Shenzhen Zhongwu Internet Technology Development Co ltd
Priority to CN202010779721.2A priority Critical patent/CN112003761A/en
Publication of CN112003761A publication Critical patent/CN112003761A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/05Digital input using the sampling of an analogue quantity at regular intervals of time, input from a/d converter or output to d/a converter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40013Details regarding a bus controller

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention provides a data acquisition method, a data acquisition device and a storage medium, wherein the data acquisition method comprises the following steps: clearing the execution marks of all the execution objects; acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object; judging according to the priority class, reading the equipment parameters of the execution object, obtaining the equipment data of the execution object based on the equipment parameters, and performing application processing; judging and processing the next execution object according to a table pointer pNext in the execution object linked list; and executing the executing objects which are processed in sequence according to the first priority, the second priority and the timing in the executing object linked list. The invention also provides a data acquisition device and a storage medium. The technical scheme provided by the invention improves the real-time response capability of key equipment data, the real-time monitoring capability of the control system and the safety guarantee capability of the system, and simultaneously reduces the construction and maintenance cost of the control system.

Description

Data acquisition method, device and storage medium
Technical Field
The present invention relates to the field of remote data acquisition technologies, and in particular, to a data acquisition method, device, and storage medium.
Background
RS-485 is an electrical characteristic standard for serial communications defined by the telecommunication industry Association and the electronics industry Association, also known as TIA-485-A, ANSI/TIA/EIA-485 or TIA/EIA-485. The RS-485 bus adopts differential transmission, has the characteristics of long distance, multiple nodes and low transmission line cost, and is widely applied to the fields of remote data acquisition such as industrial automation, Internet of things, meter reading systems and the like. The RS485 bus is in a master-multi-slave topology structure, namely, the same bus only has one master, but allows a plurality of slave devices. The traditional RS-485 bus adopts a polling method to acquire data of devices on the bus one by one. In practical engineering application, remote data acquisition generally adopts a lower communication baud rate (2400-9600bps) to ensure the reliability of data transmission, particularly in some application occasions with difficult wiring, a bigcee or Lora wireless module can be additionally arranged on an RS-485 bus to relay signals, so that the communication efficiency is further reduced, through testing in practical engineering application, the time required for one-time simple double-byte data acquisition (additionally part of communication protocol data) is about tens of milliseconds, and the time required for relaying wireless signals can exceed 200 milliseconds, so that when more devices are arranged on the bus and the scale of data to be acquired is larger, the time consumed for completely polling and acquiring the device data once can be as much as several seconds or even tens of seconds, and when the system has higher requirement on the response speed of device events, the application can be difficult to meet. Generally, if such problems are to be solved, a plurality of RS-485 communication lines need to be erected, and a multi-channel and multi-thread parallel acquisition method is adopted, so that the construction, operation and maintenance costs of the system are greatly increased.
Disclosure of Invention
The invention provides a data acquisition method, a data acquisition device and a storage medium, and aims to solve the problem of large delay and low communication efficiency during data acquisition.
In order to achieve the above object, the present invention provides a data acquisition method, including:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
Further, the execution object linked list is constructed by a plurality of execution object links and a table pointer pNext, where the table pointer pNext is used for the link direction of the execution object.
Further, the execution object includes any one or more of a timer, a priority class, an execution flag, a device address, a function code, a register address, a register number, and a read-write data cache.
Further, the timer is used for timing transmission timing of the timing data with a long period.
Further, the priority class is used to identify a priority order; wherein the first priority is a highest priority for processing high real-time data; the second priority is a sub-optimal level for processing normal real-time data.
Further, the execution flag is a set flag for the execution object of the second priority to complete processing.
Further, the device address, the function code, the register address, the register number, and the read-write data buffer are used for communication packets.
Further, the data acquisition method is used for data acquisition of an RS-485 communication protocol.
In addition, the present invention provides a data acquisition apparatus, which includes a memory and a processor, wherein the memory stores a data acquisition program operable on the processor, and the data acquisition program implements the steps of the data acquisition method as described above when executed by the processor.
Meanwhile, the present invention provides a storage medium, which is a computer-readable storage medium, on which a data acquisition program is stored, where the data acquisition program can be executed by one or more processors to implement the steps of the data acquisition method as described above.
According to the data acquisition method, the data acquisition device and the storage medium, the data acquisition is processed through the priority level and the timer, the real-time response capability of key equipment data is improved, the real-time monitoring capability of a control system is greatly improved, the safety guarantee capability of the system is improved, meanwhile, the construction and maintenance cost of the control system is reduced, and the market popularization value is high.
Drawings
Fig. 1 is a schematic flow chart of a data acquisition method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a message format according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an internal structure of a data acquisition device according to an embodiment of the present invention;
fig. 4 is a schematic diagram of program modules of a data acquisition program in an embodiment of the data acquisition device of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In some data collection applications, not all device data are required to be high real-time, for example, in a sensor device on the same RS-485 bus, some are used for collecting ambient temperature data, some are used for collecting ambient humidity data, some are used for collecting ambient brightness, some are used for collecting grid voltage, some are used for collecting line load current, some are used for collecting line power factor, some are used for collecting active power degree, some are used for collecting fire alarm data, some are used for collecting water immersion data, and the like. Obviously, the active power number can be acquired once an hour or a day or even a month to meet the requirement, and the real-time acquisition requirement is not needed; the environmental temperature, the environmental brightness and the power grid voltage can not generate large changes in a relatively short time, the whole system tends to be stable, although the line load current and the power factor are changed frequently, accidents can not be caused in a short time after the line load current and the power factor deviate from normal values, the application can be met as long as the line load current and the power factor can be detected and adjusted in a short time, and the general real-time acquisition requirement is met; however, fire alarm and water immersion data need to respond in as short a time as possible after abnormal values occur, and the highest data acquisition rate is required. Therefore, the sensor data can be prioritized according to real-time requirements, and the real-time response characteristics of all types of data can be met.
The first embodiment is as follows:
in the first embodiment, the access priority of the device parameters is divided as follows: the high real-time data is of a first priority, the normal real-time data is of a second priority, and the long-period timing data is of a third priority (i.e., period control by a timer). In certain specific application areas, data priority types can be further subdivided or combined, and other similar prioritization and implementation methods are not specifically described in the text but still fall within the scope of the present invention.
Referring to FIG. 1, each access to a device parameter on the RS-485 bus has a specific communication protocol format, most commonly the Modbus communication protocol, such as the message format of a Modbus data read request sent by a host in FIG. 2, multiple parameters may exist in each device, and the register addresses between the multiple parameters may be consecutive or non-consecutive and may require different function codes to be used for the access. Because some extra protocol data overhead is needed during Modbus protocol communication, if each equipment parameter is acquired by using a separate message, the communication efficiency is greatly reduced, so that the parameters which need to be accessed and have continuous addresses are acquired by adopting the number of messages as small as possible in principle, and the communication efficiency is improved. However, if the high-priority device parameter is mixed in the bulk data, a communication message should be made for the high-priority device parameter separately, so as to reduce the acquisition time of the high-priority device parameter. In the data encapsulation of the device data access behavior, although the content of each communication message sent by the host is different, the basic formats of the messages are consistent, and all the messages include a device address, a function code, a register address, the number of registers and read-write data cache, specifically, in fig. 1, an address field refers to an ID of a device which the host wants to access, and the value of the ID is 1 to 127; the function code refers to an operation type which is indicated by the host to be executed by the accessed equipment and has a specific value; the register address refers to a starting address of a register, a coil and an input discrete quantity in the equipment which the host wants to access; the number of registers refers to the total number of registers, coils, input discrete quantities in the device that the host wants to access; the CRC check code is used for carrying out error check on the message data and ensuring the correctness of the data.
Therefore, the process of accessing the device parameters by the host is taken as an execution object, and the execution object comprises any one or more structures of a timer, a priority class, an execution mark, a device address, a function code, a register address, a register number and a read-write data cache; specifically, the timer is used for timing transmission timing of long-period timing data; the priority class is used for identifying a priority order; wherein the first priority is a highest priority for processing high real-time data; the second priority is a sub-optimal level for processing common real-time data; the execution flag is a set flag for the execution object of the second priority to complete processing; the device address, the function code, the register address, the register number and the read-write data cache are used for communication messages. And the execution objects are constructed into an execution object linked list in a linked list mode, the execution object linked list is constructed by a plurality of execution object links and a table pointer pNext, and the table pointer pNext is used for the link direction of the execution objects.
For example, in the first embodiment, the execution object is described based on a C + + programming language, and of course, the description of the execution object is not limited to the C + + programming language. The execution object is described as follows:
Figure BDA0002619756820000051
Figure BDA0002619756820000061
wherein, the member function DeviceAccess () is an application interface model related to basic functions of the Modbus protocol.
A plurality of different Access messages may exist in one device, each message corresponds to one Modbus _ Access object, so that a plurality of Access objects may exist in one device, the plurality of Access objects in a single device are connected into a linked list through a table pointer pNext to form an independent device Access object, and then a plurality of device objects on a bus form a linked list. Instead of setting up a separate device object, the access objects of all devices on a single RS-485 bus may be formed into a single linked list, and the single linked list is used for illustration in the first embodiment.
Referring to fig. 1, an embodiment of the present invention provides a data acquisition method, where the data acquisition method includes:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
Specifically, in the first embodiment, the whole execution object linked list is retrieved, and the execution object is directly executed as long as the retrieved execution object is the first priority execution object, otherwise, only one second-priority execution object is executed in each access execution object linked list retrieval cycle, that is, the second-priority execution object or the timing-expired third-priority execution object is executed, the second-priority execution object and the third-priority execution object compete for only one executed opportunity in each retrieval cycle of the execution object linked list, and then another second-priority execution object is executed in sequence and rotation when the execution object linked list retrieval cycle is accessed next time, so that all the second-priority execution objects and the timing-expired third-priority execution object can obtain a predictable execution opportunity.
Example two:
there are 12 devices on one RS-485 bus, each device has only one parameter (simplified description), A1, A2 are access execution objects of the first priority access parameter, B1, B2, B3, B4, B5, B6, B7, B8, B9 are access execution objects of the second priority access parameter, and C1 is access execution object of the timing access parameter.
The following steps are performed according to the data acquisition method:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
The priority access sequence obtained by using the method is as follows: when the timing access of C1 is not expired, the access sequence is A1-A2-B1, A1-A2-B2, A1-A2-B3, A1-A2-B4, A1-A2-B5, A1-A2-B6, A1-A2-B7, A1-A2-B8, A1-A2-B9; when the C1 timed access is effective, the access sequence is A1-A2-B1, A1-A2-B2, A1-A2-B3, A1-A2-B4, A1-A2-B5, A1-A2-B6, A1-A2-B7, A1-A2-B8, A1-A2-B9 and A1-A2-C1.
It can be seen that the first priority access parameters a1 and a2 can obtain an execution opportunity every three bus accesses, the data refresh rate is increased from one twelfth to one third of the conventional polling method, the data response speed is greatly increased, and the second-level response can be realized. The second priority parameters B1-B9 can obtain an execution opportunity every twenty-seven times of accesses, the data refresh rate is lower than that of the traditional polling method, but the real-time data acquisition can be ensured, and the general real-time application requirements can be met. The timing access parameters acquire data regularly according to the requirements of practical application, and the result of low communication efficiency caused by frequent occupation of bus communication time like the traditional polling method is avoided.
Compared with the prior art, the data acquisition method, the data acquisition device and the storage medium provided by the invention have the advantages that the data acquisition is processed through the priority level and the timer, the RS-485 bus is not required to be electrically transformed or additionally arranged, the real-time response capability of the data of the key equipment is improved in multiples, the real-time monitoring capability of the control system is greatly improved, the safety guarantee capability of the system is improved, the construction and maintenance cost of the control system is reduced, and the market popularization value is high.
The implementation method of the present invention is not limited to the above steps, and a method based on the central idea of multi-priority data collection should be considered to fall within the scope of the present invention.
In order to achieve the above object, the present invention further provides a data acquisition apparatus, which includes a memory and a processor, wherein the memory stores a data acquisition program operable on the processor, and the data acquisition program implements the steps of the data acquisition method when executed by the processor; the data acquisition method is used for data acquisition of an RS-485 communication protocol.
Furthermore, the present invention provides a storage medium, which is a computer-readable storage medium, on which a data acquisition program is stored, where the data acquisition program can be executed by one or more processors to implement the steps of the data acquisition method described above.
Referring to fig. 3, an internal structure diagram of a data acquisition device according to an embodiment of the present invention is provided, where the data acquisition device at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may in some embodiments be an internal storage unit of the data acquisition device, for example a hard disk of the data acquisition device. The memory 11 may also be an external storage device of the data acquisition apparatus in other embodiments, such as a plug-in hard disk provided on the data acquisition apparatus, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 11 may also include both an internal storage unit of the data acquisition apparatus and an external storage device. The memory 11 may be used not only to store application software installed in the data acquisition apparatus and various types of data, such as codes of a data acquisition program, etc., but also to temporarily store data that has been output or is to be output.
The processor 12 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data Processing chip in some embodiments, and is used for executing program codes stored in the memory 11 or Processing data, such as executing a data acquisition program.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the data acquisition device and other electronic devices.
Optionally, the data acquisition device may further include a user interface, the user interface may include a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may further include a standard wired interface and a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the data acquisition device and for displaying a visual user interface.
While fig. 3 shows only a data acquisition device having components 11-14 and a data acquisition program, those skilled in the art will appreciate that the configuration shown in fig. 3 does not constitute a limitation of the data acquisition device, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
In the embodiment of the data acquisition apparatus shown in fig. 3, a data acquisition program is stored in the memory 11; the processor 12, when executing the data acquisition program stored in the memory 11, implements the following steps:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
Referring to fig. 4, a schematic diagram of program modules of a data acquisition program in an embodiment of the data acquisition apparatus of the present invention is shown, in this embodiment, the data acquisition program may be divided into a setting module 10, a determining module 20, a processing module 30, and an acquisition module 40, and exemplarily:
a setting module 10 for setting execution objects and priorities thereof;
a judging module 20, configured to judge to obtain an execution order based on the priority;
a processing module 30, configured to perform device data processing of the execution object and perform application processing;
and the acquisition module 40 is used for acquiring data of the execution object.
The functions or operation steps implemented when the program modules such as the setting module 10, the determining module 20, the processing module 30, and the collecting module 40 are executed are substantially the same as those of the above embodiments, and are not described herein again.
Furthermore, an embodiment of the present invention further provides a storage medium, where the storage medium is a computer-readable storage medium, and the storage medium stores a data acquisition program, where the data acquisition program is executable by one or more processors to implement the following operations:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
The specific implementation of the storage medium of the present invention is substantially the same as the embodiments of the data acquisition method and apparatus, and will not be described herein in a repeated manner.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above, and includes instructions for enabling a terminal device (e.g., a drone, a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A data acquisition method, characterized in that the data acquisition method comprises:
step S1: clearing the execution marks of all the execution objects;
step S2: acquiring a first execution object in an execution object linked list, and reading the priority class of the execution object;
step S3: judging according to the priority class, and executing the step S4 when the priority class is the first priority; otherwise, executing step S7;
step S4: reading the device parameters of the execution object, obtaining the device data of the execution object based on the device parameters, and performing application processing;
step S5: judging a table pointer pNext in the execution object linked list, returning to the step S1 when the pNext is 0, otherwise executing the step S6;
step S6: reading the priority class of the next execution object according to the pointer direction of the table pointer pNext and returning to the step S3;
step S7: judging whether the execution flag of the execution object is set, if not, executing the step S8, otherwise, executing the step S5;
step S8: reading the priority class of the execution object and judging whether the priority class is the second priority, and executing the step S9 when the execution object is the second priority, otherwise executing the step S10;
step S9: returning to step S4 and setting the execution flag of the execution object;
step S10: reading the timer of the execution object and judging that the timer is effective due to expiration, executing the step S11 when the timer is effective due to expiration, otherwise returning to the step S5;
step S11: return to step S9 and reset the timer.
2. The data collection method of claim 1, wherein the chain of execution objects is constructed from a plurality of execution object links and a table pointer pNext for link pointing to the execution objects.
3. The data collection method of claim 1, wherein the execution object comprises any one or more of a timer, a priority class, an execution flag, a device address, a function code, a register address, a register number, and a read-write data cache.
4. A method as claimed in claim 3, wherein the timer is arranged to time the timed delivery of long periods of timed data.
5. The data acquisition method of claim 3, wherein the priority class is used to identify a priority order; wherein the first priority is a highest priority for processing high real-time data; the second priority is a sub-optimal level for processing normal real-time data.
6. The data collection method according to claim 5, wherein the execution flag is a set flag for the execution object of the second priority to complete processing.
7. The data collection method of claim 3, wherein the device address, function code, register address, number of registers, and read-write data cache are used for communication packets.
8. The data acquisition method as claimed in claim 1, wherein the data acquisition method is used for data acquisition of RS-485 communication protocol.
9. A data acquisition device, characterized in that the data acquisition device comprises a memory and a processor, the memory having stored thereon a data acquisition program operable on the processor, the data acquisition program, when executed by the processor, implementing the steps of the data acquisition method according to any one of claims 1 to 8.
10. A storage medium, characterized in that the storage medium is a computer-readable storage medium, on which a data acquisition program is stored, the data acquisition program being executable by one or more processors to implement the steps of the data acquisition method according to any one of claims 1 to 8.
CN202010779721.2A 2020-08-05 2020-08-05 Data acquisition method, device and storage medium Pending CN112003761A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010779721.2A CN112003761A (en) 2020-08-05 2020-08-05 Data acquisition method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010779721.2A CN112003761A (en) 2020-08-05 2020-08-05 Data acquisition method, device and storage medium

Publications (1)

Publication Number Publication Date
CN112003761A true CN112003761A (en) 2020-11-27

Family

ID=73463393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010779721.2A Pending CN112003761A (en) 2020-08-05 2020-08-05 Data acquisition method, device and storage medium

Country Status (1)

Country Link
CN (1) CN112003761A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513707A (en) * 2021-11-23 2022-05-17 安科瑞电气股份有限公司 Intelligent bus data acquisition method
CN117250899A (en) * 2023-10-24 2023-12-19 烟台长青微波科技有限公司 Data acquisition instrument

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502461A (en) * 2019-08-27 2019-11-26 深圳市中物互联技术发展有限公司 A kind of high efficient data capture method based on RS485 communications protocol
CN110519158A (en) * 2018-05-21 2019-11-29 中兴通讯股份有限公司 A kind of gateway and its control method, computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519158A (en) * 2018-05-21 2019-11-29 中兴通讯股份有限公司 A kind of gateway and its control method, computer readable storage medium
CN110502461A (en) * 2019-08-27 2019-11-26 深圳市中物互联技术发展有限公司 A kind of high efficient data capture method based on RS485 communications protocol

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114513707A (en) * 2021-11-23 2022-05-17 安科瑞电气股份有限公司 Intelligent bus data acquisition method
CN114513707B (en) * 2021-11-23 2023-11-14 安科瑞电气股份有限公司 Intelligent bus data acquisition method
CN117250899A (en) * 2023-10-24 2023-12-19 烟台长青微波科技有限公司 Data acquisition instrument

Similar Documents

Publication Publication Date Title
CN110502461B (en) RS485 communication protocol-based efficient data acquisition method
CN112003761A (en) Data acquisition method, device and storage medium
CN104834582B (en) A kind of monitor event methods of exhibiting
CN108255513B (en) Electronic device, springmvc-based data interface, automatic generation method of description of springmvc-based data interface, and storage medium
CN106899549B (en) Network security detection method and device
CN108449313B (en) Electronic device, Internet service system risk early warning method and storage medium
CN110808868B (en) Test data acquisition method and device, computer equipment and storage medium
CN111404945A (en) Method for self-adapting communication protocol and weighing sensor
CN108885544B (en) Front-end page internationalized processing method, application server and computer-readable storage medium
CN116644213A (en) XML file reading method, device, equipment and storage medium
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN112306473B (en) Program interface parameter transmission method, system and related equipment
CN112346944B (en) Method, equipment and storage medium for monitoring operation experience of webpage user
CN109032693A (en) Method and device for loading display information, electronic equipment and readable storage medium
CN114500158A (en) Computer resolvable Modbus-RTU universal standardized configuration method
CN111324845A (en) Method and system for constructing dial plate object
CN111124530A (en) Method and device for calculating first rendering time of browser, browser and storage medium
CN103049069A (en) Terminal battery temperature display method and device and terminal
CN113489572B (en) Request sending method, device, equipment and storage medium
CN102360392B (en) Method and device for determining webpage encoding mode
CN111209613B (en) Rapid design method and system for intelligent product
CN110098991B (en) Equipment for accessing EtherCAT bus system to universal Internet of things cloud platform
CN111431764B (en) Node determining method, device, system and medium
CN204465598U (en) A kind of multiprotocol conversion alert Information Remote Transmission System based on MODBUS
CN103019907A (en) Method and device for monitoring terminal battery temperature and terminal

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518000 1603, west block, Tian'an Innovation Technology Plaza (phase II), intersection of Binhe Road and Xiangmihu Road, Tian'an community, Shatou street, Futian District, Shenzhen, Guangdong Province

Applicant after: Shenzhen Zhongwu Internet Technology Development Co.,Ltd.

Address before: 518000 1905, west block, phase II, Tian'an Innovation Technology Plaza, Tairan 10th Road, Tian'an community, Shatou street, Futian District, Shenzhen, Guangdong Province

Applicant before: Shenzhen Zhongwu Internet Technology Development Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201127