Data processing method and device, medium and electronic equipment
By setting high-frequency data processing interrupts and data acquisition interrupts in the master station, and allocating processing cycles based on the slave station data acquisition time, the real-time and integrity problems of the master station when processing multiple data in a multi-slave station communication system are solved , achieving efficient and timely data processing.
Patent Information
- Application Number
- CN202410760331.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-24
AI Technical Summary
In a communication system with one master and multiple slaves, the real-time performance of the master station when processing data from multiple slave stations is difficult to guarantee. As a result, the master station cannot respond in time to receive the next set of data during the data processing process, which may lead to data loss. Moreover, the existing technology After all data is processed, there is an overload problem, making it difficult to ensure the integrity and real-time nature of data processing.
By setting periodic data acquisition interrupts and data processing interrupts in the master station, and setting the frequency of data processing interrupts higher than the data acquisition interrupt, the corresponding data processing cycle is allocated to the slave station data based on the data acquisition time of the slave station data. Realize time-sharing limited processing of data from the slave station and reduce the load on the data processing cycle of the master station.
It effectively avoids data loss, improves the integrity and real-timeness of data processing, reduces the load of the main station in a single data processing cycle, and ensures the timeliness of the data processing process.
Smart Images

Figure CN118694774A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication data processing, and in particular to a data processing method, device, medium and electronic device. Background Art
[0002] In a one-master-multiple-slave communication system, there is a one-to-many correspondence between the master station and the slave stations. The master station generally uses a data processing method of receiving and processing the slave station data sent from multiple slave stations, which has high real-time performance.
[0003] In the data processing mode, the master station can only respond to receive the next group of slave station data after receiving and processing the current group of slave station data. For scenarios where the time interval between multiple slave stations sending their respective group station data to the master station is short, and the single group processing time consumed by the master station to process a group of slave station data is long. This scenario uses a data processing mode of receiving and processing, which will result in the failure to respond to the next group of slave station data in time during the data processing process, resulting in data loss and reducing the integrity of data processing.
[0004] For the above scenario, in the related technology, the master station generally processes all the slave station data at one time after the last set of slave station data is received. However, the related technology often has the problem of master station overload, and the real-time performance of data processing is difficult to guarantee. Summary of the invention
[0005] The present application provides a data processing method, device, medium and electronic device, which can avoid data loss and improve the integrity and real-time performance of data processing.
[0006] According to a first aspect of the present application, a data processing method is provided, the method comprising:
[0007] In response to a data processing interrupt being triggered, determining slave station data to be processed and a data acquisition time of the slave station data; wherein the slave station data is acquired from a plurality of slave stations by the master station in response to a data acquisition interrupt being triggered;
[0008] Allocate a corresponding data processing cycle to the slave station data based on the data acquisition time, and process the slave station data in the corresponding data processing cycle to obtain a data processing result;
[0009] Among them, the data processing interruption and the data acquisition interruption are both periodic interruptions, the data processing period corresponding to the data processing interruption is a first time interval; the data acquisition period corresponding to the data acquisition interruption is a second time interval; wherein the first time interval is smaller than the second time interval.
[0010] According to a second aspect of the present application, a data processing device is provided, the device comprising:
[0011] A data acquisition time determination module, for determining the slave station data to be processed and the data acquisition time of the slave station data in response to the data processing interrupt being triggered; wherein the slave station data is acquired from a plurality of slave stations by the master station in response to the data acquisition interrupt being triggered;
[0012] A data processing result determination module, used to allocate a corresponding data processing period to the slave station data based on the data acquisition time, and process the slave station data in the corresponding data processing period to obtain a data processing result;
[0013] Among them, the data processing interruption and the data acquisition interruption are both periodic interruptions, the data processing period corresponding to the data processing interruption is a first time interval; the data acquisition period corresponding to the data acquisition interruption is a second time interval; wherein the first time interval is smaller than the second time interval.
[0014] According to a third aspect of the present invention, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data processing method described in the embodiment of the present application is implemented.
[0015] According to the fourth aspect of the present invention, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data processing method described in the embodiment of the present application is implemented.
[0016] According to a fifth aspect of the present application, an embodiment of the present application provides a computer program product, including a computer program, which implements the data processing method as described in the embodiment of the present application when executed by a processor.
[0017] The technical solution of the present application sets periodic data acquisition interruption and data processing interruption in the master station, and sets the frequency of data processing interruption higher than that of data acquisition interruption. Then, the corresponding data processing cycle is allocated to the slave station data based on the data acquisition time of the slave station data, and the slave station data is processed in the corresponding data processing cycle to obtain the data processing result, thereby realizing time-sharing and limited processing of the slave station data, reducing the load of the master station in the data processing cycle, avoiding data loss, and being conducive to improving the integrity and real-time performance of data processing.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be 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 creative work.
[0020] Figure 1A is a flow chart of a data processing method provided according to Embodiment 1;
[0021] Figure 1B is a flowchart of a specific data processing method provided according to the first embodiment;
[0022] Figure 2 is a flow chart of a data processing method provided according to Embodiment 2;
[0023] Figure 3 is a structural diagram of a data processing device provided in Embodiment 3 of the present application;
[0024] Figure 4 It is a structural schematic diagram of an electronic device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", "target" and "candidate" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] Embodiment 1
[0028] Figure 1A It is a flowchart of the data processing method provided in Example 1. This embodiment can be applied to a communication system with one master and multiple slaves, in which multiple slave stations send data to the master station, the sending time interval between the data of each slave station is short, and the single group processing time consumed by the master station to process a group of slave station data is long. In this case, data is processed. The method can be configured to be executed by a data processing device, which is implemented in the form of hardware and / or software and can be integrated into an electronic device running this system.
[0029] like Figure 1A As shown, the method includes:
[0030] S110 , in response to a data processing interrupt being triggered, determining slave station data to be processed and a data acquisition time of the slave station data.
[0031] S120, allocating a corresponding data processing cycle to the slave station data based on the data acquisition time, and processing the slave station data in the corresponding data processing cycle to obtain a data processing result.
[0032] The slave data is obtained from multiple slaves by the master station in response to a data acquisition interrupt being triggered. The slave data refers to the communication data generated by the slave station, and the master station is used to process the slave data generated by the slave station. The slave data is actively reported to the master station by the slave station or actively pulled from the slave station by the master station.
[0033] The data processing interruption and the data acquisition interruption are both periodic interruptions. The data processing period corresponding to the data processing interruption is the first time interval; and the data acquisition period corresponding to the data acquisition interruption is the second time interval.
[0034] The master station is triggered to enter a data processing cycle in response to a data processing interrupt, during which the master station executes data processing logic to process slave station data. The master station is triggered to enter a data acquisition cycle in response to a data acquisition interrupt, during which the master station acquires slave station data from the slave station.
[0035] Each set of slave data has a corresponding data acquisition time, which refers to the time when the master acquires the slave data from the slave. The slave data may be acquired by the master before the data processing interrupt of the master is triggered, or it may be acquired by the master after the data processing interrupt is triggered. The data acquisition time of the slave data can determine the order in which the master acquires the slave data. The data acquisition time can be used to allocate data processing cycles for the slave data.
[0036] Among them, the first time interval is less than the second time interval. The specific values of the first time interval and the second time interval are not limited here, and are determined according to actual business needs. In other words, the frequency of data processing interrupt triggering is higher than that of data acquisition interruption. One data acquisition cycle corresponds to at least two data processing cycles. The slave data acquired in one data acquisition cycle is allocated to at least two data processing cycles for processing. Optionally, according to the data acquisition time of the slave data, the slave data is allocated to the nearest data processing cycle for processing.
[0037] In this way, the master station can process the slave station data in a limited time-sharing manner, reducing the load of the master station in a single data processing cycle and reducing the data processing time of a single data processing cycle.
[0038] The technical solution of the present application sets periodic data acquisition interruption and data processing interruption in the master station, and sets the frequency of data processing interruption higher than data acquisition interruption. Then, the corresponding data processing cycle is allocated to the slave station data based on the data acquisition time of the slave station data, and the slave station data is processed in the corresponding data processing cycle to obtain the data processing result, thereby realizing time-sharing and limited processing of the slave station data, reducing the load of the master station in a single data processing cycle, avoiding data loss, and being conducive to improving the integrity and real-time performance of data processing.
[0039] In an optional embodiment, there is a one-to-many correspondence between the master station and the multiple slave stations; the multiple slave stations asynchronously send the slave station data to the master station during the data acquisition cycle; the sending time interval between the multiple slave stations sending each group of slave station data to the master station is less than the single group processing time required for the master station to process a group of slave station data.
[0040] The master station and multiple slave stations belong to a one-master-multiple-slave communication system, and there is a one-to-many correspondence between the master station and the slave stations. A master station is responsible for processing the slave station data generated by multiple slave stations. For example, the master station is a master servo drive, and the slave station is a slave servo drive.
[0041] In a data acquisition cycle, multiple slave stations asynchronously send slave station data to the master station, so that the slave station data will be dispersed into different data processing cycles. The time interval between each group of slave station data sent by multiple slave stations to the master station is determined according to actual business needs, and its specific value is not limited here. It is worth noting that the time interval between each group of slave station data sent by multiple slave stations to the master station is less than the processing time of a single group of slave station data consumed by the master station to process a group of slave station data.
[0042] In this case, the data processing method of receiving and processing immediately will cause the master station to be unable to respond to the next set of slave station data in time during the data processing process, resulting in data loss. The data processing method of receiving first and then processing is adopted. After the last set of slave station data is received, the master station processes all the slave station data at once, which will cause the master station to be overloaded and the real-time performance of data processing is difficult to guarantee.
[0043] The above technical solution is aimed at the scenario where there is a one-to-many correspondence between a master station and multiple slave stations; multiple slave stations asynchronously send slave station data to the master station within a data acquisition cycle; and the time interval between the sending of each group of slave station data by multiple slave stations to the master station is less than the single group processing time consumed by the master station to process a group of slave station data. It provides a practical data processing method to reduce the load of the master station in a single data processing cycle, and can ensure the real-time performance of data processing while avoiding data loss.
[0044] In an optional embodiment, the method also includes: dividing the slave station data that can be acquired in one data acquisition cycle into the same data synchronization batch; determining the batch processing time required to complete processing a data synchronization batch based on the data acquisition time and the single group processing time required for the master station to process a group of slave station data; and adjusting the relative delay between the data acquisition interruption and the data processing interruption based on the batch processing time to complete the processing of all slave station data in the data synchronization batch within the data acquisition cycle.
[0045] After processing the slave data, the master station will collect the data processing results. That is to say, the master station will not only obtain slave data from multiple slaves during the data acquisition cycle, but also collect the data processing results corresponding to the slave data.
[0046] The corresponding data processing results of the slave station data acquired in a data acquisition cycle must also be obtained in the data acquisition cycle. For example, the slave station data acquired in data acquisition cycle 1 are Data1, Data2, Data 3, Data 4 and Data 5. The corresponding data processing results Result1, Result2, Result3, Result4 and Result5 must also be obtained in data acquisition cycle 1.
[0047] Figure 1B is a flowchart of a specific data processing method provided according to Example 1, see Figure 1B ,in, Figure 1BT1 represents the first time interval, T2 represents the second time interval, t1 represents the single group processing time required for the master station to process a group of slave station data, and t2 represents the relative delay between the data acquisition interruption and the data processing interruption. The relative delay refers to the time interval between the triggering moment of the data processing interruption and the triggering moment of the data acquisition interruption. Figure 1B A shaded rectangle in the data processing cycle indicates that slave data has entered the data processing cycle, and a blank rectangle indicates that no slave data has entered the data processing cycle. If no slave data has entered the data processing cycle, the master station does not need to process data.
[0048] Data1 is assigned to data processing cycle 1, Data2 and Data 3 are assigned to data processing cycle 2, and Data4 and Data 5 are assigned to data processing cycle 3. Data processing cycles 1 to 3 are three consecutive data processing cycles. Before the end of data acquisition cycle 1, the master station completes the processing of Data 4 and Data 5 in data processing cycle 3 to obtain Result 4 and Result 5. This requires that data acquisition cycle 1 can cover data processing cycles 1 to 3.
[0049] The time required for the master station to process a batch of data synchronization is the batch processing time. Figure 1B The batch processing duration is the duration required for the master station to process Data1, Data2, Data 3, Data 4, and Data 5. The batch processing duration is determined based on the data acquisition time of the slave station data and the single group processing duration consumed by the master station to process a group of slave station data. For example, the starting time of the batch processing duration can be determined based on the data acquisition time of Data1, and the end time of the batch processing duration can be determined based on the data acquisition time of Data5 and the single group processing duration consumed by the master station to process Data5. When the starting time and the end time are known, the batch processing duration can be determined.
[0050] When the batch processing duration is known, the relative delay t2 between the data acquisition interrupt and the data processing interrupt is adjusted, and the data processing cycle for processing the same synchronous batch of slave station data is adjusted to the data acquisition cycle, ensuring that the last group of slave station data in the same synchronous batch can be processed before the next data acquisition interrupt is triggered.
[0051] The above technical solution adjusts the relative delay between data acquisition interruption and data processing interruption, so that all slave station data in the data synchronization batch can be processed within the data acquisition cycle, thereby ensuring the real-time performance of the data processing process.
[0052] Embodiment 2
[0053] Figure 2It is a flow chart of the data processing method provided according to the second embodiment. This embodiment is further optimized on the basis of the above embodiment.
[0054] like Figure 2 As shown, the method includes:
[0055] S210 : In response to a data processing interrupt being triggered, determining slave station data to be processed and a data acquisition time of the slave station data.
[0056] The slave station data is acquired from multiple slave stations by the master station in response to being triggered by a data acquisition interrupt.
[0057] S220. Based on the data acquisition time, determine how many groups of slave station data fall into each data processing cycle to obtain the number of data groups corresponding to each data processing cycle.
[0058] Since the data processing interrupt is a periodic interrupt and is repeatedly triggered at the first time interval, when the triggering moment of the data processing interrupt is determined, the time of the data processing cycle can be determined.
[0059] Based on the data acquisition time of the slave station data, it can be determined which data processing cycle the slave station data falls into. Thus, it can be determined how many groups of slave station data fall into each data processing cycle to obtain the number of data groups corresponding to each data processing cycle.
[0060] S230: Determine a data processing cycle in which the number of data groups is greater than a preset group number threshold as an overload processing cycle.
[0061] When the processing time of a single group is determined, the number of data groups will affect the data processing time in a single data processing cycle, and further affect the load of the master station in a single data processing cycle. The preset group number threshold is used to control the load of the master station in a single data processing cycle and the data processing time of the master station in a single data processing cycle. Controlling the load of the master station in a single data processing cycle and the data processing time of the master station in a single data processing cycle is of great significance to ensuring the real-time and integrity of the data processing process.
[0062] If the number of data groups is greater than the preset group number threshold, it means that the load of the master station in a single data processing cycle is greater than the expected load, and the data processing time of the master station in a single data processing cycle is greater than the expected time. The data processing cycle in which the number of data groups is greater than the preset group number threshold is determined as an overload processing cycle. Among them, the overload processing cycle refers to a data processing cycle in which the load is greater than the expected load. The slave station data falling into the overload processing cycle needs to be further allocated to other data processing cycles for processing.
[0063] In an optional embodiment, the preset group number threshold is based on the sending time interval between the multiple slave stations sending each group of slave station data to the master station, the single group processing time required for the master station to process a group of slave station data, the data processing cycle and the data acquisition cycle.
[0064] Since the data processing cycle is the first time interval and the data acquisition cycle is the second time interval, both are determined. The sending time intervals between multiple slave stations sending each group of slave station data to the master station and the processing time consumed by the master station to process the slave station data are both included in the first time interval. When the processing time consumed by the master station to process a group of slave station data is determined, the preset group number threshold will affect the processing time consumed by the master station to process the slave station data.
[0065] By setting a preset group number threshold, time-limited processing of slave station data can be achieved. However, the premise of time-limited processing is to ensure that the last group of slave station data in the current data acquisition cycle can be processed before the next data acquisition interrupt is triggered.
[0066] The above technical solution provides a feasible solution for determining the preset group number threshold, provides data support for realizing time-sharing and limited processing of slave station data, and at the same time, provides data support for ensuring the real-time performance of the data processing process.
[0067] S240. Based on the data acquisition time and the preset group number threshold, a corresponding data processing cycle is allocated to the slave station data falling within the overload processing cycle, and the slave station data is processed in the corresponding data processing cycle to obtain a data processing result.
[0068] The preset group number threshold limits the maximum number of groups that the master station can process in a single data processing cycle. The slave station data in the overload processing cycle has exceeded the maximum number of groups that the master station can process in a single data processing cycle. In the overload processing cycle, the master station cannot process all the slave station data that falls into it. Therefore, it is necessary to allocate corresponding data processing cycles to the slave station data that falls into the overload processing cycle based on the data acquisition time of the slave station data and the preset group number threshold, and process the slave station data in the corresponding data processing cycle to obtain the data processing result.
[0069] Optionally, a portion of the slave station data falling within the overload processing cycle is still processed in the overload processing cycle, and the other portion is processed in another data processing cycle.
[0070] The technical solution of the present application determines how many groups of slave station data fall into each data processing cycle based on the data acquisition time of the slave station data to obtain the number of data groups corresponding to each data processing cycle, and determines the data processing cycle with a data group number greater than a preset group number threshold as an overload processing cycle. Based on the data acquisition time and the preset group number threshold, the corresponding data processing cycle is allocated to the slave station data that falls into the overload processing cycle, and the slave station data is processed in the corresponding data processing cycle to obtain the data processing result. The load between different data processing cycles is balanced, the load of the master station in a single data processing cycle is reduced, and it is conducive to improving the integrity of data processing.
[0071] In an optional embodiment, based on the data acquisition time and the preset group number threshold, a corresponding data processing cycle is allocated to the slave station data falling within the overload processing cycle, including: sorting the slave station data falling within the overload processing cycle in chronological order based on the data acquisition time; determining the slave station data ranked before and after the preset group number threshold as light-loaded slave station data and overloaded slave station data, respectively; allocating the light-loaded slave station data to the overload processing cycle, and allocating the overloaded slave station data to the next data processing cycle after the overload processing cycle.
[0072] Among them, the slave station data falling into the overload processing cycle is sorted in chronological order based on the data acquisition time. The light-loaded slave station data refers to the slave station data ranked before the preset group number threshold. As of the receipt of the light-loaded slave station data, the load of the master station in the single data processing cycle is still less than the expected load. The overloaded slave station data refers to the slave station data ranked after the preset group number threshold. The overloaded slave station data is received after the light-loaded slave station data. At this time, the load of the master station in the single data processing cycle is greater than the expected load.
[0073] The light-load slave station data is assigned to the overload processing cycle and processed by the master station in the overload processing cycle; the overload slave station data is assigned to the next data processing cycle after the overload processing cycle and processed by the master station in the next data processing cycle after the overload processing cycle.
[0074] The above technical solution provides a feasible slave station data distribution solution, which is suitable for the situation where the load of the master station in a single data processing cycle is greater than the expected load, and provides data support for reducing the load of the master station in a single data processing cycle.
[0075] In an optional embodiment, the data processing duration determined based on the single-group processing duration consumed by the master station to process a group of slave station data and the preset group number threshold is less than or equal to the first time interval.
[0076] Optionally, based on the single group processing time required for the master station to process a group of slave station data and the preset group number threshold, the time actually consumed by the master station for data processing in a data processing cycle can be determined. Specifically, the time actually consumed by the master station for data processing in a data processing cycle is equal to the product of the single group processing time and the preset group number threshold.
[0077] The time actually consumed by the master station for data processing in a data processing cycle must be less than or equal to the first time interval to avoid data loss.
[0078] Embodiment 3
[0079] Figure 3 This is a structural diagram of the data processing device provided in Example 3 of the present application. This embodiment can be applied to a communication system with one master and multiple slaves, in which multiple slave stations send data to the master station, the sending time interval between the data of each slave station is short, and the single group processing time required for the master station to process a group of slave station data is long. In this case, data is processed. The device can be implemented by software and / or hardware and can be integrated in electronic devices such as smart terminals.
[0080] like Figure 3 As shown, the device may include:
[0081] The data acquisition time determination module 310 is used to determine the slave station data to be processed and the data acquisition time of the slave station data in response to the data processing interrupt being triggered; wherein the slave station data is obtained by the master station from multiple slave stations in response to the data acquisition interrupt being triggered;
[0082] A data processing result determination module 320, configured to allocate a corresponding data processing period to the slave station data based on the data acquisition time, and process the slave station data in the corresponding data processing period to obtain a data processing result;
[0083] Among them, the data processing interruption and the data acquisition interruption are both periodic interruptions, the data processing period corresponding to the data processing interruption is a first time interval; the data acquisition period corresponding to the data acquisition interruption is a second time interval; wherein the first time interval is smaller than the second time interval.
[0084] The technical solution of the present application sets periodic data acquisition interruption and data processing interruption in the master station, and sets the frequency of data processing interruption higher than that of data acquisition interruption. Then, the corresponding data processing cycle is allocated to the slave station data based on the data acquisition time of the slave station data, and the slave station data is processed in the corresponding data processing cycle to obtain the data processing result, thereby realizing time-sharing and limited processing of the slave station data, reducing the load of the master station in the data processing cycle, avoiding data loss, and being conducive to improving the integrity and real-time performance of data processing.
[0085] Optionally, there is a one-to-many correspondence between the master station and the multiple slave stations; the multiple slave stations asynchronously send the slave station data to the master station within the data acquisition cycle; the sending time interval between the multiple slave stations sending each group of slave station data to the master station is less than the single group processing time required for the master station to process a group of slave station data.
[0086] Optionally, the data processing result determination module 320 includes: a data group number determination submodule, which is used to determine how many groups of slave station data fall into each data processing cycle based on the data acquisition time to obtain the number of data groups corresponding to each data processing cycle; an overload processing cycle determination submodule, which is used to determine a data processing cycle in which the number of data groups is greater than a preset group number threshold as an overload processing cycle; and a data allocation submodule, which is used to allocate corresponding data processing cycles to the slave station data falling into the overload processing cycle based on the data acquisition time and the preset group number threshold.
[0087] Optionally, the data allocation submodule includes: a data sorting unit, used to sort the slave station data falling within the overload processing cycle in chronological order based on the data acquisition time; a data classification unit, used to determine the slave station data ranked before and after the preset group number threshold as light-loaded slave station data and overloaded slave station data, respectively; a data allocation unit, used to allocate the light-loaded slave station data to the overload processing cycle, and allocate the overloaded slave station data to the next data processing cycle after the overload processing cycle.
[0088] Optionally, the preset group number threshold is based on the sending time interval between the multiple slave stations sending each group of slave station data to the master station, the single group processing time required for the master station to process a group of slave station data, the data processing cycle and the data acquisition cycle.
[0089] Optionally, the data processing duration determined based on the single-group processing duration required for the master station to process a group of slave station data and the preset group number threshold is less than or equal to the first time interval.
[0090] Optionally, the device further comprises: a synchronization batch processing module, configured to divide the slave station data that can be acquired in one data acquisition cycle into the same data synchronization batch;
[0091] A processing duration determination module is used to determine the batch processing duration required to complete processing a data synchronization batch based on the data acquisition time and the single group processing duration required for the master station to process a group of slave station data; a relative delay adjustment module is used to adjust the relative delay between the data acquisition interruption and the data processing interruption based on the batch processing duration, so as to complete the processing of all slave station data in the data synchronization batch within the data acquisition cycle.
[0092] The data processing device provided in the embodiment of the invention can execute the data processing method provided in any embodiment of the present application, and has the corresponding performance modules and beneficial effects for executing the data processing method.
[0093] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of user data involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0094] Embodiment 4
[0095] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0096] Figure 4 The schematic diagram of the structure of the electronic device 410 of the embodiment that can be used to implement is shown. The electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In the RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, the ROM 412, and the RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0097] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0098] The processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 411 performs the various methods and processes described above, such as a data processing method.
[0099] In some embodiments, the data processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor, the functions / operations specified in the flow charts and / or block diagrams are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data processing server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0107] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A data processing method, characterized in that: Executed by the master station, the method includes: In response to a data processing interrupt being triggered, determining slave station data to be processed and a data acquisition time of the slave station data; wherein the slave station data is acquired by the master station from multiple slave stations in response to the data acquisition interrupt being triggered; Allocating a corresponding data processing period to the slave station data based on the data acquisition time, and processing the slave station data in the corresponding data processing period to obtain a data processing result; Among them, the data processing interruption and the data acquisition interruption are both periodic interruptions, the data processing period corresponding to the data processing interruption is a first time interval; the data acquisition period corresponding to the data acquisition interruption is a second time interval; wherein, the first time interval is smaller than the second time interval.
2. The method according to claim 1, characterized in that There is a one-to-many correspondence between the master station and the multiple slave stations; the multiple slave stations asynchronously send the slave station data to the master station during the data acquisition cycle; The time interval between each group of slave station data sent by the multiple slave stations to the master station is less than a single group processing time required by the master station to process a group of slave station data.
3. The method according to claim 1, characterized in that The allocating a corresponding data processing cycle to the slave station data based on the data acquisition time includes: Based on the data acquisition time, determining how many groups of slave station data fall within each data processing cycle to obtain the number of data groups corresponding to each data processing cycle; Determine a data processing period in which the number of data groups exceeds a preset group number threshold as an overload processing period; Based on the data acquisition time and the preset group number threshold, a corresponding data processing cycle is allocated to the slave station data falling within the overload processing cycle.
4. The method according to claim 3, characterized in that The allocating a corresponding data processing cycle to the slave station data falling within the overload processing cycle based on the data acquisition time and the preset group number threshold includes: sorting the slave station data that falls within the overload processing period in chronological order based on the data acquisition time; Determine the slave station data ranked before and after the preset group number threshold as lightly loaded slave station data and overloaded slave station data, respectively; The lightly loaded slave station data is allocated to the overload processing cycle, and the overloaded slave station data is allocated to a next data processing cycle after the overload processing cycle.
5. The method according to claim 3, characterized in that The preset group number threshold is based on the sending time interval between the multiple slave stations sending each group of slave station data to the master station, the single group processing time required for the master station to process a group of slave station data, the data processing cycle and the data acquisition cycle.
6. The method according to claim 3, characterized in that The data processing duration determined based on the single-group processing duration consumed by the master station to process a group of slave station data and the preset group number threshold is less than or equal to the first time interval.
7. The method according to claim 1, characterized in that The method further comprises: The slave station data that can be acquired in one data acquisition cycle are divided into the same data synchronization batch; Determine the batch processing time required to complete processing a data synchronization batch based on the data acquisition time and the single group processing time required for the master station to process a group of slave station data; Based on the batch processing duration, the relative delay between the data acquisition interruption and the data processing interruption is adjusted to complete the data processing of all slave stations in the data synchronization batch within the data acquisition cycle.
8. A data processing device, characterized in that: Configured at the main station, the device includes: a data acquisition time determination module, configured to determine, in response to a data processing interrupt being triggered, slave station data to be processed and a data acquisition time for the slave station data; wherein the slave station data is acquired from a plurality of slave stations by the master station in response to the data acquisition interrupt being triggered; a data processing result determination module, configured to allocate a corresponding data processing period to the slave station data based on the data acquisition time, and process the slave station data in the corresponding data processing period to obtain a data processing result; Among them, the data processing interruption and the data acquisition interruption are both periodic interruptions, the data processing period corresponding to the data processing interruption is a first time interval; the data acquisition period corresponding to the data acquisition interruption is a second time interval; wherein, the first time interval is smaller than the second time interval.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein: When the processor executes the computer program, the data processing method according to any one of claims 1 to 7 is implemented.
