CN116821177B - Equipment data query method and device, electronic equipment and storage medium - Google Patents

Equipment data query method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116821177B
CN116821177B CN202311107643.1A CN202311107643A CN116821177B CN 116821177 B CN116821177 B CN 116821177B CN 202311107643 A CN202311107643 A CN 202311107643A CN 116821177 B CN116821177 B CN 116821177B
Authority
CN
China
Prior art keywords
query
target signal
memory area
determining
signal point
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.)
Active
Application number
CN202311107643.1A
Other languages
Chinese (zh)
Other versions
CN116821177A (en
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.)
Hangzhou Kongtrolink Information Technology Co ltd
Original Assignee
Hangzhou Kongtrolink Information Technology 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 Hangzhou Kongtrolink Information Technology Co ltd filed Critical Hangzhou Kongtrolink Information Technology Co ltd
Priority to CN202311107643.1A priority Critical patent/CN116821177B/en
Publication of CN116821177A publication Critical patent/CN116821177A/en
Application granted granted Critical
Publication of CN116821177B publication Critical patent/CN116821177B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a device data query method, a device, electronic equipment and a storage medium, wherein target signal points to be queried are determined, the signal list to be queried corresponding to each target signal point is generated by sequencing the height of a memory address, then a signal query mode corresponding to each target signal point is determined according to the sequence of the target signal points in the signal list to be queried in a dynamic design mode, and finally data query operation is executed according to the determined signal query mode, so that the determination efficiency of the signal query mode is improved, and the device data query efficiency is further improved.

Description

Equipment data query method and device, electronic equipment and storage medium
Technical Field
The present application relates to edge computing technologies, and in particular, to a device data query method, a device data query apparatus, an electronic device, and a storage medium.
Background
In an industrial internet of things system, a large number of devices accessing an edge computing host system exist, and the edge computing host realizes reading of device data and parameter setting through a communication protocol of the devices. The device comprises a plurality of signal points, the signal points are distributed in the device memory, and the edge computing host reads through a preset communication protocol.
According to different industrial scenes, the acquisition modes of the signal points by the users are different. Some signal points are distributed in a continuous section of memory, and some signal points are distributed in the memory at intervals. The configuration of each signal point generally comprises a signal point position address and a signal point position length, and is inquired through a serial port mode. In the current device data query method, a query strategy is generally determined by adopting a static design mode, so that the device data query efficiency is low.
Disclosure of Invention
The application provides a device data query method, a device, electronic equipment and a storage medium, which are used for solving the problem that the device data query efficiency is low because a query strategy is determined by adopting a static design mode in the current device data query method.
In a first aspect, the present application provides a device data query method, including:
determining a target signal point position to be queried;
determining a signal list to be queried according to the memory address of the target signal point location;
determining a signal query mode corresponding to each target signal point position according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
and according to the determined signal query mode, carrying out data query on each target signal point location.
As an optional implementation manner, determining, according to the signal list to be queried, a signal query mode corresponding to each target signal point location, including:
initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length;
determining the memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
and according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location.
As an optional implementation manner, initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length, including:
determining the query length of the memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
according to the preset communication protocol type, determining the inquiring frame byte length, the signal point byte length and the single byte transmission time of each target signal point, and determining the response time of the equipment;
determining single-point data query time of each target signal point according to the query frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
And determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
As an alternative embodiment, the method further comprises:
determining mode selection parameters according to the single-point data query time and the memory area data query time;
the mode selection parameters are used for determining signal query modes corresponding to target signal points in the memory area sliding window moving process.
As an optional implementation manner, according to a memory address sequence, moving a memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location, including:
according to the memory address sequence, moving the memory region sliding window to perform data query on each target signal point location, and determining the number of target signal point locations in the current memory region sliding window;
if the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the sliding window of the current memory area as single-point query;
if the number of the target signal points is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal points in the sliding window of the current memory area as batch inquiry;
And in the process of carrying out data query on each target signal point in the moving memory area sliding window, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
In a second aspect, the present application provides a device data query apparatus, the apparatus comprising:
the point position determining module is used for determining the point position of the target signal to be queried;
the list determining module is used for determining a signal list to be queried according to the memory address of the target signal point location;
the mode determining module is used for determining a signal query mode corresponding to each target signal point position according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
and the data query module is used for carrying out data query on each target signal point location according to the determined signal query mode.
As an optional implementation manner, the mode determining module determines, according to the signal list to be queried, a specific mode of a signal query mode corresponding to each target signal point location, including:
Initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length;
determining the memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
and according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location.
As an optional implementation manner, the mode determining module initializes data query time corresponding to each target signal point according to the signal list to be queried, and establishes a memory area sliding window with a preset length, including:
determining the query length of the memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
according to the preset communication protocol type, determining the inquiring frame byte length, the signal point byte length and the single byte transmission time of each target signal point, and determining the response time of the equipment;
determining single-point data query time of each target signal point according to the query frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
And determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
As an alternative embodiment, the apparatus further comprises a parameter determining module for:
determining mode selection parameters according to the single-point data query time and the memory area data query time;
the mode selection parameters are used for determining signal query modes corresponding to target signal points in the memory area sliding window moving process.
As an optional implementation manner, the mode determining module moves the memory area sliding window to perform data query on each target signal point location according to the memory address sequence, and determines a specific mode of a signal query mode corresponding to each target signal point location, including:
according to the memory address sequence, moving the memory region sliding window to perform data query on each target signal point location, and determining the number of target signal point locations in the current memory region sliding window;
if the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the sliding window of the current memory area as single-point query;
If the number of the target signal points is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal points in the sliding window of the current memory area as batch inquiry;
and in the process of carrying out data query on each target signal point in the moving memory area sliding window, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
In a third aspect, the present application also provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as in the first aspect.
In a fourth aspect, the application also provides a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, are adapted to carry out the method of the first aspect.
According to the device data query method, the device, the electronic device and the storage medium, the target signal points to be queried are determined, the signal list to be queried corresponding to the target signal points is generated by sequencing the high and low of the memory address, the signal query mode corresponding to the target signal points is determined according to the sequence of the target signal points in the signal list to be queried in a dynamic design mode, and finally the data query operation is executed according to the determined signal query mode, so that the determination efficiency of the signal query mode is improved, and the device data query efficiency is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of an application scenario of a device data query method disclosed in an embodiment of the present application;
fig. 2 is a schematic diagram of another application scenario of a device data query method disclosed in an embodiment of the present application;
FIG. 3 is a schematic flow chart of a device data query method according to an embodiment of the present application;
FIG. 4 is a flow chart of another method for querying device data according to an embodiment of the present application;
Fig. 5 is a schematic diagram of another application scenario of a device data query method disclosed in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a device data query apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of another device data query apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device for querying device data according to an embodiment of the present application;
specific embodiments of the present application have been shown by way of the above drawings and will be described in more detail below. The drawings and the written description are not intended to limit the scope of the inventive concepts in any way, but rather to illustrate the inventive concepts to those skilled in the art by reference to the specific embodiments.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
Referring to fig. 1, fig. 1 is a schematic diagram of an application scenario of a device data query method according to an embodiment of the present invention. As shown in fig. 1, in an industrial internet of things system, there are a large number of devices accessing an edge computing host system, and the edge computing host implements reading of device data and parameter setting through a communication protocol of the devices. For example, in a factory intelligent manufacturing process, an industrial internet of things needs to be established in a factory to realize ubiquitous interconnection of factory equipment. The device is accessed to an edge computing host in a communication protocol mode, and the edge computing host realizes reading of device data and parameter setting through the communication protocol of the device. The device comprises a plurality of signal points, the signal points are distributed in the memory of the device, and the edge computing host reads through a communication protocol (such as MODBUS RTU). According to different industrial scenes, the acquisition of the signal points by the user is different. Some signal points are distributed in a continuous section of memory, and some signal points are distributed in the memory at intervals. The configuration of each signal point generally comprises a signal point position address and a signal point position length, and is inquired through a serial port mode.
The main means of inquiring the signal points of the equipment at present is to firstly carry out static design on the signal inquiring mode of each signal point, and then carry out equipment data inquiring flow on each signal point one by one through the designed signal inquiring mode. Specifically, the method is to search signal points by taking the signal points as units, namely, the edge computing gateway forms a query list from the signal points which need to be queried by a user, and queries the signal points one by one. The other mode is to divide the memory of the device, identify the divided memory area according to the signal point address to be inquired, if the area has signal points, identify the memory area to form a memory area identification list, the edge computing host computer inquires the whole area data one by one according to the memory area in the memory area identification list, and analyze the signal points from the data in the memory area. In addition, after the number of signal points and the configuration information are determined, the edge computing host can also calculate the average query time of each signal point in the two modes, and the mode has high efficiency, namely the mode is adopted, so that the data query efficiency is improved to a certain extent, but the query efficiency is still insufficient in practical application.
Referring to fig. 2, fig. 2 is a schematic diagram of an application scenario of another device data query method disclosed in an embodiment of the present application, so as to illustrate the technical concept of the present application. As shown in fig. 2, after the signal point positions to be acquired are determined, the edge computing host orders according to the addresses of the signal point positions to form a signal list to be queried. Two data query modes exist in the edge computing gateway, namely a single point mode and a batch mode. The single-point mode is to inquire according to a single signal point, and the batch mode is to inquire continuously a plurality of signal points according to a memory area mode. If a single point mode is adopted, the data of a plurality of signal points are queried at one time by taking a single signal point as a unit, and if a batch mode is adopted. For the single-point mode or the batch mode, a specific query strategy can be determined through a built-in query template. Specifically, the target signal points to be queried are determined, the signal list to be queried corresponding to each target signal point is generated by sequencing the high and low of the memory address, then the signal query mode corresponding to each target signal point is determined according to the sequence of the target signal points in the signal list to be queried in a dynamic design mode, finally the data query operation is executed according to the determined signal query mode, the determination efficiency of the signal query mode is improved, and the data query efficiency of equipment is further improved.
Example 1
Referring to fig. 3, fig. 3 is a flow chart of a device data query method according to an embodiment of the invention. As shown in fig. 3, the method includes:
s101, determining target signal points to be queried;
the target signal points can be from the same equipment or from different equipment in the same system, but each target signal point needs to be accessed to the same edge computing host or belongs to the edge computing host in one edge computing system, and each target signal point can be used for indicating parameters, working states, signal states or communication states of the equipment.
S102, determining a signal list to be queried according to the memory address of the target signal point location;
the memory addresses occupied by the target signal points have a reading sequence, so that a signal list to be queried can be generated according to the memory addresses, and the memory address relation of each target signal is indicated through the list.
S103, determining a signal query mode corresponding to each target signal point position according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
the determining process of the signal query mode is a dynamically designed process, and can be specifically referred to the related description in other embodiments.
S104, according to the determined signal query mode, carrying out data query on each target signal point location.
The single-point query and the batch query have the same meaning as the previous, if the single-point mode is adopted, the query is carried out by taking a single signal point as a unit, and if the batch mode is adopted, the data of a plurality of signal points are queried at one time. Through the reasonable design of the query mode of each signal point, the efficiency of equipment data query can be integrally and real-timely improved.
According to the method, the target signal points to be queried are determined, the signal list to be queried corresponding to the target signal points is generated by sequencing the target signal points to be queried according to the height of the memory address, then the signal query mode corresponding to the target signal points is determined according to the sequence of the target signal points in the signal list to be queried in a dynamic design mode, finally the data query operation is executed according to the determined signal query mode, the determination efficiency of the signal query mode is improved, and the data query efficiency of equipment is improved.
Example two
Referring to fig. 4, fig. 4 is a flowchart of another device data query method according to an embodiment of the present invention. As shown in fig. 4, the method includes:
s201, determining a target signal point position to be queried;
S202, determining a signal list to be queried according to the memory address of the target signal point location;
s203, initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length;
the specific mode of dynamic design is that the search mode which the signal points in the window should take is determined in real time through the sliding window of the memory area, the window slides according to the preset memory address sequence, and the signal search mode of each signal point is updated in real time in the sliding process, so that the design of the signal search mode of each signal point can be completed after the window slides to the last byte of the memory address.
S204, determining the memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
in addition, the process of determining the memory sequence may be completed in the process of forming the signal list to be queried.
S205, according to the memory address sequence, moving a memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location;
the signal query mode comprises single-point query or batch query;
s206, according to the determined signal query mode, carrying out data query on each target signal point location.
For the related descriptions of S201, S202, and S206, reference may be made to the related descriptions in the first embodiment, and the description is omitted here.
As an optional implementation manner, initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length, including:
determining the query length of the memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
according to the preset communication protocol type, determining the inquiring frame byte length, the signal point byte length and the single byte transmission time of each target signal point, and determining the response time of the equipment;
determining single-point data query time of each target signal point according to the query frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
and determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
Specifically, each index is defined as follows:
inquiring frame byte length: LF; single byte transmission time: TB; memory area inquiry time: TM; device response time: t is a T; signal point byte length: LB; memory area query length: LM.
Then there is a single signal point transmission time tb1=lf+lb+tb+t, and the time required to query a memory area length LM is calculated as: tm=lf+lm+tb+t, and the memory area sliding window size is LM.
TB1 and TM may also be used to determine mode selection parameters, see also other embodiments.
Referring to fig. 5, fig. 5 is a schematic diagram of an application scenario of another device data query method according to an embodiment of the present invention. As shown in fig. 5, the sliding window of the memory area slides according to the address sequence of the signal points, and any number of complete target signal points may be included in the sliding process, and it should be understood that the complete target signal points are meant to indicate that all bytes of the signal points fall into the coverage area of the sliding window of the memory area. In the sliding process, each time a complete signal point is entered or withdrawn, the complete signal point can be dynamically calculated once, so that the dynamic design of the signal query mode of each target signal point is realized.
Specifically, the sliding window of the memory area slides from the low address of the signal point, and dynamic calculation is performed once when one signal point is entered. If the difference between the newly entered signal point address and the earliest entered signal point address is less than the window length, the signal point is not removed. And if the difference between the newly-entered signal point address and the earliest-entered signal point address is larger than the window length, removing the earliest-entered signal points one by one until the difference between the newly-entered signal point address and the earliest-entered signal point address is smaller than the window length. The signal query mode of each signal point can be further specifically determined according to the relationship between TB1 and TM.
Basic parameters of a memory area sliding window and a query process can be determined through a preset communication protocol type, single-point data query time and memory area data query time of each target signal point can be obtained through calculation according to each basic parameter, initialized data query time corresponding to each target signal point can be obtained, and a signal query mode corresponding to each signal point is determined, so that the determination efficiency of the signal query mode is improved, and the data query efficiency of equipment is improved.
As an alternative embodiment, the method further comprises:
determining mode selection parameters according to the single-point data query time and the memory area data query time;
the mode selection parameters are used for determining signal query modes corresponding to target signal points in the memory area sliding window moving process.
As a specific example of the mode selection parameter, a ratio of the memory area data inquiry time to the single point data inquiry time may be determined as the mode selection parameter. Defining the mode selection parameter as N, then n=tm/TB 1. According to the relation between the N value and the number of the real-time signal points in the sliding window, a signal query mode corresponding to each target signal point position can be determined, and the next implementation mode can be seen.
And selecting parameters in a determining mode, so that in the moving process of the sliding window of the memory area, determining a signal query mode corresponding to each target signal point position corresponding to the window range, thereby improving the determining efficiency of the signal query mode and further improving the efficiency of equipment data query.
As an optional implementation manner, according to a memory address sequence, moving a memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location, including:
according to the memory address sequence, moving the memory region sliding window to perform data query on each target signal point location, and determining the number of target signal point locations in the current memory region sliding window;
if the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the sliding window of the current memory area as single-point query;
if the number of the target signal points is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal points in the sliding window of the current memory area as batch inquiry;
and in the process of carrying out data query on each target signal point in the moving memory area sliding window, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
In addition, when the query mode of each target signal point in the current sliding window area is determined to be batch query, the sliding window moves according to the preset address direction until each target signal point in the batch query moves out of the sliding window, the sliding of the sliding window of the memory area is repeatedly executed from the low address of the signal point, and dynamic calculation is performed once when each signal point is entered. If the difference between the newly entered signal point address and the earliest entered signal point address is less than the window length, the signal point is not removed. If the difference between the address of the newly-entered signal point and the address of the earliest-entered signal point is greater than the window length, removing the earliest-entered signal points one by one until the difference between the address of the newly-entered signal point and the address of the earliest-entered signal point is less than the window length, and determining the signal query mode corresponding to all the target signal points in the sliding window of the current memory area as single-point query if the number of the target signal points is less than the mode selection parameter; if the number of the target signal points is greater than or equal to the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the sliding window of the current memory area as batch query.
Comparing the determined mode selection parameters with the number of target signal points in the current memory area sliding window, determining signal query modes corresponding to all target signal points in the current memory area sliding window as single-point query when the number of target signal points is smaller than the mode selection parameters, and determining signal query modes corresponding to all target signal points in the current memory area sliding window as batch query when the number of target signal points is greater than or equal to the mode selection parameters, thereby improving the determination efficiency of the signal query modes and further improving the efficiency of equipment data query.
In a specific application scenario, the edge computing host is to collect 20 signal points from the device, and the table of signal points and the address are shown in table 1. The communication protocol type is Modbus RTU, the communication rate is 9600bps/s, i.e. the transmission time per byte is 1ms. According to the definition of Modbus, the inquiry frame byte length LF is 8, the single byte transmission time TB is 1ms, the device response time T is set to 0.5ms, the signal point byte length LB is 4, and the memory area inquiry length LM is 128 bytes.
Step 1: the transmission time tb=lf×tb+lb×tb+t= 8*1 + 4*1 +0.5=12.5 ms of a single signal point, i.e., the time required to query one byte in a single point manner is 12.5ms. The time required to query a memory region length is: tm=lf+lm+tb+t=8+128+1+0.5=136.5 ms. The single point mode and batch mode signal point query time ratios N are calculated to be 136.5/12.5=10.92, N being the mode selection parameter.
TABLE 1
Step 2: establishing the size LM of a data query memory area as 128 bytes, namely the size of a sliding window as 128 bytes;
step 3: sequencing all signal points from low to high according to addresses to form a signal point table, namely a signal list to be queried, and presetting the query mode of all signal points as a single point mode;
step 4: each time a signal point is entered in the sliding window, the dynamic calculation is performed. When the 5 th signal point is in, the value of N is 5 and less than 10.92, so that all signal points in the sliding window adopt a single-point mode to perform data query. When 6 signal points enter the sliding window, the difference between the address of the 6 th signal point and the address of the 1 st signal point is 162 and is larger than the length 128 of the sliding window, the signal points 1,2,3 and 4 can be gradually removed, and finally only the signal point 5 and the signal point 6 are finally reserved in the sliding window, at the moment, the value of N is 2 and is smaller than 10.92, and the signal point 5 and the signal point 6 all adopt a single-point mode to perform data query. According to the same calculation method, the signal points 6 to 16 are all in a batch mode, and the number of signal points in the sliding window is 11. It should be noted that, when the signal query mode of a signal point is determined to be the batch mode, the signal query mode of a signal point is not returned to the single-point mode, and no further design is needed, but when the signal query mode is determined to be the single-point mode, the signal query mode may be further updated to the batch mode in the sliding process of the window. For example, in this step, the query mode of the signal point 6 is updated from the single point mode to the batch mode, and the final query mode of the signal point 6 is the batch mode.
Step 5: because the signal points in the sliding window are all collected in a batch mode, the sliding window is moved to the high address direction until 11 signal points all remove the sliding window, namely, the position starting from the 17 th signal point is slid. The 17 th to 20 th signal points are in a sliding window and the number is less than 10.92, so the inquiry mode is a single point mode.
Step 6: and when the sliding window is moved to the highest point and no new signal point enters, the distribution of all signal point inquiry modes is completed, and the edge computing host performs data inquiry according to the distributed modes.
According to the method, the device and the system, the data query is carried out on each target signal point by moving the memory area sliding window according to the memory address sequence through the initialized data query time and the memory area sliding window with the preset length, and the signal query mode corresponding to each signal point can be determined according to the relation between the dynamic position of the window and the signal point, so that the determination efficiency of the signal query mode is improved, and the data query efficiency of the device is improved.
Example III
The embodiment of the invention also provides a device data query device to realize the method, please refer to fig. 6, fig. 6 is a schematic structural diagram of the device data query device disclosed in the embodiment of the invention. As shown in fig. 6, in any other embodiment, the apparatus includes:
The point location determining module 31 is configured to determine a target signal point location to be queried;
a list determining module 32, configured to determine a signal list to be queried according to the memory address of the target signal point location;
the mode determining module 33 is configured to determine a signal query mode corresponding to each target signal point location according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
and the data query module 34 is configured to query data for each target signal point according to the determined signal query mode.
The method comprises the steps of determining target signal points to be queried, sorting by the height of a memory address, generating a signal list to be queried corresponding to each target signal point, determining a signal query mode corresponding to each target signal point according to the sequence of the target signal points in the signal list to be queried in a dynamic design mode, and finally executing data query operation according to the determined signal query mode, thereby improving the determination efficiency of the signal query mode and further improving the data query efficiency of equipment.
As an optional implementation manner, the mode determining module 33 determines, according to the signal list to be queried, a specific mode of a signal query mode corresponding to each target signal point location, including:
Initializing data query time corresponding to each target signal point according to a signal list to be queried, and establishing a memory area sliding window with a preset length;
determining the memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
and according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location.
Through initialized data query time and a memory area sliding window with preset length, the memory area sliding window is moved to perform data query on each target signal point location according to the memory address sequence, and according to the relation between the dynamic position of the window and the signal points, the signal query mode corresponding to each signal point can be determined, so that the determination efficiency of the signal query mode is improved, and the data query efficiency of equipment is further improved.
As an optional implementation manner, the mode determining module 33 initializes a data query time corresponding to each target signal point according to the signal list to be queried, and establishes a memory area sliding window with a preset length, including:
determining the query length of the memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
According to the preset communication protocol type, determining the inquiring frame byte length, the signal point byte length and the single byte transmission time of each target signal point, and determining the response time of the equipment;
determining single-point data query time of each target signal point according to the query frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
and determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
Basic parameters of a memory area sliding window and a query process can be determined through a preset communication protocol type, single-point data query time and memory area data query time of each target signal point can be obtained through calculation according to each basic parameter, initialized data query time corresponding to each target signal point can be obtained, and a signal query mode corresponding to each signal point is determined, so that the determination efficiency of the signal query mode is improved, and the data query efficiency of equipment is improved.
As an alternative implementation manner, referring to fig. 7, fig. 7 is a schematic structural diagram of another device data query apparatus according to an embodiment of the present invention. As shown in fig. 7, the apparatus further comprises a parameter determination module 35 for:
Determining mode selection parameters according to the single-point data query time and the memory area data query time;
the mode selection parameters are used for determining signal query modes corresponding to target signal points in the memory area sliding window moving process.
And selecting parameters in a determining mode, so that in the moving process of the sliding window of the memory area, determining a signal query mode corresponding to each target signal point position corresponding to the window range, thereby improving the determining efficiency of the signal query mode and further improving the efficiency of equipment data query.
As an optional implementation manner, the manner determining module 33 moves the memory area sliding window to perform data query on each target signal point location according to the memory address sequence, and determines a specific manner of the signal query manner corresponding to each target signal point location, which includes:
according to the memory address sequence, moving the memory region sliding window to perform data query on each target signal point location, and determining the number of target signal point locations in the current memory region sliding window;
if the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the sliding window of the current memory area as single-point query;
If the number of the target signal points is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal points in the sliding window of the current memory area as batch inquiry;
and in the process of carrying out data query on each target signal point in the moving memory area sliding window, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
Comparing the determined mode selection parameters with the number of target signal points in the current memory area sliding window, determining signal query modes corresponding to all target signal points in the current memory area sliding window as single-point query when the number of target signal points is smaller than the mode selection parameters, and determining signal query modes corresponding to all target signal points in the current memory area sliding window as batch query when the number of target signal points is greater than or equal to the mode selection parameters, thereby improving the determination efficiency of the signal query modes and further improving the efficiency of equipment data query.
Example IV
The present application provides an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as in any one of the embodiments.
The present application provides a computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out a method as in any of the embodiments.
Specifically, referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 8, the electronic device may include:
a Processor 291, the apparatus further comprising a Memory 292 in which executable program code is stored; a communication interface (Communication Interface) 293 and bus 294 may also be included. The processor 291, the memory 292, and the communication interface 293 may communicate with each other via the bus 294. Communication interface 293 may be used for information transfer. Processor 291 is coupled to memory 292, and processor 291 may invoke logic instructions (executable program code) in memory 292 to perform the text processing model training method of any of the embodiments described above.
Further, the logic instructions in memory 292 described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product.
The memory 292 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and program instructions/modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running software programs, instructions and modules stored in the memory 292, i.e., implements the methods of the method embodiments described above.
Memory 292 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the terminal device, etc. Further, memory 292 may include high-speed random access memory, and may also include non-volatile memory.
The embodiment of the application also provides a computer readable storage medium, wherein computer executable instructions are stored in the computer readable storage medium, and the computer executable instructions are used for realizing the method in any embodiment when being called.
Embodiments of the present invention also disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform the steps of the text processing model training method described in any of the embodiments.
The apparatus embodiments described above are merely illustrative, in which the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above detailed description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product that may be stored in a computer-readable storage medium including Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable programmable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic disc Memory, tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (7)

1. A method for querying device data, the method comprising:
determining a target signal point position to be queried;
determining a signal list to be queried according to the memory address of the target signal point location;
determining a signal query mode corresponding to each target signal point position according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
According to the determined signal query mode, carrying out data query on each target signal point location;
the determining a signal query mode corresponding to each target signal point location according to the signal list to be queried includes:
initializing data query time corresponding to each target signal point according to the signal list to be queried, and establishing a memory area sliding window with preset length;
determining a memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location;
and moving the memory area sliding window to perform data query on each target signal point according to the memory address sequence, and determining a signal query mode corresponding to each target signal point, including:
according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining the number of the target signal point locations in the current memory area sliding window;
If the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the current memory area sliding window as single-point query;
if the number of the target signal point positions is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal point positions in the current memory area sliding window as batch inquiry;
and in the process of moving the memory area sliding window to perform data query on each target signal point, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
2. The method of claim 1, wherein initializing a data query time corresponding to each target signal point according to the signal list to be queried, and establishing a memory area sliding window with a preset length, comprises:
determining the query length of a memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
Determining the byte length of the query frame, the byte length of the signal point and the transmission time of a single byte of each target signal point according to the preset communication protocol type, and determining the response time of equipment;
determining single-point data inquiry time of each target signal point according to the inquiry frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
and determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
3. The method according to claim 2, wherein the method further comprises:
determining mode selection parameters according to the single-point data query time and the memory area data query time;
the mode selection parameter is used for determining a signal query mode corresponding to each target signal point in the memory area sliding window moving process.
4. A device data query apparatus, the apparatus comprising:
the point position determining module is used for determining the point position of the target signal to be queried;
The list determining module is used for determining a signal list to be queried according to the memory address of the target signal point location;
the mode determining module is used for determining a signal query mode corresponding to each target signal point position according to the signal list to be queried;
the signal query mode comprises single-point query or batch query;
the data query module is used for carrying out data query on each target signal point location according to the determined signal query mode;
the mode determining module determines a specific mode of the signal query mode corresponding to each target signal point location according to the signal list to be queried, including:
initializing data query time corresponding to each target signal point according to the signal list to be queried, and establishing a memory area sliding window with preset length;
determining a memory address sequence corresponding to each target signal point location for data query according to the signal list to be queried;
according to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining a signal query mode corresponding to each target signal point location;
the mode determining module moves the memory area sliding window to perform data query on each target signal point according to the memory address sequence, and determines a signal query mode corresponding to each target signal point, including:
According to the memory address sequence, moving the memory area sliding window to perform data query on each target signal point location, and determining the number of the target signal point locations in the current memory area sliding window;
if the number of the target signal points is smaller than the mode selection parameter, determining the signal query modes corresponding to all the target signal points in the current memory area sliding window as single-point query;
if the number of the target signal point positions is greater than or equal to the mode selection parameter, determining signal inquiry modes corresponding to all the target signal point positions in the current memory area sliding window as batch inquiry;
and in the process of moving the memory area sliding window to perform data query on each target signal point, the length of the memory area corresponding to the memory address difference value between the first byte of the first target signal point and the last byte of the last target signal point in the memory area sliding window is smaller than or equal to the length of the memory area corresponding to the memory area sliding window.
5. The apparatus of claim 4, wherein the means for determining initializes a data query time corresponding to each of the target signal points according to the signal list to be queried, and establishes a memory area sliding window with a preset length, including:
Determining the query length of a memory area according to a preset communication protocol type, and establishing a memory area sliding window according to the query length;
determining the byte length of the query frame, the byte length of the signal point and the transmission time of a single byte of each target signal point according to the preset communication protocol type, and determining the response time of equipment;
determining single-point data inquiry time of each target signal point according to the inquiry frame byte length, the signal point byte length, the single byte transmission time and the equipment response time;
and determining the data query time of the memory area according to the query length of the memory area, the byte length of the query frame, the single byte transmission time and the equipment response time.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-3.
7. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any of claims 1-3.
CN202311107643.1A 2023-08-31 2023-08-31 Equipment data query method and device, electronic equipment and storage medium Active CN116821177B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311107643.1A CN116821177B (en) 2023-08-31 2023-08-31 Equipment data query method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311107643.1A CN116821177B (en) 2023-08-31 2023-08-31 Equipment data query method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116821177A CN116821177A (en) 2023-09-29
CN116821177B true CN116821177B (en) 2023-12-05

Family

ID=88127859

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311107643.1A Active CN116821177B (en) 2023-08-31 2023-08-31 Equipment data query method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116821177B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543081A (en) * 2018-10-09 2019-03-29 中交广州航道局有限公司 Ship signaling point data processing method, device and computer equipment
CN111142942A (en) * 2019-12-26 2020-05-12 远景智能国际私人投资有限公司 Window data processing method and device, server and storage medium
CN111857029A (en) * 2020-06-30 2020-10-30 广州明珞汽车装备有限公司 Data acquisition method, system, device, terminal equipment and medium
CN114721796A (en) * 2022-03-30 2022-07-08 杭州义益钛迪信息技术有限公司 Data acquisition method, device and system and electronic equipment
CN114860437A (en) * 2022-04-29 2022-08-05 杭州义益钛迪信息技术有限公司 Data acquisition method, edge calculation host and computer-readable storage medium
CN115904719A (en) * 2022-12-02 2023-04-04 杭州义益钛迪信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11334538B2 (en) * 2019-05-31 2022-05-17 Microsoft Technology Licensing, Llc System and method for cardinality estimation feedback loops in query processing

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543081A (en) * 2018-10-09 2019-03-29 中交广州航道局有限公司 Ship signaling point data processing method, device and computer equipment
CN111142942A (en) * 2019-12-26 2020-05-12 远景智能国际私人投资有限公司 Window data processing method and device, server and storage medium
CN111857029A (en) * 2020-06-30 2020-10-30 广州明珞汽车装备有限公司 Data acquisition method, system, device, terminal equipment and medium
WO2022000806A1 (en) * 2020-06-30 2022-01-06 广州明珞装备股份有限公司 Data acquisition method, system and apparatus, terminal device, and medium
CN114721796A (en) * 2022-03-30 2022-07-08 杭州义益钛迪信息技术有限公司 Data acquisition method, device and system and electronic equipment
CN114860437A (en) * 2022-04-29 2022-08-05 杭州义益钛迪信息技术有限公司 Data acquisition method, edge calculation host and computer-readable storage medium
CN115904719A (en) * 2022-12-02 2023-04-04 杭州义益钛迪信息技术有限公司 Data acquisition method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Equipment Servo System Signal Acquisition Module Design Based On Embedded;Jingtong Chen et al.;Applied Mechanics and Materials;第536-537页 *
嵌入式数控机床状态信息采集技术的研究;徐永乐;叶文华;;机械科学与技术(07);第1098-1012页 *

Also Published As

Publication number Publication date
CN116821177A (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN105989079A (en) Method and apparatus for obtaining device fingerprint
CN113132267B (en) Distributed system, data aggregation method and computer readable storage medium
CN109446515A (en) Group information analysis method, electronic device and computer readable storage medium
CN116821177B (en) Equipment data query method and device, electronic equipment and storage medium
CN110019400B (en) Data storage method, electronic device and storage medium
CN110888965A (en) Document data extraction method and device
CN111460098A (en) Text matching method and device and terminal equipment
CN112350912A (en) Data acquisition method, system and device based on Modbus protocol
CN110928902A (en) Query method and system for acquiring cloud platform terminal data aiming at paging
CN109120731B (en) Universal communication method, system and device
CN113194107B (en) Internet-based regional characteristic addressing method and device
CN115185904A (en) Cloud storage data processing method and device, electronic equipment and readable storage medium
CN110502611B (en) Character string retrieval method and device
CN113139102A (en) Data processing method, data processing device, nonvolatile storage medium and processor
CN110059109B (en) Device, method and storage medium for data query
CN111026827A (en) Data service method and device for soil erosion factors and electronic equipment
WO2014173129A1 (en) Mobile terminal flow identification method and apparatus
CN116302224A (en) Interface switching method and device for RTOS system, terminal equipment and storage medium
CN106990938A (en) Random number acquisition methods, device and electronic equipment
CN112532750B (en) Big data push processing method and system and cloud platform
CN102196061A (en) Address filter table generating method and device, and Ethernet frame receiving method and device
CN108959870B (en) User identification method and device
CN108419253B (en) A kind of location determining method, device, electronic equipment and readable storage medium storing program for executing
CN117331970A (en) Data query method, device, computer storage medium and acceleration card
CN114443044A (en) Data processing method and device, electronic equipment and storage medium

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