Point position polling method and device, electronic equipment and storage medium
By determining the target point according to the point weight, synchronization signs and the number of rotation inquiries, and updating the weight and synchronization signs after the rotation inquiry, the problem of rotation communication obstruction caused by a large number of equipment has been solved, and the real -time nature of important data communication is enhanced.
Patent Information
- Application Number
- CN202411571536.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-11-06
AI Technical Summary
In the field of industrial control technology, when there are a large number of devices, the communication through polling will cause the system to be blocked, resulting in a long delay in execution of data acquisition commands and control commands, delay in information update, and insufficient real-time performance.
Through a point rotation method, according to the point weight, synchronization signs and rotation times of each point, determine the target point to be inquired, and update the point weight and synchronization logo after the rotation inquiry to optimize the wheel Inquiry order and frequency.
This method can enhance the real -time nature of important data communication, ensure that each round of data inquiry covers important points, and reduce system communication blockage and delay.
Smart Images

Figure CN119383119A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a point polling method, device, electronic device, storage medium and computer program product. Background Art
[0002] In the field of industrial control technology, data collection commands and control commands can be sent to devices through communication methods of various protocols. In some protocols, polling is used to collect information from devices and device locations in sequence.
[0003] However, when there are a large number of devices, the above method will cause system communication congestion when polling the devices, resulting in long execution delays for data acquisition commands and control commands in the communication system, delays in information updates, and insufficient real-time performance of the polling communication process. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, electronic device, computer-readable storage medium and computer program product that can improve the real-time performance of important data communications in response to the above technical problems.
[0005] In a first aspect, the present application provides a point polling method. The method comprises:
[0006] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0007] Polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain an updated point weight;
[0008] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point is returned to be executed until the point polling is completed.
[0009] In one embodiment, determining the target point to be polled based on the point weight, synchronization flag and point polling times of each point includes:
[0010] For each point, obtain the priority of each point; the priority includes high priority, medium priority and low priority;
[0011] In the case where the priority of the point is medium priority, if the synchronization flag of the point is the first flag value, the point is determined to be an initial point;
[0012] The initial points are sorted based on the order of magnitude corresponding to the point weights of the initial points, and the sorted initial points are determined as the target points to be polled.
[0013] In one embodiment, after obtaining the priority of each point, the method further includes:
[0014] In the case where the priority of the point is a high priority, if the synchronization flag of the point is a first flag value, determining the point to be an initial point;
[0015] When the priority of the point is low priority and the number of polling times of the point reaches the number corresponding to the forced synchronization cycle, determining the synchronization flag of the point to be the first flag value, and determining the point to be the initial point;
[0016] When the priority of the point is low priority and the number of polling times of the point does not reach the number corresponding to the forced synchronization cycle, if the synchronization flag of the point is not the first flag value, the point is determined to be a non-target point.
[0017] In one embodiment, polling the target point to obtain the polled target point, and updating the point weight of the polled target point to obtain the updated point weight includes:
[0018] Polling the target point, and updating the current data value and data change interval of the target point based on the data value obtained by polling;
[0019] According to the priority of the target point and the data change interval, the point weight of the target point is updated to obtain an updated point weight.
[0020] In one embodiment, updating the point weight of the target point according to the priority of the target point and the data change interval to obtain the updated point weight includes:
[0021] In the case where the priority of the target point is medium priority, determining a weight adjustment amount; the weight adjustment amount is determined based on a weight coefficient of the target point;
[0022] If it is determined that the data change interval is less than the forced synchronization period, the point weight of the target point is added to the weight adjustment amount to obtain an updated point weight;
[0023] If it is determined that the data change interval is greater than the forced synchronization period, the point weight of the target point is subtracted from the weight adjustment amount to obtain an updated point weight.
[0024] In one embodiment, the updating of the synchronization mark of the target point based on the updated point weight to obtain the updated synchronization mark includes:
[0025] If the updated point weight is not 0, determining the synchronization flag of the target point to be the first flag value;
[0026] If the updated point weight is 0, the synchronization flag of the target point is determined to be the second flag value.
[0027] In one of the embodiments, if the priority of the target point is high priority, the synchronization flag of the target point is determined to be the first flag value;
[0028] If the priority of the target point is low priority, the synchronization flag of the target point is determined to be the second flag value.
[0029] In a second aspect, the present application also provides a point polling device. The device comprises:
[0030] A point determination module is used to determine the target point to be polled for each round of point polling based on the point weight, synchronization flag and point polling number of each point;
[0031] A weight updating module, used for polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain the updated point weight;
[0032] The flag update module is used to update the synchronization flag of the target point based on the updated point weight, obtain the updated synchronization flag, and return to execute the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point until the point polling is completed.
[0033] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the following steps are implemented:
[0034] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0035] Polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain an updated point weight;
[0036] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point is returned to be executed until the point polling is completed.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0038] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0039] Polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain an updated point weight;
[0040] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point is returned to be executed until the point polling is completed.
[0041] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0042] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0043] Polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain an updated point weight;
[0044] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point is returned to be executed until the point polling is completed.
[0045] The above-mentioned point polling method, device, electronic device, storage medium and computer program product will perform multiple rounds of polling on each point of the device, and in each round of point polling, the target point to be polled will be determined in each point according to the number of point polling, the synchronization flag of the point and the point weight of the point. Based on this, the target point is polled, and the point weight of the target point is updated after polling, and the synchronization flag of the target point is updated by the updated point weight, so that the target point is updated at the same time after each round of polling, and the above-mentioned point polling process is repeated until the point polling is completed. Each point is screened by point weight, synchronization flag and point polling times. Matching or important target points are determined in each round of point polling. After completing the polling of the target points, the point weight and synchronization flag are updated to provide a basis for determining the target points for the next round of point polling, thereby improving the accuracy of the determined target points. The target points are then polled to ensure that each round of point polling can cover the data of important points and improve the real-time communication of important data. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] FIG1 is an application environment diagram of a point polling method in one embodiment;
[0048] FIG2 is a schematic diagram of a flow chart of a point polling method in one embodiment;
[0049] FIG3 is a schematic diagram of a flow chart of a point polling method in another embodiment;
[0050] FIG4 is a structural block diagram of a point polling device in one embodiment;
[0051] FIG. 5 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The point polling method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the point 102 communicates with the server 104 through the communication network, and the server 104 can obtain the point attributes such as the point weight and synchronization flag of each point 102, and based on the point attributes and the number of point polling corresponding to each round of point polling, determine the target point to be polled in each point 102, and send a request to the target point for polling respectively, and update the point attributes corresponding to the target point after polling, and update the number of point polling. The data storage system can store the communication data obtained after the server 104 polls. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The point 102 can be a device or a point contained in the device. The point 102 is not limited to various industrial components, industrial equipment, and equipment points. For example, the point can be a household appliance, a computer, a smart phone, a tablet computer, an Internet of Things device, and a portable wearable device. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head mounted device, etc. The head mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0054] In an exemplary embodiment, as shown in FIG2 , a point polling method is provided, which is described by taking the method applied to the server 104 in FIG1 as an example, and includes the following steps S202 to S206 . Among them:
[0055] Step S202: for each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point.
[0056] Point polling refers to polling each device in the system and the points of the device. Point weight and synchronization flag are both point attributes of the point. Point weight is used to indicate the importance of the point, and synchronization flag is used to determine whether the point is polled.
[0057] Specifically, the server performs multiple rounds of point polling on the points of each device in the system. For each round of point polling, the server can read the point attributes of each point, and determine whether the point is a target point based on the point weight and synchronization flag in the point attributes. In one example, if the point weight of the point is greater than a preset weight value, the point can be determined to be a target point; if the synchronization flag of the point is a preset flag value, the point can be determined to be a target point; if the point weight of the point is greater than a preset weight value, and the synchronization flag of the point is a preset flag value, the point is determined to be a target point. In addition, the server can determine whether the point is a target point based on the number of point polling times. For example, when the number of point polling times reaches a preset number, the point that meets certain conditions can be determined to be a target point. Therefore, the server can comprehensively determine whether each point is a target point based on the point weight, synchronization flag and number of point polling times.
[0058] Step S204, polling the target point to obtain the polled target point, and updating the point weight of the polled target point to obtain the updated point weight.
[0059] Specifically, after polling the target point, the polled point is obtained, and it can be known that the point attribute of the point is updated. Based on the updated point attribute, the point weight of the target point can be updated to obtain the updated point weight. The point attribute can also include priority and data change interval. The priority is used to indicate whether each point can be polled first, and the data change interval is used to indicate the time interval during which the data value of the point changes. The server can update the point weight of the target point according to the point priority, data change interval and original point weight to obtain the updated point weight.
[0060] Step S206, based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of returning to perform for each round of point polling, based on the point weight, synchronization flag and number of point polling of each point, determining the target point to be polled, until the point polling is completed.
[0061] Specifically, the server obtains the updated point weight, and determines the synchronization flag corresponding to the updated point weight according to the pre-configured update strategy, and uses it as the latest synchronization flag. After the server updates the point weight and synchronization flag of the target point, it repeats a new round of point polling. The server can continue to perform multiple rounds of point polling until the point polling ends. The conditions for the end of unit polling can be set according to user needs.
[0062] In the above-mentioned point polling method, multiple rounds of polling will be performed on each point of the device, and in each round of point polling, the target point to be polled will be determined in each point according to the number of point polling, the synchronization flag of the point and the point weight of the point. Based on this, the target point is polled, and the point weight of the target point is updated after polling, and the synchronization flag of the target point is updated through the updated point weight, so that the target point is updated at the same time after each round of polling, and the above-mentioned point polling process is repeated until the point polling is completed. Each point is screened by point weight, synchronization flag and point polling times. Matching or important target points are determined in each round of point polling. After completing the polling of the target points, the point weight and synchronization flag are updated to provide a basis for determining the target points for the next round of point polling, thereby improving the accuracy of the determined target points. The target points are then polled to ensure that each round of point polling can cover the data of important points and improve the real-time communication of important data.
[0063] In an exemplary embodiment, the specific implementation process of the step of "determining the target point to be polled based on the point weight, synchronization flag and point polling number of each point" includes:
[0064] For each point, obtain the priority of each point; when the priority of the point is medium priority, if the synchronization flag of the point is the first flag value, determine the point as the initial point; based on the order of size corresponding to the point weights of each initial point, sort the initial points, and determine the sorted initial points as the target points to be polled.
[0065] Among them, the priorities include high priority, medium priority and low priority.
[0066] Specifically, the point attributes also include priority. The server obtains the priority of each point based on the point attributes. If the priority of the point is medium priority, the synchronization flag of the point is obtained, and it is determined whether the synchronization flag of the point is the first flag value. If the synchronization flag is the first flag value, the point can be determined to be an initial point. After traversing each point, an initial point consisting of multiple points can be obtained. For each initial point, the server can obtain the point weight of each initial point, and sort the initial points according to the order of the point weight, and the sorted initial points are obtained as the target points to be polled. For example, the first flag value can be 1. If the value of the synchronization flag is 1, the point can be determined to be an initial point.
[0067] In one example, the server may filter out points whose point weights are greater than a preset weight value from the initial points, and sort the filtered points in order of point weights to obtain sorted points, and determine them as target points to be polled. For example, the preset weight value may be 0.5, and the server sorts the points whose preset weight values are greater than 0.5 in order of point weights to obtain the target points.
[0068] In this embodiment, the synchronization mark of the priority point is used to determine whether the point is the initial point, and the initial points are sorted by the size of the point weight to obtain the target point. The priority points can be accurately divided according to actual user needs to obtain the target point to be polled, thereby improving the accuracy of obtaining the target point.
[0069] In an exemplary embodiment, after the step of “obtaining the priority of each point”, the method further includes:
[0070] When the priority of the point is high, if the synchronization flag of the point is the first flag value, the point is determined to be the initial point. When the priority of the point is low, and the number of polling times of the point reaches the number corresponding to the forced synchronization cycle, the synchronization flag of the point is determined to be the first flag value, and the point is determined to be the initial point. When the priority of the point is low, and the number of polling times of the point does not reach the number corresponding to the forced synchronization cycle, if the synchronization flag of the point is not the first flag value, the point is determined to be a non-target point.
[0071] Among them, the forced synchronization cycle is the time it takes for the server to perform multiple rounds of point polling for a preset number of times. The forced synchronization cycle can be configured as time T. During the time period corresponding to time T, the server can perform n rounds of point polling for the point. The number of times corresponding to the forced synchronization cycle is the ratio of T to the time spent in a single round of point polling, and the ratio is rounded to get the number n. In an example, the number of forced synchronization cycles can be the preset rounds of point polling, and this example does not need to determine the number n corresponding to the ratio through time T.
[0072] Specifically, the server obtains the priority of each point based on the point attribute. If the priority of the point is high, the synchronization flag of the point is obtained, and it is determined whether the synchronization flag of the point is the first flag value. If the synchronization flag is the first flag value, the point can be determined to be the initial point.
[0073] In addition, if the priority of the point is low priority, it is determined whether the number of point polling in the current round is the number corresponding to the forced synchronization cycle. If the number of point polling in the current round is the number corresponding to the forced synchronization cycle, the synchronization flag of the point is set to the first flag value, and the point is determined to be the initial point. In one example, if the number of point polling in the current round is the number corresponding to the forced synchronization cycle, all points can be determined to be initial points.
[0074] If the priority of the point is low, determine whether the number of point polling in the current round is the number corresponding to the forced synchronization cycle. If the number of point polling in the current round does not reach the number corresponding to the forced synchronization cycle, and the synchronization flag of the point is not the first flag value, then determine that the point is a non-target point. Non-target points are not polled.
[0075] In this embodiment, the initial point is determined by using different judgment logics for high priority and low priority respectively, and whether the number of point polling times reaches the number corresponding to the forced synchronization cycle is used as the basis for judgment. It is possible to flexibly judge points of different priorities to obtain the initial point, which can improve the accuracy of determining the initial point.
[0076] In an exemplary embodiment, the specific implementation process of the step of "polling the target point to obtain the polled target point, and updating the point weight of the polled target point to obtain the updated point weight" includes:
[0077] Poll the target point, and based on the data value obtained from the polling, update the current data value and data change interval of the target point; according to the priority and data change interval of the target point, update the point weight of the target point to obtain the updated point weight.
[0078] Specifically, the point attribute of the point also includes the current data value. When the server polls each target point, it may not obtain the latest data value of the target point, but it may obtain the latest data value of the target point. The server can update the latest data value to the current data value in the point attribute. The server determines the data change interval based on the time interval for updating the current data value. Afterwards, the server can update the point weights of target points of different priorities according to the priority of the target point to obtain the updated point weights. The server can determine whether to increase or decrease the point weight of the target point based on the data change interval and the forced synchronization period.
[0079] In this embodiment, the current data value and data change interval of the target point are updated through the data value after polling the target point, and the importance of the target point can be determined according to the priority of the target point and the data change interval, so that the point weight is updated according to the importance, thereby improving the accuracy of the updated point weight.
[0080] In an exemplary embodiment, the specific implementation process of the step of "updating the point weight of the target point according to the priority of the target point and the data change interval to obtain the updated point weight" includes:
[0081] When the priority of the target point is medium priority, determine the weight adjustment amount; if it is determined that the data change interval is less than the forced synchronization period, add the point weight of the target point to the weight adjustment amount to obtain the updated point weight; if it is determined that the data change interval is greater than the forced synchronization period, subtract the point weight of the target point from the weight adjustment amount to obtain the updated point weight.
[0082] The weight adjustment amount is determined based on the weight coefficient of the target point. In one example, the server may determine the inverse of the weight coefficient as the weight adjustment amount.
[0083] Specifically, the server determines the priority of the target point. If the priority of the target point is medium priority, the weight adjustment amount is determined according to the inverse of the weight coefficient corresponding to the target point. The server determines the data change interval and the size of the forced synchronization period of the target point. If the data change interval is less than the forced synchronization period, the server adds the current point weight of the target point to the weight adjustment amount to obtain the updated point weight. If the data change interval is greater than the forced synchronization period, the server subtracts the current point weight of the target point from the weight adjustment amount to obtain the updated point weight. If the data change interval is equal to the forced synchronization period, the server determines the current point weight of the target point as the updated point weight.
[0084] Optionally, when the priority of the target point is high, the weight coefficient of the target point is determined to be the highest weight coefficient; when the priority of the target point is low, the weight coefficient of the target point is determined to be the lowest weight coefficient.
[0085] In this embodiment, the data change interval of the target point and the size of the forced synchronization period are used to determine whether to update the point weight of the target point through the weight adjustment amount to obtain the updated point weight. The real-time importance of the target point can be determined based on the data change interval, thereby obtaining the adjusted point weight and improving the accuracy of the point weight.
[0086] In an exemplary embodiment, the specific implementation process of the step of "updating the synchronization mark of the target point based on the updated point weight to obtain the updated synchronization mark" includes:
[0087] If the updated point weight is not 0, the synchronization flag of the target point is determined to be the first flag value; if the updated point weight is 0, the synchronization flag of the target point is determined to be the second flag value.
[0088] Specifically, the value range of the point weight can be 0 to 1. If the updated point weight of the target point is not 0, the server can determine that the synchronization flag of the target point is the first flag value. If the updated point weight of the target point is 0, the server can determine that the synchronization flag of the target point is the second flag value. If the synchronization flag of the target point is the first flag value, a judgment process of whether the point is the target point will be performed in a new round of point polling. If the synchronization flag of the target point is the second flag value, there is no need to perform a judgment process of whether the point is the target point in a new round of point polling, and the point can be directly determined as a non-target point.
[0089] In one example, if the updated point weight is not the preset weight value, the synchronization flag of the target point is determined to be the first flag value; if the updated point weight is the preset weight value, the synchronization flag of the target point is determined to be the second flag value. The preset weight value can be a weight value arbitrarily configured by the user according to actual needs.
[0090] In this embodiment, the synchronization flag of the target point is updated through the updated point weight, which can ensure that important target points can be determined in the next round of point polling, thereby ensuring that important target points participate in each polling as much as possible and improving the real-time nature of important data.
[0091] In an exemplary embodiment, the method further includes: if the priority of the target point is high priority, determining the synchronization flag of the target point to be a first flag value; if the priority of the target point is low priority, determining the synchronization flag of the target point to be a second flag value.
[0092] Specifically, the server may determine the priority of the target point. The priority of the target point may be changed during the polling process, and based on this, the server may update the synchronization flag of the target point in real time according to the priority of the target point at any time. For example, if the priority of the target point is high priority, the synchronization flag of the target point is determined to be the first flag value; if the priority of the target point is low priority, the synchronization flag of the target point is determined to be the second flag value.
[0093] Optionally, the priority of each point may be changed during the polling process, based on which the server can update the synchronization flag of each point in real time according to the priority of each point at any time. For example, if the priority of each point is high, the synchronization flag of each point is determined to be the first flag value; if the priority of each point is low, the synchronization flag of each point is determined to be the second flag value.
[0094] Optionally, the priority of each point may be changed during the polling process, based on which the server can update the point weight of each point in real time according to the priority of each point at any time. For example, the point weight ranges from 0 to 1. If the priority of each point is high, the point weight of each point is determined to be 1; if the priority of each point is low, the point weight of each point is determined to be 0.
[0095] In this embodiment, the synchronization flag and point weight of the point can be modified according to the priority of the point, so that the importance of the point can be adjusted at any time according to the priority of the point, so that the data of the important points can be processed in time during the next round of polling, thereby improving the real-time communication of important data.
[0096] As shown in FIG3 , the specific execution process of the above-mentioned point polling method is described in detail below in conjunction with a specific embodiment.
[0097] In the embodiment of the present application, unlike the common polling mechanism communication protocol point, the embodiment of the present application adds or supplements the point attribute information in Table 1, and specifies the point address information addr, data priority P, data change interval Td, point weight V, synchronization flag S, current data value Data and other attributes. The above parameters of the point are important attributes for system scheduling and judging the point communication requirements, and are the basic parameters of the entire polling system.
[0098] Table 1 Communication point attribute information
[0099]
[0100] The point address information addr includes but is not limited to the device address of the communication point and the monitoring point offset point address information. The address information is an important parameter for communicating with the corresponding point of the device.
[0101] The priority level P refers to the priority level of the point communication process. The functional characteristics of each priority level are shown in Table 2. The system is divided into three priorities. Priority level 1 represents that the point is in the highest priority state. The communication point in this state should perform the communication interaction process with the slave device in each polling cycle. Priority level 2 represents that the point is in the second priority level. The communication characteristics of this priority point are: whether to perform communication interaction in the polling cycle depends on the point weight V. The system assigns the point to communicate in this round according to the weight information of the point. Priority level 3 represents that the point is in a low priority state, indicating that the real-time requirements of this monitoring point are not strict, so this priority point will only perform communication scans and data updates for all points in the mandatory update cycle n, that is, in n polling cycles.
[0102] The data change interval time Td refers to the interval time between the data and the last change. The shorter the Td time is, the faster the data change frequency is, and vice versa, the data change is slow.
[0103] The point weight V is a measure of the importance of the point, and the value range is 0-1 (or 0-100, etc.). For the point with priority 1, the point weight is always assigned to 1 (always polled in each cycle). For the point with priority 3, the point weight is always assigned to 0 (never polled, polling in a specific cycle). For the point weight information with priority 2, it is necessary to combine the number of data scans and the number of data changes to perform weight analysis and assign weights.
[0104] The synchronization flag S is a data synchronization flag. When S=1, the data performs a synchronization operation. When S=0, the data does not perform a synchronization operation. The current data value Data is a point data value.
[0105] Table 2 Communication processing methods for different priority points
[0106]
[0107] Specifically, the specific execution process of the above point polling method includes the following steps:
[0108] S1: Start periodic polling of points according to the synchronization flag S. At the beginning of the first round of polling, the synchronization flag of all points is 1 by default. During this operation, the communication will poll data one by one. This polling process completes the update of the point data value Data and records the data change interval Td time.
[0109] S2: Determine whether the polling times have reached the mandatory synchronization cycle times n. The completion of polling for all communication protocol points in the protocol table is recorded as the completion of one polling operation. When n polling times are completed, the system will reach the mandatory synchronization cycle times n mentioned above.
[0110] S3: By setting the synchronization flags of all points to 1, the polling operation of all points is completed, that is, the communication completes the polling of all communication protocol points in the protocol table and records the completion of a polling operation. As described in S2, this is to ensure the real-time and effectiveness of the monitoring of all points. As with S1, this polling process completes the update of the point data value Data and records the data change interval Td time.
[0111] S4: Assign weights V to points of different priorities. The weight of points with priority 1 is 1, and that of points with priority 3 is 0. Points with priority 2 are assigned a weight of 1 in the first round of scanning, and then the weight V is calculated.
[0112] If T-Td>0, calculation formula 1 is: .
[0113] If T-Td<0, calculation formula 2 is: .
[0114] If T-Td=0, calculation formula 3 is: .
[0115] Among them, T is the time required for the forced synchronization cycle to complete the entire cycle polling, V is the point weight, which is the point weight of the previous cycle, and m is the weight coefficient. If all points with different weights have no data changes for m consecutive judgment cycles, it can be determined that the point weights will all be 0. Similarly, if all points with different weights have data changes continuously within m judgment cycles, the weights of the points will all become 1.
[0116] It should be understood that for calculation formula 1, In the case of , the process no longer performs the addition operation and assigns the value to 1. For calculation formula 2, In the case of , no subtraction operation is performed and the value is assigned to 0.
[0117] S5: Sort the points according to the weights, and set the synchronization flag (synchronization flag) S according to the point weights. For all communication points with a priority of 1 and a point weight greater than 0, the synchronization flag S is set to 1. For all communication points with a priority of 3 or a weight equal to 0, the synchronization flag S is set to 0.
[0118] In this embodiment, by using the point classification method, the corresponding points are polled according to the urgency of the point data of different importance, which can avoid the lag of important control data control during the polling communication process in the case of multiple devices and ensure the real-time upload of key monitoring data. In addition, the embodiment of the present application can simulate the communication from the device and monitor the data during the communication process. The number of point polling communications will decrease as the point data changes. When the frequency of point data changes increases, the number of point communications will increase as the point data changes.
[0119] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0120] Based on the same inventive concept, the embodiment of the present application also provides a point polling device for implementing the point polling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more point polling device embodiments provided below can refer to the limitations of the point polling method above, and will not be repeated here.
[0121] In an exemplary embodiment, as shown in FIG. 4 , a point polling device 400 is provided, comprising: a point determination module 401 , a weight update module 402 and a flag update module 403 , wherein:
[0122] The point determination module 401 is used to determine the target point to be polled for each round of point polling based on the point weight, synchronization flag and point polling number of each point;
[0123] The weight updating module 402 is used to poll the target point to obtain the target point after polling, and to update the point weight of the target point after polling to obtain the updated point weight;
[0124] The flag update module 403 is used to update the synchronization flag of the target point based on the updated point weight, obtain the updated synchronization flag, return to execute the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point, until the point polling is completed.
[0125] Furthermore, the point determination module 401 is specifically used to: obtain the priority of each point for each point; the priority includes high priority, medium priority and low priority; when the priority of the point is medium priority, if the synchronization flag of the point is the first flag value, the point is determined to be an initial point; based on the order of size corresponding to the point weights of each initial point, the initial points are sorted, and the sorted initial points are determined to be the target points to be polled.
[0126] Furthermore, the point determination module 401 is specifically used for: when the priority of the point is high priority, if the synchronization flag of the point is the first flag value, determining the point as an initial point; when the priority of the point is low priority and the number of point polling times reaches the number corresponding to the forced synchronization cycle, determining the synchronization flag of the point as the first flag value, and determining the point as the initial point; when the priority of the point is low priority and the number of point polling times does not reach the number corresponding to the forced synchronization cycle, if the synchronization flag of the point is not the first flag value, determining the point as a non-target point.
[0127] Furthermore, the weight updating module 402 is specifically used to: poll the target point, and update the current data value and data change interval of the target point based on the data value obtained by polling; update the point weight of the target point according to the priority and data change interval of the target point to obtain an updated point weight.
[0128] Furthermore, the weight updating module 402 is also specifically used to: determine the weight adjustment amount when the priority of the target point is medium priority; the weight adjustment amount is determined based on the weight coefficient of the target point; if it is determined that the data change interval is less than the forced synchronization period, the point weight of the target point is added to the weight adjustment amount to obtain the updated point weight; if it is determined that the data change interval is greater than the forced synchronization period, the point weight of the target point is subtracted from the weight adjustment amount to obtain the updated point weight.
[0129] Furthermore, the flag updating module 403 is specifically configured to: if the updated point weight is not 0, determine the synchronization flag of the target point to be the first flag value; if the updated point weight is 0, determine the synchronization flag of the target point to be the second flag value.
[0130] Furthermore, the flag updating module 403 is further specifically used to: if the priority of the target point is high priority, determine the synchronization flag of the target point to be the first flag value; if the priority of the target point is low priority, determine the synchronization flag of the target point to be the second flag value.
[0131] Each module in the above-mentioned point polling device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0132] In an exemplary embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be shown in FIG5. The electronic device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data such as the point attributes of the point. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a point polling method is implemented.
[0133] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In an exemplary embodiment, an electronic device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the following steps are implemented:
[0135] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0136] Poll the target point to obtain the target point after polling, and update the point weight of the target point after polling to obtain the updated point weight;
[0137] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled based on the point weight, synchronization flag and number of point polling for each round of point polling is returned to be executed until the point polling is completed.
[0138] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0139] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0140] Poll the target point to obtain the target point after polling, and update the point weight of the target point after polling to obtain the updated point weight;
[0141] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled based on the point weight, synchronization flag and number of point polling for each round of point polling is returned to be executed until the point polling is completed.
[0142] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0143] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0144] Poll the target point to obtain the target point after polling, and update the point weight of the target point after polling to obtain the updated point weight;
[0145] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled based on the point weight, synchronization flag and number of point polling for each round of point polling is returned to be executed until the point polling is completed.
[0146] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0147] For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point;
[0148] Poll the target point to obtain the target point after polling, and update the point weight of the target point after polling to obtain the updated point weight;
[0149] Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled based on the point weight, synchronization flag and number of point polling for each round of point polling is returned to be executed until the point polling is completed.
[0150] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0152] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A point polling method, characterized in that: The method comprises: For each round of point polling, the target point to be polled is determined based on the point weight, synchronization flag and number of point polling of each point; Polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain an updated point weight; Based on the updated point weight, the synchronization flag of the target point is updated to obtain the updated synchronization flag, and the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point is returned to be executed until the point polling is completed.
2. The method according to claim 1, characterized in that: The step of determining the target point to be polled based on the point weight, synchronization flag and number of point polling of each point includes: For each point, obtain the priority of each point; the priority includes high priority, medium priority and low priority; In the case where the priority of the point is medium priority, if the synchronization flag of the point is the first flag value, the point is determined to be an initial point; The initial points are sorted based on the order of magnitude corresponding to the point weights of the initial points, and the sorted initial points are determined as the target points to be polled.
3. The method according to claim 2, characterized in that After obtaining the priority of each point, the method further includes: In the case where the priority of the point is a high priority, if the synchronization flag of the point is a first flag value, determining the point to be an initial point; When the priority of the point is low priority and the number of polling times of the point reaches the number corresponding to the forced synchronization cycle, determining the synchronization flag of the point to be the first flag value, and determining the point to be the initial point; When the priority of the point is low priority and the number of polling times of the point does not reach the number corresponding to the forced synchronization cycle, if the synchronization flag of the point is not the first flag value, the point is determined to be a non-target point.
4. The method according to claim 2, characterized in that: The polling of the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain the updated point weight, includes: Polling the target point, and updating the current data value and data change interval of the target point based on the data value obtained by polling; According to the priority of the target point and the data change interval, the point weight of the target point is updated to obtain an updated point weight.
5. The method according to claim 4, characterized in that The updating of the point weight of the target point according to the priority of the target point and the data change interval to obtain the updated point weight includes: In the case where the priority of the target point is medium priority, determining a weight adjustment amount; the weight adjustment amount is determined based on a weight coefficient of the target point; If it is determined that the data change interval is less than the forced synchronization period, the point weight of the target point is added to the weight adjustment amount to obtain an updated point weight; If it is determined that the data change interval is greater than the forced synchronization period, the point weight of the target point is subtracted from the weight adjustment amount to obtain an updated point weight.
6. The method according to claim 2, characterized in that The updating of the synchronization mark of the target point based on the updated point weight to obtain the updated synchronization mark includes: If the updated point weight is not 0, determining the synchronization flag of the target point to be the first flag value; If the updated point weight is 0, the synchronization flag of the target point is determined to be the second flag value.
7. The method according to claim 6, characterized in that The method further comprises: If the priority of the target point is high priority, determining the synchronization flag of the target point to be the first flag value; If the priority of the target point is low priority, the synchronization flag of the target point is determined to be the second flag value.
8. A point polling device, characterized in that: The device comprises: A point determination module is used to determine the target point to be polled for each round of point polling based on the point weight, synchronization flag and point polling number of each point; A weight updating module, used for polling the target point to obtain the target point after polling, and updating the point weight of the target point after polling to obtain the updated point weight; The flag update module is used to update the synchronization flag of the target point based on the updated point weight, obtain the updated synchronization flag, and return to execute the step of determining the target point to be polled for each round of point polling based on the point weight, synchronization flag and number of point polling of each point until the point polling is completed.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data acquisition method, device and system and electronic equipment
CN114721796A
Task management method and device, electronic equipment and storage medium
CN118567808A
Multithreaded central operating unit and simultaneous multithreading control method
JP2006343872A
Polling monitoring system, polling monitoring server, polling monitoring method, and polling monitoring program
JP2012212341A