Data push method, electronic device, and computer-readable storage medium

By building event alarm tables, task timetables and task tables, the detection time of push tasks is used to update the detection time, the problem of inaccurate push of boundless data is solved, bounded data is pushed, and the accuracy and timeliness of data push are improved.

CN116303564BActive Publication Date: 2025-08-22ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310105476.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-02
Publication Date
2025-08-22
Estimated Expiration
2043-02-02

AI Technical Summary

Technical Problem

In the prior art, the push of boundless data is inaccurate and it is difficult to meet the users' precise data acquisition needs.

Method used

By constructing event alarm tables, task schedules and task tables, the detection time is used to extract the message field of the alarm event from the event alarm table as the fields to be pushed, and the push tasks in the task table are updated. The detection time of the task schedule is updated using the time field with the latest timing to realize bounded data push.

Benefits of technology

It improves the accuracy and timeliness of data push, reduces the probability of duplicate data, and meets users' needs for accurate data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303564B_ABST
    Figure CN116303564B_ABST
Patent Text Reader

Abstract

The present application discloses a data push method, electronic device, and computer-readable storage medium. The method includes: obtaining an event alarm table, a task schedule, and a task table; wherein the event alarm table includes multiple types of alarm events and their corresponding multiple message fields, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to a type, and the task table includes push tasks; based on the detection time, extracting at least part of the message field corresponding to each type of alarm event from the event alarm table as the to-be-pushed field corresponding to each push task, and using the to-be-pushed field to update the push tasks in the task table; based on the latest time field in the to-be-pushed field corresponding to each push task, updating the detection time corresponding to each push task in the task schedule; and using the to-be-pushed field corresponding to each push task in the task table to push data. The above scheme can improve the accuracy of data push.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data push method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the continuous development of new technologies such as the Internet of Things and the internet, massive amounts of data are pouring out from all aspects of life, generating a variety of alarm events. Users are demanding increasingly precise data. However, existing technologies typically push real-time, unbounded data directly after obtaining it. However, unbounded data is disordered, resulting in inaccurate data push and a failure to meet user needs. Therefore, improving the accuracy of data push has become a pressing issue. Summary of the Invention

[0003] The main technical problem solved by this application is to provide a data push method, electronic device and computer-readable storage medium, which can improve the accuracy of data push.

[0004] In order to solve the above technical problems, the first aspect of the present application provides a data push method, which includes: obtaining an event alarm table, a task schedule and a task table; wherein the event alarm table includes multiple types of alarm events and their corresponding multiple message fields, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to one of the types, and the task table includes the push tasks; based on the detection time, at least part of the message fields corresponding to each type of the alarm event are extracted from the event alarm table as the fields to be pushed corresponding to each push task, and the push tasks in the task table are updated using the fields to be pushed; based on the latest time field in the fields to be pushed corresponding to each push task, the detection time corresponding to each push task in the task schedule is updated; and data is pushed using the fields to be pushed corresponding to each push task in the task table.

[0005] To solve the above technical problems, the second aspect of the present application provides an electronic device, which includes: a memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect above.

[0006] In order to solve the above technical problems, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.

[0007] The above scheme obtains an event alarm table, a task schedule, and a task table, wherein the event alarm table includes multiple types of alarm events and multiple message fields corresponding to the alarm events, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to a type of alarm event, and the task table includes push tasks. Based on the detection time, at least part of the message fields corresponding to each type of alarm event are extracted from the event alarm table, and the extracted message fields are used as the fields to be pushed. The push tasks in the task table are updated using the fields to be pushed, and the detection time corresponding to each push task in the task schedule is updated using the latest time field in the fields to be pushed corresponding to each push task. Therefore, the detection time recorded in the task schedule provides a time reference basis for extracting the message fields corresponding to the alarm events from the event alarm table, so that the push tasks in the task table are divided according to the time granularity related to the detection time, obtaining a bounded task table, and then using the fields to be pushed corresponding to each push task in the task table to push data, thereby improving the accuracy of data push. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:

[0009] Figure 1 This is a flow chart of an implementation method of the data push method of this application;

[0010] Figure 2 This is a flow chart of another embodiment of the data push method of the present application;

[0011] Figure 3 This is a schematic structural diagram of an embodiment of the electronic device of the present application;

[0012] Figure 4 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0013] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0014] The terms "system" and "network" are often used interchangeably in this document. The term "and / or" is simply a description of an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " generally indicates that the related objects are in an "or" relationship. Furthermore, "multiple" in this document means two or more than two.

[0015] The data push method provided in this application is used to process and push data, and its corresponding execution subject is a processor that can call data.

[0016] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a data push method of the present application, which includes:

[0017] S101: Obtain an event alarm table, a task schedule, and a task table, wherein the event alarm table includes multiple types of alarm events and their corresponding multiple message fields, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to a type, and the task table includes push tasks.

[0018] Specifically, an event alarm table, a task schedule and a task table are created in advance, wherein the event alarm table is used to store multiple types of alarm events and their corresponding multiple message fields, and the task schedule is used to store the detection times corresponding to multiple push tasks, wherein the detection time is related to the latest time field corresponding to each push task, each type of alarm event corresponds to a push task, and the task table is used to store the push tasks.

[0019] In one application method, the event alarm table is associated with a preset data source and is used to obtain all message fields corresponding to different types of alarm events from the preset data source. The task schedule includes a task name column and a time field column, wherein the task name column is used to store the task name that matches the type of alarm event, and the time field column is used to store the detection time. The task table includes push tasks. After the event alarm table, task schedule and task table are created, the pre-created event alarm table, task schedule and task table are obtained.

[0020] In another application method, the event alarm table includes a storage space for storing multiple message fields of different types of alarm events, wherein the source data obtained from the preset data source is converted into the data format and stored in the corresponding storage space according to the type of alarm event. The task schedule includes an event type column and a time field column, wherein the event type column is used to store the type of alarm event, and the time field column is used to store the detection time. The task table includes push tasks. After the event alarm table, task schedule and task table are created, the pre-created event alarm table, task schedule and task table are obtained.

[0021] S102: extracting at least part of the message fields corresponding to each type of alarm event from the event alarm table based on the detection time as the to-be-pushed fields corresponding to each push task, and updating the push tasks in the task table using the to-be-pushed fields.

[0022] Specifically, using the detection time in the task schedule, at least part of the message fields corresponding to each type of alarm event after the corresponding detection time are extracted from the event alarm table, so that the extracted message fields are used as the fields to be pushed, and the push tasks in the task table are updated using the fields to be pushed.

[0023] In one application method, in response to a preset time interval, the task schedule is associated with the event alarm table, and the detection time corresponding to different types of alarm events is determined in the task schedule, wherein the task schedule includes a task name related to the event type, so that based on the detection time in the task schedule, at least part of the message field corresponding to the corresponding type of alarm event after the detection time is extracted from the event alarm table as the to-be-pushed field corresponding to the push task, and the to-be-pushed field corresponding to the push task is updated to the task table, so that the to-be-pushed field is determined after each preset time interval to reduce the probability of duplication of the to-be-pushed field and make the to-be-pushed field orderly.

[0024] In another application method, in response to the fact that the accumulated number of at least one type of alarm events in the event alarm table exceeds a quantity threshold after the corresponding detection time, the task schedule is associated with the event alarm table, and the detection time corresponding to different types of alarm events is determined in the task schedule, wherein the task schedule includes an event type column to store the type of alarm event, so that based on the detection time in the task schedule, at least part of the message field corresponding to the corresponding type of alarm event after the detection time is extracted from the event alarm table as the field to be pushed corresponding to the push task, the task table is cleared, and according to the push task corresponding to the field to be pushed, the field to be pushed corresponding to each push task is updated to the task table in sequence, so that after the accumulated number of at least one type of alarm event in the event alarm table exceeds the quantity threshold after the corresponding detection time, the field to be pushed is determined to improve the timeliness of data push.

[0025] S103: Based on the latest time field in the to-be-pushed field corresponding to each push task, update the detection time corresponding to each push task in the task schedule.

[0026] Specifically, the time field corresponding to each push task is determined from the pending push field corresponding to each push task. The latest time field in the pending push field corresponding to each push task is used to update the detection time corresponding to each push task in the task schedule. The detection time recorded in the task schedule provides a time reference for extracting the message field corresponding to the alarm event from the event alarm table. This allows the push tasks in the task table to be segmented according to the time granularity related to the detection time, resulting in a bounded task table.

[0027] In one application method, the corresponding fields to be pushed in the push task are updated in chronological order, following the principle of first extract, first update, and the fields to be pushed with the latest chronological order are extracted from the push task, thereby determining the latest time field corresponding to each push task, and using the latest time field to update the detection time corresponding to the push task in the task schedule.

[0028] In another application method, the time fields in the to-be-pushed field corresponding to each push task are arranged in chronological order according to the numerical values ​​corresponding to the time fields, so as to determine the latest time field corresponding to each push task, and the latest time field is used to update the detection time corresponding to the push task in the task schedule.

[0029] S104: Push data using the to-be-pushed field corresponding to each push task in the task table.

[0030] Specifically, data is pushed using the fields to be pushed corresponding to each push task in the task table, wherein the fields to be pushed corresponding to the push task in the task table are divided according to the time granularity related to the detection time, and the fields to be pushed corresponding to the push task in the task table are bounded fields, thereby improving the accuracy of data push.

[0031] Optionally, the to-be-pushed fields are format-converted according to the data format required by the data receiving end, so that the converted to-be-pushed fields corresponding to each push task in the task table are pushed to the data receiving end.

[0032] In one application, the to-be-pushed field corresponding to each push task in the task table is converted into a preset format and pushed to the Kafka message queue so that the data receiving end obtains the pushed data, wherein the preset format is related to the data receiving end.

[0033] In another application mode, based on the field types of multiple to-be-pushed fields corresponding to each push task in the task table, the to-be-pushed fields are format-converted to obtain result fields, which are then pushed to the Kafka message queue so that the data receiving end obtains the pushed data.

[0034] The above scheme obtains an event alarm table, a task schedule, and a task table, wherein the event alarm table includes multiple types of alarm events and multiple message fields corresponding to the alarm events, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to a type of alarm event, and the task table includes push tasks. Based on the detection time, at least part of the message fields corresponding to each type of alarm event are extracted from the event alarm table, and the extracted message fields are used as the fields to be pushed. The push tasks in the task table are updated using the fields to be pushed, and the detection time corresponding to each push task in the task schedule is updated using the latest time field in the fields to be pushed corresponding to each push task. Therefore, the detection time recorded in the task schedule provides a time reference basis for extracting the message fields corresponding to the alarm events from the event alarm table, so that the push tasks in the task table are divided according to the time granularity related to the detection time, obtaining a bounded task table, and then using the fields to be pushed corresponding to each push task in the task table to push data, thereby improving the accuracy of data push.

[0035] See also Figure 2 , Figure 2 This is a flow chart of another embodiment of the data push method of the present application, which includes:

[0036] S201: Obtain an event alarm table, a task schedule, and a task table. The event alarm table includes multiple types of alarm events and their corresponding message fields, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to a type, and the task table includes push tasks.

[0037] Specifically, the event alarm table, task schedule and task table are all created in advance, wherein the event alarm table includes multiple types of alarm events and their corresponding multiple message fields, the task schedule includes the detection times corresponding to multiple push tasks, each push task corresponds to a type, and the task table includes push tasks.

[0038] Furthermore, the event alarm table is associated with a preset data source, and the message fields obtained after the message queue in the preset data source is format converted are stored in the event alarm table, wherein the message queue in the preset data source is updated in real time, and the message fields are stored in the event alarm table by partition, and the partition is related to time.

[0039] Specifically, the message queue in the preset data source is updated in real time, that is, the message queue in the preset data source is continuous and boundless. The event alarm table is associated with the preset data source, but the message queue in the preset data source needs to be converted into a format to obtain the message field, so that the message field is stored in the partition. Among them, the partitions in the event alarm table are based on time division, so that the message fields can be archived through partitions, and the message fields can be located and extracted more efficiently from the event alarm table according to the partitions.

[0040] In one application scenario, the process of obtaining the message field in the event alarm table includes: obtaining a message queue from a preset data domain, converting the messages in the message queue into message fields in a preset format, and saving the message fields to the partition corresponding to the current time; wherein, the preset data source includes a RabbitMQ server, and the preset format is a Hive data table format.

[0041] Specifically, the message queue obtained from the RabbitMQ server includes multiple types of alarm events, and the message queue obtained from the RabbitMQ server is unbounded data updated in real time. The message queue including multiple types of alarm events is pulled from the RabbitMQ end, and the pulled message queue is converted into the Hive data table format to obtain the Hive table field, and the Hive table field is stored in the partition corresponding to the current time. Then, when extracting the message field, you only need to know the time field in the message field to determine the partition corresponding to the message field, so you only need to scan the corresponding partition without scanning the entire event alarm table, so as to improve the efficiency of data extraction.

[0042] In a specific application scenario, the types of alarm events include passenger flow, crowd gathering, fire occupying the road, illegal parking of motor vehicles, illegal parking of urban non-motor vehicles, non-motor vehicles entering elevators, disorderly stacking of materials and outdoor advertising. In the event alarm table, time partitions are established with each natural day as the interval. The message queue including multiple types of alarm events is pulled from the RabbitMQ end, and the pulled message queue is converted into the Hive data table format to obtain the Hive table field. The Hive table field is stored in the partition corresponding to the current time. By dynamically judging the time field in the access message field, the data of the day will be placed in the partition corresponding to the day, thereby realizing the conversion and archiving of the disordered message queue and improving the efficiency of subsequent data processing.

[0043] Furthermore, the task schedule includes a task name column, a task category column, and a time field column corresponding to each type of alarm event. The task name of the push task corresponding to the alarm event is stored in the task name column, the task identification code corresponding to the alarm event is stored in the task category column, and the detection time is stored in the time field column. The task table includes a storage area corresponding to each task category.

[0044] Specifically, each type of alarm event includes a task identification code, and the task schedule includes at least a task name column, a task category column, and a time field column corresponding to each type of alarm event, so that the task name of the push task corresponding to the alarm event is stored in the task name column, the task identification code corresponding to the alarm event is stored in the task category column, and the detection time is stored in the time field column.

[0045] Furthermore, the task table includes a storage area that matches each task category, so that after the fields to be pushed are obtained, the fields to be pushed are stored in the corresponding storage area according to the task category.

[0046] Optionally, the time field column can be further divided into an initial time column and a conversion time column, wherein the time field in the initial format corresponding to the detection time is stored in the initial time column, and the time field obtained after the initial format time field is converted is stored in the conversion time column to improve the readability of the detection time.

[0047] It should be noted that after constructing the task schedule, the initial schedule data in the task schedule needs to be manually added so that the task schedule and the event alarm table can be associated according to the detection time. When adding the initial schedule data, add the task name corresponding to the alarm event in the task name column, and add the task identification code corresponding to the alarm event in the task category column. The task identification code includes a digital code, which can be a binary, decimal or hexadecimal digital combination. Add a millisecond timestamp in the initial time column, convert the millisecond timestamp into a conversion time displayed in year, month and day, and add it to the conversion time column.

[0048] S202: In response to a preset time interval, the to-be-pushed field in the task table is cleared, the detection time corresponding to each push task is extracted from the task schedule according to the task category, and the historical update time corresponding to the alarm event is determined.

[0049] Specifically, after a preset time interval has passed, the pending push field in the task table is cleared, and the detection time corresponding to each push task is determined from the task schedule based on the task category in the task category column, thereby obtaining the historical update time corresponding to the alarm event. The historical update time is the latest time field matched by the alarm event corresponding to the push task within the previous preset time interval.

[0050] Furthermore, by clearing the to-be-pushed fields corresponding to the previous preset time interval in the task table and retaining the task categories, the probability of obtaining duplicate data is reduced, and only the to-be-pushed fields corresponding to the tasks pushed within the current preset time interval are retained in the task table.

[0051] S203: extracting at least part of the message fields of each type of alarm event after the historical update time from the event alarm table as the to-be-pushed fields of the push task corresponding to the alarm event.

[0052] Specifically, the event alarm table includes multiple message fields of each type of alarm event obtained after conversion from a preset data source. After obtaining the historical update time corresponding to each type of alarm event, at least part of the message fields of all message fields after the historical update time are extracted from the event alarm table, and the extracted message fields are used as the fields to be pushed for the push task corresponding to the alarm event, thereby reducing the number of data fields and alleviating the load pressure during data push.

[0053] In one application scenario, some of the message fields in all message fields are preset message fields, wherein the preset message fields include an event type field, a time field, a location field, a data path field, a device field, and a channel field, wherein the data path field records the storage path of the picture or video corresponding to the alarm event, the device field records the device number corresponding to the device that collected the picture or video of the alarm event, and the channel field records the channel number corresponding to the channel that uploaded the picture or video of the alarm event. After obtaining the historical update time corresponding to the alarm event, at least the preset message field and the specified message field specified by the user are extracted from all message fields as the fields to be pushed for the push task corresponding to the alarm event to meet the basic requirements of data push and the personalized needs of users.

[0054] S204: Save the fields to be pushed to the corresponding storage area in the task table according to the task category.

[0055] Specifically, when the fields to be pushed are extracted from the event alarm table, the task categories corresponding to the fields to be pushed can be determined based on the type of the alarm event, and the fields to be pushed are saved in storage areas matching the task categories according to the task categories.

[0056] S205: Based on the latest time field in the to-be-pushed field corresponding to each push task, update the detection time corresponding to each push task in the task schedule.

[0057] Specifically, the time field corresponding to the push task is determined from the to-be-pushed field corresponding to each push task, and the detection time corresponding to each push task in the task schedule is updated using the latest time field in the to-be-pushed field corresponding to each push task.

[0058] In one application scenario, the latest time field in the to-be-pushed field corresponding to each push task in the task table is used as the target time field; the task name corresponding to the task category is determined based on the task category, the task category is updated to the task category column, the task name is updated to the task name column in the task schedule, and the target time field is updated to the time field column in the task schedule.

[0059] Specifically, the fields to be pushed in the task table are stored according to task categories, and the fields to be pushed include time fields. The latest time field in the fields to be pushed corresponding to the push tasks matched by each task category in the task table is used to obtain the target time field, and the target time field matches the task category.

[0060] Furthermore, the task category and the task name have a binding relationship. The task name corresponding to the task category is determined based on the task category, the task category is updated to the task category column, the task name is updated to the task name column in the task schedule, and the target time field is updated to the time field column in the task schedule to improve the matching degree between the task name, task category and detection time in the task schedule, and the detection time recorded in the task schedule provides a time reference basis for extracting the message field corresponding to the alarm event from the event alarm table, so that the push tasks in the task table are divided according to the time granularity related to the detection time to obtain a bounded task table.

[0061] S206: Push data using the to-be-pushed field corresponding to each push task in the task table.

[0062] Specifically, for each push task in the task table, based on the data type corresponding to the field to be pushed in the task table, data processing is performed on the field to be pushed to obtain the result field, and a result table is generated based on the result field corresponding to each push task, and the result fields in the result table are pushed to the data receiving end according to the push task.

[0063] Furthermore, the fields to be pushed include multiple data types. The fields to be pushed of different data types need to be processed in accordance with the processing method that matches the data type to obtain the result field. The result fields corresponding to each push task constitute a result table. After the result fields corresponding to each push task in the result table are pushed to the data receiving end respectively, the data receiving end can obtain a more intuitive result field.

[0064] In one application scenario, the data type includes at least one of a time type, a picture type, and a location type. Based on the data type corresponding to the field to be pushed in the task table, data processing is performed on the field to be pushed to obtain a result field, including: in response to obtaining the field to be pushed of the time type, converting the field to be pushed of the time type into a preset time format to obtain a time result field; wherein the preset time format is related to the time display order; in response to obtaining the field to be pushed of the picture type, converting the field to be pushed of the picture type into a picture path address in a preset address format to obtain a picture result field; wherein the picture path address includes a preset network prefix; in response to obtaining the field to be pushed of the location type, converting the field to be pushed of the location type into a picture path address in a preset location format to obtain a location result field; wherein the preset location format is related to longitude and latitude.

[0065] Specifically, when obtaining a time type field to be pushed, the time type field to be pushed is converted into a preset time format to obtain a time result field in the preset time format, wherein the preset time format is related to the time display order, for example, the time display order can be year, month, and day.

[0066] Furthermore, when the field to be pushed of the picture type is obtained, the initial picture storage path is extracted, and a preset network prefix is ​​added to the extracted picture path to ensure the availability of the picture path address, thereby converting the field to be pushed of the picture type into a picture path address in a preset address format to obtain the picture result field.

[0067] Furthermore, when obtaining the field to be pushed of the location type, the field to be pushed of the location type includes latitude and longitude information, and the field to be pushed of the location type is converted into an image path address in a preset location format to obtain a location result field, thereby converting fields of different data types into result fields of corresponding types, so that the result field can be provided to the data receiving end more intuitively, and can obtain a customized result field that matches the needs of the data receiving end according to the requirements of the data receiving end.

[0068] In a specific application scenario, the message queue in the RabbitMQ server itself does not include the channel name and longitude and latitude related to the capture location. Therefore, the event alarm table does not include the message fields related to the channel name and longitude and latitude. Therefore, it is necessary to use the channel field in the field to be pushed to associate the channel checkpoint table, and obtain the channel name and longitude and latitude from the checkpoint table. The checkpoint table records the channel name corresponding to the device and the longitude and latitude of the device, so as to obtain the field to be pushed of the location type by associating with the checkpoint table. The field to be pushed of the location type corresponding to the longitude and latitude is spelled into the json format {"lat":'gps_y',"lng":'gps_x'} according to the requirements of the third party, and the location result field is obtained. The capture time is recorded. The time-type fields to be pushed are converted into the preset time format as the time result fields. When processing the image-type fields to be pushed, the original path is in a long nested JSON array. The semi-structured data needs to be converted into structured data. The get_json_object function is used to cut out the core fields and the image path. After cutting, the image link cannot be opened directly. The concat function is also needed to splice the path with the preset network prefix to obtain the image result field, so that the data receiving end can directly view the image, which increases ease of use, thereby obtaining a result table consisting of multiple result fields. In this application scenario, the result table is shown in Table 1 below, so that the data receiving end can obtain more intuitive results.

[0069] Table 1: Results

[0070]

[0071] Furthermore, the result fields in the result table are pushed to the Kafka message queue to achieve the effect of peak shaving, reduce load pressure and improve the convenience of visualization.

[0072] In this embodiment, the event alarm table is associated with the task schedule, and the to-be-pushed fields are pulled from the event alarm table based on the detection time stored in the task schedule, wherein the detection time is the latest time field in the to-be-pushed fields corresponding to the pushed tasks that have been pushed. The detection time recorded in the task schedule provides a time reference basis for extracting the message field corresponding to the alarm event from the event alarm table, so that the push tasks in the task table are divided according to the time granularity related to the detection time to obtain a bounded task table, and the unbounded data in the preset data source is converted into bounded data for processing. After processing, bounded data can be pushed freely according to the preset time interval, avoiding repeated pulling and repeated processing of real-time data, and improving the accuracy of data push.

[0073] See also Figure 3 , Figure 3This is a structural diagram of an embodiment of an electronic device of the present application. The electronic device 30 includes a memory 301 and a processor 302 coupled to each other, wherein the memory 301 stores program data (not shown), and the processor 302 calls the program data to implement the attribute classification method based on video frames in any of the above embodiments. For an explanation of the relevant content, please refer to the detailed description of the above method embodiments, which will not be repeated here.

[0074] See also Figure 4 , Figure 4 This is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 40 stores program data 400. When the program data 400 is executed by the processor, the attribute classification method based on the video frame in any of the above embodiments is implemented. For an explanation of the relevant content, please refer to the detailed description of the above method embodiment, which will not be repeated here.

[0075] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

[0076] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0077] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0078] The above description is only an implementation method of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A data push method, characterized in that: The method comprises: Obtain an event alarm table, a task schedule, and a task table; wherein the event alarm table includes multiple types of alarm events and their corresponding multiple message fields, the task schedule includes detection times corresponding to multiple push tasks, each push task corresponds to one of the types, and the task table includes the push tasks; Extracting at least part of the message fields corresponding to each type of the alarm event from the event alarm table based on the detection time as the to-be-pushed fields corresponding to each push task, and updating the push task in the task table using the to-be-pushed fields; Based on the latest time field in the to-be-pushed field corresponding to each push task, updating the detection time corresponding to each push task in the task schedule; Data is pushed using the to-be-pushed field corresponding to each push task in the task table.

2. The data push method according to claim 1, characterized in that: The event alarm table is associated with a preset data source, and the message fields obtained after format conversion of the message queue in the preset data source are stored in the event alarm table; The message queue in the preset data source is updated in real time, the message fields are stored in the event alarm table by partition, and the partition is related to time.

3. The data push method according to claim 2, characterized in that: The process of obtaining the message field in the event alarm table includes: Obtain the message queue from the preset data source, convert the messages in the message queue into the message fields in a preset format, and save the message fields to the partition corresponding to the current time; wherein the preset data source includes a RabbitMQ server, and the preset format is a Hive data table format.

4. The data push method according to claim 1, wherein: The task schedule includes a task name column, a task category column and a time field column corresponding to each type of the alarm event; Among them, the task name of the push task corresponding to the alarm event is stored in the task name column, the task identification code corresponding to the alarm event is stored in the task category column, and the detection time is stored in the time field column; the task table includes a storage area matching each task category.

5. The data push method according to claim 4, characterized in that: The extracting, based on the detection time, at least part of the message fields corresponding to each type of the alarm event from the event alarm table as the to-be-pushed fields corresponding to each push task, and updating the push task in the task table using the to-be-pushed fields, includes: In response to a preset time interval, clearing the to-be-pushed field in the task table, extracting the detection time corresponding to each push task from the task schedule according to the task category, and determining the historical update time corresponding to the alarm event; Extracting at least part of the message fields of each type of the alarm event after the historical update time from the event alarm table as the to-be-pushed fields of the push task corresponding to the alarm event; The fields to be pushed are saved in the corresponding storage area in the task table according to the task category.

6. The data push method according to claim 4, characterized in that: The updating of the detection time corresponding to each push task in the task schedule based on the latest time field in the to-be-pushed field corresponding to each push task includes: The latest time field in the to-be-pushed field corresponding to each push task in the task table is used as the target time field; Determine the task name corresponding to the task category based on the task category, update the task category to the task category column, update the task name to the task name column in the task schedule, and update the target time field to the time field column in the task schedule.

7. The data push method according to claim 1, characterized in that: The data pushing using the to-be-pushed field corresponding to each push task in the task table includes: For each of the push tasks in the task table, based on the data type corresponding to the field to be pushed in the task table, data processing is performed on the field to be pushed to obtain a result field; A result table is generated based on the result fields corresponding to each push task, and the result fields in the result table are pushed to the data receiving end respectively according to the push tasks.

8. The data push method according to claim 7, characterized in that: The data type includes at least one of a time type, a picture type, and a location type. The data processing of the field to be pushed based on the data type corresponding to the field to be pushed in the task table to obtain a result field includes: In response to obtaining a time-type field to be pushed, converting the time-type field to be pushed into a preset time format to obtain a time result field; wherein the preset time format is related to a time display order; In response to obtaining the to-be-pushed field of the picture type, converting the to-be-pushed field of the picture type into a picture path address in a preset address format to obtain a picture result field; wherein the picture path address includes a preset network prefix; In response to obtaining the to-be-pushed field of the location type, the to-be-pushed field of the location type is converted into a picture path address of a preset location format to obtain a location result field; wherein the preset location format is related to longitude and latitude.

9. An electronic device, characterized in that: include: A memory and a processor coupled to each other, wherein the memory stores program data, and the processor calls the program data to execute the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having program data stored thereon, characterized in that: When the program data is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Dynamic message pushing method and system and automobile diagnosis server

    CN111225029A

  • Customized message pushing method and apparatus, and electronic device

    WO2017166783A1