A satellite positioning enhancement service broadcasting method and device based on coroutine technology

By using coroutine technology in the GNSS enhanced service broadcast system to create a coroutine for each network connection, adjust its operating environment and process subscription content, the problem of resource waste caused by thread switching is solved, and more efficient concurrent broadcasting and cost reduction are achieved.

CN116594044BActive Publication Date: 2025-10-03NAT AUTOMOBILE UNIV SPACE-TIME TECH (ANQING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310528603.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2025-10-03
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

When the existing technology uses thread switching technology to achieve high-concurrency broadcasting in GNSS augmentation service broadcasting, it leads to waste of computing resources and fails to fully utilize the computing resources of computer programs.

Method used

A satellite positioning enhancement service broadcasting method based on coroutine technology is adopted. By creating a one-to-one coroutine for each network connection, parsing the network data to adjust the coroutine's operating environment, and determining the subscription content according to the network information type, the coroutine is responsible for handling the subscription content adjustment work.

Benefits of technology

It reduces the number of threads, reduces the waste of storage space and computing resources, improves the utilization of computing resources, achieves higher concurrent broadcasting goals, and reduces broadcasting costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116594044B_ABST
    Figure CN116594044B_ABST
Patent Text Reader

Abstract

The present invention discloses a satellite positioning enhancement service broadcasting method and device based on coroutine technology, which is applied to the GNSS enhancement service broadcasting system. The method determines the first service to-be-broadcasted queue through a first broadcasting thread, creates corresponding coroutines for the network connections in the first service to-be-broadcasted queue, and adjusts the operating environment of each coroutine based on the network data obtained by parsing the network connection, so that several coroutines can adjust the subscription content for their corresponding network connections, thereby enabling the first broadcasting thread to broadcast the satellite positioning enhancement service based on the adjusted subscription content. This broadcasting method transfers the subscription content adjustment that originally needed to be implemented by the thread to the coroutine, reducing the number of compatible threads and reducing the storage space required for the synchronous operation of a large number of threads. The method transfers the work that originally required thread switching technology to the coroutine, thereby improving the degree to which the computing resources of the computer program are fully utilized and reducing the waste of computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for broadcasting satellite positioning enhancement services based on coroutine technology. Background Art

[0002] Given that the global satellite navigation and positioning system is affected by multiple factors such as relativistic effects, clock errors and other errors in actual applications, it is necessary to eliminate or correct the above-mentioned influencing factors in actual GNSS high-precision positioning applications. As a result, different GNSS differential augmentation service models and systems have been born at different times.

[0003] The approach used by the most commonly used models and systems in existing technologies is to eliminate or correct these factors, either collectively or individually, by broadcasting SSR or OSR differential augmentation data to users within different spatial and temporal ranges. Given the application characteristics of GNSS augmentation services and their broad future expansion, GNSS augmentation service broadcast platforms must achieve a concurrent broadcast target of millions of broadcasts. To achieve this higher concurrent broadcast target, existing technologies typically use a multi-threaded model, leveraging thread switching technology to achieve this high concurrent broadcast target.

[0004] However, thread switching technology is a heavyweight scheduling operation for computer programs, involving multiple thread scheduling overheads. Therefore, using this thread switching technology to improve the concurrency broadcast target cannot fully utilize the computing resources of the computer program. Summary of the Invention

[0005] The present invention provides a satellite positioning enhancement service broadcasting method and device based on coroutine technology, so as to fully utilize the computing resources of computer programs and thus achieve the technical effect of improving the concurrent broadcasting target.

[0006] In order to solve the above technical problems, the present invention provides a satellite positioning enhancement service broadcasting method based on coroutine technology, which is applied to the GNSS enhancement service broadcasting system, comprising the following steps:

[0007] Receive a satellite positioning enhancement service and call a first broadcast thread, determine a corresponding first service to-be-broadcast queue according to the first broadcast thread, and create a one-to-one corresponding coroutine for each of the network connections in the first service to-be-broadcast queue;

[0008] parsing the plurality of network connections to obtain a plurality of network data, and adjusting the operating environment of each of the coroutines according to the plurality of network data;

[0009] Running each of the coroutines so that each of the coroutines determines corresponding subscription content according to its own operating environment and network data;

[0010] The subscription content and the satellite positioning enhancement service are sent to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content.

[0011] The broadcast method provided by the present invention retrieves and determines a first service to-be-broadcast queue based on a first broadcast thread, and then creates corresponding coroutines for each of the network connections in the first service to-be-broadcast queue. After creation, the coroutines parse the network connections to obtain various types of network data, and adjust the operating environment of each coroutine based on the various types of network data, so that the operating environment of each coroutine also corresponds one-to-one with the network connections. This allows the coroutines to adjust the subscription content for their corresponding network connections, and the first broadcast thread to broadcast the corresponding satellite positioning enhancement service based on the adjusted subscription content.

[0012] The above-mentioned broadcasting method separates the subscription content adjustment steps that originally need to be implemented by several threads, and hands them over to their corresponding coroutines for implementation, thereby reducing the number of threads that need to be compatible, and at the same time reducing the storage space required for the synchronous operation of a large number of threads. In response to the problem of a large amount of computing resources being wasted in the prior art of using thread switching technology to implement multi-threaded synchronous operation, the method of creating a coroutine to perform subscription content adjustment provided by the present invention hands over the work that originally needed to be solved by switching threads to the created coroutine, thereby improving the degree to which the computing resources of the computer program are fully utilized and reducing the waste of computing resources.

[0013] As a preferred example, the parsing of the plurality of network connections to obtain a plurality of network data, and adjusting the operating environment of each of the coroutines according to the plurality of network data, is specifically as follows:

[0014] Parsing the plurality of network connections to obtain the corresponding plurality of environmental contexts and plurality of network information;

[0015] According to the several environmental contexts, the operating environment of each coroutine is adjusted so that the operating environment of each coroutine is associated with the several environmental contexts in a one-to-one correspondence, and after the association, the several network information is sent to each coroutine.

[0016] Since each coroutine has its own corresponding operating environment, and each network connection also has its own corresponding environment context, the broadcasting method provided by the present invention, when associating each coroutine with a number of network connections, also needs to adjust the operating environment corresponding to each of the above coroutines according to the environment context corresponding to the above-mentioned several network connections, thereby improving the association relationship between the above-mentioned four, so that each coroutine can adjust the associated environment context through the operating environment and thereby implement the adjustment operation for the subscription content of the several network connections, thereby avoiding the problem of a large amount of computing resources being wasted due to the need for multiple threads to implement the adjustment operation through thread switching technology.

[0017] At the same time, the present invention also sends the parsed network information to each corresponding coroutine, so that each coroutine determines the specific operation to be included in the subscription content according to the network information.

[0018] As a preferred example, each of the coroutines determines the corresponding subscription content according to its own operating environment and network data, specifically:

[0019] Each of the coroutines receives its own network information through its corresponding operating environment, and judges and determines the network information type of the plurality of network information;

[0020] If the network information type is GGA location information, determining, according to the GGA location information, whether the subscription content of the corresponding network connection is subscription object addition or subscription object deletion;

[0021] If the network information type is GNSS differential enhancement area coding information, determining, according to the GNSS differential enhancement area coding information, that the subscription content of the corresponding network connection is subscription object switching;

[0022] If the network information type includes the GGA location information and the GNSS differential enhancement area coding information, the subscription content of the corresponding network connection is determined according to the GGA location information and the GNSS differential enhancement area coding information, including subscription object addition or subscription object deletion and subscription object switching.

[0023] Based on the different types of network information obtained from parsing multiple network data, the specific operations required for the subscription objects of the users corresponding to the network connections are determined based on the types of network information obtained. Each coroutine then determines the final subscription content based on each specific operation and sends the determined subscription content to the first broadcast thread, thereby adjusting the subsequent broadcast process of the first broadcast thread. The above determination process is implemented by the functions contained in the created coroutines, eliminating the need for the system to perform other operations on the network information, reducing the computer resource consumption of the computer program and saving the proportion of system operating resources.

[0024] Among them, the specific operations of subscribing to content provided by the present invention include adding subscription objects, deleting subscription objects and switching subscription objects. The coroutine can use the function to determine the type of network information and then determine the specific adjustment operations that need to be performed on the network connection according to the subscription situation.

[0025] As a preferred example, before calling the first broadcast thread, the method further includes:

[0026] Listening for and receiving a network connection trigger signal, parsing the network connection trigger signal to obtain a corresponding first network connection, and creating a corresponding first environment context based on the corresponding first network connection, so that the first network connection is associated with the first environment context;

[0027] After association, the first network connection is added to the connection to be authenticated queue for authentication, so that the first network connection is added to the service to be broadcast queue after being authenticated.

[0028] In order to ensure the receiving efficiency of multiple network connections, the present invention obtains a first network connection by monitoring a trigger signal and parsing the trigger signal, creates a corresponding first environment context based on the first network connection, associates the first network connection with the first environment context, and adds the associated first network connection to a connection to be authenticated queue, so that the authenticated network connection enters a service to be broadcast queue, providing a data basis for subsequent adjustment operations on the operating environment of the coroutine.

[0029] As a preferred example, the step of adding the first network connection to the service to-be-broadcasted queue after being authenticated specifically includes:

[0030] Retrieving and parsing the first network connection from the connection to be authenticated queue to obtain first authentication information;

[0031] parsing and determining whether the first authentication information is valid, and if the parsing determines that the first authentication information is valid, adding the first network connection to a queue for broadcasting the first service;

[0032] If the analysis determines that the first authentication information is invalid, the first network connection is added to an exception queue to be processed.

[0033] To improve the security of normal system operation, the present invention analyzes and determines whether the first authentication information contained in the first network connection is valid. Only network connections whose first authentication information is confirmed to be valid can enter the service broadcast queue. This authentication step not only improves the ability to determine the security and threat level of network connections, but also prevents malicious attacks on network connections from causing destructive damage to the normal operation of the system.

[0034] At the same time, if the above authentication fails, the corresponding network connection will be added to the exception processing queue and wait for subsequent exception processing.

[0035] As a preferred example, sending the subscribed content to the first broadcast thread so that the first broadcast thread broadcasts the subscribed content specifically includes:

[0036] Running the first broadcast thread to receive the subscription content and the satellite positioning enhancement service and determining an update status of the satellite positioning enhancement service in a service to be broadcasted area, and adjusting subscription status of a plurality of network connections included in the service to be broadcasted area according to the subscription content;

[0037] After determination, the first broadcast thread is run to send the satellite positioning enhancement service to the plurality of network connections according to the update status of the satellite positioning enhancement service, and when an abnormality occurs during the broadcast process, the network connection with the abnormality is added to the abnormality queue.

[0038] After the broadcast method provided by the present invention hands over the subscription-related services to the coroutine technology for processing, the work originally handled by the thread is left with determining the update status of the satellite positioning enhancement service in the service to be broadcast area, and adjusting the subscription status of the corresponding network connection according to the determined subscription content. At the same time, the updated satellite positioning enhancement service is sent to the network connection according to the update status of the satellite positioning enhancement service, and when an abnormality occurs in the broadcast, the abnormal network connection is added to the abnormality queue to be processed, waiting for subsequent processing.

[0039] Since the threads in this broadcasting method only need to undertake monitoring, authentication, exception handling and sending of the satellite positioning enhancement service, a large amount of computing resources required for multi-threaded synchronous execution and multi-threaded switching processing technology are saved to achieve the goal of improving the concurrency index of the system broadcasting process.

[0040] As a preferred example, after adding the abnormal network connection to the abnormality queue, the method further includes:

[0041] Determine and retrieve a first exception to be processed from the exception processing queue, and perform exception processing on the first exception to be processed according to the exception type corresponding to the first exception to be processed;

[0042] After the exception is handled, the network connection information corresponding to the first pending exception that has been handled is recorded in the system operation log of the GNSS enhanced service broadcasting system.

[0043] Exception handling is performed on the pending exception according to the exception type corresponding to the pending exception, and the abnormal network connection information corresponding to the pending exception is recorded in the system operation log, so that the user can retrieve and view the abnormal network connection later.

[0044] Accordingly, the present invention also provides a satellite positioning enhancement service broadcasting device based on the coroutine technology, wherein the broadcasting device includes a coroutine creation module, an environment adjustment module, a content determination module, and a content broadcasting module;

[0045] The coroutine creation module is configured to receive a satellite positioning enhancement service and call a first broadcast thread, determine a corresponding first service to-be-broadcast queue according to the first broadcast thread, and create one-to-one corresponding coroutines for each of the network connections in the first service to-be-broadcast queue;

[0046] The environment adjustment module is used to analyze the plurality of network connections to obtain a plurality of network data, and adjust the running environment of each of the coroutines according to the plurality of network data;

[0047] The content determination module is used to run each of the coroutines, so that each of the coroutines determines the corresponding subscription content according to its own operating environment and network data;

[0048] The content broadcasting module is used to send the subscription content and the satellite positioning enhancement service to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content.

[0049] The broadcasting device provided by the present invention can implement any of the broadcasting methods described above, and has a simple structure and is easy to operate.

[0050] As a preferred example, the broadcasting device further includes a signal monitoring module, a connection authentication module and an exception handling module;

[0051] The signal monitoring module is configured to monitor and receive a network connection trigger signal, parse the network connection trigger signal to obtain a corresponding first network connection, create a corresponding first environment context based on the corresponding first network connection, associate the first network connection with the first environment context, and add the first network connection to a connection to be authenticated queue for authentication after the association, so that the first network connection is added to the service to be broadcast queue after being authenticated;

[0052] The connection authentication module is configured to retrieve and parse the first network connection from the connection to-be-authenticated queue, obtain first authentication information, parse and determine whether the first authentication information is valid, and if the analysis determines that the first authentication information is valid, add the first network connection to the first service to-be-broadcast queue; if the analysis determines that the first authentication information is invalid, add the first network connection to the exception to-be-processed queue;

[0053] The exception handling module is used to determine and retrieve the first pending exception from the exception pending queue, perform exception handling on the first pending exception according to the exception type corresponding to the first pending exception, and record the network connection information corresponding to the first pending exception that has been processed into the system operation log of the GNSS enhanced service broadcasting system after the exception handling is completed.

[0054] Correspondingly, the present invention also provides a GNSS enhancement service broadcasting system, which includes a memory, a processor, and a computer program stored on the memory and running on the processor. When the processor processes the computer program, it implements any of the above-mentioned satellite positioning enhancement service broadcasting methods based on coroutine technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 : A flow chart of an embodiment of a method for broadcasting satellite positioning enhancement services based on the coroutine technology provided by the present invention;

[0056] Figure 2 : A flow chart of an embodiment of step 102 provided by the present invention;

[0057] Figure 3 : A schematic flow chart of an embodiment of step 103 provided by the present invention;

[0058] Figure 4 : A flow chart of an embodiment of step 104 provided by the present invention;

[0059] Figure 5 : A flow chart of another embodiment of the satellite positioning enhancement service broadcasting method based on the coroutine technology provided by the present invention;

[0060] Figure 6 : A structural diagram of an embodiment of a satellite positioning enhancement service broadcasting device based on coroutine technology provided by the present invention. DETAILED DESCRIPTION

[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0062] Example 1

[0063] Please refer to Figure 1 , which is a flow chart of an embodiment of a method for broadcasting satellite positioning enhancement services based on coroutine technology provided by an embodiment of the present invention, including steps 101 to 104, each of which is specifically as follows:

[0064] Step 101: Receive a satellite positioning enhancement service and call a first broadcast thread, determine a corresponding first service to-be-broadcast queue according to the first broadcast thread, and create one-to-one corresponding coroutines for each of the network connections in the first service to-be-broadcast queue.

[0065] In the prior art, computer OS systems usually use threads as the minimum scheduling unit for computing tasks. In order to obtain more OS resources and improve concurrent computing efficiency, the execution program usually adopts a multi-threading mode as the main method and thread switching technology as the auxiliary method to achieve this goal.

[0066] Compared with the prior art, after the system of the embodiment of the present invention accepts the satellite positioning enhancement service and calls and determines the first service to-be-broadcast queue according to the first broadcast thread, it does not adopt the method of creating another working thread to share the work of determining and adjusting the subscription status of the network connection as in the prior art, but creates a one-to-one corresponding coroutine for several network connections in the first service to-be-broadcast queue, so that each coroutine is associated with the corresponding network connection, determines their association relationship, and provides a conditional basis for later determining and adjusting the subscription status of the network connection through the coroutine.

[0067] Step 102: Analyze the plurality of network connections to obtain a plurality of network data, and adjust the operating environment of each of the coroutines according to the plurality of network data.

[0068] Step 103: Run each of the coroutines, so that each of the coroutines determines corresponding subscription content according to its own operating environment and network data.

[0069] In an embodiment of the present invention, the system obtains a number of network data by parsing the number of network connections and adjusts the operating environment of each coroutine based on the number of network data, so that each coroutine can determine the subscription content of the network connection based on its own operating environment and the network data, providing a parameter basis for the subsequent broadcast thread to broadcast according to the subscription content.

[0070] At the same time, this embodiment reduces the large amount of storage space required for thread switching by separating the subscription content determination and adjustment work originally implemented by threads and entrusting it to coroutines, further reduces the number of compatible threads required by the operating system, and reduces the computing resources required for the synchronous operation of a large number of threads.

[0071] Step 104: Send the subscription content and the satellite positioning enhancement service to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content.

[0072] Existing technologies often use multi-threading models and thread switching techniques to achieve the high concurrency of GNSS augmentation service broadcast systems. However, thread switching is a significant overhead for the computer operating system, requiring OS thread scheduling overhead such as pushing thread context, saving the thread context, restoring the thread, and popping the context. Consequently, multi-threaded programs often fail to fully utilize OS computing resources due to thread switching.

[0073] In summary, this broadcasting method separates the subscription content adjustment steps that originally needed to be implemented by several threads and assigns them to their corresponding coroutines for implementation, thereby reducing the number of compatible threads and the storage space required for the synchronous operation of a large number of threads. In response to the problem of a large amount of computing resources being wasted due to the multi-threaded synchronous operation implemented by thread switching technology in the prior art, the method of creating a coroutine to perform subscription content adjustment provided by the present invention assigns the work that originally required thread switching to the created coroutine, thereby improving the degree of utilization of the computer program's computing resources, reducing the waste of computing resources, and reducing the waste of operating system scheduling resources, thereby achieving the high concurrency goal of the GNSS enhancement service broadcasting system. At the same time, it reduces the service broadcasting cost of the GNSS enhancement service broadcasting system and promotes the application and popularization of GNSS differential enhancement services.

[0074] Experiments have shown that, under the same operating environment and the same broadcast delay index requirements, the concurrency index of the GNSS enhanced service broadcast system using the broadcast method provided by the present invention is at least 1 times higher than that of the GNSS enhanced service broadcast system using multi-threading technology.

[0075] As another example of this embodiment, see Figure 2 , Figure 2 The flowchart of an embodiment of step 102 provided by the present invention includes steps 201 to 203. Figure 1 Step 101 is the same as in step 202 to step 203. Figure 1 A specific implementation method of step 102.

[0076] Step 202: parse the plurality of network connections to obtain the corresponding plurality of environmental contexts and plurality of network information.

[0077] Step 203: According to the plurality of environmental contexts, the operating environment of each coroutine is adjusted so that the operating environment of each coroutine is associated with the plurality of environmental contexts in a one-to-one correspondence, and after the association, the plurality of network information is sent to each coroutine.

[0078] The system of this embodiment adjusts the running environment of each coroutine by parsing the network data obtained by the network connection, that is, initializes the running environment so that the running environment of each coroutine is associated with the environment context of the network connection.

[0079] The technology of associating coroutines with network connections provided in this embodiment is because each coroutine has its own corresponding operating environment, and each network connection also has its own corresponding environment context. Therefore, this embodiment improves the association relationship between each coroutine and the several network connections by associating the operating environment of each coroutine with the environment context of the network connection, so that each coroutine can adjust the associated environment context through the operating environment and thereby implement adjustment operations for the subscription content of several network connections, thereby avoiding the problem of a large amount of computing resources being wasted due to the need for multiple threads to implement adjustment operations through thread switching technology.

[0080] At the same time, the present invention also sends the parsed network information to each corresponding coroutine, so that each coroutine determines the specific operation to be included in the subscription content according to the network information.

[0081] As another example of this embodiment, see Figure 3 , Figure 3 The flowchart of an embodiment of step 103 provided by the present invention includes steps 301 to 302, wherein step 302 includes three different situations generated according to step 301 and different specific operations performed according to the three different situations.

[0082] Step 301: Each of the coroutines receives its own network information through its corresponding operating environment, and judges and determines the network information type of the plurality of network information.

[0083] This embodiment receives respective network information from associated network connections through respective operating environments by running each coroutine, judges and determines the type of network information based on the network information, and determines the subscription status that needs to be adjusted for the first broadcast thread based on different network information types.

[0084] Step 302A: If the information type is GGA location information, determine, based on the GGA location information, whether the subscription content of the corresponding network connection is subscription object addition or subscription object deletion.

[0085] The GGA in the GGA location information is a line of ASCII data defined in the NMEA 0183 standard and identified by the string $GPGSA. The system runs each coroutine and, through the coroutine runtime environment, calls the callback function in the coroutine to read the GGA location of the associated network connection, thereby determining the subscription object that the user corresponding to the network connection needs to subscribe to or delete the subscription object.

[0086] Step 302B: If the network information type is GNSS differential enhancement area coding information, determine, based on the GNSS differential enhancement area coding information, that the subscription content of the corresponding network connection is subscription object switching.

[0087] The GNSS differential augmentation region code information is a type of code information defined in this embodiment and identified by the #GID string. The system can run each coroutine and, through the coroutine runtime environment, call the callback function in the coroutine to read the GNSS differential augmentation region code for the associated network connection, thereby determining the subscription object to which the user corresponding to the network connection needs to switch subscription objects.

[0088] Step 302C: If the network information type includes the GGA location information and the GNSS differential enhancement area coding information, then the subscription content of the corresponding network connection is determined based on the GGA location information and the GNSS differential enhancement area coding information, including subscription object addition or subscription object deletion and subscription object switching.

[0089] If the network information includes the above two types, the specific content of the adjustment that the user corresponding to the coroutine-associated network connection needs to make to the subscription object is determined according to the specific content of the above two types of information respectively.

[0090] Therefore, the determination method provided in this embodiment determines the specific types of network information obtained by parsing a number of network data, determines the specific operations that need to be performed on the subscription objects of the users corresponding to the network connection, and enables each coroutine to determine the final subscription content based on each specific operation and send the determined subscription content to the first broadcast thread, thereby adjusting the subsequent broadcast process of the first broadcast thread. The above determination process is implemented by the functions contained in the created coroutines, eliminating the need for the system to perform other operations on the network information, reducing the computer resource consumption of the computer program and saving the proportion of system operating resources.

[0091] Among them, the specific operations of subscribing to content provided by the present invention include adding subscription objects, deleting subscription objects and switching subscription objects. The coroutine can use the function to determine the type of network information and then determine the specific adjustment operations that need to be performed on the network connection according to the subscription situation.

[0092] As another example of this embodiment, see Figure 4 , Figure 4 The flowchart of an embodiment of step 104 provided by the present invention includes steps 401 to 402, and each step is specifically as follows:

[0093] Step 401: Run the first broadcast thread to receive the subscription content and the satellite positioning service and determine the update status of the satellite positioning service in the service to be broadcast area, and adjust the subscription status of several network connections included in the service to be broadcast area according to the subscription content.

[0094] Step 402: After determination, the first broadcast thread is run to send the satellite positioning service to the plurality of network connections according to the update status of the satellite positioning service, and when an exception occurs during the broadcast process, the network connection with the exception is added to an exception queue for processing.

[0095] After the broadcast method provided in this embodiment hands over the subscription-related services to the coroutine technology for processing, the remaining tasks originally handled by the thread are to determine the update status of the satellite positioning enhancement service in the service to be broadcast area, and adjust the subscription status of the corresponding network connection according to the determined subscription content. At the same time, the updated satellite positioning enhancement service is sent to the network connection according to the update status of the satellite positioning enhancement service in the service to be broadcast area, and when an abnormality occurs in the broadcast, the abnormal network connection is added to the abnormality queue for processing, waiting for subsequent processing.

[0096] Example 2

[0097] Please refer to Figure 5, which is a flow chart of another embodiment of the satellite positioning enhancement service broadcasting method based on the coroutine technology provided by the present invention, wherein the broadcasting method adopted in step 503A is the satellite positioning enhancement service broadcasting method based on the coroutine technology described in Example 1. Figure 5 The process includes steps 501 to 505, each of which is as follows:

[0098] Step 501: monitor and receive a network connection trigger signal, parse the network connection trigger signal to obtain a corresponding first network connection, and create a corresponding first environment context based on the corresponding first network connection, so that the first network connection is associated with the first environment context.

[0099] In this embodiment, this step is implemented by a network listening thread. The system runs the network listening thread, so that the network listening thread starts the TCP / IP network connection listening service, and at the same time asynchronously listens for new TCP / IP network connections through the epoll mode (a network programming model provided by the Linux operating system), that is, listens and receives the network connection trigger signal. When a new TCP / IP network connection enters, the corresponding first network connection is obtained according to the network connection trigger signal, and the corresponding first environment context is created according to the network connection, providing a data basis for the subsequent broadcast of the network connection through the coroutine.

[0100] At the same time, the network monitoring thread also asynchronously monitors the status of the TCP / IP network connection monitoring service according to the functions it contains, and rebuilds the network monitoring service when a status abnormality signal is triggered.

[0101] Step 502: After association, the first network connection is added to a connection waiting for authentication queue, the first network connection is retrieved and parsed from the connection waiting for authentication queue, first authentication information is obtained, and the first authentication information is parsed and determined to be valid.

[0102] In this embodiment, this step is implemented by a connection authentication thread. The system runs the connection authentication thread so that the connection authentication thread retrieves the first network connection from the connection to be authenticated queue and parses the first authentication information from the first network connection. In this embodiment, the first authentication information includes first authentication data and first subscription information, wherein the first authentication data is used to determine the security and timeliness of the corresponding network connection, thereby improving the security and stability of the system operation, avoiding the occurrence of a malicious attack on the network connection, thereby affecting the security and stability of the system operation, and further affecting the user's use. The first subscription information is used to determine the validity of the network data, thereby avoiding the problem of invalid network data occupying system operation resources and causing useless consumption of computing resources, thereby effectively improving the utilization rate of computing resources.

[0103] Step 503A: If the analysis determines that the first authentication information is valid, the first network connection is added to the first service to-be-advertised queue, so that the first connection can be advertised according to the advertisement method described in the first embodiment.

[0104] Step 503B: If the analysis determines that the first authentication information is invalid, the first network connection is added to an exception queue to be processed.

[0105] The above two methods perform different execution operations for different judgment results generated in step 502. Since the first authentication information provided in this embodiment includes the first authentication data and the first subscription information, the system judges the validity of the first authentication data and the first subscription information in turn by running the connection authentication thread. If the authentication thread judges that the first authentication data is valid, it enters the second stage of judgment, i.e., judging the validity of the first subscription information. If it is determined that the first subscription information is valid, the first network connection is added to the first service to-be-broadcast queue, so that the first connection can be broadcast according to the broadcast method described in Example 1. At the same time, the method for selecting the first service to-be-broadcast queue provided in this embodiment is to select according to the load level of several service to-be-broadcast queues, and add the authenticated network connection to the broadcast queue with a lower broadcast load level for broadcast. The embodiment of the present invention does not further limit this selection method.

[0106] If the authentication thread determines that the first authentication data is invalid, the network connection will be added to the exception queue. At the same time, if the first authentication data is determined to be valid in the first stage, but the first subscription information is determined to be invalid in the second stage, the network connection will also be added to the exception queue, waiting for subsequent exception processing.

[0107] Step 504: Determine and retrieve a first exception to be processed from the exception processing queue, and perform exception processing on the first exception to be processed according to the exception type corresponding to the first exception to be processed.

[0108] Step 505: After the exception is handled, the network connection information corresponding to the first pending exception that has been handled is recorded in the system operation log of the GNSS enhanced service broadcasting system.

[0109] In this embodiment, this step is implemented by an exception handling thread. The system runs the exception handling thread, causing it to retrieve the first pending exception from the pending exception queue in real time according to the function it contains, and perform exception handling on the pending exception based on the type of the pending exception. Since the pending exception is a network connection that has not passed authentication or failed to be broadcast, the processing thread retrieves the pending abnormal network connection from the pending exception queue and performs exception handling on the network connection based on the connection type of the abnormal network connection.

[0110] At the same time, after the exception is handled, the network connection information of the handled abnormal network connection will be recorded in the system's operation log, which is convenient for users to retrieve and view the abnormal network connection later.

[0111] Accordingly, in order to better illustrate the working principle and step flow of a satellite positioning enhancement service broadcasting method and device based on coroutine technology of the present invention, reference may be made to, but not limited to, the relevant records above.

[0112] Accordingly, see Figure 6 , Figure 6 This is a structural diagram of an embodiment of a satellite positioning enhancement service broadcasting device based on coroutine technology provided by the present invention. Figure 6 The broadcasting device includes a signal monitoring module 601 , a connection authentication module 602 , a coroutine creation module 603 , an environment adjustment module 604 , a content determination module 605 , a content broadcasting module 606 and an exception handling module 607 .

[0113] The signal monitoring module 601 is used to monitor and receive a network connection trigger signal, parse the network connection trigger signal to obtain a corresponding first network connection, and create a corresponding first environment context based on the corresponding first network connection, so that the first network connection is associated with the first environment context, and after the association, the first network connection is added to the connection to be authenticated queue for authentication, so that the first network connection is added to the service to be broadcast queue after being authenticated. Authenticating the first network connection so that the first network connection is added to the service to be broadcast queue after being authenticated is specifically as follows:

[0114] Retrieving and parsing the first network connection from the connection to be authenticated queue to obtain first authentication information;

[0115] parsing and determining whether the first authentication information is valid, and if the parsing determines that the first authentication information is valid, adding the first network connection to a queue for broadcasting the first service;

[0116] If the analysis determines that the first authentication information is invalid, the first network connection is added to an exception queue to be processed.

[0117] The connection authentication module 602 is used to retrieve and parse the first network connection from the connection to be authenticated queue, obtain first authentication information, parse and determine whether the first authentication information is valid; if the analysis determines that the first authentication information is valid, the first network connection is added to the first service to be broadcast queue; if the analysis determines that the first authentication information is invalid, the first network connection is added to the exception to be processed queue.

[0118] The coroutine creation module 603 is used to receive the satellite positioning enhancement service and call the first broadcast thread, determine the corresponding first service to-be-broadcast queue according to the first broadcast thread, and create one-to-one corresponding coroutines for several network connections in the first service to-be-broadcast queue.

[0119] The environment adjustment module 604 is used to analyze the plurality of network connections to obtain a plurality of network data, and adjust the operating environment of each of the coroutines according to the plurality of network data. Specifically, it includes:

[0120] Parse the plurality of network connections to obtain the corresponding plurality of environmental contexts and a plurality of network information; adjust the operating environment of each coroutine according to the plurality of environmental contexts so that the operating environment of each coroutine is associated one-to-one with the plurality of environmental contexts, and after the association, send the plurality of network information to each coroutine.

[0121] The content determination module 605 is used to run each of the coroutines so that each coroutine determines the corresponding subscription content according to its own operating environment and network data. Specifically, it includes:

[0122] Each of the coroutines receives its own network information through its corresponding operating environment, and judges and determines the network information type of the plurality of network information;

[0123] If the network information type is GGA location information, determining, according to the GGA location information, whether the subscription content of the corresponding network connection is subscription object addition or subscription object deletion;

[0124] If the network information type is GNSS differential enhancement area coding information, determining, according to the GNSS differential enhancement area coding information, that the subscription content of the corresponding network connection is subscription object switching;

[0125] If the network information type includes the GGA location information and the GNSS differential enhancement area coding information, the subscription content of the corresponding network connection is determined according to the GGA location information and the GNSS differential enhancement area coding information, including subscription object addition or subscription object deletion and subscription object switching.

[0126] The content broadcasting module 606 is used to send the subscription content and the satellite positioning enhancement service to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content. Specifically, it includes:

[0127] Running the first broadcast thread to receive the subscription content and the satellite positioning enhancement service and determining an update status of the satellite positioning enhancement service in a service to be broadcasted area, and adjusting subscription status of a plurality of network connections included in the service to be broadcasted area according to the subscription content;

[0128] After determination, the first broadcast thread is run to send the satellite positioning enhancement service to the plurality of network connections according to the update status of the satellite positioning enhancement service, and when an abnormality occurs during the broadcast process, the abnormal network connection is added to the abnormality queue.

[0129] The exception handling module 607 is used to determine and retrieve the first pending exception from the exception pending queue, perform exception handling on the first pending exception according to the exception type corresponding to the first pending exception, and record the network connection information corresponding to the first pending exception that has been processed into the system operation log of the GNSS enhanced service broadcasting system after the exception handling is completed.

[0130] At the same time, this embodiment also provides a GNSS enhanced service broadcasting system, which includes a memory, a processor, and a computer program stored on the memory and running on the processor. When the processor processes the computer program, it implements any of the above-mentioned thread broadcasting methods based on coroutine technology.

[0131] In summary, the present invention provides a satellite positioning enhancement service broadcasting method and device based on coroutine technology, which is applied to the GNSS enhancement service broadcasting system. By calling and determining the first service to-be-broadcasted queue according to the first broadcasting thread, a one-to-one corresponding coroutine is created for each of the network connections in the first service to-be-broadcasted queue. After creation, the several network connections are parsed to obtain several types of network data, and the operating environment of each coroutine is adjusted according to the several types of network data, so that the operating environment of each coroutine corresponds to the several network connections one-to-one, thereby enabling the several coroutines to adjust the subscription content for their corresponding network connections, and further enabling the first broadcasting thread to broadcast the corresponding satellite positioning enhancement service according to the adjusted subscription content. This broadcasting method transfers the subscription content adjustment step that originally needed to be implemented by the thread to the coroutine, thereby reducing the number of threads that need to be compatible, and at the same time reducing the storage space required for the synchronous operation of a large number of threads; the work that originally needed to be solved by switching threads is transferred to the created coroutine, thereby improving the degree to which the computing resources of the computer program are fully utilized and reducing the waste of computing resources.

[0132] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A satellite positioning enhancement service broadcasting method based on coroutine technology, characterized in that: Applied to the GNSS augmentation service broadcasting system, the following steps are included: Receive a satellite positioning enhancement service and call a first broadcast thread, determine a corresponding first service to-be-broadcast queue according to the first broadcast thread, and create a one-to-one corresponding coroutine for each of the network connections in the first service to-be-broadcast queue; parsing the plurality of network connections to obtain a plurality of network data, and adjusting the operating environment of each of the coroutines according to the plurality of network data; Running each of the coroutines so that each of the coroutines determines corresponding subscription content according to its own operating environment and network data; The subscription content and the satellite positioning enhancement service are sent to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content.

2. The satellite positioning enhancement service broadcasting method based on the coroutine technology according to claim 1, characterized in that: The analyzing the plurality of network connections to obtain a plurality of network data, and adjusting the operating environment of each of the coroutines according to the plurality of network data, specifically includes: Parsing the plurality of network connections to obtain corresponding plurality of environmental contexts and plurality of network information; According to the several environmental contexts, the operating environment of each coroutine is adjusted so that the operating environment of each coroutine is associated with the several environmental contexts in a one-to-one correspondence, and after the association, the several network information is sent to each coroutine.

3. The satellite positioning enhancement service broadcasting method based on coroutine technology according to claim 1, characterized in that: The method of enabling each coroutine to determine the corresponding subscription content according to its own operating environment and network data is as follows: Each of the coroutines receives its own network information through its corresponding operating environment, and judges and determines the network information type of the plurality of network information; If the network information type is GGA location information, determining, according to the GGA location information, whether the subscription content of the corresponding network connection is subscription object addition or subscription object deletion; If the network information type is GNSS differential enhancement area coding information, determining, according to the GNSS differential enhancement area coding information, that the subscription content of the corresponding network connection is subscription object switching; If the network information type includes the GGA location information and the GNSS differential enhancement area coding information, the subscription content of the corresponding network connection is determined according to the GGA location information and the GNSS differential enhancement area coding information, including subscription object addition or subscription object deletion and subscription object switching.

4. The satellite positioning enhancement service broadcasting method based on coroutine technology according to claim 1, characterized in that: Before calling the first broadcast thread, the method further includes: Listening for and receiving a network connection trigger signal, parsing the network connection trigger signal to obtain a corresponding first network connection, and creating a corresponding first environment context based on the corresponding first network connection, so that the first network connection is associated with the first environment context; After association, the first network connection is added to the connection to be authenticated queue for authentication, so that the first network connection is added to the service to be broadcast queue after being authenticated.

5. The satellite positioning enhancement service broadcasting method based on the coroutine technology according to claim 4, characterized in that: The step of adding the first network connection to the service to-be-broadcasted queue after being authenticated specifically includes: Retrieving and parsing the first network connection from the connection to be authenticated queue to obtain first authentication information; parsing and determining whether the first authentication information is valid, and if the parsing determines that the first authentication information is valid, adding the first network connection to a queue for broadcasting the first service; If the analysis determines that the first authentication information is invalid, the first network connection is added to an exception queue to be processed.

6. The satellite positioning enhancement service broadcasting method based on coroutine technology according to claim 1, characterized in that: The sending the subscription content and the satellite positioning enhancement service to the first broadcast thread, so that the first broadcast thread broadcasts the satellite positioning enhancement service according to the subscription content, specifically includes: Running the first broadcast thread to receive the subscription content and the satellite positioning enhancement service and determining an update status of the satellite positioning enhancement service in a service to be broadcasted area, and adjusting subscription status of a plurality of network connections included in the service to be broadcasted area according to the subscription content; After determination, the first broadcast thread is run to send the satellite positioning enhancement service to the plurality of network connections according to the update status of the satellite positioning enhancement service, and when an abnormality occurs during the broadcast process, the abnormal network connection is added to the abnormality queue.

7. The satellite positioning enhancement service broadcasting method based on coroutine technology according to claim 6, characterized in that: After adding the abnormal network connection to the abnormality waiting queue, the method further includes: Determine and retrieve a first exception to be processed from the exception processing queue, and perform exception processing on the first exception to be processed according to the exception type corresponding to the first exception to be processed; After the exception is handled, the network connection information corresponding to the first pending exception that has been handled is recorded in the system operation log of the GNSS enhanced service broadcasting system.

8. A satellite positioning enhancement service broadcasting device based on coroutine technology, characterized in that: The broadcasting device includes a coroutine creation module, an environment adjustment module, a content determination module and a content broadcasting module; The coroutine creation module is configured to receive a satellite positioning enhancement service and call a first broadcast thread, determine a corresponding first service to-be-broadcast queue according to the first broadcast thread, and create one-to-one corresponding coroutines for each of the network connections in the first service to-be-broadcast queue; The environment adjustment module is used to analyze the plurality of network connections to obtain a plurality of network data, and adjust the running environment of each of the coroutines according to the plurality of network data; The content determination module is used to run each of the coroutines, so that each of the coroutines determines the corresponding subscription content according to its own operating environment and network data; The content broadcasting module is used to send the subscription content and the satellite positioning enhancement service to the first broadcasting thread, so that the first broadcasting thread broadcasts the satellite positioning enhancement service according to the subscription content.

9. The satellite positioning enhancement service broadcasting device based on coroutine technology according to claim 8, characterized in that: The broadcasting device also includes a signal monitoring module, a connection authentication module and an exception handling module; The signal monitoring module is configured to monitor and receive a network connection trigger signal, parse the network connection trigger signal to obtain a corresponding first network connection, create a corresponding first environment context based on the corresponding first network connection, associate the first network connection with the first environment context, and add the first network connection to a connection to be authenticated queue for authentication after the association, so that the first network connection is added to the service to be broadcast queue after being authenticated; The connection authentication module is configured to retrieve and parse the first network connection from the connection to-be-authenticated queue, obtain first authentication information, parse and determine whether the first authentication information is valid, and if the analysis determines that the first authentication information is valid, add the first network connection to the first service to-be-broadcast queue; if the analysis determines that the first authentication information is invalid, add the first network connection to the exception to-be-processed queue; The exception handling module is used to determine and retrieve the first pending exception from the exception pending queue, perform exception handling on the first pending exception according to the exception type corresponding to the first pending exception, and record the network connection information corresponding to the first pending exception that has been processed into the system operation log of the GNSS enhanced service broadcasting system after the exception handling is completed.

10. A GNSS enhancement service broadcasting system, characterized in that: The broadcasting system includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor processes the computer program, it implements a satellite positioning enhancement service broadcasting method based on coroutine technology as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Coroutine-based server monitoring method, equipment and readable medium

    CN110445669A

  • Cooperative scheduling using coroutines and threads

    CN1967487A