Method and apparatus for publishing information
Patent Information
- Application Number
- CN202210601457.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-05-30
Smart Images

Figure CN117201604B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of data management, and in particular, to a method and apparatus for publishing information. BACKGROUND
[0002] Publish / subscribe systems based on communication networks are increasingly widely used. A subscribing device sends a subscription request to the system, and subscribes to information that needs to be followed. A publishing device can publish corresponding information according to the subscription request.
[0003] Existing publishing methods are generally unicast publishing or multicast publishing. For the unicast publishing method, as the number of subscribing devices increases, the publishing device needs to publish a large amount of repeated data, and the load is large. For the multicast method, the publishing device needs to send the union of the subscription content of all subscribing devices in the multicast group according to the minimum subscription period in the multicast group. As the publishing frequency increases, the publishing load of the publishing device and the network load are high.
[0004] How to reduce the load of the publishing device and the network in the publish / subscribe system has become a problem to be solved. SUMMARY
[0005] Embodiments of the present application provide a method and apparatus for publishing information, which can effectively reduce the load of the publishing device and the network when publishing information.
[0006] In a first aspect, a method for publishing information is provided, comprising: a publishing device determining a first subscription group to which a first subscribing device belongs according to first subscription content of the first subscribing device, the first subscription content comprising a first subscription service and / or a first subscription period of the first subscribing device; and the publishing device determining a publishing strategy for the first subscription group according to a number of subscribing devices in the first subscription group that need to publish the subscription service.
[0007] In this embodiment, the publishing device adds the first subscribing device to the first subscription group according to the first subscription service and / or the first subscription period of the subscribing device, which can be the subscription period of the first subscription service. The number of subscribing devices that need to be published can be obtained by combining the first subscription content and the subscription content of other subscribing devices in the first subscription group, so as to determine the publishing strategy for the first subscription group. Since the number of subscribing devices that need to be published at different times varies, the publishing strategy can also be dynamically updated. By dynamically adjusting the publishing strategy according to the number of subscribing devices that need to publish the subscription service, the publishing cost of the publishing device and the network load are reduced.
[0008] In combination with the first aspect, in some implementations of the first aspect, the method further comprises: the publishing device obtaining the first subscription content from the first subscribing device.
[0009] In this embodiment, the publisher obtains the first subscription content from the first subscriber device, so as to classify the first subscriber device into a suitable subscription group according to the first subscription content, and make a corresponding publishing strategy.
[0010] With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publisher device sending first feedback information to the first subscriber device, the first feedback information including a multicast address of the first subscription group to which the first subscriber device belongs.
[0011] In this embodiment, after the first subscriber device is added into the first subscription group, the publisher device can send the first feedback information to the first subscriber device, and the feedback information can include the multicast address of the first subscription group to which the first subscriber device belongs, so that the first subscriber device can listen to the corresponding multicast channel according to the first feedback information, and obtain the first subscription content subscribed by the first subscriber device.
[0012] With reference to the first aspect, in some implementations of the first aspect, a deviation between the subscription content of any two subscriber devices in the first subscription group is less than or equal to a first preset threshold, and the subscription content includes a subscription period and / or a subscription service; or a deviation between each subscriber device in the first subscription group and reference subscription content of the first subscription group is less than or equal to a second preset threshold.
[0013] In this embodiment, the deviation between the subscription content of the subscriber devices in the first subscription group is less than or equal to the first preset threshold, or the deviation between each subscriber device in the first subscription group and the reference subscription content of the first subscription group is less than or equal to the second preset threshold, which means that the subscription content of each subscriber device in the first subscription group has a certain similarity, so as to facilitate subsequent publishing for the first subscription group. In order to achieve this goal, for example, the first preset threshold of the deviation of the subscription content of any two subscriber devices or the second preset threshold of the deviation of the subscription content of the subscriber device and the reference subscription content of the first subscription group can be set, and different deviation determination methods can be set for the above two methods, for example, different deviation calculation methods can be set for the two methods.
[0014] In some implementations of the first aspect, the publishing-side device determines the first subscription group to which the first subscription-side device belongs according to the first subscription content of the first subscription-side device, including: the publishing-side device determines at least one matching degree according to the first subscription content, the at least one matching degree being a matching degree between the first subscription content and reference content of each of at least one subscription group, the reference content of each of the at least one subscription group including reference subscription service and / or reference subscription period of each of the at least one subscription group; and the publishing-side device determines the first subscription group to which the first subscription-side device belongs according to the at least one matching degree.
[0015] In this embodiment, the publisher determines a matching degree between the first subscription content and reference subscription content of at least one existing subscription group according to the first subscription content, and finally adds the first subscription-side device to the first subscription group according to the at least one matching degree, so that the subscription content of all subscription-side devices in the first subscription group is similar to a certain degree, which is beneficial to multicast publishing of the subscription group and reduces the publishing load of the publishing-side device and the network load.
[0016] In some implementations of the first aspect, the first subscription group is a subscription group of the at least one subscription group, and a corresponding matching degree of the first subscription group is greater than or equal to a preset threshold.
[0017] In this embodiment, the first subscription group to which the first subscription-side device belongs is a subscription group of the at least one existing subscription group, and a calculated value of the corresponding matching degree of the first subscription group is greater than the preset threshold, so that the matching degree between the first subscription-side device and the first subscription group is high, thereby reducing the publishing load of the publishing-side device and the network load.
[0018] In some implementations of the first aspect, the corresponding matching degree of the first subscription group is the highest in the at least one matching degree.
[0019] In this embodiment, the subscription-side device calculates the matching degree between all existing subscription groups and the first subscription content, selects a plurality of subscription groups with a matching degree greater than or equal to a preset threshold, selects a first subscription group with the highest matching degree, and determines that the first subscription-side device belongs to the first subscription group, so that the matching degree between the first subscription-side device and the first subscription group is high enough to reduce the load of the publishing-side device.
[0020] With reference to the first aspect, in some implementations of the first aspect, the first subscription group is not a subscription group in the at least one subscription group, and the at least one matching degree is less than a preset threshold, and before the publishing end device determines the first subscription group to which the first subscription end device belongs according to the first subscription content, the method further includes: the publishing end device establishing the first subscription group.
[0021] In this embodiment, since the matching degrees of the reference subscription content of the at least one subscription group that has been established and the first subscription content of the first subscription end device are all less than the preset threshold, the publishing end device newly establishes the first subscription group, and uses all the subscription groups including the first subscription group to match in the subsequent matching process of other subscription end devices.
[0022] With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing end device determining a matching degree of second subscription content of a second subscription end device and reference content of the first subscription group, the second subscription content including a second subscription service and / or a second subscription period of the second subscription end device, and the reference content of the first subscription group including a reference subscription service and / or a reference subscription period of the first subscription group, the reference subscription service of the first subscription group being the first subscription service, and the reference subscription period of the first subscription group being the first subscription period.
[0023] In this embodiment, when the second subscription end device subscribes, the publishing end device performs matching degree calculation on the second subscription content and the reference subscription content of all the subscription groups including the first subscription group. For the first subscription group, the reference subscription content is the first subscription content of the first subscription end device which is the first member of the first subscription group, and the publishing end device calculates the matching degree of the second subscription content and the reference subscription content, so as to finally determine whether to add the second subscription end device to the first subscription group.
[0024] With reference to the first aspect, in some implementations of the first aspect, the matching degree S is calculated as follows:
[0025] S = a * X + b * Y,
[0026] wherein a is a subscription period weight, b is a subscription service weight, X is an overlap rate of the first subscription period and the reference subscription period, and Y is an overlap rate of the first subscription service and the reference subscription service.
[0027] In this embodiment, the matching degree of the subscription content of the subscription end device and the reference subscription content of the subscription group is calculated by summing the matching degrees of the subscription service and the subscription period, so as to effectively reduce the publishing load and the network load of the publishing end device.
[0028] In some implementations of the first aspect, the publishing device determines the publishing strategy for the first subscription group according to the number of the subscription devices in the first subscription group that need to publish, including: when there is only one subscription device in the first subscription group that needs to publish in a first time period, the publishing device determines to perform unicast publishing in the first time period; or when there are at least two subscription devices in the first subscription group that need to publish in the first time period, the publishing device determines to perform multicast publishing in the first time period.
[0029] In this embodiment, in the publishing strategy finally determined by the publishing device, there is only one subscription device that needs to publish in the unicast publishing time period, and there are at least two subscription devices that need to publish in the multicast publishing time period, and the publishing content can be adjusted according to the number of the subscription devices that need to publish in the subscription group, so as to reduce the load of the publishing device and the network load. The time period can also be understood as a time point or a time.
[0030] In some implementations of the first aspect, the sum of the data sizes of the data respectively published to the at least two subscription devices by unicast in the first time period is greater than the data size of the data published to the at least two subscription devices by multicast.
[0031] In this embodiment, for the time period or time point of multicast publishing, the publishing device calculates or estimates the sum of the data sizes of the data respectively published to the at least two subscription devices by unicast and the data size of the data published to the at least two subscription devices by multicast, and the data size of the data published by multicast is smaller, so that the publishing mode is dynamically adjusted according to the data size of the data that needs to be published, and the load of the publishing device and the network load are reduced.
[0032] In some implementations of the first aspect, the method further includes: the publishing device obtaining cancel subscription information from the first subscription device, the cancel subscription information being used to cancel subscription of the first subscription content; and the publishing device removing the first subscription device from the first subscription group.
[0033] In this embodiment, the publishing device receives the cancel subscription information of the first subscription device, which is used to cancel subscription of the first subscription content, and removes the first subscription device from the first subscription group according to the information.
[0034] In some implementations of the first aspect, the method further includes: the publishing device determining that there is no subscription device in the first subscription group; and the publishing device deleting the first subscription group.
[0035] In this embodiment, after removing the first subscriber device from the first subscription group, the publishing device determines the number of subscriber devices within the first subscription group. If no other subscriber devices exist in the first subscription group, the first subscription group is deleted. That is, the first subscription group is deleted when no subscriber devices exist within it. This reduces the storage load on the publishing device for the first subscription group information. Dynamically creating or deleting subscription groups allows the technical solution provided in this application embodiment to have better implementation effects and reduces the load on the publishing device.
[0036] Secondly, an apparatus for publishing information is provided, comprising: a processing unit, configured to determine a first subscription group to which the first subscription device belongs based on the first subscription content of the first subscription device, wherein the first subscription content includes a first subscription service and / or a first subscription period, and the first subscription period may be the subscription period of the first subscription service; the processing unit is further configured to determine a publishing strategy for the first subscription group based on the number of subscription devices in the first subscription group that need to publish subscription services.
[0037] In this embodiment, the information publishing device includes a processing unit. The processing unit adds the first subscription device to a suitable first subscription group according to the first subscription content, and determines the publishing strategy for the first subscription group based on the number of subscription devices in the first subscription group that have subscription content to be published in the first time period. This allows for dynamic adjustment of the publishing strategy, reducing the publishing load and network load on the publishing devices.
[0038] In conjunction with the second aspect, in some implementations of the second aspect, the deviation between the subscription content of any two subscription devices in the first subscription group is less than or equal to a first preset threshold, and the subscription content includes the subscription period and / or subscription service; or, the deviation between each subscription device in the first subscription group and the reference subscription content of the first subscription group is less than or equal to a second preset threshold.
[0039] In conjunction with the second aspect, in some implementations of the second aspect, the apparatus further includes a transceiver unit for sending first feedback information to the first subscriber device, the first feedback information including the multicast address of the first subscription group to which it belongs.
[0040] In conjunction with the second aspect, in some implementations of the second aspect, the processing unit is specifically configured to: determine at least one matching degree based on the first subscription content, wherein the at least one matching degree is the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group, wherein the reference content of each subscription group includes the reference subscription service and / or reference subscription period of each subscription group; and determine the first subscription group to which the first subscription terminal device belongs based on the at least one matching degree.
[0041] With reference to the second aspect, in some implementations of the second aspect, the first subscription group is a subscription group in the at least one subscription group, and the matching degree corresponding to the first subscription group is greater than or equal to a preset threshold.
[0042] With reference to the second aspect, in some implementations of the second aspect, the first subscription group is not a subscription group in the at least one subscription group, and the at least one matching degree is less than a preset threshold, and the processing unit is further configured to establish the first subscription group.
[0043] With reference to the second aspect, in some implementations of the second aspect, the processing unit is further configured to determine a matching degree between second subscription content of a second subscription end device and reference content of the first subscription group, the second subscription content including a second subscription service and / or a second subscription period of the second subscription end device, and the reference content of the first subscription group including a reference subscription service and a reference subscription period of the first subscription group, the reference subscription service of the first subscription group being the first subscription service, and the reference subscription period of the first subscription group being the first subscription period.
[0044] With reference to the second aspect, in some implementations of the second aspect, the matching degree S is calculated in the following manner:
[0045] S = a * X + b * Y,
[0046] wherein a is a subscription period weight, b is a subscription service weight, X is an overlap rate between the first subscription period and the reference subscription period, and Y is an overlap rate between the first subscription service and the reference subscription service.
[0047] With reference to the second aspect, in some implementations of the second aspect, the processing unit is specifically configured to: when there is only one subscription end device in the first subscription group that has content to be published in the first time period, determine to perform unicast publishing in the first time period; or when there are at least two subscription end devices in the first subscription group that have subscription services to be published in the first time period, determine to perform groupcast publishing in the first time period.
[0048] With reference to the second aspect, in some implementations of the second aspect, in the first time period, a sum of data sizes of unicast publishing respectively performed for the at least two subscription end devices is greater than a data size of groupcast publishing performed for the at least two subscription end devices.
[0049] With reference to the second aspect, in some implementations of the second aspect, the transceiving unit is further configured to obtain cancel subscription information from the first subscription end device, the cancel subscription information being used to cancel subscription of the first subscription content; and the processing unit is further configured to move the first subscription end device out of the first subscription group.
[0050] With reference to the second aspect, in some implementations of the second aspect, the processing unit is further configured to: determine that there is no subscription end device in the first subscription group; and delete the first subscription group.
[0051] A third aspect provides a publishing end device, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: determining, according to first subscription content of a first subscription end device, a first subscription group to which the first subscription end device belongs, the first subscription content comprising first subscription services and / or a first subscription period, the first subscription period being a subscription period of the first subscription services; and determining, according to a number of subscription end devices in the first subscription group that need to publish the subscription services, a publishing strategy for the first subscription group.
[0052] With reference to the third aspect, in some implementations of the third aspect, the instructions, when executed by the one or more processors, cause the publishing end device to perform the following steps: sending first feedback information to the first subscription end device, the first feedback information comprising a multicast address of the first subscription group.
[0053] With reference to the third aspect, in some implementations of the third aspect, a deviation between subscription content of any two subscription end devices in the first subscription group is less than or equal to a first preset threshold, the subscription content comprising a subscription period and / or subscription services; or a deviation between each subscription end device in the first subscription group and reference subscription content of the first subscription group is less than or equal to a second preset threshold.
[0054] With reference to the third aspect, in some implementations of the third aspect, the instructions, when executed by the one or more processors, cause the publishing end device to perform the following steps: determining, according to the first subscription content, at least one matching degree, the at least one matching degree being a matching degree between the first subscription content and reference content of each subscription group in at least one subscription group, the reference content of each subscription group comprising reference subscription services and / or a reference subscription period of each subscription group; and determining, according to the at least one matching degree, the first subscription group to which the first subscription end device belongs.
[0055] With reference to the third aspect, in some implementations of the third aspect, the first subscription group is a subscription group in the at least one subscription group, and a matching degree corresponding to the first subscription group is greater than or equal to a preset threshold.
[0056] In some implementations of the third aspect, the first subscription group is not a subscription group in the at least one subscription group, and the at least one matching degree is less than a preset threshold. When the instructions are executed by the one or more processors, the publishing-side device is caused to perform the following step: establishing the first subscription group.
[0057] In some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing-side device is caused to perform the following step: determining a matching degree between second subscription content of a second subscription-side device and reference content of the first subscription group, the second subscription content including a second subscription service and / or a second subscription period, the reference content of the first subscription group including a reference subscription service and / or a reference subscription period of the first subscription group, the reference subscription service of the first subscription group being the first subscription service, and the reference subscription period of the first subscription group being the first subscription period.
[0058] In some implementations of the third aspect, the matching degree S is calculated as follows:
[0059] S = a * X + b * Y,
[0060] wherein a is a subscription period weight, b is a subscription service weight, X is an overlap rate between the first subscription period and the reference subscription period, and Y is an overlap rate between the first subscription service and the reference subscription service.
[0061] In some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing-side device is caused to perform the following step: when there is only one subscription-side device in the first subscription group that has content to be published in a first time period, determining to perform unicast publishing in the first time period; or when there are at least two subscription-side devices in the first subscription group that have subscription services to be published in the first time period, determining to perform groupcast publishing in the first time period.
[0062] In some implementations of the third aspect, in the first time period, a sum of data sizes of unicast publishing respectively performed for the at least two subscription-side devices is greater than a data size of groupcast publishing performed for the at least two subscription-side devices.
[0063] In some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing-side device is caused to perform the following step: obtaining cancel subscription information from the first subscription-side device, the cancel subscription information being used to cancel subscription of the first subscription content; and moving the first subscription-side device out of the first subscription group.
[0064] With reference to the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publisher device is caused to perform the following steps: determining that there is no subscriber device in the first subscription group; and deleting the first subscription group.
[0065] A fourth aspect provides a computer-readable storage medium, including a computer program, when the computer program is run on a computer, the computer is caused to execute the method of the first aspect or any implementation of the first aspect.
[0066] A fifth aspect provides a device for publishing information, characterized in comprising at least one processor, the processor being coupled with a memory, the memory being used to store instructions, when the instructions are run by the processor, the processor is caused to execute the method of the first aspect or any implementation of the first aspect.
[0067] A sixth aspect provides a computer program product, the computer program product comprising computer program code or instructions, when the computer program code or instructions are executed on a computer, the computer is caused to execute the method of the first aspect or any implementation of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0068] Figure 1 is a schematic architecture diagram of a system suitable for embodiments of the present application.
[0069] Figure 2 is a schematic diagram of a publish / subscribe interaction process in an industrial scenario.
[0070] Figure 3 A method for publishing information provided by embodiments of the present application is shown.
[0071] Figure 4 A schematic flowchart of a grouping method in a subscription process provided by embodiments of the present application is shown.
[0072] Figure 5 A schematic flowchart of a processing method in a cancellation subscription process provided by embodiments of the present application is shown.
[0073] Figure 6 A device for publishing information provided by embodiments of the present application is shown.
[0074] Figure 7 Another device for publishing information provided by embodiments of the present application is shown. DETAILED DESCRIPTION
[0075] The technical solutions in embodiments of the present application will be described below with reference to the accompanying drawings.
[0076] The technical solutions of the embodiments of the present application can be applied to various communication systems, for example: a global system of mobile communication (GSM) system, a code division multiple access (CDMA) system, a wideband code division multiple access (WCDMA) system, a general packet radio service (GPRS), a long term evolution (LTE) system, an LTE frequency division duplex (FDD) system, an LTE time division duplex (TDD), a universal mobile telecommunication system (UMTS), a worldwide interoperability for microwave access (WiMAX) communication system, a 5th generation (5G) system or a new radio (NR), and the like, or a communication system evolved after 5G (for example, a 6G communication system), and the like. The technical solutions of the embodiments of the present application can also be applied to a satellite inter-satellite link communication system, a wireless screen projection system, a virtual reality (VR) communication system, an integrated access and backhaul (IAB) system, a wireless fidelity (Wi-Fi) communication system, an optical communication system, and the like, without limitation.
[0077] The server involved in the present application is also called a server, which is a device providing computing services. Since the server needs to respond to service requests and process them, in general, the server should have the ability to bear and guarantee services. The composition of the server includes a processor, a hard disk, a memory, a system bus, and the like, which is similar to the general computer architecture, but since it needs to provide high-reliability services, it has higher requirements in terms of processing capacity, stability, reliability, security, scalability, manageability, and the like. In a network environment, according to the type of service provided by the server, it is divided into a file server, a database server, an application server, and the like.
[0078] The terminal device in the embodiments of the present application can refer to a user equipment, an access terminal, a user unit, a user station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent or a user apparatus. The terminal device can also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network or a terminal device in an evolved Public Land Mobile Network (PLMN), etc. The embodiments of the present application are not limited thereto.
[0079] Figure 1 is a schematic architecture diagram of a system suitable for the embodiments of the present application. The system includes a publishing end device 101, a subscribing end device 102, a subscribing end device 103 and a subscribing end device 104. The subscribing end device 102, the subscribing end device 103 and the subscribing end device 104 each have a communication link with the publishing end device 101. The publishing end device 101 can be a server or a terminal device, for example, can be a publishing server or a publishing terminal device, used for publishing content subscribed by the subscribing end device 102, the subscribing end device 103 and the subscribing end device 104.
[0080] The subscribing end device can be a server or a terminal device, for example, can be a subscribing terminal device or a subscribing server. A user can subscribe to different content through the subscribing terminal device to the publishing end device, so that the publishing end device publishes the subscribed content to the subscribing terminal device through the link between them.
[0081] The number of the above-mentioned publishing end device and subscribing end device is only illustratively given. In a specific situation, for example, there can be more than one publishing end device, and each publishing end device can be connected to each other, so as to jointly perform the publishing task. Figure 1 The number of the subscribing end device can also be other numbers. The number of the subscribing end device can be one, and the one subscribing end device can perform one or more subscription tasks. The number of the subscribing end device can also be multiple.
[0082] In the publish / subscribe mode, the publishing end device publishes the message subscribed by the subscribing end device generally based on unicast or multicast mode. Specifically, the subscribing end device determines whether to use unicast or multicast mode for publishing when subscribing.
[0083] When the publishing end device sends the subscription message to the subscribing end device in a unicast manner, with the increase of the number of subscribing end devices, a large amount of repeated data is generated, which brings a large load to the network of the publishing end device.
[0084] When the publishing end device sends the subscription message to the subscribing end device in a multicast manner, with the increase of the number of subscribing end devices in the multicast group, the publishing end device needs to send the multicast message to all members in the subscription group according to the minimum period, and with the increase of the publishing frequency, the network bandwidth and performance of the publishing end device are adversely affected.
[0085] In the industrial scene, due to the continuous expansion of the scale of modern industrial production, production equipment develops towards a comprehensive automation system. Due to the large geographical span of various devices in the industrial system, many devices are laid out outdoors or the operating points of the devices are scattered. For some industrial production with certain environmental requirements, the running state of the industrial equipment, the humidity, temperature and other factors of the production environment need to be monitored in real time. Under the condition of the continuous development of network technology, a mobile terminal such as a mobile phone or a computer is used to subscribe to the required data, so that the subscription request is published to the subscribing terminal by the publishing terminal, so that the production situation can be more conveniently obtained by the technical personnel or the management personnel, thereby providing a certain reference for their decision-making.
[0086] Figure 2 The interaction process of publishing / subscription in the industrial scene is shown. As shown in Figure 2 , the publishing end device corresponds to a publishing end device, which can be a server or a terminal device. The subscribing end device corresponds to a subscribing end device, which can be a subscription server or a subscription terminal device. Figure 2 N subscribing end devices are shown in the middle, corresponding to different subscription requests, which can be sent by one subscribing end device to the publishing / subscription system, or sent by multiple subscribing end devices to the system, and the present application takes one subscribing end device corresponding to one publishing information or subscription task as an example to introduce the technical scheme of the embodiments of the present application. In Figure 2 , the subscribing end device 1 subscribes to the publishing information 1 (temperature), the subscribing end device 2 subscribes to the publishing information 2 (humidity), the subscribing end device 3 also subscribes to the publishing information 2 (humidity), and the subscribing end device 4 subscribes to the publishing information 1 (temperature) and the publishing information N (water conductivity)……The subscribing end device N subscribes to the publishing information 2 (humidity) and the publishing information 3 (water oxygen content). The publishing end device can correspondingly adopt unicast or multicast mode according to the individualized needs of different subscribing end devices to publish the corresponding information according to the subscription period.
[0087] In actual industrial production, Figure 2Some of the publishing information shown, such as temperature, humidity, etc., due to the large geographical span of the device, may need to subscribe to the corresponding information for each production area, such as production workshop, and the subscription end device needs to subscribe to different information combinations to monitor different production conditions, such as subscribing to the combination of publishing information 1 (temperature) and publishing information 2 (humidity) to monitor the air condition during production, and subscribing to the combination of publishing information 3 (water oxygen content) and publishing information (water conductivity) to monitor the water quality of production water. Therefore, the amount of data to be published is large, so that a large amount of bandwidth will be occupied during publishing. However, the publishing end device in the industrial scene is generally not high in configuration, and the publication of massive data may cause excessive traffic of the publishing end, affecting the real-time publishing effect of the information and having an adverse effect on production.
[0088] To solve the above problems, the embodiment of the application provides a method for publishing information, which can reduce the load of the publishing end device in the publish / subscribe mode. It should be understood that the above describes the publish / subscribe interaction process taking the industrial scene as an example, and the embodiment of the application is not limited to be applied in the industrial scene, but can also be applied in other scenes where it is necessary to reduce the publishing load of the publishing end or the network load.
[0089] Figure 3 A method for publishing information provided by the embodiment of the application is shown, as shown in Figure 3 The method comprises the following steps.
[0090] In S310, the publishing end device determines a first subscription group to which the first subscription end device belongs according to the first subscription content of the first subscription end device, and the first subscription content comprises a first subscription service and a first subscription period.
[0091] The first subscription content can be directly sent by the first subscription end device to the publishing end device, or sent by the first subscription end device to other servers in the publish / subscribe system for processing, and then forwarded to the publishing end device by the server. The first subscription service can be a field of the subscription service. The first subscription content can further comprise identification information of the first subscription end device, such as an IP address, a user identification, etc., so as to facilitate the publishing end device to publish information to the first subscription end device according to the identification information.
[0092] The publishing end device can be a terminal device or a server, and the publishing end device is used to publish the content subscribed by the subscription end device. The publishing end device can directly or through a program interface obtain the content to be published from other devices. Taking the industrial scene as an example, the content to be published can be temperature, humidity, etc. Production environment indicators, which can be directly obtained by a sensor and processed to the publishing end device, so that the publishing end device can publish different data according to the requirements of the subscription end device.
[0093] The first subscription end device can correspond to a subscription end device. The subscription end device can be a separate device, such as a mobile terminal such as a mobile phone or a computer, or can be the same device as the publishing end device, such as two modules or units of the same device.
[0094] The first subscription content includes a first subscription service and / or a first subscription period. The first subscription service is the content subscribed by the subscription end device. For example, in an industrial scenario, the first subscription content can be subscribed by the system at a specified time, such as monitoring the parameters of the production environment within a specified time period through a program; the first subscription content is manually subscribed by a technician or a manager, such as subscribing to the production parameters that the technician or the manager wants to view or manage through the publish / subscribe system. The first subscription service can be a single information or multiple information, such as a single environmental temperature or a combination of environmental temperature and humidity. The first subscription period is a period in which publishing is required. The period can be set according to experience or can be set according to the needs of the manager. When a parameter changes greatly and is important, a smaller publishing period, such as 5 minutes, can be set, so that the production system or the worker can timely find the parameter change and make certain adjustments to ensure the relatively stable operation of the production environment or system. When a parameter changes slowly or is not important, a larger publishing period, such as 1 hour, can be set, so as to reduce the publishing cost of the publishing end.
[0095] In S310, the publishing end device can add subscription end devices with similar subscription content into a subscription group according to the subscription content of the subscription end device.
[0096] Optionally, before S310, the publishing end device obtains the first subscription content from the first subscription end device.
[0097] The obtaining can be understood as receiving or determining. The first subscription end device can send the first subscription service and the subscription period to the publishing end device directly. The first subscription service and the first subscription period can be sent to the publishing end device in one information or in multiple information through a field or identification information, or the information sent by the subscription end device needs to be further processed or determined by the publishing end device to obtain the first subscription content of the first subscription end device, such as decoding or further processing.
[0098] In the embodiment of the present application, the publishing end device determines the first subscription group to which the first subscription end device belongs according to the first subscription content of the first subscription end device, which includes that the publishing end device determines at least one matching degree according to the first subscription content, the at least one matching degree being a matching degree of the first subscription content and reference content of each subscription group in at least one subscription group, the reference content of each subscription group including reference subscription service and / or reference subscription period of the each subscription group; and the publishing end device determines the first subscription group to which the first subscription end device belongs according to the at least one matching degree.
[0099] In this embodiment, the matching degree can correspond to a similarity of the first subscription content and the reference content of the at least one subscription group, specifically, a similarity of the first subscription period and the reference subscription period of the at least one subscription group and / or a similarity of the first subscription service and the reference subscription service of the at least one subscription group.
[0100] In the embodiment of the present application, a deviation between subscription contents of any two subscription end devices in the first subscription group is less than or equal to a first preset threshold, the subscription contents including subscription period and / or subscription service; or a deviation between each subscription end device in the first subscription group and reference subscription content of the first subscription group is less than or equal to a second preset threshold.
[0101] In this embodiment, the deviation between the subscription contents of the subscription end devices in the first subscription group is less than or equal to the first preset threshold or the deviation between each subscription end device in the first subscription group and the reference subscription content of the first subscription group is less than or equal to the second preset threshold, which means that the subscription contents of the subscription end devices in the first subscription group have a certain similarity, thereby facilitating subsequent publishing for the first subscription group. In order to achieve this goal, for example, the first preset threshold of the deviation between the subscription contents of any two subscription end devices or the second preset threshold of the deviation between the subscription end device and the reference subscription content of the first subscription group can be set, and different deviation determination methods can be set for the above two methods, for example, different deviation calculation methods can be set for the two methods.
[0102] The at least one subscription group can be at least one subscription group established by the publishing end device according to the subscription end devices that have already subscribed, when the first subscription end device subscribes, the first subscription content of the first subscription end device needs to be compared with the reference subscription content of the at least one subscription group that already exists, to determine the matching degree of the first subscription content of the first subscription end device and the reference subscription content of each subscription group in the at least one subscription group.
[0103] In some embodiments, the first subscription group is a subscription group in the at least one subscription group, and the first subscription group corresponds to a matching degree greater than or equal to a preset threshold.
[0104] In this embodiment, there can be several subscription groups in the at least one subscription group, and the matching degrees of the several subscription groups and the first subscription terminal device are greater than a preset threshold. When the at least one subscription group is one subscription group, the subscription group is the first subscription group. When the at least one subscription group is a plurality of subscription groups, the first subscription group is included in the plurality of subscription groups.
[0105] For example, there is only one subscription group in the at least one subscription group, and the matching degree of the one subscription group and the first subscription terminal device is greater than the preset threshold. The one subscription group can be the first subscription group, so that the publishing terminal device can add the first subscription terminal device to the first subscription group according to the matching degree.
[0106] For another example, there are a plurality of subscription groups in the at least one subscription group, and the matching degrees of the plurality of subscription groups and the first subscription terminal device are greater than the first preset threshold. For example, the matching degrees of the first subscription group, the second subscription group, and the third subscription group and the first subscription terminal device are greater than the first preset threshold. The publishing terminal device can stop calculating the matching degrees of other subscription groups and the first subscription terminal device because the first subscription group and the first subscription terminal device are determined to have a matching degree greater than the preset threshold when the matching degrees are determined, thereby reducing the overhead when the matching degrees are calculated, and directly adding the first subscription terminal device to the first subscription group. The first subscription group can be the first subscription group calculated by the publishing terminal device, so that the publishing terminal device only calculates one matching degree. The first subscription group can also be the Nth matching degree (N>1) calculated by the publishing terminal device, so that the publishing terminal device calculates N matching degrees when determining the first subscription group to which the first subscription terminal device belongs.
[0107] The publishing terminal device can also calculate the matching degrees of all existing subscription groups and the first subscription terminal device, select the first subscription group with the highest matching degree from the candidate subscription groups (for example, the first subscription group, the second subscription group, and the third subscription group) with matching degrees greater than the preset threshold, and add the first subscription terminal device to the first subscription group. This way of adding the first subscription terminal device to the subscription group with the highest matching degree can improve the similarity of subscription services of subscription terminal devices in each subscription group and reduce the overhead when publishing.
[0108] In other embodiments, the first subscription group is not a subscription group in the at least one subscription group, and the at least one matching degree is less than the preset threshold. Before the publishing terminal device determines the first subscription group to which the first subscription terminal device belongs according to the at least one matching degree, the method further includes: the publishing terminal device establishing the first subscription group.
[0109] In this embodiment, the matching degree of any of the at least one subscription group to the first subscription end device is less than the preset threshold, that is, when the at least one subscription group is one subscription group, the subscription group is not the first subscription group, and when the at least one subscription group is a plurality of subscription groups, the plurality of subscription groups does not include the first subscription group. Therefore, the publishing end device can newly establish the first subscription group, and the publishing end device can add the first subscription end device to the newly established first subscription group.
[0110] In the embodiment of the present application, the publishing end device can further determine the matching degree of the second subscription content of the second subscription end device to the reference content of the first subscription group, the second subscription content including the second subscription service and / or the second subscription period, the reference content of the first subscription group including the reference subscription service and / or the reference subscription period of the first subscription group, the reference subscription service of the first subscription group being the first subscription service, and the reference subscription period of the first subscription group being the first subscription period.
[0111] In this embodiment, the publishing end device further acquires the second subscription content of the second subscription end device, so that the publishing end device can compare the second subscription content with the reference content of the plurality of subscription groups including the first subscription group. As described above, the first subscription group can be established after the first subscription end device has no suitable matching group, and the first subscription end device is the first member of the first subscription group, so that when other subscription end devices are compared with the first subscription group after the establishment of the first subscription group, the reference content of the first subscription group needs to be determined.
[0112] The reference content of the first subscription group can be consistent with the first member thereof, for example, the first subscription service can be set as the reference subscription service of the first subscription group, and the first subscription period can be set as the reference subscription period of the first subscription group, so that the reference subscription content is used as the reference for the matching degree calculation when the subsequent subscription end devices are compared with the first subscription group.
[0113] The reference content of the first subscription group can also be determined by the publishing device according to the subscription service of the first member, for example, when the reference subscription content includes the reference subscription service and the reference subscription period, it can be specified that the reference subscription period of each subscription group is not updated and is consistent with the subscription period of the first member, and the reference subscription service can be updated within a certain range. That is, the reference subscription period of the subscription group is the subscription period of the first subscription member, and the reference subscription service is set to a reference subscription number, so that when the subscription service of the first subscription member is too small, the subscription service of the subsequent member can be appropriately updated, and when the number of reference subscription services before the Xth member joins is less than the reference subscription number and the number of reference subscription services after the Xth member joins is greater than or equal to the reference subscription number, the reference subscription service after the Xth member joins is no longer updated. For example, the reference subscription number can be set to 4, so that if the subscription number of the first subscription device is 1 and the number of reference subscription services is 1, when the second subscription device joins, the number of new subscription services relative to the reference subscription service is 2, so that the number of reference subscription services is 3, and the subscription service of the third subscription device is 2 relative to the new subscription service of the current reference subscription service, so that the number of reference subscription services is 5>4, and the reference subscription service is no longer updated. The matching degree with other subscription devices can be calculated based on the reference subscription service and the reference subscription period.
[0114] The reference content of the first subscription group can also be pre-set, for example, when the subscription service of the subscription device in the subscription publishing system is relatively stable, a plurality of subscription groups can be pre-set according to experience, so that the subscription device is allocated to the pre-set subscription group.
[0115] The reference subscription content of the subscription group can also be set by other means, which will not be described here for brevity.
[0116] In the embodiments of the present application, the calculation method of the matching degree S can be as follows:
[0117] S = a * X + b * Y (Formula 1)
[0118] Wherein, a is the subscription period weight, b is the subscription service weight, X is the overlap rate of the first subscription period and the reference subscription period, and Y is the overlap rate of the first subscription service and the reference subscription service.
[0119] In the above formula, a*X is the matching degree of the subscription service period, b*Y is the matching degree of the subscription period, and the sum of the two is the total matching degree. By controlling the preset threshold size, the strictness of the matching can be adjusted. Since the maximum value of X and Y is 1 and the minimum value is 0, the variation range of S is 0-a+b. When the preset threshold is large, the matching condition is high. For example, when the preset threshold is set to a+b, the subscription service and the subscription period of all the subscription end devices in the subscription group are the same. When a>b, the preset threshold is set to a, and the subscription end devices with the same subscription period are in the same subscription group, thereby facilitating the multicast of the subscription service by the publishing end device in the subscription group. When a<b, the preset threshold is set to a, and the subscription end devices with the same subscription service are in the same subscription group, thereby reducing the packet size when the publishing end device publishes.
[0120] For example, the subscription period weight a is 1, the subscription service weight b is 0.5, the preset threshold is 1, the reference subscription period of a subscription group is 1s, the reference subscription service is {data1, data2, data3, data4}, and the total number of the reference subscription service is 4. The first subscription period of the first subscription end device is 2s, and the first subscription service of the first subscription end device is {data2, data3, data5}. The overlap rate Y of the first subscription service and the reference subscription service can be calculated by the ratio of the number of the same content in the first subscription service to the number of the reference subscription service. In this case, Y=2 / 4=0.5.
[0121] To calculate the overlap rate of the first subscription period and the reference subscription period, the overlap times according to the first subscription period and the reference subscription period within a certain time, for example, within the least common multiple period of the first subscription period and the reference subscription period, can be calculated, and the ratio of the overlap times to the number of times of publishing according to the reference subscription period (the maximum value is 1). For example, the overlap times within 10 reference subscription periods, i.e., within 10 seconds, are 5, and the number of times of publishing according to the reference subscription period is 10, so X=5 / 10=0.5.
[0122] According to the above formula, the matching degree S=1*0.5+0.5*0.5=0.5+0.25=0.75.
[0123] Since the matching degree S is less than the preset threshold 1, the first subscription end device fails to match the subscription group, and needs to continue to match other subscription groups or re-establish a subscription group.
[0124] For another example, the subscription period weight a is 1, the subscription service weight b is 0.5, the preset threshold is 1, the reference subscription period of the subscription group is 2s, the reference subscription service is {data 2, data 3, data 5}, the first subscription period of the first subscription end device is 1s, the first subscription service of the first subscription end device is {data 1, data 2, data 3, data 4}, and all time points required to be published by the first subscription period completely cover the time points required to be published by the reference subscription period. Therefore, the overlap rate of the subscription period is 1, and the overlap rate of the subscription service is 2 / 3. Finally, the matching degree S = 1*1 + 0.5*2 / 3 = 1.33 is calculated. The matching degree is greater than the preset threshold 1, and the first subscription end device can be added to the subscription group.
[0125] It should be understood that the above-described manner of calculating the matching degree is only illustrative, and the embodiments of the present application do not limit the specific manner of calculating the matching degree. For example, when X in the formula for calculating the matching degree, the ratio of the number of overlaps to the total number of publications in a certain time (for example, the least common multiple of the first subscription period and the reference subscription period) can be calculated. In this case, when the first subscription period and the reference subscription period are completely the same, X is maximized to 1 / 2, and compared with the calculation method described above, this calculation method can cover all time points published according to the reference subscription period in the case that the first subscription period and the reference subscription period are different. For example, only the matching process of the subscription period is considered, the reference subscription period of a subscription group is 2s, the subscription period of subscription end device 1 is 2s, and the subscription period of subscription end device 2 is 1s. Considering the least common multiple time of the reference subscription period and the periods of subscription end device 1 and subscription end device 2, that is, 2s, when the overlap rate is calculated by method 1, that is, the ratio of the number of overlaps published according to the first subscription period and the reference subscription period to the number of publications according to the reference subscription period, the overlap rate X1 of subscription end device 1 is 1 / 1 = 1, and the overlap rate X2 of subscription end device 2 is 1 / 1 = 1. When the overlap rate is calculated by method 2, that is, the ratio of the number of overlaps to the total number of publications, the overlap rate X1 of subscription end device 1 is 1 / 2 = 0.5, and the overlap rate X2 of subscription end device 2 is 1 / 3 = 0.33. From the above calculation process, it can be seen that although the periods of subscription end device 1 and subscription end device 2 are different, the period overlap rates calculated by method 1 are consistent, and the period overlap rates calculated by method 2 are inconsistent. Whether to use which method to calculate the period overlap rate needs to be determined according to the specific situation, and the manner of calculating the overlap rate illustrated by the technical solution of the present application does not constitute a limitation on the technical solution of the present application.
[0126] It should also be understood that the foregoing only introduces the case of considering both the subscription service and the subscription period when calculating the matching degree, and in some embodiments, the matching degree calculation can also be performed by comparing the subscription service of the subscription end device with the reference subscription service of the subscription group or by comparing the subscription period of the subscription end device with the reference subscription period. The above two methods can also achieve the same effect by adjusting the weight in the matching degree calculation formula introduced above, but compared with the case of adjusting the weight to 0 and only performing the matching of the subscription period or the subscription service, the load of the publishing end can be larger.
[0127] Through the above steps, all the subscription end devices including the first subscription end device can be properly grouped, the publishing end device can send feedback information to the subscription end device, and correspondingly, the subscription end device receives the feedback information replied by the publishing end device, which can include information indicating the success of subscription and the multicast address of the subscription group to which the subscription end device belongs. Corresponding to different subscription end devices, the multicast address in the feedback information is different due to the different subscription groups into which the subscription end devices are grouped.
[0128] Figure 4 A schematic flowchart of a grouping method in a subscription process provided by an embodiment of the present application is shown. As shown in the figure, the method includes the following steps. Figure 4
[0129] S410, the subscription end device sends a subscription request to the publishing end device.
[0130] S420, the publishing end device determines whether the subscription request meets the matching degree of an existing subscription group.
[0131] S432, in a case where the publishing end device determines that the subscription request of the subscription end device meets the matching degree of an existing subscription group, the publishing end device adds the current subscription end device into the subscription group and sends feedback information to the subscription end device.
[0132] S434, in a case where the publishing end device determines that the subscription request of the subscription end device does not meet the matching degree of an existing subscription group, the publishing end device creates a subscription group based on the current subscription content, adds the subscription end device into the created subscription group, and sends feedback information to the subscription end device.
[0133] In some cases, the subscription end device can also cancel the subscription, and the embodiment of the present application also provides a method for the case of canceling the subscription by the subscription end device.
[0134] In the embodiment of the present application, the method includes: the publishing end device acquires cancel subscription information from the first subscription end device, the cancel subscription information being used to cancel the subscription of the first subscription content; and the publishing end device removes the first subscription end device from the first subscription group.
[0135] In this embodiment, the cancel subscription information can include the identification information of the first subscription end device, and after the publishing end device obtains the cancel subscription information, the corresponding subscription end device is removed from the first subscription group in which the subscription end device is located. After the first subscription end device is removed from the first subscription group in which the subscription end device is located, feedback information can be sent to the first subscription end device, for notifying the first subscription end device of the success of the cancel subscription.
[0136] Then, the publishing end device can determine whether there is still another subscription end device in the first subscription group.
[0137] In some embodiments, the publishing end device determines that there is still another subscription end device in the first subscription group, and the publishing end device can update the publishing manner corresponding to the first subscription group.
[0138] In another embodiment, the publishing end device determines that there is no other subscription end device in the first subscription group, and the publishing end device can delete the first subscription group, thereby reducing the overhead of the publishing end device in maintaining the subscription group.
[0139] Figure 5 A processing method for cancel subscription provided by an embodiment of the present application is shown. As shown in the figure, the method comprises: Figure 5
[0140] S510, the subscription end device sends a cancel subscription request to the publishing end device.
[0141] S520, the publishing end device removes the subscription end device from the subscription group.
[0142] S530, the publishing end device sends feedback information to the subscription end device, for feeding back the success of the cancel subscription.
[0143] S540, the publishing end device determines whether there is still another subscription end device in the subscription group.
[0144] S550, the publishing end device determines that there is no other subscription end device in the subscription group, and deletes the subscription group.
[0145] Through the above-mentioned manner, the publishing end device can dynamically maintain multiple subscription groups, and set the subscription end devices with similar subscription content into a subscription group, so that the publishing end device can publish according to the subscription content of multiple subscription end devices in the subscription group.
[0146] S320, the publishing end device determines the publishing strategy for the first subscription group according to the number of subscription end devices in the first subscription group that need to publish subscription service.
[0147] In this embodiment, unlike the commonly used fixed multicast mode, the technical solution adopted by the embodiment of the application is to reduce the load of the publishing end device and the network load, and dynamically decide the publishing mode for the same subscription group, that is, for a subscription group, according to the number of subscription end devices that need to publish the subscription service, the publishing mode is determined. When there is more than one subscription end device that needs to publish the subscription service at a certain time, if there is overlapping content in the subscription service that needs to be published by the more than one subscription end device, the union of the subscription service of the more than one subscription end device can be smaller than the algebraic sum of the sizes of the subscription service of the more than one subscription end device when they are sent separately. Therefore, multicast publishing can be performed to reduce the publishing load of the publishing end and the network load.
[0148] Overall, the technical solution provided by the embodiment of the application can estimate the data volume of the information to be published for all subscription end devices in the subscription group, and select a mode with smaller data volume for publishing.
[0149] In the embodiment of the application, the publishing end device determines the publishing strategy for the first subscription group according to the number of subscription end devices that need to publish in the first subscription group, including: when there is only one subscription end device in the first subscription group that has content to publish in a first time period, the publishing end device determines to perform unicast publishing in the first time period; or when there are at least two subscription end devices in the first subscription group that have subscription service to publish in the first time period, the publishing end device determines to perform multicast publishing in the first time period.
[0150] In this embodiment, the publishing mode is dynamically adjusted according to the number of subscription end devices that need to publish at a certain time period or time point (moment), that is, unicast publishing is adopted when there is only one subscription end device that needs to publish at a time period, and multicast publishing is adopted when there are at least two subscription end devices that need to publish at a time period. This publishing strategy is simple, and it is easy for the publishing end device to dynamically adjust the publishing strategy, and the load when the publishing strategy is implemented is smaller.
[0151] In some embodiments, it can be specified that multicast publishing is performed only when the number of subscription end devices that need to publish is greater than a threshold. When the number of publishing end devices is greater than the threshold, there can be more devices that need to publish at the time period or time point, and the multicast publishing mode can further reduce the publishing load of the publishing end device and the network load.
[0152] Further, in the embodiment of the application, the sum of the data sizes of the unicast publishing for the at least two subscription end devices in the first time period is greater than the data size of the multicast publishing for the at least two subscription end devices.
[0153] That is, when the number of the subscription end devices that need to be published is at least two at a certain time period, the server can further estimate the sum of the data sizes of the unicast publishing for the at least two subscription end devices and the data size of the groupcast publishing for the subscription end devices, and adopt the groupcast mode when the data size of the groupcast is smaller. Through the embodiment, the publishing load of the publishing end device and the network load can be further reduced, and the publishing strategy can be optimized.
[0154] For example, in a subscription group, there are three subscription end devices, which are a first subscription end device, a second subscription end device and a third subscription end device. The first subscription period of the first subscription end device is 2s, and the first subscription service is {data 2, data 3, data 5}. The second subscription period of the second subscription end device is 1s, and the second subscription service is {data 1, data 2, data 3, data 4}. The third subscription period of the third subscription end device is 4s, and the third subscription service is {data 2, data 3, data 5}. The preset subscription period weight a is 1, the subscription service weight is 0.5, the preset threshold of the matching degree is 1, and the first subscription end device enters the subscription group first among the three subscription end devices. Then, according to the technical solution described above, the matching degree S2 of the second subscription end device and the subscription group can be calculated as S2 = 1*1 + 0.5*2 / 3 = 1.33. The second subscription end device can be added to the subscription group. The matching degree S3 of the third subscription end device and the subscription group is S3 = 1*0.5 + 0.5*1 = 1, which just meets the preset threshold of the matching degree. Therefore, the third subscription end device can be added to the subscription group.
[0155] For the subscription group including the above three subscription end devices, the publishing mode of the publishing end device within 4s is investigated.
[0156] At the 1st second, the {data 1, data 2, data 3, data 4} of the second subscription end device needs to be published.
[0157] At the 2nd second, the {data 2, data 3, data 5} of the first subscription end device and the {data 1, data 2, data 3, data 4} of the second subscription end device need to be published.
[0158] At the 3rd second, the {data 1, data 2, data 3, data 4} of the second subscription end device needs to be published.
[0159] At the 4th second, the {data 2, data 3, data 5} of the first subscription end device, the {data 1, data 2, data 3, data 4} of the second subscription end device and the {data 2, data 3, data 5} of the third subscription end device.
[0160] Suppose the size of {data1, data2, data3, data4} is 80 bytes, the size of {data2, data3, data5} is 60 bytes, and the size of {data1, data2, data3, data4, data5} is 100 bytes.
[0161] Thus, in 4s, if all members of the subscription group are published using unicast, the size of data that the publishing end device needs to publish
[0162] L1 = 4 * 80 + 2 * 60 + 1 * 60 = 500 bytes.
[0163] In 4s, if all members of the subscription group are published using fixed multicast, the publishing end device needs to send {data1, data2, data3, data4, data5} every 1s, and thus the size of data that needs to be published
[0164] L2 = 100 * 4 = 400 bytes.
[0165] In 4s, a dynamic decision mode can be taken, for example, because only the second subscription end device needs to publish in the first and third seconds, the second subscription end device can be published using unicast {data1, data2, data3, data4}, in the second second, the first and second subscription end devices need to publish, and the union of the subscription services of the first and second subscription end devices {data1, data2, data3, data4, data5} is sent using multicast, and in the fourth second, the first, second and third subscription end devices all need to publish, and the union of the subscription services of the three subscription end devices {data1, data2, data3, data4, data5} can be sent using multicast, and thus the size of data that needs to be published
[0166] L3 = 80 * 2 + 100 + 100 = 360 bytes.
[0167] By comparing the sizes of the above three publishing modes, it can be seen that the data published by the publishing mode of the technical solution of the present application is the smallest, which can effectively reduce the publishing load of the publishing end device and the network load.
[0168] All subscription end devices in the subscription group can listen to the unicast channel and the multicast channel to obtain the data published by the publishing end device, and the demodulation can obtain the data needed by itself.
[0169] Figure 6 An apparatus 600 for publishing information is shown. The apparatus 600 can be a publishing end device or an apparatus in a publishing end device, corresponding to Figures 3 to 5 the publishing end device in the method.
[0170] The device 600 for publishing information comprises a processing unit 610 configured to determine a first subscription group to which a first subscription terminal device belongs according to first subscription content of the first subscription terminal device, the first subscription content comprising first subscription services and / or a first subscription period; and the processing unit 610 is further configured to determine a publishing strategy for the first subscription group according to a number of subscription terminal devices in the first subscription group that need to publish subscription services in a first time period, the subscription terminal devices including the first subscription terminal device.
[0171] In this embodiment, the device 600 for publishing information comprises the processing unit 610 configured to add the first subscription terminal device into a suitable first subscription group according to the first subscription content of the first subscription terminal device, and dynamically adjust a publishing manner of a publishing terminal device according to subscription content of all subscription terminal devices in the first subscription group, i.e., in combination with the number of subscription terminal devices that need to publish subscription services, so as to reduce a publishing load of the publishing terminal device and a network load.
[0172] In some embodiments of the present application, the device further comprises a transceiver unit 620 configured to send first feedback information to the first subscription terminal device, the first feedback information comprising a multicast address of the first subscription group.
[0173] In some embodiments of the present application, a deviation between subscription content of any two subscription terminal devices in the first subscription group is less than or equal to a first preset threshold, the subscription content comprising a subscription period and / or subscription services; or a deviation between each subscription terminal device in the first subscription group and reference subscription content of the first subscription group is less than or equal to a second preset threshold.
[0174] In some embodiments of the present application, the processing unit 610 is specifically configured to determine at least one matching degree according to the first subscription content, the at least one matching degree being a matching degree between the first subscription content and reference content of each subscription group in at least one subscription group, the reference content of each subscription group comprising reference subscription services and / or a reference subscription period of each subscription group; and determine the first subscription group to which the first subscription terminal device belongs according to the at least one matching degree.
[0175] In some embodiments of the present application, the first subscription group is a subscription group in the at least one subscription group, and a matching degree corresponding to the first subscription group is greater than or equal to a preset threshold.
[0176] In some embodiments of the present application, the first subscription group is not a subscription group in the at least one subscription group, and the at least one matching degree is less than a preset threshold, and the processing unit 610 is further configured to establish the first subscription group.
[0177] In some embodiments of the present application, the processing unit 610 is further configured to determine a matching degree of second subscription content of a second subscription terminal device with reference content of the first subscription group, the second subscription content including a second subscription service and / or a second subscription period, the reference content of the first subscription group including a reference subscription service and / or a reference subscription period of the first subscription group, the reference subscription service of the first subscription group being the first subscription service, and the reference subscription period of the first subscription group being the first subscription period.
[0178] In some embodiments of the present application, the matching degree S is calculated as follows:
[0179] S = a * X + b * Y,
[0180] wherein a is a subscription period weight, b is a subscription service weight, X is an overlap rate of the first subscription period and the reference subscription period, and Y is an overlap rate of the first subscription service and the reference subscription service.
[0181] In some embodiments of the present application, when there is only one subscription terminal device in the first subscription group that has content to be published in the first time period, it is determined to perform unicast publishing in the first time period; or when there are at least two subscription terminal devices in the first subscription group that have subscription services to be published in the first time period, it is determined to perform groupcast publishing in the first time period.
[0182] In some embodiments of the present application, in the first time period, a sum of data sizes of unicast publishing respectively performed for the at least two subscription terminal devices is greater than a data size of groupcast publishing performed for the at least two subscription terminal devices.
[0183] In some embodiments of the present application, the transceiver 620 is further configured to obtain cancel subscription information from the first subscription terminal device, the cancel subscription information being used to cancel subscription of the first subscription content; and the processing unit 610 is further configured to remove the first subscription terminal device from the first subscription group.
[0184] In some embodiments of the present application, the processing unit 610 is further configured to determine that there is no subscription terminal device in the first subscription group, and delete the first subscription group.
[0185] Figure 7An apparatus 700 for publishing information is shown. The apparatus 700 for publishing information comprises a processor 720. In embodiments of the present application, the processor 720 is configured to implement various control management operations, for example, the processor 720 is configured to support the apparatus 700 for publishing information to perform the methods or operations or functions described in the above embodiments. Optionally, the apparatus 700 for publishing information further comprises a memory 710 and a communication interface 730; the processor 720, the communication interface 730 and the memory 710 can be connected with each other or through a bus 740. The communication interface 730 is configured to support the apparatus 700 for publishing information to communicate with a subscription terminal device and the like, and the memory 710 is configured to store program codes and data of the apparatus 700 for publishing information. The processor 720 invokes the codes or data stored in the memory 710 to implement corresponding operations. The memory 710 can be coupled with the processor or not. The coupling in embodiments of the present application is indirect coupling or communication connection between the apparatuses, units or modules, which can be electrical, mechanical or other forms, for information interaction between the apparatuses, units or modules.
[0186] The processor 720 can be a central processing unit, a general purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic device, transistor logic, hardware components, or any combination thereof. It can implement or execute the various exemplary logical blocks, modules and circuits described in connection with the present disclosure. The processor can also be a combination of computing components, such as one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The communication interface 730 can be a transceiver, circuit, bus, module or other type of communication interface. The bus 740 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, and the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 7 Only one thick line is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.
[0187] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0188] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0189] In this application, "at least one" means one or more, and "multiple" means two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and rear associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b, or c can represent a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple.
[0190] It should be understood that "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the application. Therefore, "in some embodiments" or "in another embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the application, the size of the sequence number of the above processes does not mean the order of execution, and the execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the application.
[0191] It should also be understood that the first, second, and various numerical numbers mentioned herein are only for the convenience of differentiation, and do not limit the scope of the embodiments of the application.
[0192] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, and the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0193] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0194] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0195] The functions, if realized in the form of software functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the present application that essentially contributes to the prior art or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program code storage media.
[0196] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for publishing information, characterized in that, include: The publishing device determines the first subscription group to which the first subscription device belongs based on the first subscription content of the first subscription device. The first subscription content includes the first subscription service and the first subscription period. The publishing device determines the publishing strategy for the first subscription group based on the number of subscription devices in the first subscription group that need to publish subscription services; Wherein, the publishing terminal device determines the first subscription group to which the first subscription terminal device belongs based on the first subscription content of the first subscription terminal device, including: The publishing device determines at least one matching degree based on the first subscription content. The at least one matching degree is the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group. The reference content of each subscription group includes the reference subscription service and reference subscription period of each subscription group. The publishing device determines the first subscription group to which the first subscription device belongs based on the at least one matching degree; The reference content of the first subscription group is determined based on the subscription services of the first m members in the first subscription group.
2. The method according to claim 1, characterized in that, The method further includes: The publishing device sends a first feedback message to the first subscribing device, the first feedback message including the multicast address of the first subscription group.
3. The method according to claim 1 or 2, characterized in that, The first subscription group is a subscription group among the at least one subscription group, and the matching degree corresponding to the first subscription group is greater than or equal to a preset threshold.
4. The method according to claim 1 or 2, characterized in that, The first subscription group is not one of the at least one subscription groups, and the at least one matching degree is less than a preset threshold. Before the publishing device determines the first subscription group to which the first subscription device belongs based on the at least one matching degree, the method further includes: The publishing device establishes the first subscription group.
5. The method according to claim 4, characterized in that, The method further includes: The publishing device determines the matching degree between the second subscription content of the second subscription device and the reference content of the first subscription group. The second subscription content includes the second subscription service and the second subscription period of the second subscription device. The reference content of the first subscription group includes the reference subscription service and the reference subscription period of the first subscription group. The reference subscription service of the first subscription group is the first subscription service, and the reference subscription period of the first subscription group is the first subscription period.
6. The method according to claim 1 or 2, characterized in that, The matching degree S is calculated as follows: S = a*X + b*Y, Where a is the subscription period weight, b is the subscription service weight, X is the overlap rate between the first subscription period and the reference subscription period, and Y is the overlap rate between the first subscription service and the reference subscription service.
7. The method according to claim 1 or 2, characterized in that, The publishing device determines a publishing strategy for the first subscription group based on the number of subscribing devices that need to publish in the first subscription group, including: When only one subscriber device in the first subscription group during the first time period has a subscription service to publish, the publishing device determines to perform unicast publishing during the first time period; or... When at least two subscription devices in the first subscription group during the first time period have subscription services that need to be published, the publishing device determines to perform multicast publishing during the first time period.
8. The method according to claim 7, characterized in that, During the first time period, the sum of the data sizes unicast to the at least two subscriber devices is greater than the data sizes multicast to the at least two subscriber devices.
9. The method according to claim 1 or 2, characterized in that, The method further includes: The publishing device obtains unsubscription information from the first subscribing device, and the unsubscription information is used to unsubscribe from the first subscription content; The publishing device removes the first subscribing device from the first subscription group.
10. The method according to claim 1 or 2, characterized in that, The method further includes: The publishing device determines that there is no subscription device in the first subscription group; The publishing device deletes the first subscription group.
11. An apparatus for disseminating information, characterized in that, include: The processing unit is configured to determine the first subscription group to which the first subscription terminal device belongs based on the first subscription content of the first subscription terminal device, wherein the first subscription content includes a first subscription service and a first subscription period; The processing unit is further configured to determine a publishing strategy for the first subscription group based on the number of subscription terminal devices in the first subscription group that need to publish subscription services; Specifically, the processing unit is used for: Based on the first subscription content, at least one matching degree is determined. The at least one matching degree is the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group. The reference content of each subscription group includes the reference subscription service and reference subscription period of each subscription group. Based on the at least one matching degree, the first subscription group to which the first subscription device belongs is determined; The reference content of the first subscription group is determined based on the subscription services of the first m members in the first subscription group.
12. The apparatus according to claim 11, characterized in that, The device further includes: The transceiver unit is used to send first feedback information to the first subscription device, wherein the first feedback information includes the multicast address of the first subscription group to which it belongs.
13. The apparatus according to claim 11 or 12, characterized in that, The first subscription group is a subscription group among the at least one subscription group, and the matching degree corresponding to the first subscription group is greater than or equal to a preset threshold.
14. The apparatus according to claim 11 or 12, characterized in that, If the first subscription group is not a subscription group among the at least one subscription group, and the at least one matching degree is less than a preset threshold, the processing unit is further configured to establish the first subscription group.
15. The apparatus according to claim 14, characterized in that, The processing unit is further configured to determine the matching degree between the second subscription content of the second subscription terminal device and the reference content of the first subscription group. The second subscription content includes a second subscription service and a second subscription period. The reference content of the first subscription group includes a reference subscription service and a reference subscription period of the first subscription group. The reference subscription service of the first subscription group is the first subscription service, and the reference subscription period of the first subscription group is the first subscription period.
16. The apparatus according to claim 11 or 12, characterized in that, The matching degree S is calculated as follows: S = a*X + b*Y, Where a is the subscription period weight, b is the subscription service weight, X is the overlap rate between the first subscription period and the reference subscription period, and Y is the overlap rate between the first subscription service and the reference subscription service.
17. The apparatus according to claim 11 or 12, characterized in that, The processing unit is specifically used for: If only one subscriber device in the first subscription group within the first time period has a subscription service that needs to be published, then unicast publishing will be performed within the first time period; or... When at least two subscription devices in the first subscription group during the first time period have subscription services that need to be published, it is determined that multicast publishing will be carried out during the first time period.
18. The apparatus according to claim 17, characterized in that, During the first time period, the sum of the data sizes unicast to the at least two subscriber devices is greater than the data sizes multicast to the at least two subscriber devices.
19. The apparatus according to claim 12, characterized in that, The transceiver unit is further configured to obtain unsubscribe information from the first subscription terminal device, the unsubscribe information being used to unsubscribe from the first subscription content; The processing unit is further configured to remove the first subscription device from the first subscription group.
20. The apparatus according to claim 11 or 12, characterized in that, The processing unit is further configured to: It has been determined that there are no subscription devices in the first subscription group; Delete the first subscription group.
21. An apparatus for disseminating information, characterized in that, It includes at least one processor coupled to a memory for storing instructions which are executed by the processor. The processor is thus made to perform the method as described in any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that, Includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1 to 10.
23. A computer program product, characterized in that, The computer program product includes computer program code or instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Resource scheduling method, device and base station for long-term evolution system multicast broadcasting service
CN103974198A
Information pushing method, device and system
CN110769021A
Communication method and related equipment
CN113498027A