Application data processing method and system, computer device and storage medium

By creating threads in the application and using event signals to drive the query of linked list data, combined with a thread lock mechanism, the data processing flow of multiple logical channels is optimized, the resource waste problem in the synchronous polling mode is solved, and efficient data acquisition and resource utilization are achieved.

CN114064776BActive Publication Date: 2026-02-17LAUNCH TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111367179.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2026-02-17
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

In existing technologies, applications using multiple logical channels waste resources and time during data processing due to the synchronous polling reception mode, resulting in low reception efficiency and excessive resource consumption, which cannot meet the high-efficiency processing needs of most applications.

Method used

This paper provides an application data processing method that creates a thread and queries a linked list based on event signals. The application is notified to retrieve the data only when the target data is found. A thread lock mechanism is used to prevent data processing errors. The method supports asynchronous notification, synchronous polling, and simultaneous receiving modes, thus optimizing the data retrieval process.

Benefits of technology

This reduces resource consumption, improves data processing efficiency, ensures that the application only calls the interface to obtain data for linked lists containing target data, and reduces operational complexity and error probability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064776B_ABST
    Figure CN114064776B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an application data processing method, system, computer device and storage medium. The application data processing method comprises: starting an application, the application comprising at least two logical channels; creating a thread, the driving thread being in a waiting state; querying at least two linked list data according to a received event signal, the at least two linked list data corresponding to the at least two logical channels one by one; when target data existing in current linked list data corresponding to a current logical channel is found, notifying the application to call an invocation interface to obtain the target data. The embodiments of the present application can effectively save resources and improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of data processing, in particular to an application data processing method and system, a computer device and a storage medium. BACKGROUND

[0002] Currently, for the application program using multiple logical channels for data processing, a synchronous polling receiving mode is used in the data processing process. The synchronous polling receiving mode needs to sort multiple logical channels of the application program, and sequentially obtains data in each logical channel. Most of the logical channels have no data, and the obtained result is empty, which leads to excessive waste of resources and time on channels without data, resulting in low efficiency of receiving and excessive occupation of resources, which cannot meet the needs of most application programs for efficient data processing. SUMMARY

[0003] The technical problem to be solved by embodiments of the present application is that excessive resources and time are wasted on channels without data, resulting in low efficiency of receiving and excessive occupation of resources, which cannot meet the needs of most diagnostic application programs. In view of the above defects of the prior art, an application data processing method, system, computer device and storage medium are provided.

[0004] The technical solution adopted by embodiments of the present application to solve the technical problem is: providing an application data processing method, the method comprising: starting an application program, the application program comprising at least two logical channels; creating a thread, and driving the thread to be in a waiting state; driving the thread to query at least two linked list data according to a received event signal, the at least two linked list data corresponding to the at least two logical channels one by one; when target data exists in current linked list data corresponding to a current logical channel, notifying the application program to call an invocation interface to obtain the target data.

[0005] The method further comprises: when driving the thread to query the current linked list data corresponding to the current logical channel, adding a first thread lock to the current linked list data, and when the query of the current linked list data corresponding to the current logical channel is completed, releasing the first thread lock.

[0006] The notification of the application program to call the invocation interface to obtain the target data further comprises: when the application program calls the invocation interface to obtain the target data, adding a second thread lock to an interface function of the invocation interface, and when the application program obtains the target data, releasing the second thread lock.

[0007] The method further comprises: sequentially obtaining linked list data corresponding to each logical channel in the at least two logical channels by calling the invocation interface.

[0008] The method further includes: obtaining a data receiving mode that matches the application requirements; if the data receiving mode is an asynchronous notification mode, then executing the steps of creating a thread to obtaining target data according to the asynchronous notification mode; if the data receiving mode is a synchronous polling mode, then executing the steps of calling the calling interface to sequentially obtain the linked list data corresponding to each of the at least two logical channels to obtain the target data according to the synchronous polling mode; if the data receiving mode is a simultaneous receiving mode, then executing the steps of creating a thread and obtaining target data according to the simultaneous receiving mode, and simultaneously executing the steps of calling the calling interface to sequentially obtain the linked list data corresponding to each of the at least two logical channels to obtain the target data.

[0009] Specifically, the step of calling the API to sequentially obtain the linked list data corresponding to each of the at least two logical channels includes: if the current linked list data corresponding to the current logical channel is not empty, then copy the current linked list data to the returned data and delete the linked list buffer where the current linked list data is located; if the current linked list data corresponding to the current logical channel is empty, then return an empty result.

[0010] After notifying the application to call the API to obtain the target data, the method further includes: copying the target data to the returned data and deleting the linked list buffer where the current linked list data corresponding to the target data is located.

[0011] The technical solution adopted by this application embodiment to solve its technical problem is: an application data processing system, comprising the following modules: a startup module for starting an application, the application including at least two logical channels; a thread module for creating threads and driving the threads to be in a waiting state; a query module for driving the threads to query at least two linked list data according to received event signals, the at least two linked list data corresponding one-to-one with the at least two logical channels; and a calling module for notifying the application to call the calling interface to obtain the target data when the target data is found to exist in the current linked list data corresponding to the current logical channel.

[0012] The technical solution adopted by the embodiments of this application to solve its technical problem is: to provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the processor performs the steps of the method described above.

[0013] The technical solution adopted by the embodiments of this application to solve its technical problem is: to provide a storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the steps of the method described above.

[0014] The beneficial effect of this application embodiment is that, compared with the prior art, this application embodiment obtains the target data in at least two linked lists in the linked list buffer by using at least two logical channels of the application. If there is no data in the linked list, then there are multiple logical channels. Detecting whether the target data exists in each linked list does not consume much time, and it can quickly respond to event signals. This allows the application to call the API interface to obtain the target data only for the linked list with target data, reducing resource consumption and improving work efficiency. Attached Figure Description

[0015] The embodiments of this application will be further described below with reference to the accompanying drawings and examples. In the accompanying drawings:

[0016] Figure 1 This is a flowchart illustrating the first embodiment of the application data processing method provided in this application.

[0017] Figure 2 This is a flowchart illustrating a second embodiment of the application data processing method provided in this application.

[0018] Figure 3 This is a flowchart illustrating the third embodiment of the application data processing method provided in this application.

[0019] Figure 4 This is a schematic diagram of the structure of an embodiment of the multi-channel data receiving system provided in this application.

[0020] Figure 5 This is a schematic diagram of the structure of an embodiment of the computer device provided in this application;

[0021] Figure 6 This is a schematic diagram of the structure of one embodiment of the storage medium provided in this application. Detailed Implementation

[0022] The preferred embodiments of the present application will now be described in detail with reference to the accompanying drawings.

[0023] Please see Figure 1 , Figure 1This is a flowchart illustrating the first embodiment of the application data processing method provided in this application. The application data processing method provided in this application is applied to an electronic device configured with an application. This electronic device can be a computer, personal computer (PC), mobile terminal, personal digital assistant, or other electronic device with logical calculation and processing functions. The application configured in this electronic device has multiple logical channels, such as a diagnostic application. The application needs to read data from a linked list buffer, which includes an array of linked lists consisting of multiple linked lists. These multiple linked lists are set according to multiple channels and correspond one-to-one with the multiple channels of the application. At least one of the multiple linked lists stores data, and the application can obtain the data in these linked lists by calling an API.

[0024] The application data processing method provided in this embodiment includes the following steps:

[0025] S101: Start the application, which includes at least two logical channels.

[0026] Specifically, users can launch the application by clicking the application icon, or by waking it up in other ways such as voice wake-up or input wake-up. In this embodiment, the application includes diagnostic applications or applications for other purposes, such as image display applications or search applications. The application includes at least two logical channels, which are channels that are connected under logical conditions. Each logical channel can be used to query linked list data, and each logical channel can query one linked list data at a time.

[0027] S102: Create a thread; the driving thread is in a waiting state.

[0028] In a specific implementation scenario, a thread is created within the application. Taking a diagnostic application as an example, when the diagnostic application uses the D-PDU (Diagnostic Protocol Data Unit) protocol, a thread is created within the D-PDU diagnostic API. The D-PDU diagnostic protocol supports both asynchronous and synchronous reception modes. This thread is driven into a waiting state, and upon receiving a notification that data is available for reception, it immediately notifies the application to retrieve the receivable data from the linked list buffer. In this implementation scenario, the thread remains in a state of waiting to receive event signals and does not consume CPU resources.

[0029] S103: Based on the received event signal, drive the thread to query at least two linked list data, and at least two linked list data correspond one-to-one with at least two logical channels.

[0030] In a specific implementation scenario, when an event signal is received in a thread, the driving thread sequentially queries multiple linked lists corresponding to multiple channels. For example, if the application is a diagnostic API, an event signal is immediately generated upon receiving data from an ECU (Electronic Control Unit). When an event signal is received in a thread, the driving thread sequentially queries multiple linked lists corresponding to multiple channels. In one implementation scenario, the multiple linked lists are sorted, or the multiple channels are sorted, and the linked lists are queried sequentially according to the sorting.

[0031] S104: When the target data is found in the current linked list corresponding to the current channel, the application is notified to call the API to obtain the target data.

[0032] In a specific implementation scenario, when the target data is found in the current linked list corresponding to the current channel, the application is notified to call the API to retrieve the target data. For example, the application includes three logical channels A, B, and C, and linked lists a, b, and c correspond to logical channels A, B, and C, respectively. If the target data exists in linked list a corresponding to logical channel A, a notification is sent to the application. The notification includes the channel identifier and / or the linked list identifier, allowing the application to retrieve the target data from linked list a based on either the channel identifier or the linked list identifier.

[0033] In one implementation scenario, if the target data is not found in the current linked list corresponding to the current logical channel, the next linked list corresponding to the next logical channel is queried. For example, if linked list b corresponding to logical channel B is checked and no data is found in linked list b, then linked list c corresponding to the next logical channel C is checked. If the target data exists in linked list c, a notification is sent to the application as described above. The notification includes the channel identifier and / or linked list identifier, allowing the application to retrieve the target data from linked list c based on either the channel identifier or the linked list identifier. If the target data is not found in linked list c, it is checked whether there are any unchecked linked lists of logical channels. If no unchecked linked lists of logical channels are found, the process ends.

[0034] In this implementation scenario, when the target data is found in the current linked list corresponding to the current logical channel, the callback function is executed to send a notification to the application. After receiving the notification, the application calls the API to obtain the target data in the current linked list according to the notification.

[0035] In some specific implementations, when the driving thread queries the current linked list corresponding to the current logical channel, a first thread lock is applied to the linked list data. Applying a first thread lock prevents other threads from simultaneously accessing the linked list data during multi-threaded processing, thus avoiding data processing errors. When the query of the current linked list corresponding to the current logical channel is completed, the first thread lock is released to restore the initial state. For example, in the scenario above, when querying linked list a, a first thread lock is added to the data of linked list a; when the query of linked list a is completed, the first thread lock is released. When querying linked list b, a first thread lock is added to the data of linked list b; when the query of linked list b is completed, the first thread lock is released. When querying linked list c, a first thread lock is added to the data of linked list c; when the query of linked list c is completed, the first thread lock is released.

[0036] In some specific implementation scenarios, when an application calls an API to retrieve target data, a second thread lock is added to the API function. By applying a second thread lock, it prevents other threads from calling the API function during multi-threaded processing, thus avoiding data processing exceptions. After the application retrieves the target data, the second thread lock is released to restore the initial state of the API function. For example, in the scenario above, when the application calls the API to retrieve target data from linked list 'a', a second thread lock is added to the API function; when the data in linked list 'a' is retrieved, the second thread lock is released. Similarly, when the application calls the API to retrieve target data from linked list 'c', a second thread lock is added to the API function; when the data in linked list 'c' is retrieved, the second thread lock is released.

[0037] In a specific implementation scenario, it is determined whether multiple linked lists have been queried. If multiple linked lists have not been queried, step S104 is continued, querying at least one linked list after the current linked list, until multiple linked lists have been queried. For example, in the above example, after checking linked list c of channel C, if there are multiple channels E, F, G, etc., and their corresponding linked lists e, f, g, etc., after channel C, the steps described above are followed to check whether the target data exists in linked lists e, f, g, etc. If there are no other linked lists after channel C that have not been checked, the process ends.

[0038] As described above, in this embodiment, the target data in at least two linked lists in the linked list buffer is obtained by using at least two logical channels of the application. If there is no data in the linked list, then there are multiple logical channels. Detecting whether the target data exists in each linked list does not consume much time and can quickly respond to event signals. This allows the application to call the API interface to obtain the target data only for the linked list with target data, reducing resource consumption and improving work efficiency.

[0039] Please see Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the application data processing method provided in this application. The application data processing method provided in this application includes the following steps:

[0040] S201: Start the application, which includes at least two logical channels.

[0041] S202: Create a thread; the driving thread is in a waiting state.

[0042] In a specific implementation scenario, steps S201-S202 are basically the same as steps S101-S102 of the first embodiment of the application data processing method provided in this application, and will not be described again here.

[0043] S203: Based on the received event signal, call the call interface to sequentially obtain the linked list data corresponding to each of the at least two logical channels.

[0044] In a specific implementation scenario, upon receiving an event signal, the application iteratively calls the API interface to retrieve the linked list data corresponding to each logical channel. Multiple channels in the application can be sorted, and the linked list data corresponding to each channel is retrieved sequentially according to the channel order. For example, the application includes three channels A, B, and C, and linked lists a, b, and c correspond to channels A, B, and C respectively. The three channels are sorted as A, B, and C. The linked list data of linked lists a, b, and c are retrieved sequentially according to the sorting.

[0045] S204: If the current linked list data corresponding to the current logical channel is not empty, copy the current linked list data to the returned data and delete the linked list buffer where the current linked list data is located; if the current linked list data corresponding to the current logical channel is empty, the returned result is empty.

[0046] In a specific implementation scenario, if the current linked list data corresponding to the current logical channel is not empty, it means that the current linked list includes the target data. The linked list data is then copied to the returned data, and the linked list buffer containing the linked list data is deleted. For example, if linked list a stores the target data, meaning that the linked list data of linked list a includes the target data, then the linked list data of linked list a is copied to the returned data, and the linked list buffer containing the linked list data of linked list a is deleted.

[0047] In other implementation scenarios, if the linked list data corresponding to the logical channel is empty, the return result will be empty. For example, if linked list b does not store the target data, then the linked list data of linked list b is empty, and the return result will be empty.

[0048] In other implementation scenarios, the linked list buffer can be deleted all at once after all linked list data has been retrieved. Alternatively, the linked list buffer containing each linked list can be deleted after retrieving each linked list data.

[0049] In other implementation scenarios, it is determined whether the linked list data of multiple linked lists has been obtained. If some linked list data has not been obtained, step S201 is continued to obtain the linked list data of at least one linked list after the current linked list, until the linked list data of multiple linked lists has been obtained. For example, in the above example, after obtaining the linked list data of linked list c of channel C, if there are multiple channels E, F, G, etc. after channel C and their corresponding linked lists e, f, g, etc., the linked list data in linked lists e, f, g, etc. are obtained sequentially according to the above steps. If there is no other linked list data after channel C that has not been obtained, the process ends.

[0050] As described above, in this embodiment, the application calls the API to sequentially obtain the linked list data corresponding to each channel. This operation is simple and easy to implement, effectively reducing the complexity of program operation and the probability of errors.

[0051] Please see Figure 3 , Figure 3 This is a flowchart illustrating a third embodiment of the application data processing method provided in this application. The application data processing method provided in this application includes the following steps:

[0052] S301: Start the application, which includes at least two logical channels.

[0053] S302: Create a thread and drive the thread into a waiting state.

[0054] In a specific implementation scenario, steps S301-S302 are basically the same as steps S101-S102 of the first embodiment of the application data processing method provided in this application, and will not be described again here.

[0055] S303: Obtain the receiving data mode that matches the application requirements. If the receiving data mode is asynchronous notification mode, proceed to step S304. If the receiving data mode is synchronous polling mode, proceed to step S307. If the receiving data mode is simultaneous receiving mode, proceed to steps S304 and S307 simultaneously.

[0056] In a specific implementation scenario, the application requirements are obtained, and a data receiving mode that matches these requirements is determined. For example, if the current requirement is rapid response, the data receiving mode is asynchronous notification; if the current requirement is to reduce operational complexity, the data receiving mode is synchronous polling; and if the current requirement is to balance rapid response and low complexity, the data receiving mode is simultaneous reception.

[0057] S304: Based on the received event signal, the driving thread queries at least two linked list data, and the at least two linked list data correspond one-to-one with at least two logical channels.

[0058] S305: When the target data is found in the current linked list data corresponding to the current logical channel, the application is notified to call the API to obtain the target data.

[0059] In a specific implementation scenario, steps S304-S305 are basically the same as steps S103-S104 in the first embodiment of the application data processing method provided in this application, and will not be described again here.

[0060] S306: Copy the target data to the returned data and delete the linked list buffer containing the current linked list corresponding to the target data.

[0061] In a specific implementation scenario, the target data is copied to the returned data, and the linked list buffer corresponding to the target data is deleted. For example, if linked list a contains target data, the target data of linked list a is copied to the returned data, and the linked list buffer corresponding to linked list a is deleted.

[0062] In other implementation scenarios, the linked list buffer can be deleted all at once after all linked list data has been retrieved. Alternatively, the linked list buffer containing each linked list can be deleted after retrieving its data.

[0063] S307: Call the API to retrieve the linked list data corresponding to each of the at least two logical channels in sequence.

[0064] S308: If the current linked list data corresponding to the current logical channel is not empty, copy the current linked list data to the returned data and delete the linked list buffer where the current linked list data is located; if the current linked list data corresponding to the current logical channel is empty, the returned result is empty.

[0065] In a specific implementation scenario, steps S307-S308 are basically the same as steps S201-S202 in the second embodiment of the application data processing method provided in this application, and will not be described again here.

[0066] As described above, in this embodiment, one or both of the asynchronous notification receiving method and the synchronous polling receiving method can be selected according to the user's data retrieval mode instruction. Both receiving methods can be executed simultaneously. Both modes directly read data from the same linked list buffer without data copying, which can improve processing efficiency and simplify data processing steps, thus meeting different user needs.

[0067] It should be understood that, although Figures 1-3 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0068] Please see Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the multi-channel data receiving system provided in this application. The multi-channel data receiving system 10 includes a startup module 11, a thread module 12, a query module 13, and a calling module 14.

[0069] The startup module 11 is used to start the application, which includes at least two logical channels. The thread module 12 is used to create threads and drive the threads to a waiting state. The query module 13 is used to drive the threads to query at least two linked lists based on received event signals, and the at least two linked lists correspond one-to-one with at least two logical channels. The calling module 14 is used to notify the application to call the API to obtain the target data when the target data is found in the current linked list corresponding to the current logical channel.

[0070] The query module 13 is also used to add a first thread lock to the current linked list data when the driving thread queries the current linked list data corresponding to the current logical channel, and to release the first thread lock when the query of the current linked list data corresponding to the current logical channel is completed.

[0071] The calling module 14 is also used to add a second thread lock to the interface function of the calling interface when the application calls the calling interface to obtain target data, and to release the second thread lock after the application obtains the target data.

[0072] The calling module 14 is also used to call the calling interface to sequentially obtain the linked list data corresponding to each of the at least two logical channels.

[0073] Thread module 12 is also used to obtain the data receiving mode that matches the application requirements. If the data receiving mode is asynchronous notification mode, then the steps of creating a thread and obtaining the target data are executed according to the asynchronous notification mode. If the data receiving mode is synchronous polling mode, then the steps of calling the calling interface to obtain the linked list data corresponding to each of the at least two logical channels in sequence until obtaining the target data are executed according to the synchronous polling mode. If the data receiving mode is simultaneous receiving mode, then the steps of creating a thread and obtaining the target data are executed according to the simultaneous receiving mode, and the steps of calling the calling interface to obtain the linked list data corresponding to each of the at least two logical channels in sequence until obtaining the target data are executed simultaneously.

[0074] The calling module 14 is also used to copy the current linked list data to the returned data and delete the linked list buffer where the current linked list data is located if the current linked list data corresponding to the current logical channel is not empty; if the current linked list data corresponding to the current logical channel is empty, the returned result is empty.

[0075] The calling module 14 is also used to copy the target data to the returned data and delete the linked list buffer where the current linked list data corresponding to the target data is located.

[0076] As described above, in this embodiment, the target data in at least two linked lists in the linked list buffer is obtained by using at least two logical channels of the application. If there is no data in a linked list, multiple logical channels exist. Detecting whether target data exists in each linked list does not consume much time, and event signals can be responded to quickly. This allows the application to call the API interface to obtain target data only for linked lists with target data, reducing resource consumption and improving work efficiency. The API can be called to obtain the linked list data corresponding to each channel in sequence. The operation is simple and easy to implement. Two receiving methods can be executed simultaneously. Both modes directly read the data from the same linked list buffer without data copying, which improves processing efficiency and simplifies data processing steps, meeting different user needs.

[0077] Please see Figure 5 , Figure 5 This is a schematic diagram of an embodiment of the computer device provided in this application. The computer device 20 includes a processor 21 and a memory 22. The processor 21 is coupled to the memory 22. The memory 22 stores a computer program, which the processor 21 executes during operation to achieve the following: Figures 1-3 The method is shown above. For detailed instructions, please refer to the above; they will not be repeated here.

[0078] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an embodiment of the storage medium provided in this application. The storage medium 30 stores at least one computer program 31, which is executed by a processor to implement, as described above. Figures 1-3 The method shown is detailed above and will not be repeated here. In one embodiment, the computer-readable storage medium 30 may be a storage chip in a terminal, a hard disk, or other readable and writable storage tools such as a portable hard disk, USB flash drive, or optical disc, or it may be a server, etc.

[0079] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0080] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0081] The above embodiments merely illustrate several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these all fall within the protection scope of the embodiments of this application. Therefore, the protection scope of the patent for the embodiments of this application should be determined by the appended claims.

Claims

1. An application data processing method, characterized in that, The method includes: Launch the application, which includes at least two logical channels; each logical channel is a channel that is connected under logical conditions, and each logical channel can be used to query linked list data, and each logical channel can query one linked list data at a time; Create a thread and drive the thread to a state of waiting to receive event signals; Obtain the data receiving mode that matches the application's requirements; where the current requirement is fast response, the data receiving mode is asynchronous notification mode; if the current requirement is to reduce operational complexity, the data receiving mode is synchronous polling mode; if the current requirement is to balance fast response and low complexity, the data receiving mode is simultaneous receiving mode. If the data receiving mode is asynchronous notification mode, the thread is driven to query at least two linked list data according to the received event signal, and the at least two linked list data correspond one-to-one with the at least two logical channels; When the target data is found to exist in the current linked list data corresponding to the current logical channel, the application is notified to call the API to obtain the target data. If the data receiving mode is synchronous polling mode, the API call will sequentially retrieve the linked list data corresponding to each of the at least two logical channels. If the data reception mode is simultaneous reception mode, then the following two steps are performed simultaneously: The thread is driven to query at least two linked lists based on the received event signal. When the target data is found in the current linked list corresponding to the current logical channel, the application is notified to call the API to obtain the target data. Additionally, the API call retrieves the linked list data corresponding to each of the at least two logical channels sequentially.

2. The method according to claim 1, characterized in that, The method further includes: When the thread is querying the current linked list data corresponding to the current logical channel, a first thread lock is added to the current linked list data. When the query of the current linked list data corresponding to the current logical channel is completed, the first thread lock is released.

3. The method according to claim 1, characterized in that, The notification to the application to call the API to obtain the target data also includes: When the application calls the API to obtain the target data, a second thread lock is added to the API function. After the application obtains the target data, the second thread lock is released.

4. The method according to claim 1, characterized in that, The process of calling the API to sequentially obtain the linked list data corresponding to each of the at least two logical channels specifically includes: If the current linked list data corresponding to the current logical channel is not empty, then copy the current linked list data to the returned data and delete the linked list buffer where the current linked list data is located. If the current linked list data corresponding to the current logical channel is empty, the return result is empty.

5. The method according to claim 1, characterized in that, After notifying the application to call the API to obtain the target data, the method further includes: Copy the target data to the returned data, and delete the linked list buffer containing the current linked list data corresponding to the target data.

6. An application data processing system, characterized in that, Includes the following modules: A startup module is used to start an application, which includes at least two logical channels. Each logical channel is a channel that is connected under logical conditions. Each logical channel can be used to query linked list data, and each logical channel can query one linked list data at a time. The thread module is used to create threads and drive those threads to a state of waiting to receive event signals. The application data processing system is also used to obtain the receiving data mode that matches the application's needs; where the current need is fast response, the receiving data mode is asynchronous notification mode; if the current need is to reduce operational complexity, the receiving data mode is synchronous polling mode; if the current need is to balance fast response and low complexity, the receiving data mode is simultaneous receiving mode. If the data receiving mode is asynchronous notification mode, the thread is driven to query at least two linked list data according to the received event signal. The at least two linked list data correspond one-to-one with the at least two logical channels. When the target data is found in the current linked list data corresponding to the current logical channel, the application is notified to call the API to obtain the target data. If the data receiving mode is synchronous polling mode, the API call will sequentially retrieve the linked list data corresponding to each of the at least two logical channels. If the data reception mode is simultaneous reception mode, then the following two steps are performed simultaneously: The thread is driven to query at least two linked lists based on the received event signal. When the target data is found in the current linked list corresponding to the current logical channel, the application is notified to call the API to obtain the target data. Additionally, the API call retrieves the linked list data corresponding to each of the at least two logical channels sequentially.

7. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The system stores a computer program, which, when executed by a processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method, device and single board for sending data

    CN101534303A

  • AIR-ROS communication method and AIR-ROS communication system based on NIO

    CN111722944A