WO2023231857A1 - Information release method and apparatus - Google Patents
Information release method and apparatus Download PDFInfo
- Publication number
- WO2023231857A1 WO2023231857A1 PCT/CN2023/095961 CN2023095961W WO2023231857A1 WO 2023231857 A1 WO2023231857 A1 WO 2023231857A1 CN 2023095961 W CN2023095961 W CN 2023095961W WO 2023231857 A1 WO2023231857 A1 WO 2023231857A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- subscription
- group
- publishing
- subscribing
- content
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 98
- 238000012545 processing Methods 0.000 claims description 34
- 238000004590 computer program Methods 0.000 claims description 15
- 230000015654 memory Effects 0.000 claims description 13
- 238000003860 storage Methods 0.000 claims description 6
- 238000004891 communication Methods 0.000 description 21
- 230000008569 process Effects 0.000 description 15
- 238000004519 manufacturing process Methods 0.000 description 14
- 238000004364 calculation method Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 6
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 6
- 230000008878 coupling Effects 0.000 description 5
- 238000010168 coupling process Methods 0.000 description 5
- 238000005859 coupling reaction Methods 0.000 description 5
- 230000003993 interaction Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000009776 industrial production Methods 0.000 description 3
- 230000000737 periodic effect Effects 0.000 description 3
- 230000002411 adverse Effects 0.000 description 2
- QVGXLLKOCUKJST-UHFFFAOYSA-N atomic oxygen Chemical compound [O] QVGXLLKOCUKJST-UHFFFAOYSA-N 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 229910052760 oxygen Inorganic materials 0.000 description 2
- 239000001301 oxygen Substances 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/566—Grouping or aggregating service requests, e.g. for unified processing
Definitions
- the embodiments of the present application relate to the field of data management, and in particular, to a method and device for publishing information.
- the subscribing device sends a subscription request to the system to subscribe for information that needs attention.
- the publishing device can publish the corresponding information based on the subscription request.
- Existing publishing methods are generally unicast publishing or multicast publishing.
- unicast publishing as the number of subscribing devices increases, the publishing device needs to publish a large amount of repeated data, resulting in a heavy load.
- multicast mode the publishing device needs to send the union of the subscription contents of all subscribing devices according to the minimum subscription period in the multicast group. As the publishing frequency increases, the publishing load and network load of the publishing device are higher.
- the embodiments of this application provide a method and device for publishing information, which can effectively reduce the load on the publishing end device and the network when publishing information.
- a method for publishing information including: the publishing device determines a first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, and the first subscription The content includes the first subscription service and/or the first subscription cycle of the first subscribing device; the publishing device determines the number of subscription services for the first subscription device according to the number of subscribing devices in the first subscription group that need to publish the subscription service. Publishing strategy for the first subscription group.
- the publishing device adds the first subscribing device to the first subscription according to the first subscription service and/or the first subscription period of the subscribing device.
- the first subscription period may be the subscription period of the first subscription service. Group. Therefore, the first subscription content and the subscription content of other subscriber devices in the first subscription group can be combined to obtain the number of subscriber devices that need to be published, thereby determining a publishing strategy for the first subscription group. Since the number of subscribing devices that need to publish changes at different times, 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 subscription services, the publishing overhead and the publishing cost of the publishing device during publishing can be reduced. Network load.
- the method further includes: the publishing device obtains the first subscription content from the first subscribing device.
- the publishing end obtains the first subscription content from the first subscribing end device, thereby classifying the first subscribing end device into an appropriate subscription group based on the first subscription content, and formulating a corresponding publishing policy.
- the method further includes: the publishing device sends a message to The first subscribing device sends first feedback information, where the first feedback information includes the multicast address of the first subscription group to which it belongs.
- the publishing device after the publishing device adds the first subscribing device to the first subscription group, it can send the first feedback information to the first subscribing device.
- the feedback information may include the first subscribing device to which the first subscribing device belongs.
- a multicast address of a subscription group so that the first subscribing device can monitor the corresponding multicast channel according to the first feedback information and obtain the first subscription content it subscribes to.
- the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
- the deviation of the subscription content between the subscribing devices in the first subscription group is less than or equal to the first preset threshold or the reference subscription of each subscribing device in the first subscription group and the first subscription group.
- the deviation between the content 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 degree of similarity, thereby facilitating subsequent publishing to the first subscription group.
- 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.
- the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, including: The publishing device determines at least one matching degree based on the first subscription content, where the at least one matching degree is a 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/or reference subscription cycle of each subscription group; the publishing device determines the first subscribing device to which the first subscribing device belongs based on the at least one matching degree. First subscription group.
- the publisher determines the matching degree between the first subscription content and the reference subscription content of at least one existing subscription group based on the first subscription content, and finally, based on the at least one matching degree, the first subscribing device Join the first subscription group, so that the subscription contents of all subscribing devices in the first subscribing group including the first subscribing device have a certain degree of similarity, which is conducive to multicast publishing of the subscription group and reduces the publishing of the publishing device. load and network load.
- 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.
- the first subscription group that the first subscribing device joins is a subscription group in at least one existing subscription group, and the calculated value of the matching degree corresponding to the first subscription group is greater than the preset threshold, so that the first The subscribing device has a higher matching degree with the first subscription group, which reduces the publishing load and network load of the publishing device.
- the matching degree corresponding to the first subscription group is the highest among the at least one matching degree.
- the subscriber device calculates the matching degree between all existing subscription groups and the first subscription content, selects several subscription groups whose matching degree is greater than or equal to the preset threshold, and selects the one with the largest matching degree.
- the first subscription group determines that the first subscribing device belongs to the first subscription group, so that the matching degree between the first subscribing device and the first subscription group is high enough to reduce the load of the publishing device.
- the first subscription group is not the at least one subscription group.
- the at least one matching degree is less than a preset threshold, and before the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content, the The method further includes: the publishing device establishing the first subscription group.
- the publishing device since the matching degree between the reference subscription content of at least one subscription group that has been established and the first subscription content of the first subscribing device is less than the preset threshold, the publishing device newly establishes the first subscription group, and in Next, all subscription groups including the first subscription group are used for matching in the matching process of other subscriber devices.
- the method further includes: the publishing device determines a matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group,
- the second subscription content includes the second subscription service and/or the second subscription cycle of the second subscribing device
- the reference content of the first subscription group includes the reference subscription service and/or reference subscription of the first subscription group.
- the reference subscription service of the first subscription group is the first subscription service
- the reference subscription period of the first subscription group is the first subscription period.
- the publishing device calculates the matching degree between the second subscription content and the reference subscription content of all subscription groups including the first subscription group.
- its reference subscription content is the first subscription content of its first subscriber device member—the first subscriber device.
- the publisher device matches the second subscription content with the reference subscription content. Calculation is performed to finally determine whether to add the second subscriber device to the first subscription group.
- a is the subscription cycle weight
- b is the subscription service weight
- X is the overlap rate of the first subscription cycle and the reference subscription cycle
- Y is the overlap rate of the first subscription service and the reference subscription service.
- the matching degree between the subscription content of the subscribing device and the reference subscription content of the subscription group is calculated by the sum of the matching degrees of the subscription business and the subscription period, thereby effectively reducing the publishing load and network load of the publishing device.
- the publishing device determines a publishing strategy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish, Including: when only one subscriber device in the first subscription group in the first period has content that needs to be published, the publishing device determines to perform unicast publishing in the first period; or, when the first subscription group in the first period When at least two subscribing devices have subscription services that need to be published, the publishing device determines to perform multicast publishing in the first period.
- the publishing strategy finalized by the publishing device there is only one subscribing device that needs to publish during the unicast publishing period, and there are at least two subscribing devices that need to publish during the multicast publishing period, and it can be based on The number of subscriber devices that need to be published in the subscription group adjusts the published content to reduce the load of the publisher device and the network load. This period can also be understood as a moment or a point in time.
- the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices.
- the data size for multicast publishing by the end device is greater than the size of the data for the at least two subscription devices.
- the publishing device calculates or estimates the sum of the data sizes for unicast publishing by at least two subscribing devices and the sum of the data sizes for multicasting by at least two subscribing devices.
- the size of published data, and the size of data published by multicast is smaller, so using multicast publishing and dynamically adjusting the publishing method according to the amount of data to be published can reduce the load on the publishing end and the network load.
- the method further includes: the publishing device obtains Obtain unsubscription information from the first subscribing device, the unsubscribing information is used to unsubscribe the first subscription content; the publishing device moves the first subscribing device out of the first subscription group .
- the publishing device receives unsubscription information from the first subscribing device to unsubscribe from the first subscription content, and the publishing device moves the first subscribing device out of the first subscription group based on the information.
- the method further includes: the publishing device determines that there is no subscribing device in the first subscription group; the publishing device deletes the third A subscription group.
- the publisher device moves the first subscriber device out of the first subscription group, it determines the number of subscriber devices in the first subscription group. There are no other subscriber devices in the first subscription group.
- the first subscription group is deleted. That is, when there is no subscribing device in the first subscription group, the first subscription group is deleted.
- an apparatus for publishing information including: a processing unit configured to determine a first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, and the third A 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 also configured to publish the subscription service according to the needs of the first subscription group The number of subscriber devices determines the publishing strategy for the first subscription group.
- the device for publishing information includes a processing unit.
- the processing unit adds the first subscribing device to the appropriate first subscription group according to the first subscription content, and adds the first subscribing device to the appropriate first subscription group according to the needs of the first subscription group during the first period.
- the number of subscriber devices that publish subscription content determines the publishing strategy for the first subscription group, so that the publishing strategy can be dynamically adjusted to reduce the publishing load and network load of the publishing device.
- the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
- the apparatus further includes a transceiver unit configured to send first feedback information to the first subscriber device, where the first feedback information includes the first The multicast address of the subscribing group.
- the processing unit is specifically configured to: determine at least one matching degree based on the first subscription content, where the at least one matching degree is the first The degree of matching between the subscription content and the reference content of each subscription group in at least one subscription group, the reference content of each subscription group including the reference subscription service and/or reference subscription cycle of each subscription group; according to the At least one matching degree determines the first subscription group to which the first subscriber device belongs.
- 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.
- the first subscription group is not a subscription group in the at least one subscription group, the at least one matching degree is less than a preset threshold, and the processing unit , is also used to establish the first subscription group.
- the processing unit is further configured to determine a matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group, so
- the second subscription content includes the second subscription service and/or the second subscription cycle of the second subscribing 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.
- a is the subscription cycle weight
- b is the subscription service weight
- X is the overlap rate of the first subscription cycle and the reference subscription cycle
- Y is the overlap rate of the first subscription service and the reference subscription service.
- the processing unit is specifically configured to: when only one subscriber device in the first subscription group in the first period has content that needs to be published, determine whether Unicast publishing is performed in the first period; or, when at least two subscriber devices in the first subscription group in the first period have subscription services that need to be published, it is determined to perform multicast publishing in the first period.
- the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices.
- the data size for multicast publishing by the end device is greater than the size of the data for the at least two subscription devices.
- the transceiver unit is also used to obtain unsubscription information from the first subscribing end device, and the unsubscription information is used to unsubscribe from the third subscribing device.
- a subscription content; the processing unit is also configured to remove the first subscribing device from the first subscription group.
- the processing unit is further configured to: determine that there is no subscribing device in the first subscription group; and delete the first subscription group.
- a publishing device includes: one or more processors; one or more memories; the one or more memories store one or more computer programs, and the The one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: determine the first subscription content of the first subscriber device.
- the first subscription content includes a first subscription service and/or a first subscription period.
- the first subscription period may be the subscription period of the first subscription service; according to the first subscription
- the number of subscriber devices in the group that need to publish subscription services determines the publishing strategy for the first subscription group.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: Send first feedback information, where the first feedback information includes the multicast address of the first subscription group.
- the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: according to the first subscription content, Determine at least one matching degree, the at least one matching degree being the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group, and the reference content of each subscription group includes each of the Reference subscription service and/or reference subscription cycle of a subscription group; determine the first subscription group to which the first subscribing device belongs based on the at least one matching degree.
- 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.
- 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.
- the publishing device When executed by the one or more processors, the publishing device is caused to perform the following steps: establishing the first subscription group.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: determine the third subscribing device of the second subscribing device.
- the reference subscription service and/or the reference subscription period, the reference subscription service of the first subscription group is the first subscription service
- the reference subscription period of the first subscription group is the first subscription period.
- a is the subscription cycle weight
- b is the subscription service weight
- X is the overlap rate of the first subscription cycle and the reference subscription cycle
- Y is the overlap rate of the first subscription service and the reference subscription service.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: when the first subscription group in the first period When only one subscribing device in the first subscription group has content that needs to be published, it is determined to perform unicast publishing in the first period; or, when there are at least two subscribing devices in the first subscription group in the first period that have subscriptions that need to be published. When providing services, it is determined to perform multicast publishing in the first time period.
- the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices.
- the data size for multicast publishing by the end device is greater than the size of the data for the at least two subscription devices.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: obtain data from the first subscribing device. Unsubscription information of the device, the unsubscription information is used to unsubscribe the first subscription content; and move the first subscribing device out of the first subscription group.
- the publishing device when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: determine the number of members in the first subscription group There is no subscriber device; delete the first subscription group.
- a fourth aspect provides a computer-readable storage medium, including a computer program, which when the computer program is run on a computer, causes the computer to execute the method of the first aspect or any implementation of the first aspect.
- a device for publishing information which is characterized in that it includes at least one processor, the processor is coupled to a memory, the memory is used to store instructions, and 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.
- a computer program product includes computer program code or instructions.
- the computer program code or instructions When the computer program code or instructions are executed on a computer, the computer program code or instructions cause the computer to execute the first aspect or any aspect of the first aspect. A way to do it.
- Figure 1 is a schematic architecture diagram of a system suitable for embodiments of the present application.
- Figure 2 is a schematic diagram of the publish/subscribe interaction process in an industrial scenario.
- Figure 3 shows a method for publishing information provided by an embodiment of the present application.
- Figure 4 shows a schematic flow chart of a grouping method in the subscription process provided by this embodiment of the present application.
- Figure 5 shows a schematic flowchart of a processing method in the unsubscription process provided by this embodiment of the present application.
- Figure 6 shows a device for publishing information provided by an embodiment of the present application.
- Figure 7 shows another device for publishing information provided by an embodiment of the present application.
- GSM global system of mobile communication
- CDMA code division multiple access
- WCDMA broadband code division multiple access
- GPRS general packet radio service
- LTE long term evolution
- FDD frequency division duplex
- TDD LTE Time division duplex
- UMTS universal mobile telecommunication system
- WiMAX global interoperability for microwave access
- the server involved in this application is also called a server and is a device that provides computing services. Since the server needs to respond to service requests and process them, generally speaking, the server should have the ability to undertake services and guarantee services.
- the composition of a server includes a processor, hard disk, memory, system bus, etc., which is similar to a general computer architecture. However, due to the need to provide highly reliable services, it must be in terms of processing power, stability, reliability, security, scalability, and availability. Management requirements are relatively high. In a network environment, according to the type of services provided by the server, it is divided into file server, database server, application server, etc.
- the terminal equipment in the embodiment of this application may refer to user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or User device.
- the terminal device may 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), or a device with wireless communications Functional handheld devices, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or terminal devices in the evolved Public Land Mobile Network (PLMN) etc., the embodiments of the present application are not limited to this.
- SIP Session Initiation Protocol
- WLL Wireless Local Loop
- PDA Personal Digital Assistant
- FIG. 1 is a schematic architecture diagram of a system suitable for embodiments of the present application.
- the system includes a publishing device 101, a subscribing device 102, a subscribing device 103 and a subscribing device 104.
- the subscribing device 102, the subscribing device 103 and the subscribing device 104 all have communication links with the publishing device 101.
- the publishing device 101 may be a server or a terminal device, for example, it may be a publishing server or a publishing terminal device, and is used for publishing by the subscribing device 102 or the subscribing device.
- the subscribing device may be a server or a terminal device, for example, it may be a subscribing terminal device or a subscribing server. Users can subscribe to different contents from the publishing terminal device through the subscribing terminal device, so that the publishing terminal device publishes the subscribed content to the subscribing terminal device through a link with the subscribing terminal device.
- the above numbers of publishing-side devices and subscribing-side devices are only illustrative. In specific situations, for example, there may be more than one publishing device, and each publishing device may be connected to each other to jointly perform publishing tasks.
- the number of subscriber devices in Figure 1 can also be other numbers.
- the number of subscriber devices can be one.
- the one subscriber device can perform one or more subscription tasks.
- the number of subscriber devices can also be multiple.
- the publisher device publishes messages subscribed by the subscriber device generally based on unicast or multicast. Specifically, the subscribing device determines whether to publish in unicast or multicast mode when subscribing.
- the publishing device uses unicast mode to send subscription messages to the subscribing device, as the number of subscribing devices increases, a large amount of duplicate data will be generated, which will put a greater load on the network of the publishing device.
- the publisher device uses multicast to send subscription messages to the subscriber device
- the publisher device needs to send multicast messages to members of the entire subscription group according to the minimum period.
- the publishing frequency increases, the network bandwidth and performance of the publishing end device are adversely affected.
- Figure 2 shows the publish/subscribe interaction process in an industrial scenario.
- the publishing device corresponds to the publishing device, which can be a server or a terminal device.
- the subscribing device corresponds to the subscribing device, which can be a subscribing server or a subscribing terminal device.
- Figure 2 shows N subscribing devices, corresponding to different subscription requests.
- the subscription request can be sent to the publish/subscribe system by one subscribing device, or can be sent to the system by multiple subscribing devices.
- This application uses one
- the subscription segment device corresponds to one publishing information or subscription task as an example to introduce the technical solution of the embodiment of this application.
- subscribing device 1 subscribes to published information 1 (temperature)
- subscribing device 2 subscribes to published information 2 (humidity)
- subscribing device 3 also subscribes to published information 2 (humidity)
- subscribing device 4 Subscribed to published information 1 (temperature) and published information N (water conductivity).
- the subscribing device N subscribed to published information 2 (humidity) and published information 3 (water oxygen content).
- the publishing device can publish the corresponding information according to the subscription cycle in unicast or multicast mode according to the personalized needs of different subscribing devices.
- embodiments of the present application provide a method of publishing information, which can reduce the complexity of the publish/subscribe model.
- the load on the publishing device It should be understood that the publish/subscribe interaction process is introduced above by taking an industrial scenario as an example.
- the embodiments of this application are not limited to application in industrial scenarios, and can also be applied in other scenarios where the publishing load or network load of the publishing end needs to be reduced.
- Figure 3 shows a method for publishing information provided by an embodiment of the present application. As shown in Figure 3, the method includes:
- the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device.
- the first subscription content includes the first subscription service and the first subscription cycle.
- the first subscription content may be sent directly by the first subscribing device to the publishing device, or may be sent by the first subscribing device to other servers in the publishing/subscribing system for processing, and then forwarded by the server to the publishing device.
- the first subscription service may be a field of the subscription service.
- the first subscription content may also include identification information of the first subscribing device, which may be an IP address, a user ID, etc., so that the publishing device publishes information to the first subscribing device based on the identification information.
- the publishing device can be a terminal device or a server.
- the publishing device is used to publish the content subscribed by the subscribing device.
- the publishing device can obtain the content that needs to be published from other devices directly or through a program interface.
- the content that needs to be published can be production environment indicators such as temperature and humidity. This indicator can be directly obtained through sensors and processed to a certain extent, and then transmitted to the publishing device, so that the publishing device can use different data according to the subscription. requirements for terminal equipment.
- the first subscribing device may correspond to the subscribing device, and the subscribing device may be a separate device, such as a mobile terminal such as a mobile phone or a computer, or the device corresponding to the publishing device may be the same device, for example, the publishing device and the publishing device.
- the subscriber device corresponds to two modules or units of the same device.
- the first subscription content includes a first subscription service and/or a first subscription cycle, and the first subscription service is the content subscribed by the subscribing device.
- the first subscription content can be regularly subscribed by the system, such as monitoring the parameters of the production environment within a specified period of time through a program; the first subscription content can be manually subscribed by technicians or managers, for example, through The publish/subscribe system subscribes to the production parameters that you want to view or manage, etc.
- the first subscription service may be a single piece of information or multiple pieces of information, for example, it may be a single ambient temperature or a combination of ambient temperature and humidity.
- the first subscription period is the period that needs to be published. This period can be set according to experience or according to the needs of managers.
- a smaller release cycle can be set, such as 5 minutes, so that the production system or staff can detect parameter changes in a timely manner and make certain adjustments to ensure the relatively stable operation of the production environment or system.
- the publishing device can add subscribing devices with similar subscription contents to a subscription group based on the subscription content of the subscribing device.
- the publishing device obtains the first subscription content from the first subscribing device.
- the Get can be understood as receiving or determining.
- the first subscribing device can directly send the services and subscription cycles that need to be subscribed to the publishing device.
- the first subscription business and the first subscription cycle can be sent to the publishing device through fields or identification information in one message or divided into multiple messages.
- the information sent by the end device or the subscribing end device requires further processing or determination by the publishing end device to obtain the first subscription content of the first subscribing end device, such as decoding or further processing.
- the publishing end device determines the first subscription group to which the first subscribing end device belongs based on the first subscription content of the first subscribing end device, including: the publishing end device determines the first subscription group to which the first subscribing end device belongs based on the first subscription content of the first subscribing end device.
- Describing the first subscription content Determine at least one matching degree, the at least one matching degree being the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group, and the reference content of each subscription group includes each of the Reference subscription service and/or reference subscription cycle of a subscription group; the publishing device determines the first subscription group to which the first subscribing device belongs based on the at least one matching degree.
- the matching degree may be equivalent to the similarity between the first subscription content and the reference content of at least one subscription group. Specifically, it may be the similarity between the first subscription period and the reference subscription period of at least one subscription group and/ Or the similarity between the first subscription service and the reference subscription service of at least one subscription group.
- the deviation between the subscription contents of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription contents include subscription cycles and/or subscription services; 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 a second preset threshold.
- the deviation of the subscription content between the subscribing devices in the first subscription group is less than or equal to the first preset threshold or the reference subscription of each subscribing device in the first subscription group and the first subscription group.
- the deviation between the content 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 degree of similarity, thereby facilitating subsequent publishing to the first subscription group.
- 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.
- the at least one subscription group may be at least one subscription group that the publisher device has established based on the subscriber device that has subscribed. When the first subscriber device subscribes, it is necessary to combine the first subscription content of the first subscriber device with the existing subscriber device.
- the reference subscription content of at least one subscription group is compared to determine a matching degree between the first subscription content of the first subscribing device and the reference subscription content of each subscription group of the at least one subscription group.
- 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.
- the subscription group is the first subscription group.
- the multiple subscription groups include the first subscription group.
- this one subscription group can be the first subscription group, so that the publishing device can add the first subscribing device to the first subscribing device according to the matching degree.
- the terminal device joins the first subscription group.
- the matching degree with the first subscription terminal device is greater than the first preset threshold, such as the first subscription group, the second subscription group, the third subscription group and the first subscription terminal.
- the matching degrees of the devices are all greater than the first preset threshold.
- the publishing end device may first determine that the matching degree between the first subscription group and the first subscribing end device is greater than the preset threshold when determining the matching degree, that is, stop calculating the matching degree between other subscription groups and the first subscribing end device. This reduces the overhead in matching degree calculation and directly adds the first subscribing device to the first subscription group.
- the first subscription group may be the first subscription group for which the publishing device calculates the matching degree, so that the publishing device only calculates one matching degree; the first subscription group may also be the Nth matching degree for which the publishing device calculates the matching degree ( N>1), so the publishing device calculates N matching degrees when determining the first subscription group to which the first subscribing device belongs.
- the publisher device can also calculate the matching degree between all existing subscription groups and the first subscriber device. Select the first subscription group with the highest matching degree among the candidate subscription groups (such as the first subscription group, the second subscription group, and the third subscription group) whose allocation degree is greater than the preset threshold, thereby adding the first subscribing device to the first subscription group.
- this method of adding the first subscribing device to the subscription group with the highest matching degree can improve the similarity of the subscription services of the subscribing devices in each subscription group and reduce the publishing overhead.
- 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.
- the method before determining the first subscription group to which the first subscribing device belongs, the method further includes: the publishing device establishing the first subscription group.
- the matching degree between any one of the at least one subscription group and the first subscriber device is less than the preset threshold, that is, when at least one subscription group is a subscription group, the subscription group is not the first subscription group, When at least one subscription group is multiple subscription groups, the multiple subscription groups do not include the first subscription group. Therefore, the publishing device can newly establish the first subscription group, and the publishing device can add the first subscribing device to the newly established first subscription group.
- the publishing device may also determine the matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group.
- the second subscription content includes the second subscription service and/or the third Two subscription cycles
- the reference content of the first subscription group includes the reference subscription service and/or the reference subscription cycle of the first subscription group
- the reference subscription service of the first subscription group is the first subscription service
- the third The reference subscription period of a subscription group is the first subscription period.
- the publishing device obtains the second subscription content of the second subscribing device, so that the publishing device can compare the second subscription content with the reference content of multiple subscription groups including the first subscription group.
- the first subscription group may be established after the first subscriber device does not have a suitable matching group, and the first subscriber device is the first member of the first subscription group, so that after the first subscription group is established , when comparing other subscriber devices with the first subscription group, the reference content of the first subscription group needs to be determined.
- the reference content of the first subscription group may be consistent with its first member.
- the first subscription service may be set as the reference subscription service of the first subscription group
- the first subscription period may be set as the reference subscription period of the first subscription group, Therefore, when subsequent subscriber devices perform matching calculations with the first subscription group, they will use the reference subscription content as a basis for matching calculations.
- the reference content of the first subscription group can also be determined by the publishing device based on the subscription services of its previous members. 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 of each subscription group The period is not updated and is consistent with the subscription period of the first member, while the reference subscription business can be updated within a certain range. That is, the reference subscription period of a subscription group is the subscription period of its first subscribing member, and the subscription business sets the reference subscription number, so that when the first subscribing member's subscription business is too small, it can be appropriately updated based on the subsequent member's subscription business.
- the reference subscription services will no longer be updated after the Xth member joins.
- the number of reference subscriptions can be set to 4, so that if the number of subscriptions of the first subscribing device is 1 and the number of reference subscription services is 1, when the second subscribing device joins, the number of new subscription services relative to the reference subscription service will be is 2, so the number of reference subscription services becomes 3, and the number of new subscription services of the third subscription terminal device relative to the current reference subscription service is 2, so the number of reference subscription services becomes 5>4,
- the reference subscription business will no longer be updated. Then the matching degree with other subscriber devices can be calculated based on the reference subscription service and reference subscription period.
- the reference content of the first subscription group can also be preset. For example, when the subscription business of the subscribing device in the subscription publishing system is relatively stable, multiple subscription groups can be preset based on experience, thereby assigning the subscribing device to the preset of Subscription group.
- the reference subscription content of the subscription group can also be set in other ways. This is concise and will not be described in detail.
- a is the subscription cycle weight
- b is the subscription service weight
- X is the overlap rate of the first subscription cycle and the reference subscription cycle
- Y is the overlap rate of the first subscription service and the reference subscription service.
- a*X is the matching degree of the subscription business cycle
- b*Y is the matching degree of the subscription period.
- the total matching degree can be obtained by adding the two items.
- the matching can be adjusted by controlling the preset threshold size. the degree of strictness. Since the maximum value of X and Y is both 1 and the minimum value is 0, the variation range of S is 0 ⁇ a+b. When the preset threshold is larger, the matching condition is higher. For example, when the preset threshold is set to When a+b, the subscription services and subscription cycles of all subscribing devices in the subscription group are the same.
- the subscription cycle weight a is 1, the subscription business weight b is 0.5, the preset threshold is set to 1, the reference subscription cycle of a certain subscription group is 1s, and the reference subscription business is ⁇ data 1, data 2, data 3, data 4 ⁇ , the total number of reference subscription services is 4.
- the first subscription period of the first subscribing terminal device is 2s, and the first subscription service of the first subscribing terminal device is ⁇ data 2, data 3, data 5 ⁇ , then the overlap rate Y of the first subscription service and the reference subscription service can be passed
- the first subscriber device fails to match the subscription group and needs to continue to match other subscription groups or re-establish the subscription group.
- the subscription period weight a is 1, the subscription service weight b is 0.5, the preset threshold is set to 1, the reference subscription period of another subscription group is 2s, the reference subscription service is ⁇ data 2, data 3, data 5 ⁇ , and the reference subscription period is ⁇ data 2, data 3, data 5 ⁇ .
- the above method of calculating the matching degree is only a schematic illustration, and the embodiment of the present application does not limit the specific method of calculating the matching degree.
- X in the matching degree formula it can be calculated within a certain period of time (such as the (the least common multiple of a subscription period and the reference subscription period), the ratio of the number of overlapping publications to the total number of publications.
- X is at most 1/2, and is the same as described above
- this calculation method can make the first subscription period different from the reference subscription period, but publishing according to the first subscription period can overwrite Covers all situations at which time points are published according to the reference subscription cycle.
- the reference subscription period of a certain subscription group is 2s
- the subscription period of subscriber device 1 is 2s
- the subscription period of subscriber device 2 is 1s
- the reference subscription period and subscriber device are considered 1 and within the least common multiple of the reference subscription cycle and the cycle of the subscriber device 2, that is, within 2 seconds, according to method 1, that is, the number of overlaps published between the first subscription cycle and the reference subscription cycle is equal to the number of times that needs to be published according to the reference subscription cycle
- the matching degree can also be calculated by comparing the subscription service of the subscribing device and the reference subscription service of the subscription group. ; Or use the subscription cycle of the subscriber device to compare with the reference subscription cycle to calculate the matching degree.
- the above two methods can also achieve the same effect by adjusting the weight in the previous matching degree calculation formula. However, for the publishing side, adjusting the weight to 0 is compared with matching only the subscription cycle or subscription business. The load may be larger.
- the publishing device can send feedback information to the subscribing device.
- the subscribing device receives a reply from the publishing device.
- the feedback information may include information indicating successful subscription and the multicast address of the subscription group to which the subscribing device belongs.
- the multicast addresses in the feedback information are also different.
- Figure 4 shows a schematic flow chart of the grouping method in the subscription process provided by the embodiment of the present application. As shown in Figure 4, the method includes:
- S410 The subscribing device sends a subscription request to the publishing device.
- S420 The publishing device determines whether the subscription request meets the matching degree of the existing subscription group.
- the publishing device determines that the subscription request of the subscribing device does not meet the matching degree of the existing subscription group, the publishing device creates a subscription group based on the current subscription content, and adds the subscribing device to the created subscription group, and Send feedback information to the subscribing device.
- the subscribing device may cancel the subscription.
- the embodiment of the present application also provides a method for canceling the subscription by the subscribing device.
- the method includes: the publishing end device obtains unsubscription information from the first subscribing end device, and the unsubscription information is used to unsubscribe from the first subscription content; the publishing end device The device moves the first subscribing device out of the first subscription group.
- the unsubscription information may include identification information of the first subscribing device.
- the publishing device obtains the unsubscribing information, it moves the corresponding subscribing device out of the first subscription group in which it is located.
- feedback information can be sent to the first subscribing device for sending the first subscribing device to the first subscribing device. Notification unsubscription successful.
- the publisher device can determine whether there are other subscriber devices in the first subscription group.
- the publishing device determines that there are other subscribing devices in the first subscription group, and the publishing device can update the publishing mode corresponding to the first subscription group.
- the publishing device determines that there are no other subscribing devices in the first subscription group, and the publishing device can delete the first subscription group, thereby reducing the cost of maintaining the subscription group by the publishing device.
- Figure 5 shows the processing method for unsubscription provided by the embodiment of this application. As shown in Figure 5, the method includes:
- S510 The subscribing device sends an unsubscription request to the publishing device.
- S520 The publisher device removes the subscriber device from the subscription group.
- the publishing device sends feedback information to the subscribing device to report successful cancellation of the subscription.
- S540 The publishing device determines whether there are other subscribing devices in the subscription group.
- S550 The publisher device determines that there is no other subscriber device in the subscription group, and deletes the subscription group.
- the publishing device can dynamically maintain multiple subscription groups, and set the subscribing devices with similar subscription contents into a subscription group, so that the publishing device can adjust the subscriptions of multiple subscribing devices in the subscription group. content and publish it.
- the publishing device determines a publishing policy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish subscription services.
- the technical solution adopted in the embodiment of this application is to reduce the load of the publishing end device and the network load, and dynamically decide the publishing method to be used for the same subscription group, that is, for A subscription group determines the publishing method based on the number of subscriber devices that need to publish subscription services.
- the publishing method that the more than one subscriber device needs to publish have overlapping content, the union of the subscription services of the more than one subscriber device may be smaller than when sending them individually.
- the technical solution provided by the embodiments of this application can estimate the data volume of information to be published for all subscribing devices in the subscription group, and select a method with a smaller data volume for publishing.
- 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 the first subscription in the first period When only one subscriber device in the group has content that needs to be published, the publisher device determines to perform unicast publishing in the first period; or, when there are at least two subscribers in the first subscription group in the first period When the device has subscription services that need to be published, the publishing end device determines to perform multicast publishing in the first period.
- the publishing method is dynamically adjusted according to the number of subscribing devices that need to publish for a certain period or time point (moment). That is, during a period when only one subscribing device needs to publish, unicast publishing is used. Multicast publishing is used for a period of time that needs to be published.
- the publishing strategy is simple, which facilitates the publishing device to dynamically adjust the publishing strategy, and the load when implementing the publishing strategy is small.
- multicast publication is performed only when the number of subscriber devices that need to publish is greater than a threshold. Since when the number of publishing devices is greater than the threshold, there may be more devices that need to publish during this time period or moment, the multicast publishing method can further reduce the publishing load and network load of the publishing device.
- the sum of the data sizes for unicast publishing for the at least two subscribing end devices is greater than the size of the data for multicast publishing for the at least two subscribing end devices.
- the data is large Small.
- the server can further estimate the sum of the data sizes for unicast release for the at least two subscriber numbers and for the subscriber.
- the publishing load and network load of the publishing end device can be further reduced, and the publishing strategy can be optimized.
- the first subscribing period of the first subscribing device is 2s.
- the business is ⁇ data 2, data 3, data 5 ⁇ ; the second subscription period of the second subscriber device is 1s, and the second subscription business is ⁇ data 1, data 2, data 3, data 4 ⁇ ; the third subscriber device
- the third subscription period is 4s, the third subscription business is ⁇ data 2, data 3, data 5 ⁇ , the set subscription cycle weight a is 1, the subscription business weight is 0.5, the preset threshold of the matching degree is 1, and the three Among the subscriber devices, the first subscriber device is the first to enter the subscription group.
- a third subscriber device can be added to the subscription group.
- the size of ⁇ data1, data2, data3, data4 ⁇ is 80 bytes
- the size of ⁇ data2, data3, data5 ⁇ is 60 bytes
- ⁇ data1, data2, data3, data4 the size of data 5 ⁇ is 100 bytes.
- the publishing device needs to publish the size
- the publishing device needs to send ⁇ data 1, data 2, data 3, data 4, data 5 ⁇ every 1 second, so the size of the publication needs to be
- a dynamic decision-making method can be adopted. For example, since only the second subscriber device needs to publish at 1s and 3s, unicast publishing ⁇ data 1, data 2, data 3, data 4 can be performed to the second subscriber device ⁇ , at 2s, the first subscribing device and the second subscribing device need to publish, using the multicast publishing method, send the union of the subscription services of the first subscribing device and the second subscribing device ⁇ data 1, data 2, data 3. Data 4, data 5 ⁇ . At the 4th second, the first subscribing device, the second subscribing device and the third subscribing device all need to be published. The union of the subscription services of the three subscribing devices can be multicasted ⁇ data 1, data 2, data 3, data 4, data 5 ⁇ , thus the final size that needs to be published
- the publishing method using the technical solution of this application publishes the smallest data, and can effectively reduce the publishing load and network load of the publishing end device.
- All subscribing devices in the subscription group can monitor the unicast channel and multicast channel to obtain the data published by the publishing device, and demodulate to obtain the data they need.
- Figure 6 shows a device 600 for publishing information provided by an embodiment of the present application.
- the device 600 may be a publishing end device, or may be a device in the publishing end device, corresponding to the publishing end device in the methods in Figures 3 to 5.
- the apparatus 600 for publishing information includes: a processing unit 610, configured to determine the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, where the first subscription content includes a first subscription service and/or the first subscription period; the processing unit 610 is also configured to determine a publishing strategy for the first subscription group according to the number of subscriber devices in the first subscription group that need to publish subscription services in the first period , the all subscriber devices include the first subscriber device.
- the apparatus 600 for publishing information includes a processing unit 610.
- the processing unit 610 adds the first subscribing device to the appropriate first subscription group according to the first subscription content of the first subscribing device, and adds the first subscribing device to the appropriate first subscription group according to the first subscribing content.
- the subscription contents of all subscribing devices in the subscription group that is, based on the number of subscribing devices that need to publish and subscribe services, dynamically adjust the publishing method of the publishing device to reduce the publishing load and network load of the publishing device.
- the device further includes a transceiver unit 620, which is further configured to send first feedback information to the first subscriber device, where the first feedback information includes the multicast address of the first subscription group to which it belongs. .
- the deviation between the subscription contents of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription contents include subscription cycles and/or subscription services; 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.
- the processing unit 610 is specifically configured to: determine at least one matching degree based on the first subscription content, where the at least one matching degree is the first subscription content and at least one subscription group
- the matching degree of the reference content of each subscription group, the reference content of each subscription group includes the reference subscription service and/or reference subscription cycle of each subscription group; according to the at least one matching degree, determine the The first subscription group to which the first subscriber device belongs.
- 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.
- 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.
- the processing unit 610 is also used to establish the First subscription group.
- the processing unit 610 is also used to determine the matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group, where the second subscription content includes the third Two subscription services and/or a second subscription period, the reference content of the first subscription group includes the reference subscription service and/or the reference subscription period of the first subscription group, and the reference subscription service of the first subscription group is the second subscription service.
- a subscription service, the reference subscription period of the first subscription group is the first subscription period.
- a is the subscription cycle weight
- b is the subscription service weight
- X is the overlap rate of the first subscription cycle and the reference subscription cycle
- Y is the overlap rate of the first subscription service and the reference subscription service.
- the sum of the sizes of data published by unicast for the at least two subscribing devices is greater than the data size published by multicast for the at least two subscribing devices. size.
- the transceiver unit 620 is also used to obtain unsubscription information from the first subscribing device, and the unsubscription information is used to unsubscribe from the first subscription content; the processing Unit 610 is also used to remove the first subscriber device from the first subscription group.
- the processing unit 610 is further configured to: determine that there is no subscribing device in the first subscription group; and delete the first subscription group.
- FIG. 7 shows a device 700 for publishing information provided by an embodiment of the present application.
- the device 700 for publishing information includes: a processor 720 .
- the processor 720 is used to implement corresponding control management operations.
- the processor 720 is used to support the device 700 for publishing information to perform the methods, operations or functions of the foregoing embodiments.
- the device 700 for publishing information may also include: a memory 710 and a communication interface 730; the processor 720, the communication interface 730, and the memory 710 may be connected to each other or connected to each other through a bus 740.
- the communication interface 730 is used to support the communication between the device 700 for publishing information and the subscribing device, etc.
- the memory 710 is used to store the program code and data of the device 700 for publishing information.
- the processor 720 calls the code or data stored in the memory 710 to implement corresponding operations.
- the memory 710 may or may not be coupled with the processor. Coupling in the embodiments of this application is an indirect coupling or communication connection between devices, units or modules that publish information. It can be in electrical, mechanical or other forms and is used for information between devices, units or modules that publish information. Interaction.
- the processor 720 may 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 devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with this disclosure.
- the processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on.
- Communication interface 730 may be a transceiver, circuit, bus, module, or other type of communication interface.
- the bus 740 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
- PCI peripheral component interconnect
- EISA extended industry standard architecture
- the bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 7, but it does not mean that there is only one bus or one type of bus.
- At least one refers to one or more, and “plurality” refers to two or more.
- “And/or” describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
- the character “/” generally indicates that the related objects are in an "or” relationship.
- “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c An item (item) can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
- the disclosed systems, devices and methods can be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented.
- the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
- the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
- the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
- the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
- the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. .
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Embodiments of the present application provide an information release method and apparatus. The method comprises: a release end device determines, 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 service and/or a first subscription period; and the release end device determines a release strategy for the first subscription group according to the number of subscription end devices needing to release subscription service in the first subscription group. According to the information release method and apparatus provided by the present application, different subscription end devices are added into a subscription group, and a release mode is dynamically adjusted according to the number of subscription end devices needing to release subscription service, so that the release load and the network load of the release end device can be effectively reduced.
Description
本申请要求于2022年05月30日提交中国专利局、申请号为202210601457.2、申请名称为“发布信息的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the China Patent Office on May 30, 2022, with the application number 202210601457.2 and the application title "Method and Device for Publishing Information", the entire content of which is incorporated into this application by reference.
本申请实施例涉及数据管理领域,尤其涉及一种发布信息的方法和装置。The embodiments of the present application relate to the field of data management, and in particular, to a method and device for publishing information.
基于通信网络的发布/订阅系统应用日益广泛,订阅端设备向系统发送订阅请求,订阅需要关注的信息,发布端设备可以根据订阅请求发布对应的信息。Publish/subscribe systems based on communication networks are increasingly widely used. The subscribing device sends a subscription request to the system to subscribe for information that needs attention. The publishing device can publish the corresponding information based on the subscription request.
现有的发布方式一般为单播发布或组播发布,对于单播发布方式,随着订阅端设备数量的增加,发布端设备需要发布大量重复的数据,负载较大。对于组播方式,发布端设备需要按照组播组内最小订阅周期发送所有订阅端设备的订阅内容的并集,随着发布频率的提高,发布端设备的发布负载和网络负载较高。Existing publishing methods are generally unicast publishing or multicast publishing. For unicast publishing, as the number of subscribing devices increases, the publishing device needs to publish a large amount of repeated data, resulting in a heavy load. For multicast mode, the publishing device needs to send the union of the subscription contents of all subscribing devices according to the minimum subscription period in the multicast group. As the publishing frequency increases, the publishing load and network load of the publishing device are higher.
如何减小发布/订阅系统中发布端设备和网络的负载,成为亟待解决的问题。How to reduce the load on the publishing device and network in the publish/subscribe system has become an urgent problem to be solved.
发明内容Contents of the invention
本申请实施例提供一种发布信息的方法和装置,能够有效降低发布端设备和网络在信息发布时的负载。The embodiments of this application provide a method and device for publishing information, which can effectively reduce the load on the publishing end device and the network when publishing information.
第一方面,提供了一种发布信息的方法,包括:发布端设备根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,所述第一订阅内容包括所述第一订阅端设备的第一订阅业务和/或第一订阅周期;所述发布端设备根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。In a first aspect, a method for publishing information is provided, including: the publishing device determines a first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, and the first subscription The content includes the first subscription service and/or the first subscription cycle of the first subscribing device; the publishing device determines the number of subscription services for the first subscription device according to the number of subscribing devices in the first subscription group that need to publish the subscription service. Publishing strategy for the first subscription group.
在该实施例中,发布端设备根据订阅端设备的第一订阅业务和/或第一订阅周期,第一订阅周期可以是第一订阅业务的订阅周期,将第一订阅端设备加入第一订阅组。从而可以结合第一订阅内容和第一订阅组其他订阅端设备的订阅内容,获得需要发布的订阅端设备的数目,从而确定针对第一订阅组的发布策略。由于不同时刻需要发布的订阅端设备的数目是变化的,发布策略也可以动态更新,通过根据需要发布订阅业务的订阅端设备的数目动态调整发布策略,减小发布时发布端设备的发布开销和网络负载。In this embodiment, the publishing device adds the first subscribing device to the first subscription according to the first subscription service and/or the first subscription period of the subscribing device. The first subscription period may be the subscription period of the first subscription service. Group. Therefore, the first subscription content and the subscription content of other subscriber devices in the first subscription group can be combined to obtain the number of subscriber devices that need to be published, thereby determining a publishing strategy for the first subscription group. Since the number of subscribing devices that need to publish changes at different times, 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 subscription services, the publishing overhead and the publishing cost of the publishing device during publishing can be reduced. Network load.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:发布端设备获取来自第一订阅端设备的第一订阅内容。With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing device obtains the first subscription content from the first subscribing device.
在该实施例中,发布端从第一订阅端设备获取第一订阅内容,从而根据该第一订阅内容将第一订阅端设备分入合适的订阅组中,并制定相应的发布策略。In this embodiment, the publishing end obtains the first subscription content from the first subscribing end device, thereby classifying the first subscribing end device into an appropriate subscription group based on the first subscription content, and formulating a corresponding publishing policy.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述发布端设备向
所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所属第一订阅组的组播地址。With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing device sends a message to The first subscribing device sends first feedback information, where the first feedback information includes the multicast address of the first subscription group to which it belongs.
在该实施例中,发布端设备在将第一订阅端设备加入第一订阅组后,即可以向第一订阅端设备发送第一反馈信息,反馈信息中可以包括第一订阅端设备所属的第一订阅组的组播地址,从而第一订阅端设备可以根据该第一反馈信息,监听对应的组播通道,获得其订阅的第一订阅内容。In this embodiment, after the publishing device adds the first subscribing device to the first subscription group, it can send the first feedback information to the first subscribing device. The feedback information may include the first subscribing device to which the first subscribing device belongs. A multicast address of a subscription group, so that the first subscribing device can monitor the corresponding multicast channel according to the first feedback information and obtain the first subscription content it subscribes to.
结合第一方面,在第一方面的某些实现方式中,所述第一订阅组中任意两个订阅端设备的订阅内容之间的偏差小于或等于第一预设阈值,该订阅内容包括订阅周期和/或订阅业务;或者,所述第一订阅组中每个订阅端设备与所述第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值。With reference to the first aspect, in some implementations of the first aspect, the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
在该实施例中,第一订阅组内的订阅端设备之间的订阅内容的偏差小于或等于第一预设阈值或者第一订阅组中每个订阅端设备与该第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值,意味着该第一订阅组中的各个订阅端设备的订阅内容有一定的相似度,从而便于后续针对第一订阅组进行发布。为了实现这一目标,例如可以通过设置任意两个订阅端设备的订阅内容偏差的第一预设阈值或者设置订阅端设备与第一订阅组的参考订阅内容偏差的第二预设阈值,并分别针对上述两种方法可以设置不同的偏差确定方式,例如可以通过针对两种方法设置不同的偏差计算方法。In this embodiment, the deviation of the subscription content between the subscribing devices in the first subscription group is less than or equal to the first preset threshold or the reference subscription of each subscribing device in the first subscription group and the first subscription group. The deviation between the content 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 degree of similarity, thereby facilitating subsequent publishing to the first subscription group. In order to achieve this goal, for example, you can set a first preset threshold for the deviation of the subscription content of any two subscriber devices or set a second preset threshold for the deviation of the reference subscription content between the subscriber device and the first subscription group, and respectively 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.
结合第一方面,在第一方面的某些实现方式中,所述发布端设备根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,包括:所述发布端设备根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;所述发布端设备根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。With reference to the first aspect, in some implementations of the first aspect, the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, including: The publishing device determines at least one matching degree based on the first subscription content, where the at least one matching degree is a 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/or reference subscription cycle of each subscription group; the publishing device determines the first subscribing device to which the first subscribing device belongs based on the at least one matching degree. First subscription group.
在该实施例中,发布者根据第一订阅内容,确定第一订阅内容与已经存在的至少一个订阅组的参考订阅内容的匹配度,并且最终根据该至少一个匹配度,将第一订阅端设备加入第一订阅组,从而第一订阅组中包括第一订阅端设备的所有订阅端设备的订阅内容是有一定相似度的,利于对该订阅组进行组播发布,减小发布端设备的发布负载和网络负载。In this embodiment, the publisher determines the matching degree between the first subscription content and the reference subscription content of at least one existing subscription group based on the first subscription content, and finally, based on the at least one matching degree, the first subscribing device Join the first subscription group, so that the subscription contents of all subscribing devices in the first subscribing group including the first subscribing device have a certain degree of similarity, which is conducive to multicast publishing of the subscription group and reduces the publishing of the publishing device. load and network load.
结合第一方面,在第一方面的某些实现方式中,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。With reference to the first aspect, in some implementations of the first 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. .
在该实施例中,第一订阅端设备加入的第一订阅组是已经存在的至少一个订阅组中的订阅组,并且第一订阅组对应的匹配度的计算值大于预设阈值,从而第一订阅端设备与第一订阅组的匹配程度较高,减小发布端设备的发布负载和网络负载。In this embodiment, the first subscription group that the first subscribing device joins is a subscription group in at least one existing subscription group, and the calculated value of the matching degree corresponding to the first subscription group is greater than the preset threshold, so that the first The subscribing device has a higher matching degree with the first subscription group, which reduces the publishing load and network load of the publishing device.
结合第一方面。在第一方面的某些实现方式中,所述第一订阅组对应的匹配度是所述至少一个匹配度中最高的。Combined with the first aspect. In some implementations of the first aspect, the matching degree corresponding to the first subscription group is the highest among the at least one matching degree.
在该实施例中,订阅端设备会将现存的所有订阅组与第一订阅内容的匹配度都计算出来,选取其中匹配度大于或等于预设阈值的若干个订阅组,并选择其中匹配度最大的第一订阅组,确定第一订阅端设备属于该第一订阅组,从而第一订阅端设备与第一订阅组匹配程度足够高,减少发布端设备的负载。In this embodiment, the subscriber device calculates the matching degree between all existing subscription groups and the first subscription content, selects several subscription groups whose matching degree is greater than or equal to the preset threshold, and selects the one with the largest matching degree. The first subscription group determines that the first subscribing device belongs to the first subscription group, so that the matching degree between the first subscribing device and the first subscription group is high enough to reduce the load of the publishing device.
结合第一方面,在第一方面的某些实现方式中,所述第一订阅组不是所述至少一个订
阅组中的订阅组,所述至少一个匹配度均小于预设阈值,在所述发布端设备根据所述第一订阅内容,确定所述第一订阅端设备所属的第一订阅组之前,所述方法还包括:所述发布端设备建立所述第一订阅组。In conjunction with the first aspect, in some implementations of the first aspect, the first subscription group is not the at least one subscription group. For a subscription group in a reading group, the at least one matching degree is less than a preset threshold, and before the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content, the The method further includes: the publishing device establishing the first subscription group.
在该实施例中,由于已经建立的至少一个订阅组的参考订阅内容与第一订阅端设备的第一订阅内容的匹配度均小于预设阈值,发布端设备新建立第一订阅组,并在接下来对其他订阅端设备的匹配过程中使用包括第一订阅组在内的所有订阅组进行匹配。In this embodiment, since the matching degree between the reference subscription content of at least one subscription group that has been established and the first subscription content of the first subscribing device is less than the preset threshold, the publishing device newly establishes the first subscription group, and in Next, all subscription groups including the first subscription group are used for matching in the matching process of other subscriber devices.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:发布端设备确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括所述第二订阅端设备的第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing device determines a matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group, The second subscription content includes the second subscription service and/or the second subscription cycle of the second subscribing device, and the reference content of the first subscription group includes the reference subscription service and/or reference subscription of the first subscription group. period, 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.
在该实施例中,第二订阅端设备订阅时,发布端设备会将第二订阅内容与包括第一订阅组在内的所有订阅组的参考订阅内容进行匹配度计算。对于第一订阅组来说,其参考订阅内容是其第一个订阅端设备成员—第一订阅端设备的第一订阅内容,发布端设备将第二订阅内容与该参考订阅内容的匹配度进行计算,从而最终确定是否将第二订阅端设备加入第一订阅组。In this embodiment, when the second subscribing device subscribes, the publishing device calculates the matching degree between the second subscription content and the reference subscription content of all subscription groups including the first subscription group. For the first subscription group, its reference subscription content is the first subscription content of its first subscriber device member—the first subscriber device. The publisher device matches the second subscription content with the reference subscription content. Calculation is performed to finally determine whether to add the second subscriber device to the first subscription group.
结合第一方面,在第一方面的某些实现方式中,所述匹配度S的计算方式如下:
S=a*X+b*Y,Combined with the first aspect, in some implementations of the first aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
S=a*X+b*Y,Combined with the first aspect, in some implementations of the first aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
在该实施例中,订阅端设备的订阅内容与订阅组的参考订阅内容的匹配度通过订阅业务和订阅周期的匹配度之和计算,从而有效减小发布端设备的发布负载和网络负载。In this embodiment, the matching degree between the subscription content of the subscribing device and the reference subscription content of the subscription group is calculated by the sum of the matching degrees of the subscription business and the subscription period, thereby effectively reducing the publishing load and network load of the publishing device.
结合第一方面,在第一方面的某些实现方式中,所述发布端设备根据所述第一订阅组中需要发布的订阅端设备的数目,确定针对所述第一订阅组的发布策略,包括:当第一时段第一订阅组中只有一个订阅端设备有需要发布的内容时,所述发布端设备确定在所述第一时段进行单播发布;或者,当第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,所述发布端设备确定在所述第一时段进行组播发布。In conjunction with the first aspect, in some implementations of the first aspect, the publishing device determines a publishing strategy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish, Including: when only one subscriber device in the first subscription group in the first period has content that needs to be published, the publishing device determines to perform unicast publishing in the first period; or, when the first subscription group in the first period When at least two subscribing devices have subscription services that need to be published, the publishing device determines to perform multicast publishing in the first period.
在该实施例中,发布端设备最终确定的发布策略中,单播发布时段需要发布的订阅端设备仅有一个,而组播发布的时段需要发布的订阅端设备有至少两个,并且能够根据订阅组内需要发布的订阅端设备的个数调整发布的内容,减小发布端设备的负载和网络负载,该时段也可以理解为时刻或时间点。In this embodiment, in the publishing strategy finalized by the publishing device, there is only one subscribing device that needs to publish during the unicast publishing period, and there are at least two subscribing devices that need to publish during the multicast publishing period, and it can be based on The number of subscriber devices that need to be published in the subscription group adjusts the published content to reduce the load of the publisher device and the network load. This period can also be understood as a moment or a point in time.
结合第一方面,在第一方面的某些实现方式中,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。In conjunction with the first aspect, in some implementations of the first aspect, in the first period, the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices. The data size for multicast publishing by the end device.
在该实施例中,对于组播发布的时间段或时刻,发布端设备会计算或预估至少两个订阅端设备进行单播发布的数据大小之和与针对至少两个订阅端设备进行组播发布的数据大小,且进行组播发布的数据大小更小,因此使用组播发布,根据需要发布的数据量大小动态调整发布方式,能够减小发布端负载和网络负载。In this embodiment, for the time period or moment of multicast publishing, the publishing device calculates or estimates the sum of the data sizes for unicast publishing by at least two subscribing devices and the sum of the data sizes for multicasting by at least two subscribing devices. The size of published data, and the size of data published by multicast is smaller, so using multicast publishing and dynamically adjusting the publishing method according to the amount of data to be published can reduce the load on the publishing end and the network load.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述发布端设备获
取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;所述发布端设备将所述第一订阅端设备移出所述第一订阅组。With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing device obtains Obtain unsubscription information from the first subscribing device, the unsubscribing information is used to unsubscribe the first subscription content; the publishing device moves the first subscribing device out of the first subscription group .
在该实施例中,发布端设备接收第一订阅端设备的取消订阅信息,用于取消订阅第一订阅内容,发布端设备根据该信息将第一订阅端设备移出第一订阅组。In this embodiment, the publishing device receives unsubscription information from the first subscribing device to unsubscribe from the first subscription content, and the publishing device moves the first subscribing device out of the first subscription group based on the information.
结合第一方面,在第一方面的某些实现方式中,所述方法还包括:所述发布端设备确定所述第一订阅组中不存在订阅端设备;所述发布端设备删除所述第一订阅组。With reference to the first aspect, in some implementations of the first aspect, the method further includes: the publishing device determines that there is no subscribing device in the first subscription group; the publishing device deletes the third A subscription group.
在该实施例中,发布端设备在将第一订阅端设备移出第一订阅组后,确定第一订阅组内的订阅端设备的数量,在第一订阅组中不存在其他订阅端设备,将第一订阅组删除。即在第一订阅组内不存在订阅端设备时,将第一订阅组删除。从而减小发布端设备对第一订阅组信息的存储负载,动态建立或删除订阅组能够使得本申请实施例提供的技术方案具有更好的实施效果,减小发布端设备的负载。In this embodiment, after the publisher device moves the first subscriber device out of the first subscription group, it determines the number of subscriber devices in the first subscription group. There are no other subscriber devices in the first subscription group. The first subscription group is deleted. That is, when there is no subscribing device in the first subscription group, the first subscription group is deleted. Thereby reducing the storage load of the first subscription group information on the publishing device, and dynamically establishing or deleting the subscription group can make the technical solutions provided by the embodiments of this application have better implementation effects and reduce the load on the publishing device.
第二方面,提供了一种发布信息的装置,包括:处理单元,用于根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,所述第一订阅内容包括第一订阅业务和/或第一订阅周期,第一订阅周期可以是第一订阅业务的订阅周期;所述处理单元,还用于根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。In a second aspect, an apparatus for publishing information is provided, including: a processing unit configured to determine a first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, and the third A 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 also configured to publish the subscription service according to the needs of the first subscription group The number of subscriber devices determines the publishing strategy for the first subscription group.
在该实施例中,发布信息的装置包括处理单元,处理单元根据第一订阅内容,将第一订阅端设备加入合适的第一订阅组中,并根据第一时段第一订阅组的中有需要发布的订阅内容的订阅端设备的数目,确定针对第一订阅组的发布策略,从而可以动态调整发布策略,减轻发布端设备的发布负载和网络负载。In this embodiment, the device for publishing information includes a processing unit. The processing unit adds the first subscribing device to the appropriate first subscription group according to the first subscription content, and adds the first subscribing device to the appropriate first subscription group according to the needs of the first subscription group during the first period. The number of subscriber devices that publish subscription content determines the publishing strategy for the first subscription group, so that the publishing strategy can be dynamically adjusted to reduce the publishing load and network load of the publishing device.
结合第二方面,在第二方面的某些实现方式中,所述第一订阅组中任意两个订阅端设备的订阅内容之间的偏差小于或等于第一预设阈值,该订阅内容包括订阅周期和/或订阅业务;或者,所述第一订阅组中每个订阅端设备与所述第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值。With reference to the second aspect, in some implementations of the second aspect, the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
结合第二方面,在第二方面的某些实现方式中,所述装置还包括收发单元,用于向所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所属第一订阅组的组播地址。With reference to the second aspect, in some implementations of the second aspect, the apparatus further includes a transceiver unit configured to send first feedback information to the first subscriber device, where the first feedback information includes the first The multicast address of the subscribing group.
结合第二方面,在第二方面的某些实现方式中,所述处理单元,具体用于:根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。With reference to 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, where the at least one matching degree is the first The degree of matching between the subscription content and the reference content of each subscription group in at least one subscription group, the reference content of each subscription group including the reference subscription service and/or reference subscription cycle of each subscription group; according to the At least one matching degree determines the first subscription group to which the first subscriber device belongs.
结合第二方面,在第二方面的某些实现方式中,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。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. .
结合第二方面,在第二方面的某些实现方式中,所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,所述处理单元,还用于建立所述第一订阅组。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, the at least one matching degree is less than a preset threshold, and the processing unit , is also used to establish the first subscription group.
结合第二方面,在第二方面的某些实现方式中,所述处理单元,还用于确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括所述第二订阅端设备的第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括
第一订阅组的参考订阅业务和参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。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 the second subscription content of the second subscribing device and the reference content of the first subscription group, so The second subscription content includes the second subscription service and/or the second subscription cycle of the second subscribing device, and 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.
结合第二方面,在第二方面的某些实现方式中,所述匹配度S的计算方式如下:
S=a*X+b*Y,Combined with the second aspect, in some implementations of the second aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
S=a*X+b*Y,Combined with the second aspect, in some implementations of the second aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
结合第二方面,在第二方面的某些实现方式中,所述处理单元,具体用于:当所述第一时段第一订阅组中只有一个订阅端设备有需要发布的内容时,确定在所述第一时段进行单播发布;或者,当所述第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,确定在所述第一时段进行组播发布。With reference to the second aspect, in some implementations of the second aspect, the processing unit is specifically configured to: when only one subscriber device in the first subscription group in the first period has content that needs to be published, determine whether Unicast publishing is performed in the first period; or, when at least two subscriber devices in the first subscription group in the first period have subscription services that need to be published, it is determined to perform multicast publishing in the first period.
结合第二方面,在第二方面的某些实现方式中,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。In conjunction with the second aspect, in some implementations of the second aspect, in the first period, the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices. The data size for multicast publishing by the end device.
结合第二方面,在第二方面的某些实现方式中,所述收发单元,还用于获取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;所述处理单元,还用于将所述第一订阅端设备移出所述第一订阅组。With reference to the second aspect, in some implementations of the second aspect, the transceiver unit is also used to obtain unsubscription information from the first subscribing end device, and the unsubscription information is used to unsubscribe from the third subscribing device. A subscription content; the processing unit is also configured to remove the first subscribing device from the first subscription group.
结合第二方面,在第二方面的某些实现方式中,所述处理单元,还用于:确定所述第一订阅组中不存在订阅端设备;删除所述第一订阅组。In conjunction with the second aspect, in some implementations of the second aspect, the processing unit is further configured to: determine that there is no subscribing device in the first subscription group; and delete the first subscription group.
第三方面,提供了一种发布端设备,所述发布端设备包括:一个或多个处理器;一个或多个存储器;所述一个或多个存储器存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述一个或多个处理器执行时,使得所述电子设备执行以下步骤:根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,所述第一订阅内容包括第一订阅业务和/或第一订阅周期,第一订阅周期可以是第一订阅业务的订阅周期;根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。In a third aspect, a publishing device is provided. The publishing device includes: one or more processors; one or more memories; the one or more memories store one or more computer programs, and the The one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: determine the first subscription content of the first subscriber device. A first subscription group to which a subscribing device belongs. The first subscription content includes a first subscription service and/or a first subscription period. The first subscription period may be the subscription period of the first subscription service; according to the first subscription The number of subscriber devices in the group that need to publish subscription services determines the publishing strategy for the first subscription group.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:向所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所述第一订阅组的组播地址。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: Send first feedback information, where the first feedback information includes the multicast address of the first subscription group.
结合第三方面,在第三方面的某些实现方式中,所述第一订阅组中任意两个订阅端设备的订阅内容之间的偏差小于或等于第一预设阈值,该订阅内容包括订阅周期和/或订阅业务;或者,所述第一订阅组中每个订阅端设备与所述第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值。In connection with the third aspect, in some implementations of the third aspect, the deviation between the subscription content of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription content includes subscription Periodic and/or subscription services; 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.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: according to the first subscription content, Determine at least one matching degree, the at least one matching degree being the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group, and the reference content of each subscription group includes each of the Reference subscription service and/or reference subscription cycle of a subscription group; determine the first subscription group to which the first subscribing device belongs based on the at least one matching degree.
结合第三方面,在第三方面的某些实现方式中,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。
In conjunction with 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 the matching degree corresponding to the first subscription group is greater than or equal to a preset threshold. .
结合第三方面,在第三方面的某些实现方式中,所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:建立所述第一订阅组。Combined with the third aspect, 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 instruction When executed by the one or more processors, the publishing device is caused to perform the following steps: establishing the first subscription group.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: determine the third subscribing device of the second subscribing device. The matching degree between the second subscription content and the reference content of the first subscription group, the second subscription content includes the second subscription service and/or the second subscription period, and the reference content of the first subscription group includes the first subscription group The reference subscription service and/or the reference subscription period, 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.
结合第三方面,在第三方面的某些实现方式中,匹配度S的计算方式如下:
S=a*X+b*Y,Combined with the third aspect, in some implementations of the third aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
S=a*X+b*Y,Combined with the third aspect, in some implementations of the third aspect, the matching degree S is calculated as follows:
S=a*X+b*Y,
其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:当第一时段第一订阅组中只有一个订阅端设备有需要发布的内容时,确定在所述第一时段进行单播发布;或者,当所述第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,确定在所述第一时段进行组播发布。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: when the first subscription group in the first period When only one subscribing device in the first subscription group has content that needs to be published, it is determined to perform unicast publishing in the first period; or, when there are at least two subscribing devices in the first subscription group in the first period that have subscriptions that need to be published. When providing services, it is determined to perform multicast publishing in the first time period.
结合第三方面,在第三方面的某些实现方式中,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。In conjunction with the third aspect, in some implementations of the third aspect, in the first period, the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscription devices. The data size for multicast publishing by the end device.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:获取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;将所述第一订阅端设备移出所述第一订阅组。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: obtain data from the first subscribing device. Unsubscription information of the device, the unsubscription information is used to unsubscribe the first subscription content; and move the first subscribing device out of the first subscription group.
结合第三方面,在第三方面的某些实现方式中,当所述指令被所述一个或多个处理器执行时,使得所述发布端设备执行以下步骤:确定所述第一订阅组中不存在订阅端设备;删除所述第一订阅组。In conjunction with the third aspect, in some implementations of the third aspect, when the instructions are executed by the one or more processors, the publishing device is caused to perform the following steps: determine the number of members in the first subscription group There is no subscriber device; delete the first subscription group.
第四方面,提供了一种计算机可读存储介质,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行第一方面或第一方面任一种实现方式的方法。A fourth aspect provides a computer-readable storage medium, including a computer program, which when the computer program is run on a computer, causes the computer to execute the method of the first aspect or any implementation of the first aspect.
第五方面,提供了一种发布信息的装置,其特征在于,包括至少一个处理器,所述处理器与存储器耦合,所述存储器用于存储指令,所述指令被所述处理器运行时,使得所述处理器执行第一方面或第一方面任一种实现方式的方法。In a fifth aspect, a device for publishing information is provided, which is characterized in that it includes at least one processor, the processor is coupled to a memory, the memory is used to store instructions, and 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.
第六方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序代码或指令,所述计算机程序代码或指令在计算机上执行时,使得所述计算机执行第一方面或第一方面任一种实现方式的方法。In a sixth aspect, a computer program product is provided. The computer program product includes computer program code or instructions. When the computer program code or instructions are executed on a computer, the computer program code or instructions cause the computer to execute the first aspect or any aspect of the first aspect. A way to do it.
图1是适用于本申请实施例的系统的示意性架构图。
Figure 1 is a schematic architecture diagram of a system suitable for embodiments of the present application.
图2是工业场景下的发布/订阅交互流程示意图。Figure 2 is a schematic diagram of the publish/subscribe interaction process in an industrial scenario.
图3示出了本申请实施例提供的一种发布信息的方法。Figure 3 shows a method for publishing information provided by an embodiment of the present application.
图4示出了本申请实施例提供订阅过程中的一种分组方法的示意性流程图。Figure 4 shows a schematic flow chart of a grouping method in the subscription process provided by this embodiment of the present application.
图5示出了本申请实施例提供取消订阅过程中的处理方法的示意性流程图。Figure 5 shows a schematic flowchart of a processing method in the unsubscription process provided by this embodiment of the present application.
图6示出了本申请实施例提供的一种发布信息的装置。Figure 6 shows a device for publishing information provided by an embodiment of the present application.
图7示出了本申请实施例提供的另一种发布信息的装置。Figure 7 shows another device for publishing information provided by an embodiment of the present application.
下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
本申请实施例的技术方案可以应用于各种通信系统,例如:全球移动通讯(global system of mobile communication,GSM)系统、码分多址(code division multiple access,CDMA)系统、宽带码分多址(wideband code division multiple access,WCDMA)系统、通用分组无线业务(general packet radio service,GPRS)、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)、通用移动通信系统(universal mobile telecommunication system,UMTS)、全球互联微波接入(worldwide interoperability for microwave access,WiMAX)通信系统、未来的第五代(5th generation,5G)系统或新无线(new radio,NR)等,或者5G之后演进的通信系统(例如,6G通信系统)等。本申请实施例的技术方案还可以应用于卫星星间链路通信系统、无线投屏系统、虚拟现实(virtual reality,VR)通信系统、接入回传一化链路(integrated access and backhaul,IAB)系统、无线保真(wireless fidelity,Wi-Fi)通信系统、光通信系统等,对此不作限定。The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: global system of mobile communication (GSM) system, code division multiple access (code division multiple access, CDMA) system, broadband code division multiple access (wideband code division multiple access, WCDMA) system, general packet radio service (GPRS), long term evolution (long term evolution, LTE) system, LTE frequency division duplex (FDD) system, LTE Time division duplex (TDD), universal mobile telecommunication system (UMTS), global interoperability for microwave access (WiMAX) communication system, the future fifth generation (5th generation, 5G) system or new radio (NR), etc., or communication systems evolved after 5G (for example, 6G communication system), etc. The technical solutions of the embodiments of this application can also be applied to satellite inter-satellite link communication systems, wireless screen projection systems, virtual reality (VR) communication systems, integrated access and backhaul (IAB) links ) system, wireless fidelity (Wi-Fi) communication system, optical communication system, etc., there is no limit to this.
本申请中所涉及的服务器也称伺服器,是提供计算服务的设备。由于服务器需要响应服务请求,并进行处理,因此一般来说服务器应具备承担服务并且保障服务的能力。服务器的构成包括处理器、硬盘、内存、系统总线等,和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。在网络环境下,根据服务器提供的服务类型不同,分为文件服务器、数据库服务器、应用程序服务器等。The server involved in this application is also called a server and is a device that provides computing services. Since the server needs to respond to service requests and process them, generally speaking, the server should have the ability to undertake services and guarantee services. The composition of a server includes a processor, hard disk, memory, system bus, etc., which is similar to a general computer architecture. However, due to the need to provide highly reliable services, it must be in terms of processing power, stability, reliability, security, scalability, and availability. Management requirements are relatively high. In a network environment, according to the type of services provided by the server, it is divided into file server, database server, application server, etc.
本申请实施例中的终端设备可以指用户设备、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。终端设备还可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字处理(Personal Digital Assistant,PDA)、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备,5G网络中的终端设备或者演进的公用陆地移动通信网络(Public Land Mobile Network,PLMN)中的终端设备等,本申请实施例对此并不限定。The terminal equipment in the embodiment of this application may refer to user equipment, access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user agent or User device. The terminal device may 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), or a device with wireless communications Functional handheld devices, computing devices or other processing devices connected to wireless modems, vehicle-mounted devices, wearable devices, terminal devices in 5G networks or terminal devices in the evolved Public Land Mobile Network (PLMN) etc., the embodiments of the present application are not limited to this.
图1是适用于本申请实施例的系统的示意性架构图。该系统包括发布端设备101、订阅端设备102、订阅端设备103和订阅端设备104。订阅端设备102、订阅端设备103和订阅端设备104均与发布端设备101之间有通信链路。发布端设备101可以是服务器或终端设备,例如可以为发布服务器或发布终端设备,用于发布由订阅端设备102、订阅端设
备103和订阅端设备104订阅的内容。Figure 1 is a schematic architecture diagram of a system suitable for embodiments of the present application. The system includes a publishing device 101, a subscribing device 102, a subscribing device 103 and a subscribing device 104. The subscribing device 102, the subscribing device 103 and the subscribing device 104 all have communication links with the publishing device 101. The publishing device 101 may be a server or a terminal device, for example, it may be a publishing server or a publishing terminal device, and is used for publishing by the subscribing device 102 or the subscribing device. The content subscribed by the device 103 and the subscribing device 104.
订阅端设备可以为服务器或终端设备,例如可以为订阅终端设备或订阅服务器。用户可以通过该订阅终端设备向发布端设备订阅不同的内容,从而发布端设备通过与订阅终端设备之间的链路向其发布订阅的内容。The subscribing device may be a server or a terminal device, for example, it may be a subscribing terminal device or a subscribing server. Users can subscribe to different contents from the publishing terminal device through the subscribing terminal device, so that the publishing terminal device publishes the subscribed content to the subscribing terminal device through a link with the subscribing terminal device.
上述发布端设备、订阅端设备的数量仅是示意性给出。在具体情境下,例如发布端设备可以不止一个,且各个发布端设备可以彼此相连,从而共同执行发布的任务。图1中订阅端设备的数量也可以为其他数量,订阅端设备的数量可以为一个,该一个订阅端设备可以执行一个或多个订阅任务,订阅端设备的数量也可以为多个。The above numbers of publishing-side devices and subscribing-side devices are only illustrative. In specific situations, for example, there may be more than one publishing device, and each publishing device may be connected to each other to jointly perform publishing tasks. The number of subscriber devices in Figure 1 can also be other numbers. The number of subscriber devices can be one. The one subscriber device can perform one or more subscription tasks. The number of subscriber devices can also be multiple.
在发布/订阅模式中,发布端设备发布由订阅端设备订阅的消息一般基于单播或组播方式。具体的,订阅端设备在订阅时即确定采用单播还是组播方式进行发布。In the publish/subscribe mode, the publisher device publishes messages subscribed by the subscriber device generally based on unicast or multicast. Specifically, the subscribing device determines whether to publish in unicast or multicast mode when subscribing.
当发布端设备采用单播方式向订阅端设备发送订阅消息时,随着订阅端设备数量的增多,会产生大量重复的数据,对发布端设备的网络带来了较大的负载。When the publishing device uses unicast mode to send subscription messages to the subscribing device, as the number of subscribing devices increases, a large amount of duplicate data will be generated, which will put a greater load on the network of the publishing device.
当发布端设备采用组播方式向订阅端设备发送订阅消息,随着组播组内的订阅端设备数量的增加,发布端设备需要按照最小周期向整个订阅组内的成员发送组播消息,随着发布频率的提高,发布端设备的网络带宽和性能产生不利影响。When the publisher device uses multicast to send subscription messages to the subscriber device, as the number of subscriber devices in the multicast group increases, the publisher device needs to send multicast messages to members of the entire subscription group according to the minimum period. As the publishing frequency increases, the network bandwidth and performance of the publishing end device are adversely affected.
在工业场景中,由于现代工业生产规模的不断扩大,生产设备向综合自动化体系发展。而由于工业系统中各个设备的地域跨越度较大,很多设备布局在户外或者设备的作业点分散。对于一些对环境有一定要求的工业生产,需要对工业设备的运行状态,生产环境的湿度、温度等因素进行实时监控。在网络技术不断发展的条件下,使用例如手机或电脑等移动终端对需要的数据进行订阅,从而该订阅请求由发布终端发布到订阅终端上,使得技术人员或管理人员可以更便捷地获取生产情况,从而为其决策提供一定的参考。In industrial scenarios, due to the continuous expansion of the scale of modern industrial production, production equipment is developing towards a comprehensive automation system. Due to the large geographical span of each equipment in the industrial system, many equipment are deployed outdoors or the operating points of the equipment are scattered. For some industrial productions that have certain environmental requirements, it is necessary to monitor the operating status of industrial equipment, the humidity, temperature and other factors of the production environment in real time. With the continuous development of network technology, mobile terminals such as mobile phones or computers are used to subscribe to the required data, so that the subscription request is published from the publishing terminal to the subscribing terminal, allowing technicians or managers to obtain production status more conveniently , thereby providing a certain reference for its decision-making.
图2示出了工业场景下的发布/订阅的交互流程。如图2所示,发布端设备对应的是发布端设备,可以为服务器或终端设备。订阅端设备对应的是订阅端设备,可以为订阅服务器或订阅终端设备。图2中示出了N个订阅端设备,对应不同的订阅请求,该订阅请求可以由一个订阅端设备向发布/订阅系统发送,也可以由多个订阅端设备向系统发送,本申请以一个订阅段设备对应一个发布信息或订阅任务为例介绍本申请实施例的技术方案。在图2中,订阅端设备1订阅了发布信息1(温度),订阅端设备2订阅了发布信息2(湿度),订阅端设备3也订阅了发布信息2(湿度),而订阅端设备4订阅了发布信息1(温度)和发布信息N(水电导率)……订阅端设备N订阅了发布信息2(湿度)和发布信息3(水含氧量)。发布端设备可以根据不同订阅端设备的个性化需求,对应采用单播或组播方式按照订阅周期发布相应信息。Figure 2 shows the publish/subscribe interaction process in an industrial scenario. As shown in Figure 2, the publishing device corresponds to the publishing device, which can be a server or a terminal device. The subscribing device corresponds to the subscribing device, which can be a subscribing server or a subscribing terminal device. Figure 2 shows N subscribing devices, corresponding to different subscription requests. The subscription request can be sent to the publish/subscribe system by one subscribing device, or can be sent to the system by multiple subscribing devices. This application uses one The subscription segment device corresponds to one publishing information or subscription task as an example to introduce the technical solution of the embodiment of this application. In Figure 2, subscribing device 1 subscribes to published information 1 (temperature), subscribing device 2 subscribes to published information 2 (humidity), subscribing device 3 also subscribes to published information 2 (humidity), and subscribing device 4 Subscribed to published information 1 (temperature) and published information N (water conductivity)... The subscribing device N subscribed to published information 2 (humidity) and published information 3 (water oxygen content). The publishing device can publish the corresponding information according to the subscription cycle in unicast or multicast mode according to the personalized needs of different subscribing devices.
在实际工业生产中,对于图2示出的一些发布信息,例如温度、湿度等,由于设备的地域跨度较大,可能需要针对每个生产区域,例如生产车间都订阅相应的信息,订阅端设备需要订阅不同的信息组合监控不同的生产条件,例如订阅发布信息1(温度)和发布信息2(湿度)的组合监测生产时的空气状况,通过订阅发布信息3(水含氧量)和发布信息(水电导率)的组合监测生产用水的水质等。因此需要发布的数据量较大,从而发布时会占用大量带宽。但是工业场景下的发布端设备一般配置不高,海量数据的发布可能会引起发布端流量过大,影响信息实时发布的效果,对生产产生不利的影响。In actual industrial production, for some of the published information shown in Figure 2, such as temperature, humidity, etc., due to the large geographical span of the equipment, it may be necessary to subscribe to the corresponding information for each production area, such as the production workshop, and the subscriber device It is necessary to subscribe to different information combinations to monitor different production conditions. For example, subscribe to the combination of publishing information 1 (temperature) and publishing information 2 (humidity) to monitor the air conditions during production, and subscribe to publishing information 3 (water oxygen content) and publishing information (Water conductivity) combination monitors the water quality of production water, etc. Therefore, the amount of data that needs to be published is large, which consumes a lot of bandwidth when publishing. However, publishing-end equipment in industrial scenarios is generally not configured well, and the release of massive data may cause excessive traffic on the publishing end, affecting the effect of real-time information release and adversely affecting production.
针对上述问题,本申请实施例提供了一种发布信息的方法,能够减小发布/订阅模式
中发布端设备的负载。应理解,上文以工业场景为例介绍了发布/订阅交互流程,本申请实施例不限于应用于工业场景中,在其他需要降低发布端发布负载或网络负载的场景也可以适用。In response to the above problems, embodiments of the present application provide a method of publishing information, which can reduce the complexity of the publish/subscribe model. The load on the publishing device. It should be understood that the publish/subscribe interaction process is introduced above by taking an industrial scenario as an example. The embodiments of this application are not limited to application in industrial scenarios, and can also be applied in other scenarios where the publishing load or network load of the publishing end needs to be reduced.
图3示出了本申请实施例提供的一种发布信息的方法,如图3所示,该方法包括:Figure 3 shows a method for publishing information provided by an embodiment of the present application. As shown in Figure 3, the method includes:
S310,发布端设备根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,第一订阅内容包括第一订阅业务和第一订阅周期。S310: The publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device. The first subscription content includes the first subscription service and the first subscription cycle.
第一订阅内容可以是第一订阅端设备直接发送给发布端设备的,或者是第一订阅端设备发送给发布/订阅系统中其他用于处理的服务器,而后由该服务器转发给发布端设备的。第一订阅业务可以是订阅业务的字段。第一订阅内容中还可以包括第一订阅端设备的标识信息,例如可以为IP地址、用户标识等,以便于发布端设备根据该标识信息向该第一订阅端设备发布信息。The first subscription content may be sent directly by the first subscribing device to the publishing device, or may be sent by the first subscribing device to other servers in the publishing/subscribing system for processing, and then forwarded by the server to the publishing device. . The first subscription service may be a field of the subscription service. The first subscription content may also include identification information of the first subscribing device, which may be an IP address, a user ID, etc., so that the publishing device publishes information to the first subscribing device based on the identification information.
发布端设备可以为终端设备或服务器,发布端设备用于发布订阅端设备订阅的内容,发布端设备可以直接或通过程序接口从其他设备中获得需要发布的内容。以工业场景为例,需要发布的内容可以为温度、湿度等生产环境指标,该指标可以通过传感器直接获得并经过一定的处理,传向发布端设备,从而发布端设备可以将不同的数据按照订阅端设备的要求进行发布。The publishing device can be a terminal device or a server. The publishing device is used to publish the content subscribed by the subscribing device. The publishing device can obtain the content that needs to be published from other devices directly or through a program interface. Taking industrial scenarios as an example, the content that needs to be published can be production environment indicators such as temperature and humidity. This indicator can be directly obtained through sensors and processed to a certain extent, and then transmitted to the publishing device, so that the publishing device can use different data according to the subscription. requirements for terminal equipment.
第一订阅端设备可以对应订阅端设备,订阅端设备可以是单独的设备,例如可以为手机、电脑等移动终端,也可以与发布端设备对应的设备为同一个设备,例如,发布端设备和订阅端设备分别对应该同一个设备的两个模块或单元。The first subscribing device may correspond to the subscribing device, and the subscribing device may be a separate device, such as a mobile terminal such as a mobile phone or a computer, or the device corresponding to the publishing device may be the same device, for example, the publishing device and the publishing device. The subscriber device corresponds to two modules or units of the same device.
第一订阅内容包括第一订阅业务和/或第一订阅周期,第一订阅业务即订阅端设备订阅的内容。以工业场景为例,第一订阅内容可以是由系统定时订阅的,例如通过程序等在规定时间段内监测生产环境的参数;第一订阅内容是由技术人员或管理人员手动订阅的,例如通过发布/订阅系统订阅想要查看或者管理的生产参数等。第一订阅业务可以是单个信息,也可以是多个信息,例如可以为单一的环境温度,或者环境温度以及湿度的组合等。第一订阅周期为需要进行发布的周期,该周期可以按照经验设置或者可以依据管理人员的需求设置。当某一个参数变化较大且又较为重要时,可以设置较小的发布周期,例如5min,从而便于生产系统或工作人员及时发现参数变化,进行一定的调整,保证生产环境或系统的相对稳定运行。当某一个参数变化较为平缓或重要性不高时,可以设置较大的发布周期,例如1h,从而减小发布端的开销。The first subscription content includes a first subscription service and/or a first subscription cycle, and the first subscription service is the content subscribed by the subscribing device. Taking an industrial scenario as an example, the first subscription content can be regularly subscribed by the system, such as monitoring the parameters of the production environment within a specified period of time through a program; the first subscription content can be manually subscribed by technicians or managers, for example, through The publish/subscribe system subscribes to the production parameters that you want to view or manage, etc. The first subscription service may be a single piece of information or multiple pieces of information, for example, it may be a single ambient temperature or a combination of ambient temperature and humidity. The first subscription period is the period that needs to be published. This period can be set according to experience or according to the needs of managers. When a certain parameter changes significantly and is important, a smaller release cycle can be set, such as 5 minutes, so that the production system or staff can detect parameter changes in a timely manner and make certain adjustments to ensure the relatively stable operation of the production environment or system. . When a certain parameter changes slowly or is not of high importance, you can set a larger release cycle, such as 1 hour, to reduce the overhead on the release end.
在S310中,发布端设备能够根据订阅端设备的订阅内容,将订阅内容相似的订阅端设备加入到一个订阅组内。In S310, the publishing device can add subscribing devices with similar subscription contents to a subscription group based on the subscription content of the subscribing device.
可选的,在S310之前,发布端设备获取来自第一订阅端设备的第一订阅内容。Optionally, before S310, the publishing device obtains the first subscription content from the first subscribing device.
获取可以理解为接收或确定。第一订阅端设备可以通过直接向发布端设备发送需要订阅的业务和订阅周期,该第一订阅业务和第一订阅周期可以是通过字段或标识信息在一个信息中或分成多个信息发送给发布端设备,或者订阅端设备发送的信息需要发布端设备经过进一步处理或确定才能获得第一订阅端设备的第一订阅内容,例如需要解码或进一步处理。Get can be understood as receiving or determining. The first subscribing device can directly send the services and subscription cycles that need to be subscribed to the publishing device. The first subscription business and the first subscription cycle can be sent to the publishing device through fields or identification information in one message or divided into multiple messages. The information sent by the end device or the subscribing end device requires further processing or determination by the publishing end device to obtain the first subscription content of the first subscribing end device, such as decoding or further processing.
在本申请实施例中,所述发布端设备根据所述第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,包括:所述发布端设备根据所述第一订阅内容,
确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;所述发布端设备根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。In this embodiment of the present application, the publishing end device determines the first subscription group to which the first subscribing end device belongs based on the first subscription content of the first subscribing end device, including: the publishing end device determines the first subscription group to which the first subscribing end device belongs based on the first subscription content of the first subscribing end device. Describing the first subscription content, Determine at least one matching degree, the at least one matching degree being the matching degree between the first subscription content and the reference content of each subscription group in at least one subscription group, and the reference content of each subscription group includes each of the Reference subscription service and/or reference subscription cycle of a subscription group; the publishing device determines the first subscription group to which the first subscribing device belongs based on the at least one matching degree.
在该实施例中,匹配度可以相当于第一订阅内容与至少一个订阅组的参考内容的相似度,具体的,可以为第一订阅周期与至少一个订阅组的参考订阅周期的相似度和/或第一订阅业务与至少一个订阅组的参考订阅业务的相似度。In this embodiment, the matching degree may be equivalent to the similarity between the first subscription content and the reference content of at least one subscription group. Specifically, it may be the similarity between the first subscription period and the reference subscription period of at least one subscription group and/ Or the similarity between the first subscription service and the reference subscription service of at least one subscription group.
在本申请实施例中,所述第一订阅组中任意两个订阅端设备的订阅内容之间的偏差小于或等于第一预设阈值,该订阅内容包括订阅周期和/或订阅业务;或者,所述第一订阅组中每个订阅端设备与所述第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值。In this embodiment of the present application, the deviation between the subscription contents of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription contents include subscription cycles and/or subscription services; 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 a second preset threshold.
在该实施例中,第一订阅组内的订阅端设备之间的订阅内容的偏差小于或等于第一预设阈值或者第一订阅组中每个订阅端设备与该第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值,意味着该第一订阅组中的各个订阅端设备的订阅内容有一定的相似度,从而便于后续针对第一订阅组进行发布。为了实现这一目标,例如可以通过设置任意两个订阅端设备的订阅内容偏差的第一预设阈值或者设置订阅端设备与第一订阅组的参考订阅内容偏差的第二预设阈值,并分别针对上述两种方法可以设置不同的偏差确定方式,例如可以通过针对两种方法设置不同的偏差计算方法。In this embodiment, the deviation of the subscription content between the subscribing devices in the first subscription group is less than or equal to the first preset threshold or the reference subscription of each subscribing device in the first subscription group and the first subscription group. The deviation between the content 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 degree of similarity, thereby facilitating subsequent publishing to the first subscription group. In order to achieve this goal, for example, you can set a first preset threshold for the deviation of the subscription content of any two subscriber devices or set a second preset threshold for the deviation of the reference subscription content between the subscriber device and the first subscription group, and respectively 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.
该至少一个订阅组可以是发布端设备已经根据已经订阅的订阅端设备建立的至少一个订阅组,当第一订阅端设备订阅时,需要将第一订阅端设备的第一订阅内容与已经存在的至少一个订阅组的参考订阅内容进行比对,确定第一订阅端设备的第一订阅内容与至少一个订阅组的每个订阅组的参考订阅内容的匹配度。The at least one subscription group may be at least one subscription group that the publisher device has established based on the subscriber device that has subscribed. When the first subscriber device subscribes, it is necessary to combine the first subscription content of the first subscriber device with the existing subscriber device. The reference subscription content of at least one subscription group is compared to determine a matching degree between the first subscription content of the first subscribing device and the reference subscription content of each subscription group of the at least one subscription group.
在一些实施例中,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。In some embodiments, 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.
在该实施例中,至少一个订阅组中可以存在若干个订阅组与第一订阅端设备的匹配度大于预设阈值。至少一个订阅组是一个订阅组时,该订阅组即为第一订阅组,至少一个订阅组是多个订阅组时,该多个订阅组中包括第一订阅组。In this embodiment, there may be several subscription groups in at least one subscription group whose matching degree with the first subscriber device is greater than the preset threshold. When at least one subscription group is one subscription group, the subscription group is the first subscription group. When at least one subscription group is multiple subscription groups, the multiple subscription groups include the first subscription group.
例如至少一个订阅组中仅存在一个订阅组与第一订阅端设备的匹配度大于预设阈值,该一个订阅组可以为第一订阅组,从而发布端设备可以根据该匹配度,将第一订阅端设备加入第一订阅组。For example, there is only one subscription group in at least one subscription group whose matching degree with the first subscribing device is greater than a preset threshold. This one subscription group can be the first subscription group, so that the publishing device can add the first subscribing device to the first subscribing device according to the matching degree. The terminal device joins the first subscription group.
又如,至少一个订阅组中存在多个订阅组与第一订阅端设备的匹配度都大于第一预设阈值,例如第一订阅组、第二订阅组、第三订阅组与第一订阅端设备的匹配度都大于第一预设阈值。发布端设备可以是由于进行匹配度确定时,首先确定出第一订阅组与第一订阅端设备的匹配度大于预设阈值,即停止再计算其他订阅组与第一订阅端设备的匹配度,从而减小匹配度计算时的开销,直接将第一订阅端设备加入第一订阅组。第一订阅组可以是发布端设备计算匹配度的第一个订阅组,从而发布端设备仅计算了一个匹配度;第一订阅组也可以是发布端设备计算匹配度的第N个匹配度(N>1),从而发布端设备确定第一订阅端设备所属的第一订阅组时计算了N个匹配度。For another example, there are multiple subscription groups in at least one subscription group, and the matching degree with the first subscription terminal device is greater than the first preset threshold, such as the first subscription group, the second subscription group, the third subscription group and the first subscription terminal. The matching degrees of the devices are all greater than the first preset threshold. The publishing end device may first determine that the matching degree between the first subscription group and the first subscribing end device is greater than the preset threshold when determining the matching degree, that is, stop calculating the matching degree between other subscription groups and the first subscribing end device. This reduces the overhead in matching degree calculation and directly adds the first subscribing device to the first subscription group. The first subscription group may be the first subscription group for which the publishing device calculates the matching degree, so that the publishing device only calculates one matching degree; the first subscription group may also be the Nth matching degree for which the publishing device calculates the matching degree ( N>1), so the publishing device calculates N matching degrees when determining the first subscription group to which the first subscribing device belongs.
发布端设备也可以将现存的所有订阅组与第一订阅端设备的匹配度均计算出来,在匹
配度大于预设阈值的候选订阅组(例如第一订阅组、第二订阅组、第三订阅组)中选择匹配度最高的第一订阅组,从而将第一订阅端设备加入第一订阅组,这种将第一订阅端设备加入匹配度最高的订阅组的方式能够提高每个订阅组中订阅端设备的订阅业务的相似度,减小发布时的开销。The publisher device can also calculate the matching degree between all existing subscription groups and the first subscriber device. Select the first subscription group with the highest matching degree among the candidate subscription groups (such as the first subscription group, the second subscription group, and the third subscription group) whose allocation degree is greater than the preset threshold, thereby adding the first subscribing device to the first subscription group. , this method of adding the first subscribing device to the subscription group with the highest matching degree can improve the similarity of the subscription services of the subscribing devices in each subscription group and reduce the publishing overhead.
在另一些实施例中,所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,在所述发布端设备根据所述至少一个匹配度,确定第一订阅端设备所属的第一订阅组之前,所述方法还包括:所述发布端设备建立所述第一订阅组。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 a preset threshold. , before determining the first subscription group to which the first subscribing device belongs, the method further includes: the publishing device establishing the first subscription group.
在该实施例中,至少一个订阅组中任一个订阅组与第一订阅端设备的匹配度都小于预设阈值,即至少一个订阅组是一个订阅组时,该订阅组不是第一订阅组,至少一个订阅组是多个订阅组时,该多个订阅组不包括第一订阅组。从而发布端设备可以新建立第一订阅组,从而发布端设备可以将第一订阅端设备加入刚建立的第一订阅组。In this embodiment, the matching degree between any one of the at least one subscription group and the first subscriber device is less than the preset threshold, that is, when at least one subscription group is a subscription group, the subscription group is not the first subscription group, When at least one subscription group is multiple subscription groups, the multiple subscription groups do not include the first subscription group. Therefore, the publishing device can newly establish the first subscription group, and the publishing device can add the first subscribing device to the newly established first subscription group.
在本申请实施例中,发布端设备还可以确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,第二订阅内容包括第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。In this embodiment of the present application, the publishing device may also determine the matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group. The second subscription content includes the second subscription service and/or the third Two subscription cycles, the reference content of the first subscription group includes the reference subscription service and/or the reference subscription cycle of the first subscription group, the reference subscription service of the first subscription group is the first subscription service, and the third The reference subscription period of a subscription group is the first subscription period.
在该实施例中,发布端设备又获取第二订阅端设备的第二订阅内容,从而发布端设备可以将第二订阅内容与包括第一订阅组在内的多个订阅组的参考内容进行比对。如前所述,第一订阅组可以是由于第一订阅端设备没有合适的匹配组之后建立的,第一订阅端设备是第一订阅组的第一个成员,从而在第一订阅组建立之后,将其他订阅端设备与第一订阅组比对时,需要确定第一订阅组的参考内容。In this embodiment, the publishing device obtains the second subscription content of the second subscribing device, so that the publishing device can compare the second subscription content with the reference content of multiple subscription groups including the first subscription group. right. As mentioned above, the first subscription group may be established after the first subscriber device does not have a suitable matching group, and the first subscriber device is the first member of the first subscription group, so that after the first subscription group is established , when comparing other subscriber devices with the first subscription group, the reference content of the first subscription group needs to be determined.
第一订阅组的参考内容可以与其第一个成员一致,例如,可以将第一订阅业务设置为第一订阅组的参考订阅业务,将第一订阅周期设置为第一订阅组的参考订阅周期,从而之后的订阅端设备在与第一订阅组进行匹配度计算时,均使用该参考订阅内容作为匹配度计算的基准。The reference content of the first subscription group may be consistent with its first member. For example, the first subscription service may be set as the reference subscription service of the first subscription group, and the first subscription period may be set as the reference subscription period of the first subscription group, Therefore, when subsequent subscriber devices perform matching calculations with the first subscription group, they will use the reference subscription content as a basis for matching calculations.
第一订阅组的参考内容也可以由发布端设备根据其前几个成员的订阅业务而确定,例如,参考订阅内容包括参考订阅业务和参考订阅周期时,可以规定,每一个订阅组的参考订阅周期不更新,与第一个成员的订阅周期一致,而参考订阅业务可以在一定范围内更新。即订阅组的参考订阅周期为其第一个订阅成员的订阅周期,而订阅业务设置参考订阅数目,从而当第一个订阅成员的订阅业务过少时,可以根据后续成员的订阅业务适当更新,当第X个成员加入前参考订阅业务的数目小于参考订阅数目且第X个成员加入后参考订阅业务的数目大于或等于参考订阅数目时,第X个成员加入后参考订阅业务不再更新。例如可以设置参考订阅数目为4,从而如果第一订阅端设备的订阅数目为1,参考订阅业务的数目为1,第二订阅端设备加入时,相对于参考订阅业务的新的订阅业务的数目为2,从而参考订阅业务的数目变为3,而第三订阅端设备的订阅业务相对于当前参考订阅业务的新的订阅业务的数目为2,从而参考订阅业务的数目变为5>4,参考订阅业务不再更新。之后可以以该参考订阅业务和参考订阅周期为基础计算与其他订阅端设备的匹配度。The reference content of the first subscription group can also be determined by the publishing device based on the subscription services of its previous members. 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 of each subscription group The period is not updated and is consistent with the subscription period of the first member, while the reference subscription business can be updated within a certain range. That is, the reference subscription period of a subscription group is the subscription period of its first subscribing member, and the subscription business sets the reference subscription number, so that when the first subscribing member's subscription business is too small, it can be appropriately updated based on the subsequent member's subscription business. If the number of reference subscription services before the Xth member joins is less than the number of reference subscriptions and the number of reference subscription services after the Xth member joins is greater than or equal to the number of reference subscriptions, the reference subscription services will no longer be updated after the Xth member joins. For example, the number of reference subscriptions can be set to 4, so that if the number of subscriptions of the first subscribing device is 1 and the number of reference subscription services is 1, when the second subscribing device joins, the number of new subscription services relative to the reference subscription service will be is 2, so the number of reference subscription services becomes 3, and the number of new subscription services of the third subscription terminal device relative to the current reference subscription service is 2, so the number of reference subscription services becomes 5>4, The reference subscription business will no longer be updated. Then the matching degree with other subscriber devices can be calculated based on the reference subscription service and reference subscription period.
第一订阅组的参考内容也可以是预先设置的,例如,在订阅发布系统中订阅端设备的订阅业务较为稳定时,可以根据经验预设置多个订阅组,从而将订阅端设备分配到预设的
订阅组内。The reference content of the first subscription group can also be preset. For example, when the subscription business of the subscribing device in the subscription publishing system is relatively stable, multiple subscription groups can be preset based on experience, thereby assigning the subscribing device to the preset of Subscription group.
订阅组的参考订阅内容还可以通过其他方式设置,此处为简洁,不再赘述。The reference subscription content of the subscription group can also be set in other ways. This is concise and will not be described in detail.
在本申请实施例中,匹配度S的计算方式可以如下:
S=a*X+b*Y (公式1)In the embodiment of this application, the matching degree S can be calculated as follows:
S=a*X+b*Y (Formula 1)
S=a*X+b*Y (公式1)In the embodiment of this application, the matching degree S can be calculated as follows:
S=a*X+b*Y (Formula 1)
其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
在上述公式中,a*X为订阅业务周期的匹配度,b*Y为订阅周期的匹配度,将两项相加即可以得到总的匹配度,通过预设阈值大小的控制,可以调整匹配的严格程度。由于X和Y的最大值均为1,最小值均为0,从而S的变动范围为0~a+b,当预设阈值较大时,匹配的条件较高,例如当预设阈值设置为a+b时,订阅组内所有订阅端设备的订阅业务以及订阅周期都是一样的。当a>b时,预设阈值设置为a时,订阅周期一致的订阅端设备都会在同一个订阅组内,从而利于发布端设备在该订阅组内组播订阅业务。当a<b时,预设阈值设置为a时,订阅业务一致的订阅端设备会在同一个订阅组内,能够减小发布端设备发布时的数据包大小。In the above formula, a*X is the matching degree of the subscription business cycle, and b*Y is the matching degree of the subscription period. The total matching degree can be obtained by adding the two items. The matching can be adjusted by controlling the preset threshold size. the degree of strictness. Since the maximum value of X and Y is both 1 and the minimum value is 0, the variation range of S is 0~a+b. When the preset threshold is larger, the matching condition is higher. For example, when the preset threshold is set to When a+b, the subscription services and subscription cycles of all subscribing devices in the subscription group are the same. When a>b, when the preset threshold is set to a, subscribing devices with the same subscription period will be in the same subscription group, which facilitates the publishing device to multicast subscription services in the subscription group. When a < b, when the preset threshold is set to a, subscribing devices with consistent subscription services will be in the same subscription group, which can reduce the data packet size when publishing by the publishing device.
例如,订阅周期权重a为1,订阅业务权重b为0.5,预设阈值设为1,某一订阅组参考订阅周期为1s,参考订阅业务为{数据1,数据2,数据3,数据4},参考订阅业务的总数目为4。第一订阅端设备的第一订阅周期为2s,第一订阅端设备的第一订阅业务为{数据2,数据3,数据5},则第一订阅业务与参考订阅业务的重叠率Y可以通过第一订阅业务中与参考订阅业务相同的内容的数目与参考订阅业务的数目的比值计算,在这种情况下Y=2/4=0.5。For example, the subscription cycle weight a is 1, the subscription business weight b is 0.5, the preset threshold is set to 1, the reference subscription cycle of a certain subscription group is 1s, and the reference subscription business is {data 1, data 2, data 3, data 4} , the total number of reference subscription services is 4. The first subscription period of the first subscribing terminal device is 2s, and the first subscription service of the first subscribing terminal device is {data 2, data 3, data 5}, then the overlap rate Y of the first subscription service and the reference subscription service can be passed The ratio of the number of the same contents as the reference subscription service in the first subscription service to the number of the reference subscription service is calculated, in this case Y=2/4=0.5.
要计算第一订阅周期与参考订阅周期的重叠率可以计算一定时间内,例如在第一订阅周期和参考订阅周期的最小公倍数周期内,依据第一订阅周期和参考订阅周期发布的重叠次数与依据参考订阅周期需要发布的次数的比值(最大值为1)。例如可以则考察在10个参考订阅周期内,即10秒时间内,重叠次数为5,按照参考订阅周期需要发布的次数为10,则X=5/10=0.5。To calculate the overlap rate between the first subscription period and the reference subscription period, you can calculate the number of overlaps and the basis published based on the first subscription period and the reference subscription period within a certain period of time, for example, within the least common multiple period of the first subscription period and the reference subscription period. The ratio of the number of times the reference subscription cycle needs to be published (the maximum value is 1). For example, within 10 reference subscription cycles, that is, within 10 seconds, the number of overlaps is 5, and the number of times required to publish according to the reference subscription cycle is 10, then X=5/10=0.5.
通过上述公式,可以计算匹配度S=1*0.5+0.5*0.5=0.5+0.25=0.75。Through the above formula, the matching degree S=1*0.5+0.5*0.5=0.5+0.25=0.75 can be calculated.
由于匹配度S小于预设阈值1,第一订阅端设备与该订阅组匹配失败,需要继续匹配其他订阅组或重新建立订阅组。Since the matching degree S is less than the preset threshold 1, the first subscriber device fails to match the subscription group and needs to continue to match other subscription groups or re-establish the subscription group.
再如,订阅周期权重a为1,订阅业务权重b为0.5,预设阈值设为1,又一订阅组参考订阅周期为2s,参考订阅业务为{数据2,数据3,数据5},第一订阅端设备的第一订阅周期为1s,第一订阅端设备的第一订阅业务为{数据1,数据2,数据3,数据4},第一订阅周期需要发布的所有时间点完全覆盖了参考订阅周期需要发布的时间点,因此,订阅周期的重叠率为1,订阅业务的重叠率为2/3,最终计算出匹配度S=1*1+0.5*2/3=1.33,该匹配度大于预设阈值1,可以将第一订阅端设备加入该订阅组。For another example, the subscription period weight a is 1, the subscription service weight b is 0.5, the preset threshold is set to 1, the reference subscription period of another subscription group is 2s, the reference subscription service is {data 2, data 3, data 5}, and the reference subscription period is {data 2, data 3, data 5}. The first subscription period of a subscribing device is 1s, and the first subscription business of the first subscribing device is {data 1, data 2, data 3, data 4}. All time points that need to be published in the first subscription cycle are completely covered. Refer to the time point when the subscription cycle needs to be published. Therefore, the overlap rate of the subscription cycle is 1, and the overlap rate of the subscription business is 2/3. Finally, the matching degree S=1*1+0.5*2/3=1.33 is calculated. If the degree is greater than the preset threshold 1, the first subscriber device can be added to the subscription group.
应理解,上述计算匹配度的方式只是示意性示出,本申请实施例并不限制计算匹配度的具体方式,例如,计算匹配度公式中的X时,可以通过计算在一定时间内(例如第一订阅周期与参考订阅周期的最小公倍数),发布重叠次数与发布总次数的比值,此时,在第一订阅周期和参考订阅周期完全相同时,X最大为1/2,且与前文叙述的计算方式相比,该计算方式能够将第一订阅周期与参考订阅周期不同,但是按照第一订阅周期发布能够覆
盖所有按照参考订阅周期发布的时间点的情况。例如,仅考虑订阅周期的匹配过程,某一订阅组的参考订阅周期为2s,订阅端设备1的订阅周期为2s,订阅端设备2的订阅周期为1s,则考虑参考订阅周期和订阅端设备1以及参考订阅周期与订阅端设备2的周期的最小公倍数时间内,即2s的时间内,通过依据方法1,即第一订阅周期和参考订阅周期发布的重叠次数与依据参考订阅周期需要发布的次数的比值计算重叠率时,订阅端设备1的重叠率X1=1/1=1,订阅端设备2的重叠率X2=1/1=1。而通过方法2,发布重叠次数与发布总次数的比值计算重叠率时,订阅端设备1的重叠率X1=1/2=0.5,订阅端设备2的重叠率X2=1/3=0.33。由上述计算过程可以看出,虽然订阅端设备1和订阅端设备2的周期不同,按照方法1计算出的周期重叠率是一致的,而按照方法2计算出的周期重叠率不一致。具体使用何种方法计算周期重叠率需要依据具体情况而确定,而本申请的技术方案示意的计算重叠率的方式并不构成对本申请技术方案的限定。It should be understood that the above method of calculating the matching degree is only a schematic illustration, and the embodiment of the present application does not limit the specific method of calculating the matching degree. For example, when calculating X in the matching degree formula, it can be calculated within a certain period of time (such as the (the least common multiple of a subscription period and the reference subscription period), the ratio of the number of overlapping publications to the total number of publications. At this time, when the first subscription period and the reference subscription period are exactly the same, X is at most 1/2, and is the same as described above Compared with the calculation method, this calculation method can make the first subscription period different from the reference subscription period, but publishing according to the first subscription period can overwrite Covers all situations at which time points are published according to the reference subscription cycle. For example, only considering the matching process of subscription periods, the reference subscription period of a certain subscription group is 2s, the subscription period of subscriber device 1 is 2s, and the subscription period of subscriber device 2 is 1s, then the reference subscription period and subscriber device are considered 1 and within the least common multiple of the reference subscription cycle and the cycle of the subscriber device 2, that is, within 2 seconds, according to method 1, that is, the number of overlaps published between the first subscription cycle and the reference subscription cycle is equal to the number of times that needs to be published according to the reference subscription cycle When calculating the overlap rate based on the ratio of times, the overlap rate of subscriber device 1 is X1=1/1=1, and the overlap rate of subscriber device 2 is X2=1/1=1. By method 2, when the overlap rate is calculated as the ratio of the number of overlapping releases to the total number of releases, the overlap rate of subscriber device 1 is X1 = 1/2 = 0.5, and the overlap rate of subscriber device 2 is X2 = 1/3 = 0.33. It can be seen from the above calculation process that although the cycles of subscriber device 1 and subscriber device 2 are different, the cycle overlap rates calculated according to method 1 are consistent, but the cycle overlap rates calculated according to method 2 are inconsistent. The specific method used to calculate the period overlap rate needs to be determined based on the specific situation, and the method of calculating the overlap rate illustrated in the technical solution of this application does not constitute a limitation on the technical solution of this application.
还应理解,前文只介绍了计算匹配度时,同时考虑订阅业务和订阅周期的情况,在一些实施例中,还可以使用订阅端设备的订阅业务和订阅组的参考订阅业务对比进行匹配度计算;或者使用订阅端设备的订阅周期和参考订阅周期对比进行匹配度计算。上述两种方式也可以通过调节前文的匹配度计算公式中的权重实现同样的效果,只不过,对于发布端来说,权重调节为0和仅进行订阅周期或订阅业务的匹配相比,发布端的负载可能会大一些。It should also be understood that the previous article only introduces the situation of taking into account the subscription service and the subscription period when calculating the matching degree. In some embodiments, the matching degree can also be calculated by comparing the subscription service of the subscribing device and the reference subscription service of the subscription group. ; Or use the subscription cycle of the subscriber device to compare with the reference subscription cycle to calculate the matching degree. The above two methods can also achieve the same effect by adjusting the weight in the previous matching degree calculation formula. However, for the publishing side, adjusting the weight to 0 is compared with matching only the subscription cycle or subscription business. The load may be larger.
通过上文介绍的步骤,即可以将包括第一订阅端设备在内的所有订阅端设备进行合适的分组,发布端设备可以向订阅端设备发送反馈信息,对应,订阅端设备接收发布端设备回复的反馈信息,该反馈信息中可以包括用于指示订阅成功的信息和订阅端设备所在的订阅组的组播地址。对应于不同的订阅端设备,由于其分入的订阅组不同,反馈信息中的组播地址也有所不同。Through the steps introduced above, all subscribing devices, including the first subscribing device, can be appropriately grouped. The publishing device can send feedback information to the subscribing device. Correspondingly, the subscribing device receives a reply from the publishing device. The feedback information may include information indicating successful subscription and the multicast address of the subscription group to which the subscribing device belongs. Corresponding to different subscriber devices, because they are assigned to different subscription groups, the multicast addresses in the feedback information are also different.
图4示出了本申请实施例提供的订阅过程中分组方法的示意性流程图。如图4所示,该方法包括:Figure 4 shows a schematic flow chart of the grouping method in the subscription process provided by the embodiment of the present application. As shown in Figure 4, the method includes:
S410,订阅端设备向发布端设备发送订阅请求。S410: The subscribing device sends a subscription request to the publishing device.
S420,发布端设备确定该订阅请求是否满足已有订阅组的匹配度。S420: The publishing device determines whether the subscription request meets the matching degree of the existing subscription group.
S432,在发布端设备确定订阅端设备的订阅请求满足已有订阅组的匹配度情况下,发布端设备将当前订阅端设备加入该订阅组中,并向订阅端设备发送反馈信息。S432: When the publishing device determines that the subscription request of the subscribing device meets the matching degree of the existing subscription group, the publishing device adds the current subscribing device to the subscription group and sends feedback information to the subscribing device.
S434,在发布端设备确定订阅端设备的订阅请求不满足已有订阅组的匹配度情况下,发布端设备基于当前订阅内容创建订阅组,并将该订阅端设备加入创建的订阅组中,并向订阅端设备发送反馈信息。S434, when the publishing device determines that the subscription request of the subscribing device does not meet the matching degree of the existing subscription group, the publishing device creates a subscription group based on the current subscription content, and adds the subscribing device to the created subscription group, and Send feedback information to the subscribing device.
在一些情况下,订阅端设备还可能取消订阅,本申请实施例还提供了针对订阅端设备取消订阅时的方法。In some cases, the subscribing device may cancel the subscription. The embodiment of the present application also provides a method for canceling the subscription by the subscribing device.
在本申请实施例中,该方法包括:所述发布端设备获取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;所述发布端设备将所述第一订阅端设备移出所述第一订阅组。In this embodiment of the present application, the method includes: the publishing end device obtains unsubscription information from the first subscribing end device, and the unsubscription information is used to unsubscribe from the first subscription content; the publishing end device The device moves the first subscribing device out of the first subscription group.
在该实施例中,取消订阅信息中可以包括第一订阅端设备的标识信息,发布端设备获取该取消订阅信息后,将对应的订阅端设备移出其所在的第一订阅组。将第一订阅端设备移出所在的第一订阅组后,可以向第一订阅端设备发送反馈信息,用于向第一订阅端设备
通知取消订阅成功。In this embodiment, the unsubscription information may include identification information of the first subscribing device. After the publishing device obtains the unsubscribing information, it moves the corresponding subscribing device out of the first subscription group in which it is located. After the first subscribing device is moved out of the first subscription group, feedback information can be sent to the first subscribing device for sending the first subscribing device to the first subscribing device. Notification unsubscription successful.
之后,发布端设备可以确定第一订阅组中是否还存在其他订阅端设备。Afterwards, the publisher device can determine whether there are other subscriber devices in the first subscription group.
在一些实施例中,发布端设备确定第一订阅组中还存在其他订阅端设备,发布端设备可以更新对应该第一订阅组的发布方式。In some embodiments, the publishing device determines that there are other subscribing devices in the first subscription group, and the publishing device can update the publishing mode corresponding to the first subscription group.
在另一些实施例中,发布端设备确定第一订阅组中不存在其他订阅端设备,发布端设备可以删除该第一订阅组,减小发布端设备维护该订阅组的开销。In other embodiments, the publishing device determines that there are no other subscribing devices in the first subscription group, and the publishing device can delete the first subscription group, thereby reducing the cost of maintaining the subscription group by the publishing device.
图5示出了本申请实施例提供的针对取消订阅的处理方法。如图5所示,该方法包括:Figure 5 shows the processing method for unsubscription provided by the embodiment of this application. As shown in Figure 5, the method includes:
S510,订阅端设备向发布端设备发送取消订阅请求。S510: The subscribing device sends an unsubscription request to the publishing device.
S520,发布端设备将订阅端设备从订阅组移除。S520: The publisher device removes the subscriber device from the subscription group.
S530,发布端设备向订阅端设备发送反馈信息,用于反馈取消订阅成功。S530: The publishing device sends feedback information to the subscribing device to report successful cancellation of the subscription.
S540,发布端设备确定该订阅组内是否还存在其他订阅端设备。S540: The publishing device determines whether there are other subscribing devices in the subscription group.
S550,发布端设备确定该订阅组内不存在其他订阅端设备,将该订阅组删除。S550: The publisher device determines that there is no other subscriber device in the subscription group, and deletes the subscription group.
通过前文所述的方式,发布端设备能够动态的维护多个订阅组,将订阅内容相似的订阅端设备设置到一个订阅组内,从而发布端设备可以根据订阅组内多个订阅端设备的订阅内容,进行发布。Through the method mentioned above, the publishing device can dynamically maintain multiple subscription groups, and set the subscribing devices with similar subscription contents into a subscription group, so that the publishing device can adjust the subscriptions of multiple subscribing devices in the subscription group. content and publish it.
S320,所述发布端设备根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。S320: The publishing device determines a publishing policy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish subscription services.
在该实施例中,不同于常用的固定组播方式,本申请实施例采用的技术方案为了减小发布端设备的负载和网络负载,动态决策对于同一个订阅组所采用的发布方式,即对于一个订阅组,根据需要发布订阅业务的订阅端设备的数目,确定发布方式。当某一时刻有不止一个订阅端设备需要发布订阅业务时,如果该不止一个订阅端设备需要发布的订阅业务中有重叠内容,该不止一个订阅端设备的订阅业务并集可能是小于单独发送时的其订阅业务的大小代数和的。因此可以进行组播发布减小发布端的发布负载和网络负载。In this embodiment, different from the commonly used fixed multicast method, the technical solution adopted in the embodiment of this application is to reduce the load of the publishing end device and the network load, and dynamically decide the publishing method to be used for the same subscription group, that is, for A subscription group determines the publishing method based on the number of subscriber devices that need to publish subscription services. When there is more than one subscriber device that needs to publish subscription services at a certain time, if the subscription services that the more than one subscriber device needs to publish have overlapping content, the union of the subscription services of the more than one subscriber device may be smaller than when sending them individually. The algebraic sum of the size of its subscription business. Therefore, multicast publishing can be performed to reduce the publishing load and network load on the publishing end.
从整体上说,本申请实施例提供的技术方案可以针对该订阅组内的所有订阅端设备,预估待发布信息的数据量,选择数据量较小的方式进行发布。On the whole, the technical solution provided by the embodiments of this application can estimate the data volume of information to be published for all subscribing devices in the subscription group, and select a method with a smaller data volume for publishing.
在本申请实施例中,所述发布端设备根据所述第一订阅组中需要发布的订阅端设备的数目,确定针对所述第一订阅组的发布策略,包括:当第一时段第一订阅组中只有一个订阅端设备有需要发布的内容时,所述发布端设备确定在所述第一时段进行单播发布;或者,当所述第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,所述发布端设备确定在所述第一时段进行组播发布。In this embodiment of the present application, 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 the first subscription in the first period When only one subscriber device in the group has content that needs to be published, the publisher device determines to perform unicast publishing in the first period; or, when there are at least two subscribers in the first subscription group in the first period When the device has subscription services that need to be published, the publishing end device determines to perform multicast publishing in the first period.
在该实施例中,针对某一时段或者时间点(时刻)根据需要发布的订阅端设备的数目动态调整发布方式,即在只有一个订阅端设备需要发布的时段,采用单播发布,在至少两个需要发布的时段,采用组播发布,该发布策略简单,便于发布端设备动态调整发布策略,且发布策略实施时的负载较小。In this embodiment, the publishing method is dynamically adjusted according to the number of subscribing devices that need to publish for a certain period or time point (moment). That is, during a period when only one subscribing device needs to publish, unicast publishing is used. Multicast publishing is used for a period of time that needs to be published. The publishing strategy is simple, which facilitates the publishing device to dynamically adjust the publishing strategy, and the load when implementing the publishing strategy is small.
在一些实施例中,可以规定当需要发布的订阅端设备数目大于阈值时,才进行组播发布。由于发布端设备的数目大于阈值时,可能有较多的设备需要在该时间段或时刻进行发布,采用组播发布方式能够进一步减小发布端设备的发布负载和网络负载。In some embodiments, it may be specified that multicast publication is performed only when the number of subscriber devices that need to publish is greater than a threshold. Since when the number of publishing devices is greater than the threshold, there may be more devices that need to publish during this time period or moment, the multicast publishing method can further reduce the publishing load and network load of the publishing device.
进一步的,在本申请实施例中,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大
小。Further, in this embodiment of the present application, during the first period, the sum of the data sizes for unicast publishing for the at least two subscribing end devices is greater than the size of the data for multicast publishing for the at least two subscribing end devices. The data is large Small.
即对于当某一时段时,需要发布的订阅端设备的数目为至少两个时,服务端可以进一步预估针对该至少两个订阅端数目进行单播发布的数据大小之和和针对该订阅端设备进行组播发布时的数据大小,当组播的数据大小较小时,采用组播方式。通过该实施例,能够进一步减小发布端设备的发布负载和网络负载,优化发布策略。That is, for a certain period of time, when the number of subscriber devices that need to be published is at least two, the server can further estimate the sum of the data sizes for unicast release for the at least two subscriber numbers and for the subscriber. The data size when the device performs multicast publishing. When the multicast data size is small, multicast mode is used. Through this embodiment, the publishing load and network load of the publishing end device can be further reduced, and the publishing strategy can be optimized.
例如,在一个订阅组中,有三个订阅端设备,分别为第一订阅端设备,第二订阅端设备和第三订阅端设备,第一订阅端设备的第一订阅周期为2s,第一订阅业务为{数据2,数据3,数据5};第二订阅端设备的第二订阅周期为1s,第二订阅业务为{数据1,数据2,数据3,数据4};第三订阅端设备的第三订阅周期为4s,第三订阅业务为{数据2,数据3,数据5},设定的订阅周期权重a为1,订阅业务权重为0.5,匹配度的预设阈值为1,三个订阅端设备中第一订阅端设备最先进入该订阅组,则按照前文所述的技术方案,可以计算出第二订阅端设备和该订阅组的匹配度S2=1*1+0.5*2/3=1.33,可以将第二订阅端设备加入该订阅组,第三订阅端设备和该订阅组的匹配度S3=1*0.5+0.5*1=1,刚好满足匹配度的预设阈值,可以将第三订阅端设备加入该订阅组。For example, in a subscription group, there are three subscribing devices, namely the first subscribing device, the second subscribing device and the third subscribing device. The first subscribing period of the first subscribing device is 2s. The business is {data 2, data 3, data 5}; the second subscription period of the second subscriber device is 1s, and the second subscription business is {data 1, data 2, data 3, data 4}; the third subscriber device The third subscription period is 4s, the third subscription business is {data 2, data 3, data 5}, the set subscription cycle weight a is 1, the subscription business weight is 0.5, the preset threshold of the matching degree is 1, and the three Among the subscriber devices, the first subscriber device is the first to enter the subscription group. According to the technical solution mentioned above, the matching degree of the second subscriber device and the subscription group can be calculated S2=1*1+0.5*2 /3=1.33, you can add the second subscriber device to the subscription group. The matching degree of the third subscriber device and the subscription group is S3=1*0.5+0.5*1=1, which just meets the preset threshold of the matching degree. A third subscriber device can be added to the subscription group.
针对包括上述三个订阅端设备的订阅组,考察4s内发布端设备发布的方式:For the subscription group including the above three subscribing devices, examine the publishing method of the publishing device within 4 seconds:
在第1s时,第二订阅端设备的{数据1,数据2,数据3,数据4}需要发布。At the 1s, {data 1, data 2, data 3, data 4} of the second subscriber device need to be published.
在第2s时,第一订阅端设备的{数据2,数据3,数据5}和第二订阅端设备的{数据1,数据2,数据3,数据4}需要发布。At 2s, {data 2, data 3, data 5} of the first subscriber device and {data 1, data 2, data 3, data 4} of the second subscriber device need to be published.
在第3s时,第二订阅端设备的{数据1,数据2,数据3,数据4}需要发布。。At 3s, {data 1, data 2, data 3, data 4} of the second subscriber device need to be published. .
在第4s时,第一订阅端设备的{数据2,数据3,数据5}、第二订阅端设备的{数据1,数据2,数据3,数据4}和第三订阅端设备的{数据2,数据3,数据5}。At 4s, {data 2, data 3, data 5} of the first subscribing device, {data 1, data 2, data 3, data 4} of the second subscribing device and {data of the third subscribing device 2, data 3, data 5}.
假设{数据1,数据2,数据3,数据4}的大小为80字节,{数据2,数据3,数据5}的大小为60字节,{数据1,数据2,数据3,数据4,数据5}的大小为100字节。Suppose the size of {data1, data2, data3, data4} is 80 bytes, the size of {data2, data3, data5} is 60 bytes, {data1, data2, data3, data4 , the size of data 5} is 100 bytes.
从而在4s内,如果对于该订阅组的所有成员均使用单播进行发布,发布端设备所需要发布的大小Therefore, within 4 seconds, if all members of the subscription group use unicast to publish, the publishing device needs to publish the size
L1=4*80+2*60+1*60=500字节。L1=4*80+2*60+1*60=500 bytes.
在4s内,如果对于该订阅组的所有成员使用固定组播进行发布,发布端设备每1s都需要发送{数据1,数据2,数据3,数据4,数据5},从而所需要发布的大小Within 4 seconds, if fixed multicast is used for publishing to all members of the subscription group, the publishing device needs to send {data 1, data 2, data 3, data 4, data 5} every 1 second, so the size of the publication needs to be
L2=100*4=400字节。L2=100*4=400 bytes.
在4s内,可以采取动态决策方式,例如,由于第1s和第3s仅第二订阅端设备需要发布,可以对第二订阅端设备进行单播发布{数据1,数据2,数据3,数据4},第2s时第一订阅端设备和第二订阅端设备需要发布,采用组播发布方式,发送第一订阅端设备和第二订阅端设备订阅业务的并集{数据1,数据2,数据3,数据4,数据5},第4s时第一订阅端设备、第二订阅端设备和第三订阅端设备都需要发布,可以进行组播发送三个订阅端设备订阅业务的并集{数据1,数据2,数据3,数据4,数据5},从而最终所需要发布的大小Within 4s, a dynamic decision-making method can be adopted. For example, since only the second subscriber device needs to publish at 1s and 3s, unicast publishing {data 1, data 2, data 3, data 4 can be performed to the second subscriber device }, at 2s, the first subscribing device and the second subscribing device need to publish, using the multicast publishing method, send the union of the subscription services of the first subscribing device and the second subscribing device {data 1, data 2, data 3. Data 4, data 5}. At the 4th second, the first subscribing device, the second subscribing device and the third subscribing device all need to be published. The union of the subscription services of the three subscribing devices can be multicasted {data 1, data 2, data 3, data 4, data 5}, thus the final size that needs to be published
L3=80*2+100+100=360字节。L3=80*2+100+100=360 bytes.
通过对比上述三种发布方式的大小,可以看出,采用本申请技术方案的发布方式发布的数据最小,能够有效减轻发布端设备的发布负载和网络负载。
By comparing the sizes of the above three publishing methods, it can be seen that the publishing method using the technical solution of this application publishes the smallest data, and can effectively reduce the publishing load and network load of the publishing end device.
订阅组内的所有订阅端设备可以监听单播通道和组播通道获取发布端设备发布的数据,解调可以获取自己所需要的数据。All subscribing devices in the subscription group can monitor the unicast channel and multicast channel to obtain the data published by the publishing device, and demodulate to obtain the data they need.
图6示出了本申请实施例提供的一种发布信息的装置600。该装置600可以是发布端设备,也可以是发布端设备中的装置,对应于图3至图5中方法中的发布端设备。Figure 6 shows a device 600 for publishing information provided by an embodiment of the present application. The device 600 may be a publishing end device, or may be a device in the publishing end device, corresponding to the publishing end device in the methods in Figures 3 to 5.
该发布信息的装置600包括:处理单元610,用于根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,第一订阅内容包括第一订阅业务和/或第一订阅周期;所述处理单元610,还用于根据第一时段所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略,所述所有订阅端设备包括所述第一订阅端设备。The apparatus 600 for publishing information includes: a processing unit 610, configured to determine the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, where the first subscription content includes a first subscription service and/or the first subscription period; the processing unit 610 is also configured to determine a publishing strategy for the first subscription group according to the number of subscriber devices in the first subscription group that need to publish subscription services in the first period , the all subscriber devices include the first subscriber device.
在该实施例中,发布信息的装置600包括处理单元610,处理单元610根据第一订阅端设备的第一订阅内容,将第一订阅端设备加入合适的第一订阅组中,并根据第一订阅组的所有订阅端设备的订阅内容,即结合需要发布订阅业务的订阅端设备的数目,动态调整发布端设备的发布方式,减轻发布端设备的发布负载和网络负载。In this embodiment, the apparatus 600 for publishing information includes a processing unit 610. The processing unit 610 adds the first subscribing device to the appropriate first subscription group according to the first subscription content of the first subscribing device, and adds the first subscribing device to the appropriate first subscription group according to the first subscribing content. The subscription contents of all subscribing devices in the subscription group, that is, based on the number of subscribing devices that need to publish and subscribe services, dynamically adjust the publishing method of the publishing device to reduce the publishing load and network load of the publishing device.
在本申请一些实施例中,所述装置还包括收发单元620,还用于向所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所属第一订阅组的组播地址。In some embodiments of the present application, the device further includes a transceiver unit 620, which is further configured to send first feedback information to the first subscriber device, where the first feedback information includes the multicast address of the first subscription group to which it belongs. .
在本申请一些实施例中,所述第一订阅组中任意两个订阅端设备的订阅内容之间的偏差小于或等于第一预设阈值,该订阅内容包括订阅周期和/或订阅业务;或者,所述第一订阅组中每个订阅端设备与所述第一订阅组的参考订阅内容之间的偏差小于或等于第二预设阈值。In some embodiments of this application, the deviation between the subscription contents of any two subscribing devices in the first subscription group is less than or equal to the first preset threshold, and the subscription contents include subscription cycles and/or subscription services; 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.
在本申请一些实施例中,所述处理单元610,具体用于:根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。In some embodiments of the present application, the processing unit 610 is specifically configured to: determine at least one matching degree based on the first subscription content, where the at least one matching degree is the first subscription content and at least one subscription group The matching degree of the reference content of each subscription group, the reference content of each subscription group includes the reference subscription service and/or reference subscription cycle of each subscription group; according to the at least one matching degree, determine the The first subscription group to which the first subscriber device belongs.
在本申请一些实施例中,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。In some embodiments of this application, 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.
在本申请一些实施例中,所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,所述处理单元610,还用于建立所述第一订阅组。In some embodiments of this 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. The processing unit 610 is also used to establish the First subscription group.
在本申请一些实施例中,所述处理单元610,还用于确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。In some embodiments of the present application, the processing unit 610 is also used to determine the matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group, where the second subscription content includes the third Two subscription services and/or a second subscription period, the reference content of the first subscription group includes the reference subscription service and/or the reference subscription period of the first subscription group, and the reference subscription service of the first subscription group is the second subscription service. A subscription service, the reference subscription period of the first subscription group is the first subscription period.
在本申请一些实施例中,所述匹配度S的计算方式如下:
S=a*X+b*Y,In some embodiments of this application, the matching degree S is calculated as follows:
S=a*X+b*Y,
S=a*X+b*Y,In some embodiments of this application, the matching degree S is calculated as follows:
S=a*X+b*Y,
其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
在本申请一些实施例中,当第一时段第一订阅组中只有一个订阅端设备有需要发布的内容时,确定在所述第一时段进行单播发布;或者,当所述第一时段第一订阅组中有至少
两个订阅端设备有需要发布的订阅业务时,确定在所述第一时段进行组播发布。In some embodiments of the present application, when only one subscriber device in the first subscription group in the first period has content that needs to be published, it is determined to perform unicast publishing in the first period; or, when the first subscription group in the first period has content that needs to be published, A subscription group has at least When two subscribing devices have subscription services that need to be published, it is determined to perform multicast publishing in the first period.
在本申请一些实施例中,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。In some embodiments of the present application, in the first period, the sum of the sizes of data published by unicast for the at least two subscribing devices is greater than the data size published by multicast for the at least two subscribing devices. size.
在本申请一些实施例中,所述收发单元620,还用于获取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;所述处理单元610,还用于将所述第一订阅端设备移出所述第一订阅组。In some embodiments of this application, the transceiver unit 620 is also used to obtain unsubscription information from the first subscribing device, and the unsubscription information is used to unsubscribe from the first subscription content; the processing Unit 610 is also used to remove the first subscriber device from the first subscription group.
在本申请一些实施例中,所述处理单元610,还用于:确定所述第一订阅组中不存在订阅端设备;删除所述第一订阅组。In some embodiments of this application, the processing unit 610 is further configured to: determine that there is no subscribing device in the first subscription group; and delete the first subscription group.
图7示出了本申请实施例提供的一种发布信息的装置700。发布信息的装置700包括:处理器720。在本申请的实施例中,处理器720用于实现相应的控制管理操作,例如,处理器720用于支持发布信息的装置700执行前述实施例的方法或操作或功能。可选的,发布信息的装置700还可以包括:存储器710和通信接口730;处理器720、通信接口730以及存储器710可以相互连接或者通过总线740相互连接。其中,通信接口730用于支持该发布信息的装置700与订阅端设备等进行通信,存储器710用于存储发布信息的装置700的程序代码和数据。处理器720调用存储器710中存储的代码或者数据实现相应的操作。该存储器710可以跟处理器耦合在一起,也可以不耦合在一起。本申请实施例中的耦合是发布信息的装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于发布信息的装置、单元或模块之间的信息交互。Figure 7 shows a device 700 for publishing information provided by an embodiment of the present application. The device 700 for publishing information includes: a processor 720 . In the embodiment of the present application, the processor 720 is used to implement corresponding control management operations. For example, the processor 720 is used to support the device 700 for publishing information to perform the methods, operations or functions of the foregoing embodiments. Optionally, the device 700 for publishing information may also include: a memory 710 and a communication interface 730; the processor 720, the communication interface 730, and the memory 710 may be connected to each other or connected to each other through a bus 740. Among them, the communication interface 730 is used to support the communication between the device 700 for publishing information and the subscribing device, etc., and the memory 710 is used to store the program code and data of the device 700 for publishing information. The processor 720 calls the code or data stored in the memory 710 to implement corresponding operations. The memory 710 may or may not be coupled with the processor. Coupling in the embodiments of this application is an indirect coupling or communication connection between devices, units or modules that publish information. It can be in electrical, mechanical or other forms and is used for information between devices, units or modules that publish information. Interaction.
其中,处理器720可以是中央处理器单元,通用处理器,数字信号处理器,专用集成电路,现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理器和微处理器的组合等等。通信接口730可以是收发器、电路、总线、模块或其它类型的通信接口。总线740可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图7中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The processor 720 may 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 devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various illustrative logical blocks, modules, and circuits described in connection with this disclosure. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. Communication interface 730 may be a transceiver, circuit, bus, module, or other type of communication interface. The bus 740 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one thick line is used in Figure 7, but it does not mean that there is only one bus or one type of bus.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少
一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In this application, "at least one" refers to one or more, and "plurality" refers to two or more. "And/or" describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. "At least one of the following" or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b, or c An item (item) can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
应理解,说明书通篇中提到的“一些实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一些实施例中”或“在另一些实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It will be understood that reference throughout this specification to "some embodiments" means that a particular feature, structure, or characteristic associated with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of "in some embodiments" or "in other embodiments" in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its functions and internal logic, and should not be used in the embodiments of the present application. The implementation process constitutes any limitation.
还应理解,本文中涉及的第一、第二以及各种数字编号仅为描述方便进行的区分,并不用来限定本申请实施例的范围。It should also be understood that the first, second and various numerical numbers involved in this article are only distinctions for convenience of description and are not used to limit the scope of the embodiments of the present application.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (25)
- 一种发布信息的方法,其特征在于,包括:A method of publishing information, characterized by including:发布端设备根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,所述第一订阅内容包括第一订阅业务和/或第一订阅周期;The publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, where the first subscription content includes the first subscription service and/or the first subscription cycle;所述发布端设备根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。The publishing device determines a publishing strategy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish subscription services.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1, further comprising:所述发布端设备向所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所述第一订阅组的组播地址。The publishing device sends first feedback information to the first subscribing device, where the first feedback information includes the multicast address of the first subscription group.
- 根据权利要求1或2所述的方法,其特征在于,所述发布端设备根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,包括:The method according to claim 1 or 2, characterized in that the publishing device determines the first subscription group to which the first subscribing device belongs based on the first subscription content of the first subscribing device, including:所述发布端设备根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;The publishing device determines at least one matching degree based on the first subscription content, where the at least one matching degree is a 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/or reference subscription cycle of each subscription group;所述发布端设备根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。The publishing device determines the first subscription group to which the first subscribing device belongs based on the at least one matching degree.
- 根据权利要求3中任一项所述的方法,其特征在于,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。The method according to any one of claims 3, characterized in that 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.
- 根据权利要求3中任一项所述的方法,其特征在于,所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,在所述发布端设备根据所述至少一个匹配度,确定第一订阅端设备所属的第一订阅组之前,所述方法还包括:The method according to any one of claims 3, characterized in that 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. Before the publishing device determines the first subscription group to which the first subscribing 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 of claim 5, further comprising:所述发布端设备确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括所述第二订阅端设备的第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。The publishing end device determines a matching degree between the second subscription content of the second subscribing end device and the reference content of the first subscription group, and the second subscription content includes the second subscription service of the second subscribing end device and /or a second subscription period, the reference content of the first subscription group includes the reference subscription service and/or the reference subscription period of the first subscription group, and the reference subscription service of the first subscription group is the first subscription service, The reference subscription period of the first subscription group is the first subscription period.
- 根据权利要求3至5中任一项所述的方法,其特征在于,所述匹配度S的计算方式如下:The method according to any one of claims 3 to 5, characterized in that the matching degree S is calculated as follows:S=a*X+b*Y,S=a*X+b*Y,其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
- 根据权利要求1至7中任一项所述的方法,其特征在于,所述发布端设备根据所述第一订阅组中需要发布的订阅端设备的数目,确定针对所述第一订阅组的发布策略,包括:The method according to any one of claims 1 to 7, characterized in that the publishing device determines the number of the first subscription group according to the number of subscribing devices in the first subscription group that need to be published. Release strategy, including:当第一时段第一订阅组中只有一个订阅端设备有需要发布的订阅业务时,所述发布端 设备确定在所述第一时段进行单播发布;或者,When only one subscribing device in the first subscription group in the first period has subscription services that need to be published, the publishing device The device determines to perform unicast publishing in the first period; or,当所述第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,所述发布端设备确定在所述第一时段进行组播发布。When at least two subscribing devices in the first subscription group in the first period have subscription services that need to be published, the publishing device determines to perform multicast publishing in the first period.
- 根据权利要求8所述的方法,其特征在于,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。The method according to claim 8, characterized in that, in the first period, the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscriber devices. The data size for multicast publishing.
- 根据权利要求1或2所述的方法,其特征在于,所述方法还包括: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 unsubscribing information is used to unsubscribe from the first subscription content;所述发布端设备将所述第一订阅端设备移出所述第一订阅组。The publishing device moves the first subscribing device out of the first subscription group.
- 根据权利要求1至10中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 10, characterized in that the method further includes:所述发布端设备确定所述第一订阅组中不存在订阅端设备;The publishing device determines that there is no subscribing device in the first subscription group;所述发布端设备删除所述第一订阅组。The publishing device deletes the first subscription group.
- 一种发布信息的装置,其特征在于,包括:A device for publishing information, characterized by including:处理单元,用于根据第一订阅端设备的第一订阅内容,确定所述第一订阅端设备所属的第一订阅组,所述第一订阅内容包括第一订阅业务和/或第一订阅周期;A processing unit configured to determine the first subscription group to which the first subscription device belongs based on the first subscription content of the first subscription device, where the first subscription content includes a first subscription service and/or a first subscription cycle ;所述处理单元,还用于根据所述第一订阅组中需要发布订阅业务的订阅端设备的数目,确定针对所述第一订阅组的发布策略。The processing unit is further configured to determine a publishing strategy for the first subscription group based on the number of subscribing devices in the first subscription group that need to publish subscription services.
- 根据权利要求12所述的装置,其特征在于,所述装置还包括:The device according to claim 12, characterized in that the device further includes:收发单元,用于向所述第一订阅端设备发送第一反馈信息,所述第一反馈信息包括所属第一订阅组的组播地址。A transceiver unit configured to send first feedback information to the first subscriber device, where the first feedback information includes the multicast address of the first subscription group to which it belongs.
- 根据权利要求12或13所述的装置,其特征在于,所述处理单元,具体用于:The device according to claim 12 or 13, characterized in that the processing unit is specifically used for:根据所述第一订阅内容,确定至少一个匹配度,所述至少一个匹配度为所述第一订阅内容与至少一个订阅组中的每一个订阅组的参考内容的匹配度,所述每一个订阅组的参考内容包括所述每一个订阅组的参考订阅业务和/或参考订阅周期;According to the first subscription content, at least one matching degree is determined, and 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, and each subscription The reference content of the group includes the reference subscription service and/or reference subscription cycle of each subscription group;根据所述至少一个匹配度,确定所述第一订阅端设备所属的第一订阅组。According to the at least one matching degree, the first subscription group to which the first subscriber device belongs is determined.
- 根据权利要求14中任一项所述的装置,其特征在于,所述第一订阅组为所述至少一个订阅组中的订阅组,所述第一订阅组对应的匹配度大于或等于预设阈值。The device according to any one of claims 14, characterized in that 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.
- 根据权利要求15中任一项所述的装置,其特征在于,The device according to any one of claims 15, characterized in that:所述第一订阅组不是所述至少一个订阅组中的订阅组,所述至少一个匹配度均小于预设阈值,所述处理单元,还用于建立所述第一订阅组。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 also configured to establish the first subscription group.
- 根据权利要求16所述的装置,其特征在于,The device according to claim 16, characterized in that:所述处理单元,还用于确定第二订阅端设备的第二订阅内容与所述第一订阅组的参考内容的匹配度,所述第二订阅内容包括第二订阅业务和/或第二订阅周期,所述第一订阅组的参考内容包括第一订阅组的参考订阅业务和/或参考订阅周期,所述第一订阅组的参考订阅业务为所述第一订阅业务,所述第一订阅组的参考订阅周期为所述第一订阅周期。The processing unit is also configured to determine the matching degree between the second subscription content of the second subscribing device and the reference content of the first subscription group, where the second subscription content includes a second subscription service and/or a second subscription Period, the reference content of the first subscription group includes the reference subscription service and/or 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 first subscription The reference subscription period of the group is the first subscription period.
- 根据权利要求14至16中任一项所述的装置,其特征在于,所述匹配度S的计算方式如下:The device according to any one of claims 14 to 16, characterized in that the matching degree S is calculated as follows:S=a*X+b*Y, S=a*X+b*Y,其中,a为订阅周期权重,b为订阅业务权重,X为所述第一订阅周期与所述参考订阅周期的重叠率,Y为所述第一订阅业务与所述参考订阅业务的重叠率。Where, a is the subscription cycle weight, b is the subscription service weight, X is the overlap rate of the first subscription cycle and the reference subscription cycle, and Y is the overlap rate of the first subscription service and the reference subscription service.
- 根据权利要求12至18中任一项所述的装置,其特征在于,所述处理单元,具体用于:The device according to any one of claims 12 to 18, characterized in that the processing unit is specifically used for:当第一时段第一订阅组中只有一个订阅端设备有需要发布的订阅业务时,确定在所述第一时段进行单播发布;或者,When only one subscriber device in the first subscription group in the first period has subscription services that need to be published, determine to perform unicast publishing in the first period; or,当所述第一时段第一订阅组中有至少两个订阅端设备有需要发布的订阅业务时,确定在所述第一时段进行组播发布。When at least two subscriber devices in the first subscription group in the first period have subscription services that need to be published, it is determined to perform multicast publishing in the first period.
- 根据权利要求19所述的装置,其特征在于,在所述第一时段,针对所述至少两个订阅端设备分别进行单播发布的数据大小之和大于针对所述至少两个订阅端设备进行组播发布的数据大小。The apparatus according to claim 19, characterized in that, in the first period, the sum of the data sizes for unicast publishing for the at least two subscriber devices is greater than the size of the data for the at least two subscriber devices. The data size for multicast publishing.
- 根据权利要求12或13所述的装置,其特征在于,The device according to claim 12 or 13, characterized in that,所述收发单元,还用于获取来自所述第一订阅端设备的取消订阅信息,所述取消订阅信息用于取消订阅所述第一订阅内容;The transceiver unit is also used to obtain unsubscription information from the first subscribing device, where the unsubscription information is used to unsubscribe from the first subscription content;所述处理单元,还用于将所述第一订阅端设备移出所述第一订阅组。The processing unit is also configured to remove the first subscriber device from the first subscription group.
- 根据权利要求12至20中任一项所述的装置,其特征在于,所述处理单元,还用于:The device according to any one of claims 12 to 20, characterized in that the processing unit is also used to:确定所述第一订阅组中不存在订阅端设备;Determine that there is no subscribing device in the first subscription group;删除所述第一订阅组。Delete the first subscription group.
- 一种发布信息的装置,其特征在于,包括至少一个处理器,所述处理器与存储器耦合,所述存储器用于存储指令,所述指令被所述处理器运行时,A device for publishing information, characterized by comprising at least one processor, the processor being coupled to a memory, the memory being used to store instructions, and when the instructions are run by the processor,使得所述处理器执行如权利要求1至11中任意一项所述的方法。The processor is caused to perform the method according to any one of claims 1 to 11.
- 一种计算机可读存储介质,包括计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至11中任一项所述的方法。A computer-readable storage medium includes a computer program, which when the computer program is run on a computer, causes the computer to perform the method according to any one of claims 1 to 11.
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序代码或指令,所述计算机程序代码或指令在计算机上执行时,使得所述计算机执行如权利要求1至11中任一项所述的方法。 A computer program product, characterized in that the computer program product includes computer program code or instructions, and when the computer program code or instructions are executed on a computer, the computer executes any one of claims 1 to 11 the method described.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210601457.2A CN117201604A (en) | 2022-05-30 | 2022-05-30 | Method and device for issuing information |
CN202210601457.2 | 2022-05-30 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023231857A1 true WO2023231857A1 (en) | 2023-12-07 |
Family
ID=88991048
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/095961 WO2023231857A1 (en) | 2022-05-30 | 2023-05-24 | Information release method and apparatus |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117201604A (en) |
WO (1) | WO2023231857A1 (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2680539A1 (en) * | 2012-06-27 | 2014-01-01 | Verisign, Inc. | Hierarchical publish/subscribe system |
CN106134230A (en) * | 2013-11-21 | 2016-11-16 | 哥莱菲特软件公司 | The management domain that remote content on mobile information apparatus and configuration control |
CN112187501A (en) * | 2019-07-05 | 2021-01-05 | 腾讯科技(深圳)有限公司 | Terminal grouping management method, device, equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103974198B (en) * | 2013-01-30 | 2018-01-12 | 中国电信股份有限公司 | Resource regulating method, device and the base station of long evolving system Multimedia Broadcast Multicast Service |
CN104506578A (en) * | 2014-12-03 | 2015-04-08 | 郑州正信科技发展股份有限公司 | Publishing/subscription network subscription information maintenance method and device |
CN110769021B (en) * | 2018-07-26 | 2023-02-14 | 华为云计算技术有限公司 | Information pushing method, device and system |
CN113498027A (en) * | 2020-04-07 | 2021-10-12 | 华为技术有限公司 | Communication method and related equipment |
CN113573248B (en) * | 2020-04-28 | 2023-06-20 | 华为技术有限公司 | Method and device for transmitting data |
-
2022
- 2022-05-30 CN CN202210601457.2A patent/CN117201604A/en active Pending
-
2023
- 2023-05-24 WO PCT/CN2023/095961 patent/WO2023231857A1/en unknown
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2680539A1 (en) * | 2012-06-27 | 2014-01-01 | Verisign, Inc. | Hierarchical publish/subscribe system |
CN106134230A (en) * | 2013-11-21 | 2016-11-16 | 哥莱菲特软件公司 | The management domain that remote content on mobile information apparatus and configuration control |
CN112187501A (en) * | 2019-07-05 | 2021-01-05 | 腾讯科技(深圳)有限公司 | Terminal grouping management method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117201604A (en) | 2023-12-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022011862A1 (en) | Method and system for communication between o-ran and mec | |
US20210226902A1 (en) | Time-Sensitive Networking Communication Method and Apparatus | |
EP3223474B1 (en) | Method and device for processing adaptive flow table | |
CN100456757C (en) | Method to control home intelligent terminal and home access gateway | |
WO2022121559A1 (en) | Mobile communication system control method, network management and control agent, system, and storage medium | |
US10425849B1 (en) | Visualization of personalized quality of experience regarding mobile network | |
CN104573109A (en) | System, terminal and method for automatic recommendation based on group relation | |
CN102317935B (en) | Communication service based on context | |
CN112312427A (en) | Method for optimizing network quality and electronic equipment | |
CN103916936B (en) | Realize method, system and mobile terminal, the server of data connection long | |
WO2020133433A1 (en) | Network switching method and related apparatus | |
WO2018119677A1 (en) | Transmission link resuming method, device and system | |
Zuo et al. | Joint rate control and scheduling for real-time wireless networks | |
CN106850770B (en) | Efficient transmission method based on cloud computing service | |
WO2020123215A1 (en) | Unified messaging delivery based on analysis and predictions | |
WO2023231857A1 (en) | Information release method and apparatus | |
CN105703977A (en) | Audio/video quality monitoring method, device and system | |
CN112714146B (en) | Resource scheduling method, device, equipment and computer readable storage medium | |
CN111245878B (en) | Method for computing and unloading communication network based on hybrid cloud computing and fog computing | |
WO2023279977A1 (en) | Network nodes and methods therein for event monitoring | |
CN109039928A (en) | Transmission method, device and the Wireless Fidelity router of data | |
WO2016091126A1 (en) | Policy-making method, device and system | |
CN104601527B (en) | Data filtering method and device | |
CN110493829A (en) | A kind of WEB interface request adaptive feedback method based on wireless chaining status | |
US20240129876A1 (en) | Systems and methods for analytics and information sharing between a radio access network and a core network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23815041 Country of ref document: EP Kind code of ref document: A1 |