Task calling method and device, MEC server
Through the cache and business queue mechanism, the calculation results of on-board terminal tasks are detected and managed, the problem of repeated calculations of MEC servers is solved, and resource conservation and user experience improvement is achieved.
Patent Information
- Application Number
- CN201911315914.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-19
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2039-12-19
AI Technical Summary
In the prior art, the MEC server performs repeated calculations on the same computing task of different vehicle terminals, resulting in waste of computing resources and reduced user experience.
The existence and effectiveness of task calculation results are detected through the cache mechanism. If the result is provided directly in the cache, otherwise the calculation will be performed and stored in the cache; further calculations will be used to calculate using the hash value of the service queue, and task processing will be performed with the terminal with the best channel quality.
It effectively reduces computing resource overhead, improves processing speed, and improves user experience.
Smart Images

Figure CN113010299B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communications, and in particular to a task calling method and device, and a MEC (Mobile Edge Computing) server. Background Art
[0002] C-V2X (Cellular Vehicle to Everything) technology is a cellular-based vehicle-to-everything (V2X) communication technology. It enables direct vehicle-to-vehicle (V2V) communication, vehicle-to-pedestrian (V2P) communication, vehicle-to-road infrastructure (V2I) communication, and vehicle-to-cloud communication via mobile networks (V2N). Through these communications, we can achieve a safer and more convenient world of intelligent transportation.
[0003] The vehicle terminal interacts with the MEC server to use it to complete the corresponding computing tasks. In the existing technology, for the same computing task requested by different vehicle terminals, the MEC server will perform repeated calculations, thereby wasting computing resources and reducing the user experience. Summary of the Invention
[0004] The present disclosure provides a solution that utilizes cache to avoid repeated calculations.
[0005] According to the first aspect of an embodiment of the present disclosure, a task calling method is provided, comprising: after receiving a task request uploaded by a vehicle-mounted terminal, detecting whether a calculation result of the task is included in a cache; if the calculation result of the task is not included in the cache, calling corresponding resources to calculate the task to obtain a calculation result; writing the obtained calculation result into the cache and sending it to the vehicle-mounted terminal; if the calculation result of the task is included in the cache, reading the calculation result of the task from the cache and sending it to the vehicle-mounted terminal.
[0006] In some embodiments, if the calculation result of the task is included in the cache, reading the calculation result of the task from the cache and sending it to the vehicle terminal includes: if the calculation result of the task is included in the cache, further detecting whether the calculation result of the task is expired; if the calculation result of the task is not expired, reading the calculation result of the task from the cache and sending it to the vehicle terminal.
[0007] In some embodiments, if the calculation result of the task has expired, it is further determined whether the hash value of the requested variable corresponding to the task is recorded in the business queue; if the corresponding hash value is not recorded in the business queue, the corresponding hash value is recorded in the business queue; the corresponding resources are called, and the task is calculated using the corresponding hash value recorded in the business queue to obtain the calculation result; the obtained calculation result is written into the cache and sent to the vehicle terminal.
[0008] In some embodiments, if the corresponding hash value is recorded in the business queue, it is further determined whether the corresponding hash value is expired; if the corresponding hash value is expired, the corresponding hash value recorded in the business queue is updated using the hash value of the requested variable corresponding to the task; the corresponding resource is called, and the updated corresponding hash value recorded in the business queue is used to perform calculations to obtain calculation results; the obtained calculation results are written into the cache and sent to the vehicle terminal.
[0009] In some embodiments, if the recorded hash value has not expired, the corresponding resource is called and the task is calculated using the corresponding hash value recorded in the service queue to obtain a calculation result; the obtained calculation result is written into the cache and sent to the vehicle terminal.
[0010] In some embodiments, if the same upload task request is received from different vehicle-mounted terminals within a predetermined time interval, only the upload task request from the vehicle-mounted terminal with the best channel quality is used for upload processing.
[0011] In some embodiments, if the same download task request is received from different vehicle terminals within a predetermined time interval, the download task request from the vehicle terminal with the best channel quality is used to query the corresponding download result; and the download result is multicasted.
[0012] According to the second aspect of an embodiment of the present disclosure, a task calling device is provided, comprising: a detection module, configured to detect whether the calculation result of the task is included in the cache after receiving a task request uploaded by a vehicle-mounted terminal; a task processing module, configured to call corresponding resources to calculate the task to obtain the calculation result if the calculation result of the task is not included in the cache; write the obtained calculation result into the cache and send it to the vehicle-mounted terminal; if the calculation result of the task is included in the cache, read the calculation result of the task from the cache and send it to the vehicle-mounted terminal.
[0013] In some embodiments, the detection module is configured to further detect whether the calculation result of the task is expired if the calculation result of the task is included in the cache; the task processing module is configured to read the calculation result of the task from the cache and send it to the vehicle-mounted terminal if the calculation result of the task is not expired.
[0014] In some embodiments, the detection module is configured to further determine whether the hash value of the requested variable corresponding to the task is recorded in the business queue if the calculation result of the task has expired; the task processing module is configured to record the corresponding hash value in the business queue if the corresponding hash value is not recorded in the business queue; call the corresponding resources and use the corresponding hash value recorded in the business queue to calculate the task to obtain the calculation result; write the obtained calculation result into the cache and send it to the vehicle terminal.
[0015] In some embodiments, the detection module is configured to further determine whether the corresponding hash value is expired if the corresponding hash value is recorded in the business queue; the task processing module is configured to update the corresponding hash value recorded in the business queue using the hash value of the requested variable corresponding to the task if the corresponding hash value has expired; call the corresponding resources and use the updated corresponding hash value recorded in the business queue to perform calculations to obtain calculation results; write the obtained calculation results into the cache and send them to the vehicle-mounted terminal.
[0016] In some embodiments, the task processing module is configured to call the corresponding resources if the recorded hash value has not expired, and use the corresponding hash value recorded in the business queue to calculate the task to obtain a calculation result; write the obtained calculation result into the cache, and send it to the vehicle terminal.
[0017] In some embodiments, the task processing module is configured to only use the upload task request from the vehicle terminal with the best channel quality for upload processing if the same upload task request is received from different vehicle terminals within a predetermined time interval.
[0018] In some embodiments, the task processing module is configured to use the download task request from the vehicle terminal with the best channel quality to query the corresponding download result if the same download task request is received from different vehicle terminals within a predetermined time interval; and multicast the download result.
[0019] According to a third aspect of an embodiment of the present disclosure, a task calling device is provided, comprising: a memory configured to store instructions; a processor coupled to the memory, the processor being configured to execute a method as described in any of the above embodiments based on the instructions stored in the memory.
[0020] According to a fourth aspect of an embodiment of the present disclosure, a MEC server is provided, comprising a task calling device as described in any of the above embodiments.
[0021] According to a fifth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method involved in any of the above embodiments is implemented.
[0022] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0024] The present disclosure can be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0025] Figure 1 is a flowchart of a task calling method according to an embodiment of the present disclosure;
[0026] Figure 2 is a flowchart of a task calling method according to another embodiment of the present disclosure;
[0027] Figure 3 is a structural diagram of a task calling device according to an embodiment of the present disclosure;
[0028] Figure 4 is a structural diagram of a task calling device according to another embodiment of the present disclosure;
[0029] Figure 5 2 is a schematic diagram of the structure of an MEC server according to an embodiment of the present disclosure.
[0030] It should be understood that the size of each part shown in the drawings is not drawn according to the actual proportional relationship.In addition, the same or similar reference numerals represent the same or similar components. DETAILED DESCRIPTION
[0031] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The description of the exemplary embodiments is merely illustrative and is in no way intended to limit the present disclosure, its application, or use. The present disclosure can be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided to make the present disclosure thorough and complete and to fully convey the scope of the present disclosure to those skilled in the art. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the composition of the materials, and the numerical values set forth in these embodiments should be interpreted as being merely exemplary and not as limiting.
[0032] The words “include” or “comprising” and the like used in the present disclosure mean that the elements preceding the word include the elements listed after the word, and do not exclude the possibility of also including other elements.
[0033] All terms (including technical or scientific terms) used in this disclosure have the same meaning as those understood by one of ordinary skill in the art to which this disclosure belongs, unless otherwise specifically defined. It should also be understood that terms defined in, for example, general dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or highly formal sense, unless explicitly defined herein.
[0034] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0035] Figure 1 FIG2 is a flow chart of a task calling method according to an embodiment of the present disclosure. In some embodiments, the following task calling method steps are executed by a task calling device.
[0036] In step 101, a task request uploaded by a vehicle-mounted terminal is received.
[0037] In step 102 , it is detected whether the calculation result of the task is included in the cache.
[0038] If the calculation result of the task is not included in the cache, step 103 is executed; if the calculation result of the task is included in the cache, step 105 is executed.
[0039] In step 103, corresponding resources are called to calculate the task to obtain a calculation result.
[0040] In step 104, the obtained calculation result is written into the cache and sent to the vehicle terminal.
[0041] In step 105 , the calculation result of the task is read from the cache and sent to the vehicle terminal.
[0042] In the task invocation method provided in the above embodiment of the present disclosure, if the cache contains the corresponding calculation result, there is no need to perform the corresponding calculation for the task, and the calculation result in the cache can be directly sent to the user. This can effectively reduce resource overhead, increase processing speed, and effectively improve user experience.
[0043] Figure 2 FIG2 is a flow chart of a task calling method according to another embodiment of the present disclosure. In some embodiments, the following task calling method steps are executed by a task calling device.
[0044] In step 201, a task request uploaded by a vehicle-mounted terminal is received.
[0045] In step 202 , it is detected whether the calculation result of the task is included in the cache.
[0046] If the calculation result of the task is not included in the cache, step 203 is executed; if the calculation result of the task is included in the cache, step 206 is executed.
[0047] In step 203, corresponding resources are called to calculate the task to obtain a calculation result.
[0048] In step 204, the obtained calculation result is written into the cache.
[0049] In step 205, a task request response is sent to send the calculation result to the vehicle terminal.
[0050] In step 206 , if the calculation result of the task is included in the cache, it is further detected whether the calculation result of the task is expired.
[0051] If the calculation result in the cache has not expired, step 207 is executed; if the calculation result in the cache has expired, step 208 is executed.
[0052] In step 207 , the calculation result of the task is read from the cache, and then step 205 is executed.
[0053] In step 208 , it is determined whether the hash value of the requested variable corresponding to the task is recorded in the service queue.
[0054] If the corresponding hash value is not recorded in the service queue, step 209 is executed; if the corresponding hash value is recorded in the service queue, step 211 is executed.
[0055] In step 209, the corresponding hash value is recorded in the service queue.
[0056] In step 210 , the corresponding resource is called and the task is calculated using the corresponding hash value recorded in the service queue to obtain a calculation result. Then step 214 is executed.
[0057] In step 211, it is determined whether the corresponding hash value is expired.
[0058] If the corresponding hash value has expired, step 212 is executed; if the corresponding hash value has not expired, step 213 is executed.
[0059] In step 212, the hash value of the requested variable corresponding to the task is used to update the corresponding hash value recorded in the service queue. Then, step 210 is executed.
[0060] In step 213, the corresponding resources are called and the task is calculated using the corresponding hash value recorded in the service queue to obtain a calculation result.
[0061] In step 214, the obtained calculation result is written into the cache, and then step 205 is executed.
[0062] In some embodiments, if the same upload task request is received from different vehicle-mounted terminals within a predetermined time interval, only the upload task request from the vehicle-mounted terminal with the best channel quality is used for upload processing.
[0063] For example, if multiple vehicle terminals upload the same task at the same time, the task uploaded by the vehicle terminal with the best channel quality will be processed, while the tasks uploaded by other vehicle terminals will be ignored. This can effectively reduce the processing burden.
[0064] In some embodiments, if the same download task request is received from different vehicle terminals within a predetermined time interval, the download task request from the vehicle terminal with the best channel quality is used to query the corresponding download result, and the download result is multicasted so that the vehicle terminal with the worst channel quality can also receive the calculation result.
[0065] Figure 3 FIG. 1 is a schematic diagram of a task calling device according to an embodiment of the present disclosure. Figure 3 As shown, the task calling device includes a detection module 31 and a task processing module 32.
[0066] The detection module 31 is configured to detect whether the calculation result of the task is included in the cache after receiving the task request uploaded by the vehicle terminal.
[0067] The task processing module 32 is configured to call corresponding resources to calculate the task to obtain the calculation result if the calculation result of the task is not included in the cache; write the obtained calculation result into the cache and send it to the vehicle terminal; if the calculation result of the task is included in the cache, read the calculation result of the task from the cache and send it to the vehicle terminal.
[0068] In some embodiments, the detection module 31 is configured to further detect whether the calculation result of the task is expired if the calculation result of the task is included in the cache.
[0069] The task processing module 32 is configured to read the calculation result of the task from the cache and send it to the vehicle terminal if the calculation result of the task has not expired.
[0070] In some embodiments, the detection module 31 is configured to further determine whether a hash value of a requested variable corresponding to the task is recorded in the service queue if the calculation result of the task has expired.
[0071] The task processing module 32 is configured to record the corresponding hash value in the business queue if the corresponding hash value is not recorded in the business queue; call the corresponding resources and use the corresponding hash value recorded in the business queue to calculate the task to obtain the calculation result; write the obtained calculation result into the cache and send it to the vehicle terminal.
[0072] In some embodiments, the detection module 31 is configured to further determine whether the corresponding hash value is expired if the corresponding hash value is recorded in the service queue.
[0073] The task processing module 32 is configured to update the corresponding hash value recorded in the business queue using the hash value of the requested variable corresponding to the task if the corresponding hash value has expired; call the corresponding resource and use the updated corresponding hash value recorded in the business queue to perform calculations to obtain calculation results; write the obtained calculation results into the cache and send them to the vehicle terminal.
[0074] In some embodiments, the task processing module 32 is configured to call the corresponding resources if the recorded hash value has not expired, and use the corresponding hash value recorded in the business queue to calculate the task to obtain a calculation result; write the obtained calculation result into the cache, and send it to the vehicle terminal.
[0075] In some embodiments, the task processing module 32 is configured to only use the upload task request from the vehicle terminal with the best channel quality for upload processing if the same upload task request is received from different vehicle terminals within a predetermined time interval.
[0076] In some embodiments, if the task processing module 32 receives the same download task request from different vehicle terminals within a predetermined time interval, it is configured to use the download task request from the vehicle terminal with the best channel quality to query the corresponding download result; and multicast the download result.
[0077] Figure 4 FIG. 1 is a schematic diagram of a task calling device according to another embodiment of the present disclosure. Figure 4As shown, the task calling device includes a memory 41 and a processor 42.
[0078] The memory 41 is used to store instructions. The processor 42 is coupled to the memory 41. The processor 42 is configured to execute the instructions stored in the memory. Figure 1 、 2 The method according to any one of the embodiments.
[0079] like Figure 4 As shown, the task calling device further includes a communication interface 43 for exchanging information with other devices. At the same time, the task calling device further includes a bus 44 through which the processor 42, the communication interface 43, and the memory 41 communicate with each other.
[0080] Memory 41 may include high-speed RAM (Random Access Memory) or NVM (Non-Volatile Memory). For example, it may include at least one disk drive. Memory 41 may also be a memory array. Memory 41 may also be divided into blocks, and the blocks may be combined into virtual volumes according to certain rules.
[0081] In addition, the processor 42 may be a central processing unit, or may be an ASIC (Application Specific Integrated Circuit), or may be configured to implement one or more integrated circuits of the embodiments of the present disclosure.
[0082] The present disclosure also provides a computer readable storage medium. The computer readable storage medium stores computer instructions, which are executed by a processor to implement the following Figure 1 、 2 The method according to any one of the embodiments.
[0083] Figure 5 FIG. 1 is a schematic diagram of the structure of an MEC server according to an embodiment of the present disclosure. Figure 5 As shown, the MEC server 51 includes a task calling device 52. The task calling device 52 is Figure 3 or Figure 4 The task calling device described in any embodiment.
[0084] In some embodiments, the above-mentioned functional modules can be implemented as a general-purpose processor, a programmable logic controller (PLC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components or any appropriate combination thereof for performing the functions described in the present disclosure.
[0085] Thus far, the embodiments of the present disclosure have been described in detail. To avoid obscuring the concept of the present disclosure, some details known in the art have not been described. Based on the above description, those skilled in the art can fully understand how to implement the technical solutions disclosed herein.
[0086] Although some specific embodiments of the present disclosure have been described in detail through examples, those skilled in the art will understand that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. Those skilled in the art will understand that the above embodiments may be modified or some technical features may be replaced with equivalents without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A task calling method, comprising: After receiving a task request uploaded by the vehicle terminal, detecting whether the calculation result of the task is included in the cache; If the calculation result of the task is not included in the cache, calling the corresponding resource to calculate the task to obtain the calculation result; Writing the obtained calculation results into the cache and sending them to the vehicle terminal; If the calculation result of the task is included in the cache, reading the calculation result of the task from the cache and sending it to the vehicle terminal; Wherein, if the calculation result of the task is included in the cache, reading the calculation result of the task from the cache and sending it to the vehicle terminal includes: If the calculation result of the task is included in the cache, further detecting whether the calculation result of the task is expired; If the calculation result of the task has expired, further determining whether the hash value of the requested variable corresponding to the task is recorded in the service queue; If the corresponding hash value is not recorded in the business queue, the corresponding hash value is recorded in the business queue; Call the corresponding resource and use the corresponding hash value recorded in the business queue to calculate the task to obtain the calculation result; Writing the obtained calculation results into the cache and sending them to the vehicle terminal; If the corresponding hash value is recorded in the business queue, it is further determined whether the corresponding hash value has expired; If the corresponding hash value has expired, the corresponding hash value recorded in the service queue is updated using the hash value of the requested variable corresponding to the task; Call the corresponding resource and use the updated corresponding hash value recorded in the business queue to perform calculations to obtain the calculation results; Writing the obtained calculation results into the cache and sending them to the vehicle terminal; If the recorded hash value has not expired, the corresponding resource is called and the task is calculated using the corresponding hash value recorded in the service queue to obtain a calculation result; The obtained calculation results are written into the cache and sent to the vehicle terminal.
2. The method according to claim 1, wherein If the calculation result of the task is included in the cache, reading the calculation result of the task from the cache and sending it to the vehicle terminal includes: If the calculation result of the task has not expired, the calculation result of the task is read from the cache and sent to the vehicle terminal.
3. The method according to any one of claims 1 to 2, further comprising: If the same upload task request is received from different vehicle-mounted terminals within a predetermined time interval, only the upload task request from the vehicle-mounted terminal with the best channel quality is used for upload processing.
4. The method according to claim 3, further comprising: If the same download task request is received from different vehicle-mounted terminals within a predetermined time interval, the download task request from the vehicle-mounted terminal with the best channel quality is used to query the corresponding download result; The download result is multicasted.
5. A task calling device, comprising: a detection module configured to detect whether a calculation result of the task is included in the cache after receiving a task request uploaded by the vehicle terminal; If the calculation result of the task is included in the cache, further detecting whether the calculation result of the task is expired; if the calculation result of the task is expired, further determining whether a hash value of the requested variable corresponding to the task is recorded in the service queue; If the corresponding hash value is recorded in the business queue, it is further determined whether the corresponding hash value has expired; The task processing module is configured to, if the calculation result of the task is not included in the cache, call corresponding resources to calculate the task to obtain the calculation result; write the obtained calculation result into the cache and send it to the vehicle terminal; if the calculation result of the task is included in the cache, read the calculation result of the task from the cache and send it to the vehicle terminal; If the corresponding hash value is not recorded in the business queue, the corresponding hash value is recorded in the business queue; Calling corresponding resources, calculating the task using the corresponding hash value recorded in the service queue to obtain a calculation result; writing the obtained calculation result into a cache, and sending it to the vehicle terminal; If the corresponding hash value has expired, the corresponding hash value recorded in the service queue is updated using the hash value of the requested variable corresponding to the task; Calling the corresponding resource and performing calculation using the updated corresponding hash value recorded in the service queue to obtain a calculation result; writing the obtained calculation result into the cache and sending it to the vehicle terminal; If the recorded hash value has not expired, the corresponding resource is called, and the task is calculated using the corresponding hash value recorded in the service queue to obtain a calculation result; the obtained calculation result is written into the cache and sent to the vehicle terminal.
6. The device according to claim 5, wherein The task processing module is configured to read the calculation result of the task from the cache and send it to the vehicle-mounted terminal if the calculation result of the task has not expired.
7. The device according to any one of claims 5 to 6, wherein: The task processing module is configured to, if the same upload task request is received from different vehicle terminals within a predetermined time interval, only use the upload task request from the vehicle terminal with the best channel quality for upload processing.
8. The device according to claim 7, wherein The task processing module is configured to query the corresponding download result using the download task request from the vehicle terminal with the best channel quality if the same download task request is received from different vehicle terminals within a predetermined time interval; and multicast the download result.
9. A task calling device, comprising: a memory configured to store instructions; A processor is coupled to the memory, and the processor is configured to execute the method according to any one of claims 1 to 4 based on instructions stored in the memory.
10. An MEC server, comprising the task calling device according to any one of claims 5 to 9.
11. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Data caching method and device and server
CN109783499A
Data sending method of Internet of Vehicles and related device
CN109982264A