Message processing method and device, equipment and storage medium
By adopting an intensive message processing model, compressing and filtering redundant data, and combining it with a lightweight transmission system, the reliability and efficiency issues of data transmission in cloud-edge collaborative systems are resolved, thereby improving the resource utilization of edge devices and the overall system performance.
Patent Information
- Application Number
- CN202511432613.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-01-13
AI Technical Summary
In cloud-edge collaborative systems, data transmission faces challenges such as fluctuating network bandwidth, unstable latency, and limited resources, making it difficult to achieve reliable message transmission and efficient processing.
It adopts an intensive message processing model, which processes the initial messages of edge devices through compression and distributed processing modes, including text and image compression, filtering of redundant fields, and combining batch and high-speed transmission strategies to transmit data using a lightweight message transmission system.
It improves the efficiency and reliability of message transmission, reduces network bandwidth requirements, and optimizes resource utilization of edge devices and overall system performance.
Smart Images

Figure CN121334152A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to the technical field of cloud computing, message processing, cloud-edge collaboration and the like. BACKGROUND
[0002] With the rapid development of the Internet of Things, various application scenarios have increasingly stringent requirements for data processing and transmission. As an architecture mode that combines the advantages of cloud computing and edge computing, cloud-edge collaboration is gradually becoming a key technology to support complex businesses. SUMMARY
[0003] The present disclosure provides a message processing method and device, equipment and a storage medium.
[0004] According to an aspect of the present disclosure, a message processing method is provided, applied to an edge service, comprising: processing an initial message of an edge device based on a compression mode in an intensive message processing mode to obtain a target message; sending the target message to a synchronization service based on a collection and distribution mode in the intensive message processing mode, so that the synchronization service sends the target message to a cloud service; the synchronization service is constructed based on a lightweight message transmission system.
[0005] According to another aspect of the present disclosure, a message processing device is provided, applied to an edge service, comprising: a processing module, configured to process an initial message of an edge device based on a compression mode in an intensive message processing mode to obtain a target message; a first sending module, configured to send the target message to a synchronization service based on a collection and distribution mode in the intensive message processing mode, so that the synchronization service sends the target message to a cloud service; the synchronization service is constructed based on a lightweight message transmission system.
[0006] According to an aspect of the present disclosure, a message processing method is provided, applied to a synchronization service, comprising: receiving target information sent by an edge service, the target message being sent after the edge service compresses an initial message based on an intensive message processing mode; the synchronization service is constructed based on a lightweight message transmission system; sending the target message to a cloud service.
[0007] According to another aspect of the present disclosure, a message processing device is provided, applied to a synchronization service, comprising: a first receiving module, configured to receive target information sent by an edge service, the target message being sent after the edge service compresses an initial message based on an intensive message processing mode; the synchronization service is constructed based on a lightweight message transmission system; The second sending module is configured to send the target message to a cloud service.
[0008] According to an aspect of the present disclosure, a message processing method applied to a cloud service is provided, comprising: receiving a target message; parsing the target message based on an intensive message processing mode applied to the target message.
[0009] According to another aspect of the present disclosure, a message processing apparatus applied to a cloud service is provided, comprising: The second receiving module is configured to receive a target message. The parsing module is configured to parse the target message based on an intensive message processing mode applied to the target message.
[0010] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any of the embodiments of the present disclosure.
[0011] According to another aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to make the computer perform the method according to any of the embodiments of the present disclosure.
[0012] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method according to any of the embodiments of the present disclosure.
[0013] It should be understood that the contents described in this part are not intended to identify the key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0014] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them: Figure 1 is a schematic diagram of the framework structure of a cloud-edge collaborative system according to an embodiment of the present disclosure; Figure 2 is a flowchart of a message processing method applied to an edge service according to an embodiment of the present disclosure; Figure 3 is a flowchart of a message processing method applied to a synchronization service according to an embodiment of the present disclosure; Figure 4 is a schematic diagram of a framework structure of a synchronization service in a cloud-edge collaboration structure according to an embodiment of the present disclosure; Figure 5 is a schematic diagram of a message processing method applied to a cloud service according to an embodiment of the present disclosure; Figure 6 is a schematic diagram of a message processing method applied to a cloud service according to an embodiment of the present disclosure; Figure 7 is a schematic diagram of an overall flow of an exemplary message processing method according to an embodiment of the present disclosure; Figure 8 is a schematic diagram of a message processing apparatus applied to an edge service according to an embodiment of the present disclosure; Figure 9 is a schematic diagram of a message processing apparatus applied to a synchronization service according to an embodiment of the present disclosure; Figure 10 is a schematic diagram of a message processing apparatus applied to a cloud service according to an embodiment of the present disclosure; Figure 11 is a block diagram of an electronic device for implementing a message processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] Exemplary embodiments of the present disclosure are described herein with reference to the accompanying drawings, which are included to provide a thorough understanding of embodiments of the present disclosure by a person of ordinary skill in the art, and should not be construed as limiting the present disclosure to particular embodiments. Thus, it will be apparent to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, in the following description, descriptions of well-known functions and constructions are omitted for clarity and conciseness.
[0016] The terms "first", "second", and the like in the present disclosure are used to distinguish similar objects, and do not necessarily indicate a particular order or a chronological sequence. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, inclusion of a series of steps or units. The method, system, product, or device is not necessarily limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the processes, methods, products, or devices.
[0017] It should be noted that the operations shown in the flowcharts of the embodiments of the present disclosure can not be executed in a time sequence unless it is explicitly stated that the execution sequence of different operations is different or the execution sequence of different operations is different in technical implementation. Otherwise, the execution sequence of multiple operations can not be distinguished, and multiple operations can be executed simultaneously.
[0018] In a message system constructed based on a cloud-edge collaborative system, the data transmission process often faces the severe challenge of weak network environment. On the one hand, the cloud-edge network environment itself is complex and changeable, and problems such as network bandwidth fluctuation, unstable transmission delay, and even intermittent disconnection are prone to occur, which directly leads to the difficulty of reliable transmission of messages; on the other hand, edge devices are generally characterized by limited resources such as computing and storage, and in the weak network scenario with limited bandwidth, it is difficult to efficiently process the data to be transmitted, and the problem of low data transmission efficiency is further aggravated.
[0019] Therefore, in the embodiments of the present disclosure, a message processing method is provided, which can meet at least one of the real-time, reliability and lightweight requirements of data transmission in a message system constructed based on a cloud-edge collaborative system.
[0020] As shown in Figure 1 The architecture diagram of the cloud-edge collaborative system provided by the embodiments of the present disclosure mainly includes edge service, synchronization service and cloud service.
[0021] 1. The edge service is deployed in the localized service node close to the network edge of the edge device, and is responsible for preliminary processing and analysis of the data generated by the edge device, so as to avoid problems such as waste of bandwidth and delay of transmission caused by directly transmitting massive raw data to the cloud.
[0022] The edge device is a kind of physical device located at the network edge. For example, camera, sensor, etc. Different edge devices can collect at least one of multi-modal data such as text data, image data, audio data according to their own functional positioning, and transmit these data in the form of messages to the edge service.
[0023] In actual application, one edge service can interface and centrally manage multiple edge devices. For example, in a factory scenario, the edge devices deployed in a production line may include n safety inspection cameras and m environmental temperature and humidity sensors. These edge devices do not need to communicate with the cloud respectively, but transmit the collected safety inspection images and environmental data to the edge service dedicated to the production line; the edge service can centrally complete data preprocessing and only upload the processed key data to the cloud service.
[0024] 2、Cloud service is a series of services deployed in the cloud data center, relying on powerful computing resources and storage capabilities to complete more complex tasks. It can perform in-depth analysis and mining on the data uploaded by the edge service, provide global decision support and management functions, and provide a unified access interface and service for users. The cloud service in the embodiment of the disclosure can be deployed according to different needs. There is a corresponding relationship between the edge service and the cloud service. Or, when messaging, the edge device sends a message to the cloud service (i.e. the uplink message) that specifies the cloud service receiving the message, and the cloud service sends a message to the edge device (i.e. the downlink message) that specifies the edge service or edge device receiving the message.
[0025] 3、Synchronization service is an intermediate service between edge service and cloud service, usually deployed on network nodes between edge and cloud, responsible for realizing data communication between edge and cloud. It can ensure that the data generated by the edge is transmitted to the cloud in a timely and accurate manner, and the instructions and configuration information of the cloud are issued to the edge device. The synchronization service in the embodiment of the disclosure can be constructed based on a lightweight message transmission system, such as NATS (NATS Messaging System, a lightweight message transmission system).
[0026] 4、In the message system constructed based on the cloud-edge collaborative system, the message distribution is supported according to the message subscription mechanism. On this basis, the cloud service and the edge device can respectively subscribe to the Topic (topic) required by each other according to the respective needs. The synchronization system will record the subscribed Topic, so as to realize the accurate distribution of messages through the Topic. The synchronization service as the core distribution hub will first analyze the Topic identifier carried by each message to complete the distribution of the message.
[0027] In addition to the above-mentioned messages with Topic, the transmitted messages can also include messages that do not belong to any Topic. In the embodiment of the disclosure, it can be called a free message, including the message sent by the edge device to the cloud service, and also including the message sent by the cloud service to the edge device. For this kind of free message, the synchronization service can identify the transmission direction through the fixed target KV field (Key-Value, key-value pair) empty mechanism, and then complete the distribution of the uplink free message and the downlink free message. For example, by fixing a target KV field in each free message, when receiving the free message, it is identified by doing an empty identification. If the target KV field carries the edge ID, it is the free message sent by the cloud service to the edge device; if it does not carry the edge ID, it is the free message reported by the edge device to the cloud service.
[0028] In actual application scenarios, there is often a demand for large-scale data transmission and processing in a message system constructed based on a cloud-edge collaborative system. On the one hand, different enterprises and different edge devices in different scenarios can access the system through edge services, which leads to a variety of device types and data formats, and a demand for large-scale data transmission and processing. On the other hand, the number of edge nodes is huge, and each edge node will generate a large amount of data. For example, in an industrial Internet of Things scenario, thousands of sensors will upload data in real time. At the same time, the cloud will also issue control instructions and configuration information to the edge, so the number of message transmissions is very large.
[0029] To adapt to the above large-scale and high-concurrency transmission requirements, in the synchronization service, a multi-synchronization service distributed deployment architecture can be used, and by deploying multiple synchronization service instances in different regions and different network nodes, massive messages can be sharded and distributed according to regions, device clusters or business types.
[0030] For computer vision-related businesses, small visual models can be deployed in the edge service to preliminarily analyze the messages. These models are usually simplified and optimized, have low computational complexity and resource consumption, and can quickly run under the limited computing resources of the edge, so as to quickly perform computer vision tasks and obtain the messages that need to be uploaded to the cloud. Correspondingly, large visual models can be deployed in the cloud service for detailed analysis. Based on the powerful computing resources and storage capabilities of the cloud, the large visual models have higher accuracy and stronger feature extraction capabilities.
[0031] For ease of understanding, on the basis of the cloud-edge collaborative system as shown in Figure 1 , the message processing methods of the edge service, the synchronization service and the cloud service will be described respectively.
[0032] As shown in Figure 2 , it is a flowchart of the message processing method provided in the embodiment of the disclosure, which can be applied to the edge service and includes the following content: S201, processing the initial message of the edge device based on the compression mode in the intensive message processing mode to obtain a target message.
[0033] The initial message of the edge device in the embodiments of the present disclosure can be a message obtained by a lightweight neural network model deployed at the edge end for monitoring and analyzing data collected by the edge device. For example, the lightweight neural network model is a small model with less parameters (e.g., less than a first threshold), which is easy to deploy to the edge device to monitor and analyze data. The lightweight neural network model can be a visual model. The edge device is a visual sensor for collecting images. The lightweight model can perform visual analysis on the collected images to find abnormal conditions to generate an alarm. Therefore, the initial message can be an alarm message. In addition, in addition to the alarm message, the edge device can also collect some device status data to report to the cloud for data analysis, and therefore, the device status data collected by the edge device can also be used as the initial message. In implementation, the content of the initial information can be determined according to actual requirements, and the embodiments of the present disclosure do not limit the same.
[0034] In the embodiments of the present disclosure, as described in the foregoing, the cloud-edge collaborative system will carry a large amount of messages, in order to improve the efficiency of message transmission, the intensive message processing mode is proposed in the embodiments of the present disclosure. The meaning of “set” is centralized management, and the meaning of “intensive” is to simplify messages. Therefore, the intensive message processing mode is used for centralized management of messages and compression of messages. The centralized management of messages can uniformly schedule and process target messages of multiple edge devices, thereby improving the efficiency of processing target messages. Compression of messages can reduce the size of target messages, reduce the bandwidth demand of network transmission, thereby saving transmission cost and improving transmission speed.
[0035] In the embodiments of the present disclosure, the intensive message processing mode encapsulates multiple compression message modes, and in implementation, the compression mode can be flexibly determined according to the situation of the initial message.
[0036] In S202, the target message is sent to the synchronization service based on the intensive message processing mode, so that the synchronization service sends the target message to the cloud service; the synchronization service is constructed based on a lightweight message transmission system.
[0037] The intensive mode refers to the sending mode of the target message, and in implementation, how to send the target message can be determined according to actual requirements, for example, the sending mode can be flexibly selected according to the bandwidth state and routing condition of the cloud-edge collaborative system.
[0038] In the embodiments of the present disclosure, the messages are managed and compressed in the intensive message processing mode, the target messages of the multi-edge devices can be uniformly scheduled and processed, the inefficient problem of scattered processing of the target messages is avoided, the overall message processing efficiency of the edge side is improved, the size of the target messages is appropriately reduced, the bandwidth demand of network transmission is reduced, the transmission cost is saved and the transmission speed is improved. Based on the intensive message processing mode, the target messages are sent to the synchronization service in the intensive and scattered mode, so that the synchronization service sends the target messages to the cloud service, so that the target messages can be sent in a suitable manner according to the business requirements, and the efficiency of processing and transmitting the target messages is further improved. The synchronization service constructed based on the lightweight message transmission system serves as an intermediate service, which can utilize the characteristics of high performance, high reliability and low delay of the lightweight message transmission system, efficiently receive the target messages of the edge devices and forward them to the cloud service, and improve the cloud-edge collaboration capability.
[0039] For ease of understanding, the compression mode and the intensive and scattered mode in the intensive message processing mode are described below.
[0040] (1) Compression mode In the embodiments of the present disclosure, the compression mode can include a text compression mode and a picture compression mode. The text compression mode is used to compress the text information in the initial message, and the picture compression mode is used to compress the image in the initial message. The two compression modes focus on the message body transmitted in the lightweight cloud-edge collaboration system, and reduce the bandwidth pressure of the cloud-edge collaboration system. In implementation, a suitable compression mode can be flexibly selected according to the situation of the initial message.
[0041] In the embodiments of the present disclosure, the compression mode in the intensive message processing mode is used to process the initial message of the edge device, and in the case that the initial message includes text information, the text information is processed based on at least one of the following modes in the text compression mode, including a-1) and a-2) as follows: a-1), a text filtering mode, which is used to filter out redundant fields based on a text filtering rule to retain key fields; In implementation, in the case that the cloud-edge collaboration system transmits a large number of messages with a relatively high content repetition rate (such as greater than a preset repetition rate threshold), a mapping table can be established for such messages. The mapping table retains the association relationship between the message class identifier, the key field and the corresponding unnecessary field. The message class identifier is used to uniquely identify the same type of message, the key field is used to represent the differential content between different messages in the same type of message, and the unnecessary field is a redundant field that repeatedly appears in the same type of message.
[0042] For example, in the initial message, there can be some fields for padding, format description or other auxiliary purposes, which are not necessary fields for obtaining core information, but are unnecessary fields for repeated transmission. These unnecessary fields can be regarded as redundant fields and filtered out.
[0043] The target message can retain message class identifiers and key fields, and be sent to the cloud service via a synchronization system. The message class identifier can be represented using predefined metadata. This predefined metadata can be configured according to the actual business scenario, ensuring it can identify messages of the same type.
[0044] For example, in implementation, if the edge device is only responsible for simple tasks, the edge device ID (Identity Document) can be used as the message class identifier, and repetitive descriptive fields such as device description information, device location, and the organization to which the device belongs can be stored as redundant fields in a mapping table. Redundant fields can be filled in through the mapping table when the cloud service receives the target message.
[0045] Among them, messages of the same type with a repetition rate greater than a preset repetition rate threshold can be identified as target messages based on the following method, including the following steps A1-A2: Step A1: Perform cluster analysis on the multiple historical messages sent by the edge service based on the fields included in each historical message to obtain multiple candidate classes.
[0046] Cluster analysis can be performed using a classification-based neural network model or a traditional clustering method such as K-means (K-means Clustering Algorithm).
[0047] Step A2: For each candidate class, determine the repetition rate of the message content in that candidate class; if the repetition rate is greater than a preset repetition rate threshold, the candidate class is taken as the target class message.
[0048] The message content repetition rate can be represented as the ratio of the number of messages with repeated fields to the total number of messages in the candidate class. For example, if there are q messages in a candidate class, and all messages have m fields, and n of these m fields appear in p messages, then p / q is the repetition rate of the candidate class. If p / q is greater than a preset repetition rate threshold (e.g., 80%), then the candidate class is the target class message. During implementation, based on business needs, such as summarizing message class identifiers for the target class message based on expert experience, fields among the n repeated fields that are not included in the message class identifier can be maintained as redundant fields in a mapping table. Here, m, n, p, and q are all positive integers greater than or equal to 1.
[0049] In other embodiments, background knowledge of the target message can be input into a large language model. A simplified pattern can be summarized based on the large language model, retaining only the key fields within the simplified pattern. This simplified pattern can then be used as a filtering template. Filtering operations are performed on the target message to automatically remove redundant fields using the filtering template. For example, fields in the initial message text that are not retained in the simplified template are considered redundant fields.
[0050] It is understood that the operation of identifying target-type messages can be implemented by edge services, synchronous services, or cloud services, and this disclosure does not limit this.
[0051] In this embodiment of the disclosure, when the initial message includes text information, a mapping table is established and redundant fields are filtered out based on text filtering rules, retaining only the message class identifier and differentiated key fields to generate the target message. For situations where a large number of messages with high repetition rates need to be transmitted, the amount of text data that needs to be transmitted to the cloud can be significantly reduced, effectively reducing the network bandwidth consumption and data transmission energy consumption on the edge side. At the same time, it reduces the computing resource consumption of edge devices due to processing and transmitting repetitive and unnecessary fields, allowing edge services to focus more resources on local core task processing, improving their own data processing efficiency and response speed, and thus optimizing the operating performance and resource utilization efficiency of the edge side in the entire cloud-edge collaborative system.
[0052] a-2) Text compression method, used to compress text information.
[0053] In practice, if the initial message is processed using a text filtering method, then the text compression method is used to compress and filter the text information of redundant fields.
[0054] If the initial information is not processed using text filtering, then the text information in the initial information is compressed using this text compression method.
[0055] Text compression methods, as the name suggests, compress text information using methods that compress the text itself. Examples include zip (ZIP archive format, a compression algorithm) and deflate (DEFLATE Compressed Data Format Specification, a compression algorithm).
[0056] In this embodiment of the disclosure, by compressing text information, the network bandwidth usage when the edge server transmits data to the cloud service can be reduced, the data transmission time can be shortened, and the processing efficiency of the target data can be further improved.
[0057] Corresponding to the text compression mode is the image compression mode. Similarly, the initial message of the edge device is processed based on the compression mode in the intensive message processing mode. If the initial message includes at least one frame of image to be processed, the at least one frame of image to be processed in the initial message is processed based on at least one of the following methods in the image compression mode, including the following b-1) and b-2): b-1) Image filtering method, used to filter out redundant images in at least one frame of the image to be processed; In the initial message, there may be some images with duplicate or highly similar content, which can be considered redundant images.
[0058] For example, in a surveillance scenario where the scene changes, a video clip of a specified duration before and after the change can be extracted. This video is then encapsulated in an initial message and sent to the cloud service.
[0059] However, even though the video is short, the cloud-edge collaborative system needs to serve a large number of edge services and edge devices. In order to reduce the data transmission pressure of the cloud-edge collaborative system, an edge image filtering model (a trained neural network model) can be used to analyze the images to be processed in the video to remove redundant images and retain only the key frames.
[0060] For example, in zoos where animal safety can be monitored, animal behaviors that affect animal safety can be monitored and identified. Target animals can be designated as target objects, and only video frames containing the target object can be retained as keyframes. Furthermore, animal behaviors that affect animal safety can be designated as target behaviors, and the trajectories of these target behaviors can be analyzed, with image frames at key trajectory points used as keyframes. In implementation, the edge image filtering model can be trained according to actual needs; this disclosure does not limit its implementation.
[0061] Furthermore, redundant images can be filtered based on the repetition rate of their content. For example, images that only present the same static background and lack key information such as object movement or state changes can be identified as redundant. Redundant images can also be identified based on image quality, such as images where the target object is blurry or cannot provide effective features of the target object.
[0062] After filtering out redundant images, at least one frame of the image to be processed, including the start and / or end frames, as well as the time information of the two frames (such as duration, start timestamp, and end timestamp), can be retained in the target message so that the complete video content can be recovered from the filtered redundant images in the cloud service.
[0063] In this embodiment of the disclosure, by filtering out redundant images in the image to be processed and retaining only keyframes, start frames, end frames and timestamp information, the amount of image data transmission between the cloud and the edge can be reduced, thus reducing the network bandwidth requirements.
[0064] b-2) Image compression method, used to compress at least one frame of the image to be processed.
[0065] During implementation, if the initial message has been processed using an image filtering method, then the core image obtained after the filtering process will be compressed using the same image compression method. If the initial message is not processed using image filtering, then this image compression method is applied to all images to be processed contained in the initial message, such as a complete video frame sequence.
[0066] Image compression methods, as the name suggests, employ compression algorithms specifically designed for image data to reduce the size of image information. Common methods include LZ4 (Lempel–Ziv 4, a compression algorithm) and ZSTD (zee-standard, a compression algorithm).
[0067] In this embodiment of the disclosure, the image information is reduced in size by image compression, which can reduce the network bandwidth usage during transmission and alleviate the pressure on data transmission.
[0068] In this embodiment of the disclosure, when using the aforementioned image compression method for image compression, the compression ratio can be flexibly determined according to requirements, and can be implemented as follows: Steps B1-B2: Step B1: Perform a classification operation on at least one frame of the image to be processed to determine the compression ratio; The main purpose of classifying images for processing is to distinguish their priority and adapt them to different compression rates accordingly.
[0069] In implementation, a large-scale model and a rule engine can be introduced for classification. By collecting a large amount of training data, the large-scale model is trained, and post-processing is performed using a rule engine. With the continuous accumulation of data and ongoing model optimization, a classification model capable of iteratively prioritizing messages is obtained, making the initial message priority classification more accurate and intelligent.
[0070] For example, a pre-trained classification model can be used to categorize images according to their purpose, such as alarm images and equipment update / maintenance images. Alarm images are given high priority, while equipment update / maintenance images are given low priority. Images can also be categorized by content, such as human safety images and non-human images. Human safety images are given high priority, while non-human images are given low priority.
[0071] Different priority images correspond to different compression ratios. High-priority images need to retain more details and information, so the compression ratio can be relatively low to ensure image quality; low-priority images do not require high detail, so a higher compression ratio can be used to significantly reduce the amount of data. In implementation, the edge service can select the corresponding compression ratio range for image compression based on the image classification results and the correspondence between priority and compression ratio ranges.
[0072] Step B2: Based on the compression ratio, compress at least one frame of the image to be processed.
[0073] During implementation, a suitable compression method can be selected based on the compression ratio, and the image can be compressed using the corresponding compression method among the image compression methods mentioned above.
[0074] In this embodiment of the disclosure, by first classifying the images to distinguish their priorities, and then adapting different compression rates for targeted compression, it is possible to ensure the quality and information integrity of high-priority images while efficiently compressing low-priority images to significantly reduce the amount of data.
[0075] In addition to the aforementioned compression of initial messages, this embodiment also provides a method for filtering initial messages to reduce the number of messages transmitted by the synchronization system. In implementation, it can be first determined whether filtering of initial messages is necessary. If filtering is not required, the initial messages are processed based on a centralized message processing model (e.g., ...). Figure 2 (As shown). In cases where it is necessary to filter out the initial message, it is not necessary to process the initial message based on the centralized message processing pattern.
[0076] The filtering methods can include text-based filtering and image-based filtering. These two methods can be used individually or in combination, depending on the specific needs. The edge service will apply this filtering method to the initial message sent by each edge device to reduce the probability of the same edge device repeatedly sending the same message.
[0077] 1) When the initial message includes text information, filtering the initial message based on text filtering can be implemented through the following steps: Step C1: If the initial message includes text information, extract the message content from the text information. Step C2: Determine the hash value of the message content as the hash value to be matched; A hash value is a fixed-length numerical value calculated from the message content using a hash function in the edge service. Hash functions are unique and deterministic; that is, identical message content will generate the same hash value, and different message content will generate different hash values. The calculated hash value is used as the hash value to be matched in subsequent matching operations.
[0078] Step C3: Match the hash value to be matched with the known hash values within the current first time window; The current first time window is a pre-defined time period, such as every 10 minutes, 5 minutes, or 1 minute. The first time window at the current time is the current first time window. Within this current first time window, the edge service records the hash values of all alarm messages sent by the same edge device, and these hash values constitute a known hash value set.
[0079] During implementation, for each edge device, the edge service compares the hash value to be matched of the edge device with each hash value in the set of known hash values of the edge device.
[0080] Step C4: If the hash value to be matched matches any known hash value, filter out the initial message.
[0081] If the hash value to be matched is the same as any of the known hash values, it means that the current message content is a duplicate of a previously sent message. In order to avoid sending the same alarm message repeatedly in a short period of time, the initial message is filtered out and will not be sent again.
[0082] If the hash value to be matched does not match any known hash value, it indicates that the message content is a new alarm. In this case, the target message needs to be sent out while remaining in the current first-time window.
[0083] In this embodiment, each newly generated hash value has its own lifetime, which is calculated from the time the hash value was generated. Only hash values whose lifetime falls within the current first time window are considered known hash values within the current first time window and are used for comparison with the hash values to be matched. As time progresses, the current first time window changes continuously, and hash values whose lifetime exceeds the current first time window are removed, while newly generated hash values are added to the set of known hash values within the current first time window, thereby ensuring the dynamic updating of known hash values.
[0084] In this embodiment, message content that is repeatedly generated within a short period of time is identified and filtered based on hash values. This avoids multiple transmissions of the same initial message, reduces network bandwidth consumption, and improves the efficiency of target message processing and transmission. The known hash values are dynamically updated using the current first time window and hash value lifetime mechanism. This ensures effective identification of duplicate messages within a certain timeframe while avoiding excessive system resource consumption due to retaining too many old hash values.
[0085] 2) If the initial message includes image information, filtering the initial message based on image filtering can be implemented through the following steps: Step D1: If the initial message includes at least one frame of the image to be processed, extract the image features of at least one frame of the image to be processed to obtain the features to be matched. Among them, the features to be matched describe the characteristics of all images included in the initial message, and are used to describe the image content in the initial message as a whole.
[0086] During implementation, keyframes in the initial message can be identified. A keyframe may consist of one or more frames. The image features of all keyframes are used as features to be matched. A keyframe is a representative frame in a video or a series of consecutive images that contains important information from the image sequence. For example, frames in the initial message where the scene undergoes significant changes or where abnormal events occur can be used as keyframes.
[0087] During implementation, feature extraction is performed on the extracted keyframes to transform the image information into a set of representative feature vectors, thus obtaining the features to be matched.
[0088] Step D2: Perform a matching operation between the feature to be matched and the known features within the current second time window; Similar to the current first time window, the current second time window is a pre-defined time period. For example, it could be divided into second time windows every 10 minutes, 5 minutes, or half a minute. The second time window in which the current time point falls is the current second time window. Within this current second time window, the edge service records the image features of messages that have already been sent; these image features constitute the set of known features within the current second time window.
[0089] During implementation, the feature to be matched is compared with each feature in the known feature set. Matching methods can be based on distance metrics between feature descriptors, such as cosine distance or Euclidean distance between feature vectors. If the distance between two features is less than a pre-defined feature threshold, the two features are considered a match.
[0090] Step D3: If the feature to be matched matches any known feature, filter out the initial message.
[0091] When the feature to be matched successfully matches a feature in the known feature set, it indicates that a duplicate initial message has been transmitted within a short period of time (i.e., within the current second time window). To avoid repeatedly transmitting the same message within a short period of time, the edge service will directly filter out the initial message and will not send it to the synchronization service again.
[0092] Similar to the hash value management described earlier, each newly extracted image feature also has its own lifetime, calculated from the time the feature was generated. Only features whose lifetime falls within the current second time window are considered known features and used for comparison with the features to be matched. As time progresses, the current second time window moves forward, and features whose lifetime exceeds the current second time window are removed, while newly generated features are added to the set of known features, thus ensuring the dynamic updating of known features.
[0093] In this embodiment of the disclosure, by extracting the features to be matched that can express the overall image content of the initial message and matching them with known features within a specific time window, it is possible to accurately identify and filter out duplicate or highly similar initial messages, thereby effectively avoiding redundant transmission and storage of the same or highly similar messages in a short period of time, saving bandwidth and storage resources, and improving the overall efficiency of message transmission.
[0094] When using both methods to filter the initial message, for example, if the initial message includes both text information and at least one image frame to be processed, in order to ensure that no key information is missed, the initial message should only be filtered if both the text-based and image-based filtering methods determine that the initial message is a duplicate message. Otherwise, the initial message should not be filtered.
[0095] In some embodiments, regardless of the filtering method used to filter out initial information, the number of filtered initial messages within the current time window (such as the current first time window or the current second time window) can be recorded. At the end of the current time window, a summary message containing the number of filtered initial messages and the current time window identifier is generated and sent to the synchronization service. This allows the synchronization service to maintain the total number of initial messages within the current time window based on the summary message. The synchronization service can also send this summary message to the cloud service so that the cloud service can count the total number of initial messages within the current time window. The current time window identifier in the summary message is used by the synchronization service or the cloud service to determine the corresponding time window. The unique identifier protecting the initial messages in the summary message is used by the synchronization service and the cloud service to identify the initial messages.
[0096] (II) Distribution Model In this embodiment of the disclosure, the centralized message processing mode includes a batch mode and a high-speed mode. Wherein: 1) If the target message meets the first preset condition, the distribution mode is high-speed mode; the high-speed mode is used to interrupt the current message sending operation and send the target message to the synchronization service.
[0097] In this embodiment of the disclosure, the first preset condition may be the priority of the target message, such as a sudden equipment failure on an industrial production line or an intrusion detected by a security system. Such messages often have a high priority and need to be processed immediately.
[0098] In this embodiment, the high-speed mode setting allows the system to flexibly adjust the message sending strategy based on the characteristics of the message and the system state. When the target message meets the first preset condition, the current message sending operation is interrupted, and the target message is sent first, ensuring that urgent and real-time messages can be delivered to the synchronization service in a timely manner, thereby improving the transmission efficiency of the target message.
[0099] 2) If the target message meets the second preset condition, the distribution mode is the batch mode.
[0100] Batch mode is used to construct a message set based on the target message and at least one other message, and send the message set to the synchronization service if the batch sending conditions are met. The message set may include at least one message preceding the target message or a message following the waiting period. For example, during message processing, the edge service may have received some unsent messages. When the target message meets the second preset condition and enters batch mode, these previously existing but unsent messages in the edge service will be included in the message set. Alternatively, after detecting that the target message meets the second preset condition, the edge service may not immediately send the target message individually, but instead send a batch of messages when the batch sending condition is met. For example, it may wait for a period of time to identify whether any other messages have arrived. If new messages are generated during this waiting period, these new messages will also be included in the message set.
[0101] In this embodiment of the disclosure, the batch sending conditions may include: the number of messages in the message set, the time interval, the total data volume of the message set, etc.
[0102] Accordingly, the second preset condition may include: (1) The number of messages reaches the threshold That is, when the number of messages in the message set reaches a preset number, the system will trigger a send operation. For example, if the threshold is set to n messages, when the number of messages in the message set reaches n, the message set will be sent to the synchronization service.
[0103] (2) The time interval reaches the threshold The system sets a time limit: regardless of whether the number of messages in the message set meets the requirement, the message set will be sent if the time elapsed since the start of message set construction reaches the preset time interval. For example, the time interval can be set to 100ms.
[0104] (3) The total amount of data reaches the threshold Considering network transmission efficiency and resource consumption, the system may decide whether to send data based on the total amount of data. For example, when the total number of bytes in the message set reaches a preset size threshold, a sending operation will be performed. For instance, if the message set size threshold is set to 1MB, when the message set size reaches 1MB, it will be sent to the synchronization service.
[0105] It is important to understand that batch messages can include message delimiters (such as specific byte sequences) and check bits to ensure that each message in the message set is relatively independent while avoiding parsing errors in subsequent cloud services.
[0106] In this embodiment of the disclosure, a message set is constructed by combining a target message that meets the second preset condition and at least one other message. By batch integrating multiple messages instead of sending them one by one, the number of message transmission requests is reduced, thus avoiding waste of bandwidth resources.
[0107] During implementation, at least one of the following requirements must be met between the first and second preset conditions used to determine batch mode and high-speed mode: (1) The message priority in the first preset condition is higher than the message priority in the second preset condition; (2) The message urgency level in the first preset condition is higher than the message urgency level in the second preset condition; (3) The first preset condition includes the target field of the business requirement. For example, in the alarm type message, the alarm type is included. The target field is determined according to the alarm type, and high-risk messages are sent first.
[0108] In this embodiment, different preset conditions are set to determine whether a message should be sent in batch mode or high-speed mode. Messages are categorized based on their priority, urgency, and critical business information. High-priority, urgent messages, or messages containing critical business fields are sent first in high-speed mode to ensure their timeliness and importance. Other messages are sent in batch mode, balancing transmission efficiency and bandwidth consumption. This makes the overall message sending mechanism more aligned with business needs and improves the flexibility and rationality of system processing.
[0109] Based on the same technical concept, this disclosure also provides a message processing method, such as Figure 3 As shown, this method is applied to a synchronization service and includes the following: S301, Receive target information sent by the edge service. The target message is obtained by the edge service from the compressed initial message using a centralized message processing mode and then sent. The synchronization service is built on a lightweight message transmission system. That is, the generation and sending of the target message can refer to the aforementioned implementation method of the edge service, which will not be repeated here.
[0110] S302 sends the target message to the cloud service.
[0111] After receiving the target message sent by the edge service and performing centralized processing, the synchronization service uses the message transmission capabilities of the lightweight message transmission system to send the message to the cloud service.
[0112] In this embodiment, the edge service preprocesses the original message according to the target pattern, which reduces the amount of data and optimizes transmission efficiency. The synchronization service, as an intermediate hub, relies on the lightweight characteristics of the lightweight message transmission system to quickly receive the processed message and forward it to the cloud service, thereby achieving efficient and reliable transmission of cloud-edge messages.
[0113] In this embodiment of the disclosure, the synchronization service includes an edge synchronization sub-service and a cloud synchronization sub-service. For example... Figure 4 As shown, the edge synchronization sub-service is typically deployed on the edge side; the cloud synchronization sub-service is typically deployed on the cloud side. For ease of understanding, the edge service and the cloud synchronization sub-service will be described separately: (1) Edge synchronization sub-service, used to persist the target message and maintain the first processing progress of the target message by the edge synchronization sub-service; and send the target message to the cloud synchronization sub-service; The edge synchronization sub-service is responsible for interacting with the edge service, receiving target messages sent by the edge service, and performing preliminary processing and management on them.
[0114] Persistence refers to storing data in a persistent storage medium to ensure that the data is not lost after a system failure or restart. In this embodiment of the disclosure, the storage medium may be a MySQL (My Structured Query Language, a relational database) database.
[0115] During implementation, the edge synchronization sub-service persistently stores the received target messages. This ensures that even if the edge synchronization sub-service experiences a temporary failure, the target messages will not be lost and can be processed again later. Figure 4 As shown, the edge synchronization sub-service can store target messages in the edge database for later querying and recovery.
[0116] Meanwhile, the edge synchronization sub-service records the processing progress of the target message. This initial processing progress can include information such as whether the target message has been received, whether the first target processing operation has been performed, and whether it has been sent to the cloud synchronization sub-service. The first target processing may include multiple sub-steps, which may include steps executed by the synchronization system, steps executed by the cloud service, or steps executed by the edge service. The specific implementation can be determined according to the actual situation. By maintaining the processing progress, the edge synchronization sub-service can accurately know the processing status of the target message in the event of anomalies, thereby performing corresponding recovery operations.
[0117] After completing the persistence of the target message and recording of its processing progress, the edge synchronization sub-service will send the target message to the cloud synchronization sub-service.
[0118] (2) Cloud synchronization sub-service is used to persist the target message and maintain the second processing progress of the target message in the cloud synchronization sub-service; and send the target message to the cloud service.
[0119] The cloud synchronization sub-service is mainly responsible for receiving target messages sent from the edge synchronization sub-service and passing them to the cloud service, while also processing and managing the target messages accordingly.
[0120] Similar to the edge synchronization sub-service, the cloud synchronization sub-service also persistently stores received target messages. This is to ensure the security and reliability of target messages in the cloud environment and prevent message loss due to various reasons during subsequent processing. Figure 3 As shown, the cloud synchronization sub-service can also store target messages in a cloud database.
[0121] Meanwhile, the cloud synchronization sub-service maintains a second processing progress for the target message. This progress records the processing status of the target message within the cloud synchronization sub-service. This second processing progress may include information such as whether the target message has been received, whether the second target processing operation has been performed, and whether it has been sent to the cloud service. The second target processing may include multiple sub-steps, which may include steps executed by the synchronization system, steps executed by the cloud service, or steps executed by the edge service. The specific implementation can be determined based on the actual situation.
[0122] For example, whether it has been received, whether some verification or transformation has been performed, and whether it has been sent to the cloud service. By maintaining the second processing progress, the cloud synchronization sub-service can better manage the processing flow of the target message, ensuring that the target message can be accurately delivered to the cloud service and processed accordingly.
[0123] After persisting the target message and recording its processing progress, the cloud synchronization sub-service sends the target message to the cloud service. The cloud service typically has more powerful computing capabilities, allowing for more in-depth analysis and processing of the target message.
[0124] In this embodiment, the synchronization service consists of an edge synchronization sub-service and a cloud synchronization sub-service. These two services work together to persist the target message, maintain its processing progress, and deliver the message, ensuring stable and reliable message transmission from the edge to the cloud. Through the collaborative work of the edge and cloud synchronization sub-services, this message processing method achieves reliable message transmission and processing between the edge and the cloud. The edge and cloud synchronization sub-services respectively persist the message and maintain its processing progress, ensuring that the message is not lost during transmission and can recover in case of anomalies, thus improving the stability and reliability of the system.
[0125] During message transmission, messages may be lost or fail to be delivered due to network instability, equipment malfunction, or other reasons. To avoid this problem, the success of message delivery can be determined by recording the processing progress, thereby improving the reliability of message transmission. The specific implementation method is as follows: Based on the initial processing progress, if it is confirmed that the cloud synchronization sub-service has not received the target message, the edge synchronization sub-service resends the target message to the cloud synchronization sub-service; and / or, Based on the second processing progress, if it is confirmed that the cloud service has not received the target message, the target message is resent to the cloud service based on the cloud synchronization sub-service.
[0126] By checking the relevant information in the first processing progress, the edge synchronization sub-service can confirm whether the cloud synchronization sub-service has successfully received the target message. If the first processing progress indicates that the cloud synchronization sub-service has not received the target message, the edge synchronization sub-service will retrieve the target message content from its own edge database and resend it to the cloud synchronization sub-service.
[0127] Similarly, the cloud synchronization sub-service can determine whether the cloud service has successfully received the target message based on the second processing progress. If the second processing progress confirms that the cloud service has not received the target message, the cloud synchronization sub-service will retrieve the target message from the cloud database and resend it to the cloud service.
[0128] During implementation, the retransmission mechanism based on the first processing progress can be used alone to ensure reliable transmission of the target message between the edge synchronization sub-service and the cloud synchronization sub-service; the retransmission mechanism based on the second processing progress can be used alone to ensure accurate delivery of the target message between the cloud synchronization sub-service and the cloud service; or both mechanisms can be enabled simultaneously to fully guarantee the reliability of the entire transmission link of the target message from the edge synchronization sub-service to the cloud service.
[0129] In this embodiment of the disclosure, the message retransmission mechanism based on processing progress can effectively cope with various abnormal situations during message transmission, thereby improving the stability and reliability of the first information to be processed.
[0130] Based on the same technological concept, such as Figure 5 As shown, this is a message processing method provided in an embodiment of the present disclosure, which can be applied to cloud services and includes the following: S501, Receive target message.
[0131] The target message is processed by the edge service and then sent to the cloud service via the synchronization service. The processing methods of the edge service and the synchronization service for the target message have been explained above and will not be repeated here.
[0132] S502 parses the target message based on the intensive message processing mode applied to the target message.
[0133] In this embodiment of the disclosure, the target message is parsed based on the intensive message processing mode applied to the target message, which can avoid the repeated processing of redundant information in the cloud and improve the processing efficiency of the entire cloud-edge message system.
[0134] In this embodiment of the disclosure, based on the intensive message processing mode applied to the target message, the target message is parsed, as follows: Figure 6 As shown, it includes the following: S601, when the target message retains key fields using the text filtering method in the intensive message processing mode, the mapping table is looked up based on the message class identifier in the target message to determine the missing fields in the target message.
[0135] The mapping table is a pre-established data structure that stores the relationships between message class identifiers, key fields, and their corresponding non-essential fields. For example, if the message class identifier of the target message is an alarm message, and the key field in the target message is the edge device ID, then the mapping table will record non-essential fields such as the generation time, device location, organization to which the device belongs, and device description corresponding to that edge device ID.
[0136] When a target message is received that uses a text filtering method in a centralized message processing model to remove redundant fields and retain only key fields, the cloud service queries a mapping table based on the message class identifier in the message. Using the message class identifier as an index, it searches the mapping table for the corresponding non-key fields, i.e., missing fields or redundant fields.
[0137] S602, the missing fields and key fields are concatenated according to the preset message format of the target message to obtain a complete message that retains the context.
[0138] During implementation, the preset message format can be found based on the message class identifier. Based on this format, missing fields, key fields, and message class identifiers can be concatenated to obtain a complete message.
[0139] In this embodiment of the disclosure, when the target message retains key fields using text filtering in a centralized message processing mode, the cloud service completes missing fields by matching a key field mapping table. This quickly restores the original complete information of the message and avoids context loss due to message compression. Completing missing fields through the mapping table saves space for the cloud service to store non-critical information and avoids redundant processing of repeated non-critical fields, thereby improving the data processing efficiency of the cloud service.
[0140] In this embodiment of the disclosure, parsing the target message based on the intensive message processing mode applied to the target message further includes: when the target message adopts the batch mode in the intensive message processing mode, splitting the target message from the message set containing the target message.
[0141] During implementation, the target message can be extracted from the message set containing the target message based on the message delimiter.
[0142] In some embodiments, when the target message retains key fields using the text filtering method in the intensive message processing mode, the target message can first be separated from the message set containing the target message according to the message delimiter of the target message. Then, the mapping table is looked up based on the message class identifier of the target message to determine the missing fields in the target message. The missing fields and key fields are then concatenated according to the preset message format of the target message to obtain the target message with retained context.
[0143] In this embodiment of the disclosure, the target message is separated from the message set to ensure that the cloud service can locate and process the target message, avoid message confusion or misprocessing during batch transmission, and ensure the priority parsing of core messages.
[0144] In this embodiment of the disclosure, based on the intensive message processing mode applied to the target message, parsing the target message further includes: parsing the message content in the target message when the target message adopts the high-speed mode in the intensive message processing mode; and performing post-processing operations associated with the message content.
[0145] Since messages in high-speed mode usually represent messages of high urgency, when the cloud service receives a target message in high-speed mode using the centralized message processing model, it can perform the same processing operation on the target message in the cloud service based on the edge service processing method described above, such as sending emergency alarm information to the terminal device.
[0146] In this embodiment of the disclosure, when the target message adopts the high-speed mode in the intensive message processing mode, the message content in the target message is parsed; the post-processing operation associated with the message content is executed, which can avoid delays in the response to urgent messages in the cloud due to repeated execution of differentiated processing logic, thereby improving message processing efficiency.
[0147] In this embodiment of the disclosure, based on the intensive message processing mode applied to the target message, parsing the target message can also be achieved based on the following steps: Step E1: When redundant images are removed using the intensive message processing mode, the keyframes in the target message are obtained. The keyframes in the target message can be any of the frame images retained in the target message.
[0148] Step E2: Within the third time window, find images similar to the keyframes among the acquired known images to obtain supplementary images; The third time window is a time range defined to limit the time frame for finding similar images. In practice, images that are similar in content to the keyframes and fall within this time window can be selected from known images already stored in the cloud using image algorithms as supplementary images.
[0149] Step E3: Based on the timestamps of the keyframes and supplementary images, arrange the keyframes and supplementary images in sequence to obtain the image sequence; Both keyframes and supplementary images have their own timestamps, which record the specific time position of each image in the video. These timestamps allow for the accurate determination of the order of keyframes and supplementary images, enabling them to be arranged into a logically ordered sequence.
[0150] Step E4 involves interpolating the image sequence to obtain the video stream.
[0151] Interpolation is an operation that generates new image frames between adjacent image frames to fill in image gaps caused by the removal of redundant images.
[0152] In one implementation, as described above, the target message retains at least one start frame and / or end frame from the image to be processed, as well as the time information of the two frames (such as duration, start timestamp, and end timestamp). The total duration, start time, and end time of the video stream can be determined based on the time information to facilitate the reasonable generation of the video stream.
[0153] In practice, when the target information includes text information, this text information can be used as a constraint for the interpolation operation. By combining this text information, a more reasonable interpolation process can be performed on the transition between adjacent images. By performing interpolation operations on all adjacent image pairs in the image sequence, a series of transition frames can be generated. These transition frames are then combined with the original keyframes and supplementary images to ultimately obtain a continuous and smooth video stream.
[0154] In this embodiment, the edge service removes redundant images and retains only keyframes through image compression mode. The cloud first decompresses and extracts keyframes, then combines time windows to complete similar supplementary images and sorts them. Finally, it generates a video stream through interpolation. This can restore complete and continuous video content while reducing the amount of data transmitted by the edge service, and avoid scene information breaks caused by isolated keyframes.
[0155] It is understood that in the synchronization system provided in this disclosure, messages sent from the cloud service to the edge service can also be processed based on a centralized message processing model. Similarly, the edge service can parse messages according to the centralized message processing model, which will not be elaborated here.
[0156] In summary, taking the unidirectional message flow of sending initial messages from edge devices to cloud services as an example, the synchronization service can be pre-configured, i.e., the cloud synchronization sub-service and the edge synchronization sub-service can be configured. This includes a four-tuple of username, password, IP address, and port number, used for authentication during the connection process. The specific addresses (such as HTTP addresses) of the cloud and / or edge to be connected are pre-defined so that the APP can automatically locate and establish a connection between the cloud service and the edge service after startup. Based on this, the overall flow of the message processing method provided in this embodiment is as follows: Figure 7 As shown, it includes: S701, the edge service processes the initial messages from the edge device based on the compression mode in the intensive message processing mode to obtain the target message.
[0157] S702, the edge service sends the target message to the edge synchronization sub-service based on the distribution mode.
[0158] S703, the edge synchronization sub-service processes the target message.
[0159] The edge synchronization sub-service stores the target message in the edge database to persist the target message. At the same time, it maintains the first processing progress of the target message based on the edge database.
[0160] S704, the edge synchronization sub-service sends the target message to the cloud synchronization sub-service.
[0161] S705, the cloud synchronization sub-service processes the target message.
[0162] The cloud synchronization sub-service stores the target message in the cloud database to persist the target message. At the same time, it maintains the second processing progress of the target message based on the cloud database.
[0163] S706, the cloud synchronization sub-service sends the target message to the cloud service.
[0164] S707, the cloud service receives the target message and parses and processes it.
[0165] In summary, the message processing method provided in this embodiment reduces message volume from the source through a concentrated compression mode, which not only significantly reduces the dependence on network bandwidth in weak network scenarios and alleviates the pressure caused by unstable transmission delays, but also adapts to the limited computing and storage resources of edge devices, reduces the resource consumption of edge data processing and transmission, and improves the message transmission efficiency in a message system based on a cloud-edge collaborative architecture system.
[0166] Based on the same technical concept, this disclosure also provides a message processing device 800, applied to edge services, such as... Figure 8 As shown, it includes: Processing module 801 is used to process the initial message from the edge device based on the compression mode in the intensive message processing mode to obtain the target message; The first sending module 802 is used to send the target message to the synchronization service based on the centralized mode in the centralized message processing mode, so that the synchronization service can send the target message to the cloud service; the synchronization service is built on a lightweight message transmission system.
[0167] In some embodiments, when the target message meets a first preset condition, the distribution mode is a high-speed mode; when the target message meets a second preset condition, the distribution mode is a batch mode. Batch mode is used to construct a message set based on the target message and at least one other message, and send the message set to the synchronization service if the batch sending conditions are met. High-speed mode is used to interrupt the current message sending operation and send the target message to the synchronization service.
[0168] In some embodiments, the compression mode includes a text compression mode; the processing module includes: The text processing submodule is used to process text information based on at least one of the following methods in the text compression mode when the initial message includes text information: Text compression modes include: Text filtering is used to filter out redundant fields based on text filtering rules in order to retain key fields. Text compression methods are used to compress text information.
[0169] In some embodiments, the compression mode includes an image compression mode, and the processing module includes: The image processing submodule is used to process at least one frame of the image to be processed based on at least one of the following methods in the image compression mode, provided that the initial message includes at least one frame of the image to be processed: Image compression modes include: Image filtering method, used to filter out redundant images in at least one frame of the image to be processed; Image compression method, used to compress at least one frame of the image to be processed.
[0170] In some embodiments, the image processing submodule is specifically used for including: Perform a classification operation on at least one frame of the image to be processed to determine the compression ratio; Based on the compression ratio, at least one frame of the image to be processed is compressed.
[0171] In some embodiments, at least one of the following requirements is satisfied between the first preset condition and the second preset condition: The message priority in the first preset condition is higher than the message priority in the second preset condition; The message urgency level in the first preset condition is higher than the message urgency level in the second preset condition; The first preset condition includes the target field of the business requirement.
[0172] In some embodiments, it also includes: The first filtering module is used to extract the message content from the text information in the initial message when the initial message includes text information. Determine the hash value of the message content as the hash value to be matched; Match the hash value to be matched with the known hash values within the current first time window; If the hash value to be matched matches any known hash value, the initial message is filtered out.
[0173] In some embodiments, it also includes: The second filtering module is used to extract image features of at least one frame of the image to be processed when the initial message includes at least one frame of the image to be processed, and obtain the features to be matched. Perform a matching operation between the feature to be matched and the known features within the current second time window; If the feature to be matched matches any known feature, the initial message is filtered out.
[0174] Based on the same technical concept, this disclosure also provides a message processing device 900, applied to synchronization services, such as... Figure 9 As shown, it includes: The first receiving module 901 is used to receive target information sent by the edge service. The target message is sent by the edge service after compressing the initial message based on the intensive message processing mode. The synchronization service is built based on a lightweight message transmission system. The second sending module 902 is used to send the target message to the cloud service.
[0175] In some embodiments, the synchronization service includes an edge synchronization sub-service and a cloud synchronization sub-service; The edge synchronization sub-service is used to persist the target message and maintain the first processing progress of the target message by the edge synchronization sub-service; and to send the target message to the cloud synchronization sub-service. The cloud synchronization sub-service is used to persist the target message and maintain the second processing progress of the target message; it also sends the target message to the cloud service.
[0176] In some embodiments, a retransmission module is also included, for: Based on the first processing progress, if it is confirmed that the cloud synchronization sub-service has not received the target message, the target message is resent to the cloud synchronization sub-service based on the edge synchronization sub-service. And / or, Based on the second processing progress, if it is confirmed that the cloud service has not received the target message, the target message is resent to the cloud service based on the cloud synchronization sub-service.
[0177] Based on the same technical concept, this disclosure also provides a message processing device 1000 for use in cloud services, such as... Figure 10 As shown, it includes: 1001 Second receiving module, used to receive target messages; The 1002 parsing module is used to parse the target message based on the intensive message processing pattern applied to the target message.
[0178] In some embodiments, the parsing module includes: The first lookup unit is used to look up the mapping table based on the message class identifier in the target message to determine the missing fields in the target message when the target message retains key fields by using the text filtering method in the intensive message processing mode. The concatenation unit is used to concatenate missing fields and key fields according to the preset message format of the target message to obtain a complete message that retains the context.
[0179] In some embodiments, the parsing module includes: The splitting unit is used to split the target message from the message set containing the target message when the target message adopts the batch mode in the intensive message processing mode.
[0180] In some embodiments, the parsing module includes: The parsing unit is used to parse the message content in the target message when the target message is processed in the high-speed mode of the intensive message processing model. The post-processing unit is used to perform post-processing operations associated with the message content.
[0181] In some embodiments, the parsing module includes: The acquisition unit is used to acquire key frames in the target message when redundant images are removed using an intensive message processing mode. The second search unit is used to search for images similar to keyframes in the acquired known images within the third time window to obtain supplementary images; The sorting unit is used to sequentially arrange keyframes and supplementary images based on their timestamps to obtain an image sequence. The interpolation unit is used to perform interpolation operations on the image sequence to obtain the video stream.
[0182] The specific functions and examples of each module and submodule of the apparatus in this disclosure can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0183] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0184] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0185] Figure 11A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0186] like Figure 11 As shown, device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1102 or a computer program loaded from storage unit 1108 into random access memory (RAM) 1103. The RAM 1103 may also store various programs and data required for the operation of device 1100. The computing unit 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Input / output (I / O) interface 1105 is also connected to bus 1104.
[0187] Multiple components in device 1100 are connected to I / O interface 1105, including: input unit 1106, such as keyboard, mouse, etc.; output unit 1107, such as various types of monitors, speakers, etc.; storage unit 1108, such as disk, optical disk, etc.; and communication unit 1109, such as network card, modem, wireless transceiver, etc. Communication unit 1109 allows device 1100 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0188] The computing unit 1101 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as message processing methods. For example, in some embodiments, the message processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on device 1100 via ROM 1102 and / or communication unit 1109. When the computer program is loaded into RAM 1103 and executed by the computing unit 1101, one or more steps of the message processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to perform message processing methods by any other suitable means (e.g., by means of firmware).
[0189] Various embodiments 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-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0190] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0191] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0192] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0193] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0194] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0195] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0196] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand 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 principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A message processing method, comprising: The initial message from the edge device is processed using the compression mode in the intensive message processing model to obtain the target message; The target message is sent to the synchronization service based on the centralized and distributed mode in the centralized message processing mode, so that the synchronization service sends the target message to the cloud service; the synchronization service is built on a lightweight message transmission system.
2. The method according to claim 1, wherein, When the target message meets the first preset condition, the distribution mode is high-speed mode; when the target message meets the second preset condition, the distribution mode is batch mode. The batch mode is used to construct a message set based on the target message and at least one other message, and send the message set to the synchronization service when the batch sending conditions are met. The high-speed mode is used to interrupt the current message sending operation and send the target message to the synchronization service.
3. The method according to claim 1, wherein, The compression mode includes a text compression mode; the initial message processing of the edge device based on the compression mode in the intensive message processing mode includes: If the initial message includes text information, the text information is processed based on at least one of the following methods in the text compression mode: The text compression modes include: Text filtering is used to filter out redundant fields based on text filtering rules in order to retain key fields. A text compression method is used to compress the text information.
4. The method according to claim 1, wherein, The compression mode includes an image compression mode. The compression mode based on the intensive message processing mode processes the initial messages of the edge device, including: If the initial message includes at least one frame of image to be processed, the at least one frame of image to be processed is processed based on at least one of the following methods in the image compression mode: The image compression modes include: Image filtering method, used to filter out redundant images in the at least one frame of the image to be processed; Image compression method, used to compress the at least one frame of the image to be processed.
5. The method according to claim 4, wherein, The compression of the at least one frame of the image to be processed includes: The at least one frame of the image to be processed is classified to determine the compression ratio; Based on the compression ratio, the at least one frame of the image to be processed is compressed.
6. The method according to claim 2, wherein, The first preset condition and the second preset condition must satisfy at least one of the following requirements: The message priority in the first preset condition is higher than the message priority in the second preset condition; The message urgency level in the first preset condition is higher than the message urgency level in the second preset condition; The first preset condition includes the target field of the business requirement.
7. The method according to any one of claims 1-6, further comprising: If the initial message includes text information, extract the message content from the text information in the initial message; Determine the hash value of the message content as the hash value to be matched; The hash value to be matched is matched with the known hash values within the current first time window; If the hash value to be matched matches any known hash value, the initial message is filtered out.
8. The method according to any one of claims 1-6, further comprising: If the initial message includes at least one frame of image to be processed, the image features of the at least one frame of image to be processed are extracted to obtain the features to be matched. The feature to be matched is matched with the known features in the current second time window; If the feature to be matched matches any known feature, the initial message is filtered out.
9. A message processing method, comprising: Receive target information sent by the edge service, wherein the target message is obtained by the edge service after compressing the initial message based on the intensive message processing mode; The synchronization service is built on a lightweight message transmission system; The target message is sent to the cloud service.
10. The method according to claim 9, wherein, The synchronization service includes an edge synchronization sub-service and a cloud synchronization sub-service; The edge synchronization sub-service is used to persist the target message and maintain the first processing progress of the target message; and send the target message to the cloud synchronization sub-service. The cloud synchronization sub-service is used to persist the target message and maintain the second processing progress of the target message; and to send the target message to the cloud service.
11. The method of claim 10, further comprising: Based on the first processing progress, if it is confirmed that the cloud synchronization sub-service has not received the target message, the target message is resent to the cloud synchronization sub-service based on the edge synchronization sub-service. And / or, Based on the second processing progress, if it is confirmed that the cloud service has not received the target message, the target message is resent to the cloud service based on the cloud synchronization sub-service.
12. A message processing method, comprising: Receive the target message; The target message is parsed based on the intensive message processing pattern applied to the target message.
13. The method according to claim 12, wherein, The parsing of the target message based on the intensive message processing mode applied to the target message includes: When the target message retains key fields using the text filtering method in the intensive message processing mode, the mapping table is looked up based on the message class identifier in the target message to determine the missing fields in the target message; The missing field and the key field are concatenated according to the preset message format of the target message to obtain a complete message that retains the context.
14. The method according to claim 12, wherein, The parsing of the target message based on the intensive message processing mode applied to the target message includes: When the target message is processed in the batch mode of the intensive message processing mode, the target message is split from the message set containing the target message.
15. The method according to claim 12, wherein, The parsing of the target message based on the intensive message processing mode applied to the target message includes: When the target message is processed using the high-speed mode of the intensive message processing mode, the message content in the target message is parsed. Perform the post-processing operations associated with the message content.
16. The method according to claim 12, wherein, The parsing of the target message based on the intensive message processing mode applied to the target message includes: When the target message is processed using the intensive message processing mode to remove redundant images, the keyframes in the target message are obtained. Within the third time window, search for images similar to the keyframe among the already acquired known images to obtain supplementary images; Based on the timestamps of the keyframes and the supplementary images, the keyframes and supplementary images are arranged sequentially to obtain an image sequence; Interpolation is performed on the image sequence to obtain a video stream.
17. A message processing apparatus, comprising: The processing module is used to process the initial messages from the edge device based on the compression mode in the intensive message processing mode to obtain the target message; The first sending module is used to send the target message to the synchronization service based on the centralized and distributed mode in the centralized message processing mode, so that the synchronization service sends the target message to the cloud service; the synchronization service is built based on a lightweight message transmission system.
18. A message processing apparatus, comprising: The first receiving module is used to receive target information sent by the edge service. The target message is sent by the edge service after compressing the initial message based on the intensive message processing mode. The synchronization service is built on a lightweight message transmission system; The second sending module is used to send the target message to the cloud service.
19. A message processing apparatus, comprising: The second receiving module is used to receive the target message; The parsing module is used to parse the target message based on the intensive message processing mode applied to the target message.
20. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-16.
21. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-16.
22. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-16.