A data processing method, apparatus and gateway system

By dynamically determining the data frame priority of the expansion device in the building automation system, the bus congestion and data real-time problems caused by the lightweight gateway hardware resource limitations are solved, and the efficient transmission and real-time performance of important data are achieved.

CN119316489BActive Publication Date: 2025-10-10GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411474976.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-10-10
Estimated Expiration
2044-10-22

AI Technical Summary

Technical Problem

Due to hardware resource limitations, lightweight gateways in building automation systems have limited running memory space and do not support the access of expansion devices or a small number of access devices. When the data communication bus is busy, it affects data real-time performance, which may lead to communication failures and omission of important data.

Method used

The priority of the data frame to be sent is dynamically determined by the expansion device, including data framing, filtering low-priority data, adjusting the priority based on the waiting time for sending, and sending bus preemption requests to improve the rationality of the priority allocation of data frames.

Benefits of technology

While alleviating bus congestion, it improves the real-time transmission of important data, avoids data omissions, and improves the timeliness and reliability of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316489B_ABST
    Figure CN119316489B_ABST
Patent Text Reader

Abstract

The disclosure provides a data processing method, device and gateway system, and relates to the technical field of building automation. The data processing method is executed by an extension device, and includes the following steps: acquiring data of at least one device connected to the gateway through the extension device; framing the data of the at least one device to obtain a to-be-sent data frame; determining the priority of the to-be-sent data frame according to the priority of the at least one device and the waiting sending time of the to-be-sent data frame; sending a bus preemption request to the gateway, wherein the bus preemption request carries the priority of the to-be-sent data frame; and after receiving a bus preemption response from the gateway, which indicates that the bus preemption is successful, sending the to-be-sent data frame through the bus. Through the above method, the priority of the to-be-sent data frame of each extension device can be dynamically determined, the gateway can allocate the bus more reasonably according to the priority, and the transmission real-time performance of important data can be improved while relieving the bus congestion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of building automation technology, and in particular to a data processing method, device, and gateway system. Background Art

[0002] In building automation systems, lightweight gateways are limited by hardware resources and have a small running memory space, which results in the inability to support the access of expansion devices, or a small number of expansion devices that can be connected and the number of devices accessed through expansion devices.

[0003] When a gateway is connected to many expansion devices, the huge amount of data will cause the communication bus to be busy, making it impossible for some expansion devices to send data in time, affecting the real-time nature of the data. In addition, communication failures are likely to occur.

[0004] In order to alleviate the bus congestion problem, related technologies use a longer period to report data or directly discard old data. This approach will reduce the real-time nature of the data and may cause important data to be missed. Summary of the Invention

[0005] The present disclosure provides a data processing method, device and gateway system.

[0006] According to a first aspect of the present disclosure, a data processing method is provided, which is executed by an expansion device and includes: obtaining data of at least one device that accesses a gateway through the expansion device; framing the data of the at least one device to obtain a data frame to be sent; determining the priority of the data frame to be sent based on the priority of the at least one device and the waiting time for sending the data frame to be sent; sending a bus preemption request to the gateway, wherein the bus preemption request carries the priority of the data frame to be sent, so that the gateway generates a bus preemption response according to the priority of the data frame to be sent; and after receiving the bus preemption response indicating that the bus preemption is successful from the gateway, sending the data frame to be sent via the bus.

[0007] In some embodiments, determining the priority of the data frame to be sent based on the priority of the at least one device and the waiting time for sending the data frame to be sent includes: determining the initial priority of the data frame to be sent based on the priority of the device with the highest priority among the at least one device; and when the waiting time for sending the data frame to be sent is greater than or equal to the set time length, increasing the initial priority of the data frame to be sent to obtain the priority of the data frame to be sent.

[0008] In some embodiments, determining the priority of the data frame to be sent based on the priority of the at least one device and the waiting time for sending the data frame to be sent also includes: when the waiting time for sending the data frame to be sent is less than the set time length, using the initial priority as the priority of the data frame to be sent.

[0009] In some embodiments, increasing the initial priority of the data frame to be sent includes: taking a set duration as a timing period, and increasing the initial priority of the data frame to be sent according to a set step size at the end of each timing period, wherein the set step size is positively correlated with the cumulative number of the timing periods.

[0010] In some embodiments, the framing of the data of the at least one device to obtain the data frame to be sent includes: when the data of the at least one device includes data of a specified device, filtering out at least a portion of the data of the specified device other than the data at the most recent moment to obtain filtered data, wherein the specified device is a device with a priority lower than a set threshold; framing the filtered data to obtain the data frame to be sent.

[0011] In some embodiments, obtaining data of at least one device that accesses the gateway through the expansion device includes: collecting original data of at least one device that accesses the gateway through the expansion device; preprocessing the original data and storing the preprocessed data in a cache; and obtaining data of the at least one device from the cache.

[0012] In some embodiments, the data processing method further includes: when sending a bus preemption request to the gateway, starting timing; when no response to the successful bus preemption is received within the set time period, executing the step of determining the priority of the data frame to be sent again; sending a bus preemption request to the gateway again, and restarting timing.

[0013] According to a second aspect of the present disclosure, a data processing apparatus is provided, which is arranged in an expansion device and includes a module for executing the data processing method as described above.

[0014] According to a third aspect of the present disclosure, a data processing device is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the aforementioned data processing method based on instructions stored in the memory.

[0015] According to a fourth aspect of the present disclosure, a gateway system is provided, comprising: a plurality of extension devices, each extension device comprising a data processing apparatus as described above; a gateway connected with the plurality of extension devices, configured to: receive a bus preemption request sent by the plurality of extension devices, the bus preemption request carrying a priority of a data frame to be sent; generate a bus preemption response according to the priority of the data frame to be sent; and send the bus preemption response to the plurality of extension devices.

[0016] In some embodiments, the bus preemption request further carries an address code of the extension device, and the gateway generating the bus preemption response according to the priority of the data frame to be sent comprises: generating the bus preemption response according to the priority of the data frame to be sent and the address code of the extension device.

[0017] According to a fifth aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon computer program instructions, which when executed by a processor implement the data processing method as described above.

[0018] According to a sixth aspect of the present disclosure, a computer program product is provided, having stored thereon computer program instructions, which when executed by a processor implement the data processing method as described above.

[0019] Other features and advantages of the present disclosure will be apparent from the following detailed description of exemplary embodiments thereof, taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which constitute a part of this specification, illustrate embodiments of the present disclosure and serve to explain the principles of the present disclosure.

[0021] Figure 1 is a flowchart of a data processing method according to some embodiments of the present disclosure;

[0022] Figure 2 is a flowchart of a data processing method according to some other embodiments of the present disclosure;

[0023] Figure 3 is a structural diagram of a data frame to be sent according to some embodiments of the present disclosure;

[0024] Figure 4 is a structural diagram of a data processing apparatus according to some embodiments of the present disclosure;

[0025] Figure 5 is a structural diagram of a data processing apparatus according to some other embodiments of the present disclosure;

[0026] Figure 6 is a structural diagram of a data processing apparatus according to some further embodiments of the present disclosure;

[0027] Figure 7 It is a structural diagram of a gateway system according to some embodiments of the present disclosure.

[0028] The present disclosure can be more clearly understood from the following detailed description with reference to the accompanying drawings. DETAILED DESCRIPTION

[0029] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure.

[0030] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0031] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0032] Technologies, methods and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods and equipment should be considered part of the authorization specification.

[0033] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0034] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0035] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings.

[0036] Although the data processing method adopted by the expansion device in the related art can alleviate the bus congestion problem to a certain extent, it has shortcomings such as poor real-time data reporting and omission of important data.

[0037] In view of this, the present disclosure proposes a data processing method, device and gateway system, which can dynamically determine the priority of the data frames to be sent by the expansion device, so that the gateway can allocate the bus more reasonably based on this, which helps to alleviate bus congestion while improving the real-time transmission of important data.

[0038] Figure 1FIG is a flow chart of a data processing method according to some embodiments of the present disclosure. Figure 1 As shown, the data processing method is executed by an expansion device (also referred to as an expansion module) or a data processing apparatus located on the expansion device, and includes steps S11 to S15.

[0039] Step S11: Acquire data of at least one device connected to the gateway through the extension device.

[0040] An expansion device is connected to the gateway, allowing at least one device to connect to the gateway through the expansion device. For example, the gateway may be connected to multiple expansion devices, each of which may be connected to one or more terminal devices. These terminal devices may be devices such as indoor and outdoor air conditioner units.

[0041] In some examples, step S11 specifically includes: the extension device receives data reported by multiple devices.

[0042] In other examples, step S11 specifically includes: the expansion device collects raw data of at least one device connected to the gateway through the expansion device; preprocesses the raw data and stores the preprocessed data in a cache; and obtains data of at least one device from the cache.

[0043] The frequency of collecting data may be the same as or different from the frequency of obtaining data from the cache. The data obtained from the cache each time may be a portion of the data in the cache or all of the data in the cache.

[0044] Preprocessing can flexibly configure processing logic based on actual application scenarios. For example, preprocessing can include converting the communication protocol of the data. For example, assuming that the data reported by terminal device A connected to the expansion device uses a first communication protocol, and the data reported by terminal device B connected to the expansion device uses a second communication protocol, and the expansion device supports a third communication protocol, the communication protocol of the data reported by terminal device A and the data reported by terminal device B will be converted to the third communication protocol.

[0045] In the embodiment of the present disclosure, the original data collected by the device is preprocessed and cached, and the preprocessed data is obtained from the cache for communication framing, so as to improve the device compatibility of the expansion device and the gateway.

[0046] Step S12: framing the data of at least one device to obtain a data frame to be sent.

[0047] In some examples, after acquiring data from at least one device, all acquired data is framed to obtain a data frame to be sent.

[0048] In other examples, after acquiring data from at least one device, the acquired data is filtered according to pre-set filtering rules, and then the filtered data is framed to obtain data frames to be sent.

[0049] The filtering rule may be to filter data from a specified device. For example, after acquiring data from at least one device, a determination is made as to whether the acquired data includes data from a specified device, where the specified device is a device whose priority is lower than a set threshold. If the acquired data includes data from the specified device, at least a portion of the data from the specified device, excluding the most recent data, is filtered out to obtain filtered data, which is then framed. If the acquired data does not include data from the specified device, all acquired data is framed. The threshold can be set flexibly.

[0050] For example, assuming that the device data acquired at a certain time includes data of terminal device A at 8:10, 8:20, and 8:30, and the device priority of terminal device A is less than the set threshold, the data of terminal device A at 8:10 and 8:20 can be filtered out, and the data of terminal device A at 8:30 can be used as the filtered data, and then the filtered data can be framed.

[0051] For example, assuming that the device data acquired at a certain time includes data of terminal device A at 8:10, data of terminal device B at 8:20 and 8:30, and the device priority of terminal device A is greater than the set threshold, and the device priority of terminal device B is less than the set threshold, then the data of terminal device B at 8:20 can be filtered out, and the data of terminal device A at 8:10 and the data of terminal device B at 8:30 can be used as filtered data, and then the filtered data is framed.

[0052] In the disclosed embodiment, by performing the above filtering process before framing the data, old data of lower priority devices can be filtered out, thereby alleviating bus congestion and improving data real-time performance without missing important data.

[0053] Step S13: Determine the priority of the data frame to be sent according to the priority of at least one device and the waiting time for sending the data frame to be sent.

[0054] In some examples, step S13 includes: determining an initial priority of the data frame to be sent based on the priority of the device with the highest priority among the at least one device; and if the waiting time for sending the data frame to be sent is greater than or equal to a set time period, increasing the initial priority of the data frame to be sent to obtain the priority of the data frame to be sent. Furthermore, in the above example, step S13 may further include: if the waiting time for sending the data frame to be sent is less than the set time period, using the initial priority as the priority of the data frame to be sent.

[0055] The "wait-to-send time" refers to the time it takes for a data frame to be successfully transmitted. For example, if the timer starts counting from the moment a bus preemption request is first sent, the wait-to-send time is the time interval from the moment the bus preemption request is first sent to the current moment. For another example, if the timer starts counting from the moment a frame is first assembled, the wait-to-send time is the time interval from the moment the frame is first assembled to the current moment.

[0056] In the embodiment disclosed herein, step S13 can be used to dynamically determine the priority of the data frame to be sent. When determining the priority, not only the priority of the device corresponding to the data frame to be sent is taken into consideration, but also the waiting time for the data frame to be sent is taken into consideration. In this way, the data frame priority determined by each expansion device takes into account both the importance of the data and the real-time nature of the data, making it easier for the gateway to allocate the bus more reasonably, helping to improve the real-time nature of the transmission of important data while alleviating bus congestion. Furthermore, by comparing the waiting time for sending with the set duration, and adopting different priority determination methods according to different comparison results, the priority of the data frame can be determined more efficiently and accurately.

[0057] Furthermore, in the above example, there are multiple ways to determine the initial priority. Two exemplary methods are described below. In the first exemplary method, the highest priority of the device to which the data participating in the framing belongs can be used as the initial priority. In the second exemplary method, the product of the highest priority of the device to which the data participating in the framing belongs and a set coefficient can be used as the initial priority.

[0058] Furthermore, in the above example, there are multiple ways to increase the initial priority of the data frame to be transmitted. In one exemplary embodiment, increasing the initial priority of the data frame to be transmitted includes: using a set duration as a timing cycle, and increasing the initial priority of the data frame to be transmitted by a set step size at the end of each timing cycle. The set step size can be a fixed value or can be positively correlated with the cumulative number of timing cycles.

[0059] For example, assuming that the set time is 1 minute, the initial priority of the data frame to be sent is 5, and the set step size of the priority increase is 2, then when the waiting time for sending reaches 1 minute, the initial priority of the data frame to be sent increases by 2, so that the priority of the data frame to be sent is 7; when the waiting time for sending reaches 2 minutes, the priority of the data frame to be sent is increased by 2 again, so that the priority of the data frame to be sent is 9.

[0060] For example, assuming the set time is 1 minute, the initial priority of the data frame to be sent is 5, and the set step size of the priority increase is 2n (n is the cumulative number of timing cycles), then when the waiting time reaches 1 minute, the initial priority of the data frame to be sent increases by 2, so the priority of the data frame to be sent is 7; when the waiting time reaches 2 minutes, the priority of the data frame to be sent is increased by 4 again, so the priority of the data frame to be sent is 11.

[0061] In the disclosed embodiment, by increasing the priority of data frames to be transmitted by a set step size each time, using a set duration as the timing cycle, the expansion device can increase the priority at a more reasonable frequency, thereby ensuring the real-time performance of priority updates while reducing the resource consumption caused by the priority increase process on the expansion device. Furthermore, by ensuring that the set step size of the priority increase is positively correlated with the cumulative number of timing cycles, the impact of the waiting time on the priority can be gradually increased, further improving the real-time reporting of important data.

[0062] Furthermore, in a specific implementation, other methods may be employed to increase the initial priority of the data frame to be transmitted. For example, increasing the initial priority of the data frame to be transmitted may include: setting different weight coefficients for the initial priority and the waiting time to be transmitted; performing a weighted sum of the initial priority and the waiting time to be transmitted according to the weight coefficients, and using the sum as the priority of the data frame to be transmitted.

[0063] Step S14: Send a bus preemption request to the gateway.

[0064] The bus preemption request carries the priority of the data frame to be sent. In addition, the bus preemption request may also carry other information, such as address information of an expansion device.

[0065] After receiving bus preemption requests from multiple expansion devices, the gateway allocates buses and generates bus preemption responses in descending order of priority of the data frames to be sent by each expansion device. The bus preemption response can be a response indicating a successful bus preemption or a response indicating a failed bus preemption.

[0066] For example, after the gateway receives bus preemption requests from expansion device 1, expansion device 2, and expansion device 3, if the priority of the data frame to be sent by expansion device 1 is the highest, the bus is allocated to expansion device 1, and a bus preemption success response is generated for expansion device 1, and bus preemption failure responses are generated for expansion devices 2 and 3.

[0067] Step S15: After receiving a response indicating that the bus has been seized successfully, the data frame to be sent is sent.

[0068] In the embodiment of the present disclosure, through the above process, the priority of the data frames to be sent by each expansion device can be dynamically determined, so that the gateway can allocate the bus more reasonably based on this, which helps to alleviate bus congestion while improving the real-time transmission of important data.

[0069] Figure 2 FIG is a flow chart of a data processing method according to some other embodiments of the present disclosure. Figure 2 As shown, the data processing method can be executed by the expansion device, or a data processing apparatus located on the expansion device, and includes steps S21 to S26.

[0070] Step S21: Acquire data of at least one device connected to the gateway through the extension device.

[0071] Regarding how to specifically perform step S21, reference may be made to the relevant contents of the aforementioned embodiment.

[0072] Step S22: framing the data of at least one device to obtain a data frame to be sent.

[0073] Regarding how to specifically perform step S22, reference may be made to the relevant contents of the aforementioned embodiment.

[0074] Step S23: Determine the priority of the data frame to be sent.

[0075] Step S23 may be performed periodically, for example, at a set time interval.

[0076] In some embodiments, when step S23 is executed for the first time, the highest priority of the device to which the data participating in the framing belongs can be used as the priority of the data frame to be sent; when step S23 is executed for the second time and thereafter, the priority of the data frame to be sent can be determined based on the highest priority of the device to which the data participating in the framing belongs and the waiting time for sending the data frame to be sent.

[0077] The data frame to be sent may include multiple fields. In some examples, the data frame to be sent includes: Figure 3The shown fields include: address, data priority, data length, data address, and data. The address refers to the address of the extension device, and the data priority refers to the priority of the data frame to be sent.

[0078] In some embodiments, the data processing method further includes: the user configuring the priority of the device and the address of the extension device through the configuration management device. The higher the priority of the device, the more important the data of the device.

[0079] Step S24: sending a bus preemption request to the gateway and starting timing.

[0080] In step S24, the timing can be started after the bus preemption request is sent to the gateway, or the timing can be started at the same time as the bus preemption request is sent. The bus preemption request carries the priority of the data frame to be sent.

[0081] Step S25: determining whether the bus preemption is successful.

[0082] In some embodiments, it is periodically determined whether the bus preemption is successful. For example, it can be determined whether the bus preemption is successful according to the following manner: after receiving a response that the bus preemption is successful, it is determined that the bus preemption is successful; otherwise, it is determined that the bus preemption is unsuccessful. In the case that the bus preemption is successful, step S26 is performed; otherwise, step S27 is performed.

[0083] Step S26: sending the data frame to be sent and ending the timing.

[0084] In this step, the extension device sends the data frame to be sent through the bus after successfully preoccupying the bus. At the same time, the timing for the data frame to be sent is ended.

[0085] Step S27: determining whether the timing is ended.

[0086] In this step, the set time length is used as the timing period. In the case that the time interval from the current time to the time when the timing is started is greater than or equal to the set time length, it is determined that the timing is ended; otherwise, it is determined that the timing is not ended. In the case that the timing is ended, step S23 is performed again; otherwise, step S25 is performed again.

[0087] In some embodiments, when step S23 is performed again, the priority of the data frame to be sent is increased by a set step to obtain an updated priority. By iteratively performing the above steps, the priority of the data frame to be sent can be updated in time when the bus preemption is unsuccessful, thereby improving the timeliness, integrity, and reliability of data processing.

[0088] In the embodiment of the present disclosure, through the above process, the priority of the data frame to be sent by the expansion device can be dynamically determined, so that the gateway can allocate the bus more reasonably based on this, which helps to alleviate bus congestion while improving the real-time transmission of important data.

[0089] Figure 4 FIG. 1 is a schematic diagram of the structure of a data processing device according to some embodiments of the present disclosure. Figure 4 As shown, the data processing device 40 is set in the expansion device and is used to execute the data processing method as described above, including a data acquisition module 41, a communication framing module 42, a bus preemption module 43, and a data sending module 44.

[0090] The data acquisition module 41 is configured to acquire data of at least one device connected to the gateway through the extension device.

[0091] The communication framing module 42 is configured to frame data of at least one device to obtain a data frame to be sent; and determine the priority of the data frame to be sent according to the priority of at least one device and the waiting time for sending the data frame to be sent.

[0092] The bus preemption module 43 is configured to send a bus preemption request to the gateway, wherein the bus preemption request carries the priority of the data frame to be sent, so that the gateway generates a bus preemption response according to the priority of the data frame to be sent.

[0093] The data sending module 44 is configured to send the to-be-sent data frame through the bus after receiving a bus seizure response indicating that the bus seizure is successful from the gateway.

[0094] In the disclosed embodiment, the above device can dynamically determine the priority of the data frames to be sent by each expansion device, so that the gateway can allocate the bus more reasonably, which helps to alleviate bus congestion while improving the real-time transmission of important data.

[0095] Figure 5 FIG. 1 is a structural diagram of a data processing device according to some other embodiments of the present disclosure. Figure 5 As shown, the data processing device 50 is set in the expansion device, and includes a data acquisition module 51, a data processing module 52, a data buffer module 53, a communication framing module 54, a bus preemption module 55, and a data sending module 56.

[0096] The data collection module 51 is configured to collect raw data of at least one device connected to the gateway through the extension device.

[0097] The data processing module 52 is configured to pre-process the original data and store the pre-processed data in the data cache module 53 .

[0098] The communication framing module 54 is configured to frame the data of at least one device obtained from the data buffer module 53 to obtain a data frame to be sent, and determine the priority of the data frame to be sent.

[0099] In some embodiments, the communication framing module 54 determines the priority of the data frame to be sent according to the following manner: when determining the priority of the data frame to be sent for the first time, the priority of the data frame to be sent is determined according to the priority of the device to which the data participating in framing belongs; when determining the priority of the data frame to be sent for the second time and the subsequent times, the priority of the data frame to be sent is determined according to the priority of the device to which the data participating in framing belongs and the waiting time of the data frame to be sent.

[0100] The bus preemption module 55 is configured to send a bus preemption request to the gateway, and start timing. The bus preemption request carries the priority of the data frame to be sent, so that the gateway generates a bus preemption response according to the priority of the data frame to be sent.

[0101] The data sending module 56 is configured to send the data frame to be sent through the bus after receiving the bus preemption response indicating that the bus preemption is successful from the gateway. At the same time, the timing is ended.

[0102] In some embodiments, after sending the bus preemption request through the bus preemption module 55, it is determined whether the response indicating that the bus preemption is successful is received within a set time length; if the response indicating that the bus preemption is successful is not received within the set time length, the priority of the data frame to be sent is updated through the communication framing module 54. For example, assuming that the currently recorded priority of the data frame to be sent is 11, and the set step is 2, the sum of the currently recorded priority of the data frame to be sent and the set step is taken as the updated priority of the data frame to be sent.

[0103] In some embodiments, the data sending module 56 is further configured to save the data participating in framing to the data buffer module in the case that the sending of the data frame to be sent fails.

[0104] In the embodiments of the present disclosure, the priority of the data frame to be sent of each expansion device can be dynamically determined through the above device, which facilitates the gateway to more reasonably allocate the bus, and helps to relieve the bus congestion while improving the sending real-time performance of important data.

[0105] Figure 6 is a structural schematic diagram of a data processing device according to still another embodiment of the present disclosure; as Figure 6As shown, the data processing apparatus 60 comprises a memory 61 and a processor 62 coupled to the memory 61. The memory 61 is configured to store instructions for implementing an embodiment of the data processing method. The processor 62 is configured to execute the data processing method in any of the embodiments of the present disclosure based on the instructions stored in the memory 61.

[0106] Figure 7 is a structural schematic diagram of a gateway system according to some embodiments of the present disclosure. As shown, the gateway system comprises a gateway 71, and a plurality of extension devices. Among them, the plurality of extension devices comprises an extension device 1 72, …, and an extension device M 73. Among them, M is an integer greater than 1. Figure 7

[0107] Each of the plurality of extension devices comprises a data processing apparatus as described above.

[0108] The gateway 71 is connected with the plurality of extension devices, and is configured to: receive a bus preemption request sent by the plurality of extension devices, the bus preemption request carrying a priority of a to-be-sent data frame; generate a bus preemption response according to the priority of the to-be-sent data frame; and send the bus preemption response to the plurality of extension devices.

[0109] In some embodiments, the gateway generates the bus preemption response in the following manner: allocating the bus according to the priority of the to-be-sent data frame of each extension device in descending order; and generating the bus preemption response according to the bus allocation result. For example, the bus is allocated to the to-be-sent data frame with the highest priority, and a response of successful bus preemption is generated for the extension device where the to-be-sent data frame is located; a response of failed bus preemption is generated for the extension devices where the other to-be-sent data frames are located.

[0110] In some embodiments, the gateway allocates the bus according to the priority of the to-be-sent data frame and the address code of the extension device. For example, when the priorities of the to-be-sent data frames of the extension devices are different, the bus is allocated according to the priority of the to-be-sent data frame in descending order; when the priorities of the to-be-sent data frames of the extension devices are the same, the bus is allocated according to the address code of each extension module in descending order. Then, the bus preemption response is generated according to the bus allocation result. By considering not only the priority of the to-be-sent data frame of each extension device, but also the address code of each extension device when allocating the bus, the effect of bus allocation can be further improved, and the real-time performance of data reporting can be improved.

[0111] Further, the gateway system can further comprise a plurality of terminal devices. For example, terminal device 1 74, …, terminal device K1 75 connected to the gateway through the extension device 1, and terminal device 1 76, …, terminal device K2 77 connected to the gateway through the extension device M 73. Among them, K1 and K2 are integers greater than 1.​

[0112] In the disclosed embodiment, the above gateway system can dynamically determine the priority of the data frames to be sent by each expansion device, so that the gateway can allocate the bus more reasonably, which helps to alleviate bus congestion while improving the real-time transmission of important data.

[0113] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks, can be implemented by computer-readable program instructions.

[0114] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.

[0115] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to operate in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowcharts and / or block diagrams.

[0116] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.

[0117] The data processing method, apparatus, and gateway system according to the present disclosure have been described in detail. To avoid obscuring the concepts of the present disclosure, some details known in the art have been omitted. Based on the above description, those skilled in the art will fully understand how to implement the technical solutions disclosed herein.

Claims

1. A data processing method, executed by an expansion device, comprising: Acquire data of at least one device connected to the gateway through the expansion device; framing the data of the at least one device to obtain a data frame to be sent; Determining the priority of the data frame to be sent according to the priority of the at least one device and the waiting time for sending the data frame to be sent; Sending a bus preemption request to the gateway, wherein the bus preemption request carries the priority of the data frame to be sent, so that the gateway generates a bus preemption response according to the priority of the data frame to be sent; After receiving a bus seizure response indicating that the bus seizure is successful from the gateway, the to-be-sent data frame is sent via the bus.

2. The data processing method according to claim 1, wherein: The determining, according to the priority of the at least one device and the waiting time for sending the data frame to be sent, the priority of the data frame to be sent includes: determining an initial priority of the data frame to be sent according to the priority of the device with the highest priority among the at least one device; When the waiting time for sending the data frame to be sent is greater than or equal to the set time length, the initial priority of the data frame to be sent is increased to obtain the priority of the data frame to be sent.

3. The data processing method according to claim 2, wherein: Determining the priority of the data frame to be sent according to the priority of the at least one device and the waiting time for sending the data frame to be sent further includes: In a case where the waiting time for sending the data frame to be sent is less than the set time length, the initial priority is used as the priority of the data frame to be sent.

4. The data processing method according to claim 2, wherein: Increasing the initial priority of the data frame to be sent includes: Taking the set duration as a timing cycle, at the end of each timing cycle, the initial priority of the data frame to be sent is increased according to a set step length, wherein the set step length is positively correlated with the accumulated number of timing cycles.

5. The data processing method according to claim 1, wherein: The framing of the data of the at least one device to obtain a data frame to be sent includes: When the data of the at least one device includes data of a designated device, filtering out at least a portion of data other than the most recent data in the data of the designated device to obtain filtered data, wherein the designated device is a device having a priority lower than a set threshold; The filtered data is framed to obtain a data frame to be sent. The data processing method according to claim 1 , wherein: The acquiring of data of at least one device connected to the gateway through the extension device includes: Collecting raw data of at least one device connected to the gateway through the expansion device; Preprocessing the original data and storing the preprocessed data in a cache; The data of the at least one device is obtained from the cache.

7. The data processing method according to any one of claims 1 to 6, further comprising: In the case of sending a bus preemption request to the gateway, starting timing; If no bus preemption response indicating that the bus preemption is successful is received within the set time period, performing the step of determining the priority of the data frame to be sent again; Send a bus preemption request to the gateway again and restart the timing.

8. A data processing device, provided in an expansion device, comprising: A module for executing the data processing method according to any one of claims 1 to 7.

9. A data processing device comprising: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the data processing method according to any one of claims 1 to 7 based on instructions stored in the memory.

10. A gateway system comprising: a plurality of expansion devices, each expansion device comprising a data processing apparatus according to claim 8 or 9; A gateway, connected to the plurality of expansion devices, configured to: receive bus preemption requests sent by the plurality of expansion devices, the bus preemption requests carrying priorities of data frames to be sent; Generate a bus preemption response according to the priority of the data frame to be sent; The bus preemption response is sent to the plurality of expansion devices.

11. The gateway system according to claim 10, wherein: The bus preemption request also carries the address code of the expansion device, and the gateway generates a bus preemption response according to the priority allocation of the data frame to be sent, including: A bus preemption response is generated according to the priority of the data frame to be sent and the address code of the expansion device.

12. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the data processing method according to any one of claims 1 to 7.

13. A computer program product having computer program instructions stored thereon, wherein when the instructions are executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Bus conflict avoiding method and device

    CN112217701A

  • Data processing method and system for hybrid access of multi-protocol Internet of Things terminal to RS485 bus

    CN112489409A