Data acquisition method, vehicle, computer equipment and computer program product
By adding data interface tasks to the task queue and processing them in sequence in a service-oriented architecture, the problem of consumers obtaining the latest data is solved and the consistency of data is ensured.
Patent Information
- Application Number
- CN202411435572.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-17
AI Technical Summary
In a service-oriented architecture, consumers cannot obtain the latest target data due to different thread processing speed problems, especially when consumers actively call the interface to obtain data, and when the data update event occurs, data inconsistency is caused.
When a timing requirement is detected between the first interface and the second interface associated with the data interface task, the data interface task is added to the task queue and processed in the order of the task queue to ensure the execution order of the data interface task. Ensure that consumers obtain the latest target data.
By ensuring the execution order of data interface tasks, consumers can obtain the latest target data, solving the problem of data inconsistency caused by thread processing speed.
Smart Images

Figure CN119322690A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data acquisition method, a vehicle, a computer device, and a computer program product. Background Art
[0002] As the complexity of vehicle electronic systems increases, the use of service-oriented architecture (SOA) as an architectural guide for software system design has been widely accepted by the automotive industry. In order to comply with the high cohesion and low coupling software design philosophy of SOA, complex systems are usually split into relatively independent software modules, which interact with each other through carefully designed communication interfaces; these interfaces can be divided into two categories: remote call interfaces and event publishing interfaces. In the SOA architecture, the software module that provides the remote call interface and publishes messages is called the server, and the software module that calls the remote call interface or subscribes to messages is called the client.
[0003] Generally, when a consumer has business needs, he or she can actively call the remote call interface to actively obtain data. When the data subscribed by the consumer is updated, the service provider can actively call the event publishing interface to push data to the consumer. If a data update event occurs after the consumer actively calls the interface to obtain data but before the actively obtained data is sent to the consumer, the consumer may not be able to obtain the latest data due to the processing speed of different threads. Summary of the invention
[0004] The embodiments of the present disclosure at least provide a data acquisition method, a vehicle, a computer device, and a computer program product.
[0005] In a first aspect, an embodiment of the present disclosure provides a data acquisition method, which is applied to a vehicle, wherein the vehicle is deployed with a service-oriented SOA architecture, wherein the SOA architecture includes a service provider and a consumer, and the method includes:
[0006] In response to satisfying the acquisition condition of the target data, generating a data interface task for feeding back the target data to the consumer;
[0007] When it is detected that there is a timing requirement between the first interface associated with the data interface task and the other second interface, the data interface task is added to the task queue so that the tasks are processed in sequence according to the order in which they are added to the task queue; wherein the first interface and the second interface are used to be called to transmit target data to the consumer.
[0008] In one possible implementation, the first interface is used to be called by the consumer to request to obtain the target data, and the second interface is used to be called by the service provider to actively send the generated target data to the consumer; or, the first interface is used to be called by the service provider to actively send the generated target data to the consumer, so the second interface is used to be called by the consumer to request to obtain the target data.
[0009] In a possible implementation manner, the conditions for obtaining the target data include:
[0010] receiving a data acquisition request for the target data sent by the consumer by calling the first interface; or,
[0011] After the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed.
[0012] In a possible implementation manner, the target data acquisition condition includes that after the consumer subscribes to the target data from the service provider, when the service provider detects that the target data has changed, the task processing includes:
[0013] The first interface is called to send the target data to the consumer.
[0014] In a possible implementation manner, the method further includes detecting whether there is a timing requirement between the first interface associated with the data interface task and other second interfaces according to the following method:
[0015] Determine an interface description file of a first interface associated with the data interface task;
[0016] It is determined based on the interface description file whether there is a timing requirement between the first interface and other second interfaces.
[0017] In a possible implementation manner, after adding the data interface task to the task queue, the method further includes:
[0018] Based on the first task thread corresponding to the task queue, each task is processed sequentially in the order in which each task is added to the task queue.
[0019] In a possible implementation manner, the method further includes:
[0020] When it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, a second task thread is started to process the data interface task to send the target data to the consumer.
[0021] In a second aspect, an embodiment of the present disclosure further provides a vehicle, which is used to execute the steps in the above-mentioned first aspect, or any possible implementation of the first aspect.
[0022] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the above-mentioned first aspect, or any possible implementation of the first aspect.
[0023] In a fourth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed, implements the method described in the above-mentioned first aspect, or any possible implementation manner of the first aspect.
[0024] The data acquisition method, vehicle, computer device and computer program product provided by the embodiments of the present disclosure can generate a data interface task for feeding back the target data to the consumer after detecting that the acquisition conditions of the target data are met, and when it is detected that there is a timing requirement between the first interface associated with the data interface task and other interfaces, the data interface task can be added to the task queue to process the tasks in the order in which they are added to the task queue. In this way, the data interface task that is triggered first can be executed first, thereby ensuring the order in which the data interface tasks of each interface are executed when there are multiple interfaces for acquiring the target data, so that the consumer can obtain the latest target data.
[0025] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0027] Figure 1 An example diagram of data acquisition provided by an embodiment of the present disclosure is shown;
[0028] Figure 2 A flow chart of a data acquisition method provided by an embodiment of the present disclosure is shown;
[0029] Figure 3 An example diagram showing a data acquisition method provided by an embodiment of the present disclosure;
[0030] Figure 4 A schematic diagram of a data acquisition device provided by an embodiment of the present disclosure is shown;
[0031] Figure 5 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure.
[0033] After research, it was found that, in general, when consumers have business needs, they can actively call the remote call interface to actively obtain data. When the data subscribed by the consumer is updated, the service provider can actively call the event publishing interface to push data to the consumer. If a data update event occurs after the consumer actively calls the interface to obtain data and before the actively obtained data is sent to the consumer, the consumer may not be able to obtain the latest data due to the processing speed of different threads.
[0034] For example, Figure 1 As shown in the figure, if a client subscribes to the server's message A and obtains the value of A through the remote call interface. If the client obtains the value of message A through the remote call interface at time t0; the server receives the call at time t1, and starts a thread (thread 1) to process the remote call, "thread 1" obtains the value of message A at time t2 and returns it to the client; at time t3, "thread 2" inside the server updates the value of A and publishes it to the client through the message publishing interface at time t4; at time t5, "thread 1" returns the client's remote call, and at time t6, the client receives the value of the published message A; at time t7, the client receives the value of the message A obtained by the remote call returned by the server.
[0035] After the above process is completed, the client finally retains the value of message A received at time t7, but the value of message A received at time t7 is the value before the update, so the client cannot retain the latest value.
[0036] The reason for the above problem is that "Thread 1" and "Thread 2" are executed in parallel. Since the order of parallel execution cannot be determined, the data obtained by the thread started first may be sent to the client later, resulting in the client only saving the value before the update.
[0037] Based on the above research, the present disclosure provides a data acquisition method, a vehicle, a computer device and a computer program product. After detecting that the acquisition conditions of the target data are met, a data interface task for feeding back the target data to the consumer can be generated. When it is detected that there is a timing requirement between the first interface associated with the data interface task and other interfaces, the data interface task can be added to the task queue to process the tasks in the order in which they are added to the task queue. Through this method, the data interface task that is triggered first can be executed first, thereby ensuring the order in which the data interface tasks of each interface are executed when there are multiple interfaces for acquiring the target data, so that the consumer can obtain the latest target data.
[0038] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0039] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0040] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the personal information involved in the present disclosure (including but not limited to attribute information, facial images, etc.) is obtained with the authorization of the user. Specifically, it can be through a pop-up window in the page, information push, etc., sending a prompt message requesting authorization to the user, and obtaining the above personal information after the user agrees to the authorization.
[0041] To facilitate understanding of this embodiment, a data acquisition method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the data acquisition method provided in the embodiment of the present disclosure is a vehicle, and the vehicle is deployed with an SOA architecture, which includes a service provider and a consumer. The consumer can refer to various functional modules of the vehicle, such as a screen display module, an intelligent driving module, etc.; the service provider can be a module that provides functional services. In the present disclosure, the service provider can refer to a module that provides data to the consumer.
[0042] See also Figure 2 FIG. 2 is a flow chart of a data acquisition method provided by an embodiment of the present disclosure, wherein the method includes steps 201 to 202, wherein:
[0043] Step 201: In response to satisfying a condition for obtaining target data, generate a data interface task for feeding back the target data to the consumer.
[0044] Step 202: When it is detected that there is a timing requirement between the first interface associated with the data interface task and other second interfaces, the data interface task is added to the task queue to process the tasks in the order in which they are added to the task queue; wherein the first interface and the second interface are used to be called to transmit target data to the consumer.
[0045] The following is a detailed description of the above steps.
[0046] The target data may refer to data subscribed by the service provider to the consumer, and for example, may refer to door status data, window status data, air conditioning status data, etc.
[0047] The acquisition conditions of the target data include any conditions used to trigger the acquisition of the target data. In some application scenarios, the consumer obtains the target data mainly in two ways. One is that the consumer calls the remote call interface to actively obtain the target data. The other is that after the consumer subscribes to the target data from the service provider, the service provider actively sends the target data to the consumer when it detects that the target data has been updated. Accordingly, the response here that satisfies the acquisition conditions of the target data may include: receiving a data acquisition request for the target data sent by the consumer by calling the first interface (referred to as condition 1); or, after the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed (referred to as condition 2).
[0048] Here, the first interface called by the consumer may be a remote call interface. Under different acquisition conditions, the task type of the generated data interface task may be different. For example, if the acquisition condition includes the above condition 1, the corresponding data interface task may be to obtain the latest target data and then send the target data to the consumer; if the acquisition condition includes the above condition 2, the corresponding data interface task may refer to calling the event publishing interface to send the changed target data to the consumer.
[0049] In a possible application scenario, the above conditions 1 and 2 may be satisfied simultaneously in a relatively short period of time. For example, when the vehicle is started, the consumer may call the remote call interface to obtain the target data, and at the same time, the consumer subscribes to the target data from the service provider. If the target data changes after a short period of time when the vehicle is started, the service provider needs to feedback the changed target data to the consumer.
[0050] Here, even after the consumer subscribes to the target data from the service provider, the consumer may still have the need to actively obtain the target data, for example, when the vehicle is started, the consumer needs to actively obtain the target data.
[0051] In step 202, the first interface associated with the data interface task may refer to an interface associated with generating / executing the data interface task. Specifically, the first interface associated with the data interface task is related to the type of the acquisition condition. If the data interface task is generated when the above condition 1 is met, the first interface associated with the data interface task may refer to a remote call interface; if the data interface task is generated when the above condition 2 is met, the first interface associated with the data interface task may refer to an event publishing interface.
[0052] The second interface may be an interface of a different interface type / caller from the first interface. In different scenarios, the interface types / callers of the first interface and the second interface are different. For example, the first interface may be used to be called by the consumer to request to obtain the target data (i.e., the first interface is a remote call interface), and the second interface may be used to be called by the service provider to actively send the generated target data to the consumer (i.e., the second interface is an event publishing interface); or, the first interface is used to be called by the service provider to actively send the generated target data to the consumer (i.e., the first interface is an event publishing interface), so the second interface is used to be called by the consumer to request to obtain the target data (i.e., the second interface is a remote call interface).
[0053] Optionally, the first interface and the second interface associated with the first interface can be used to be called to transmit the same target data. For example, for door status data, the first interface can be called to transmit to the consumer, and the second interface can also be called to transmit to the consumer.
[0054] In a possible implementation, when detecting whether there is a timing requirement between the first interface associated with the data interface task and the other second interface, the interface description file of the first interface associated with the data interface task can be determined, and then based on the interface description file, it can be determined whether there is a timing requirement between the first interface and the other second interface.
[0055] Here, the timing requirement between the first interface associated with the data interface task and the other second interfaces may mean that the data interface task associated with the first interface and the data interface tasks associated with the other second interfaces have an execution sequence.
[0056] Specifically, it may be set in advance in the interface description file of each interface whether there is a timing requirement between the interface and other interfaces.
[0057] In a possible implementation, the task queue may be a task queue corresponding to the target data, different target data may correspond to different task queues, and the tasks in the task queue may be executed sequentially by the same thread. The task queue may be a first-in-first-out queue, that is, the task added to the task queue first may be processed first.
[0058] Optionally, when adding the data interface task to the task queue, you can first check whether there is a task queue corresponding to the target data. If so, directly add the data interface task to the task queue. If not, create a task queue corresponding to the target data and add the data interface task to the created task queue.
[0059] Here, there is no task queue corresponding to the target data, which means that before the current data interface task is generated, there are no other data interface tasks for acquiring the target data. However, since there may be other data interface tasks for acquiring the target data after the current data interface task, and the current data interface task may not be completed after other data interface tasks for acquiring the target data are generated, it is still necessary to create a task queue and execute the current data interface task by adding it to the task queue.
[0060] After the data interface task is added to the task queue, each task may be processed sequentially in the order in which each task is added to the task queue based on the first task thread corresponding to the task queue.
[0061] In a specific implementation, the conditions for obtaining the target data include that after the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed (ie, the above-mentioned condition 2). When processing the data interface task, it may refer to calling the first interface to send the target data to the consumer.
[0062] Here, the service party calls the first interface to send the target data to the consumer party, and the called first interface may refer to an event publishing interface.
[0063] In a possible implementation, when it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, a second task thread may be started to process the data interface task to send the target data to the consumer.
[0064] Here, task processing by different task threads can be executed in parallel. When it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, the second task thread can be directly started to perform task processing synchronously with other task threads to achieve fast processing of the data interface task.
[0065] The following is an introduction to the above data acquisition method with specific examples. Figure 3 The figure shows an example diagram of a data acquisition method provided by an embodiment of the present disclosure, where at time t0, client1 obtains door status data through a remote call interface; the server adds the generated data interface task to the task queue at time t1; the server's task thread obtains the door status data at time t2 for returning to client1; the server updates the door status at time t3, and adds a task to the task queue to publish the latest door status to client1 that has subscribed to the door status; at time t4, the server sends the return of the remote call (i.e., the door status data obtained at time t2); at time t5, the server publishes new door status data to client1 through the event publishing interface; at time t6, client1 receives the return of the remote call; at time t7, client1 receives the latest door status published by the server.
[0066] In the above example, since the remote call interface is called at time t0 and the door status is updated at time t3, the remote call task needs to be executed first, and the subscription information return task is executed only after the remote call task is completed.
[0067] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0068] Based on the same inventive concept, a data acquisition device corresponding to the data acquisition method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned data acquisition method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0069] Reference Figure 4 , which is a schematic diagram of the architecture of a data acquisition device provided by an embodiment of the present disclosure, the device is deployed in a vehicle, the vehicle is deployed with a service-oriented SOA architecture, the SOA architecture includes a service provider and a consumer, the device includes: a generation module 401, a processing module 402; wherein,
[0070] A generating module 401 is used for generating a data interface task for feeding back the target data to the consumer in response to satisfying the acquisition condition of the target data;
[0071] Processing module 402 is used to add the data interface task to the task queue when it is detected that there is a timing requirement between the first interface associated with the data interface task and other second interfaces, so as to process the tasks in sequence according to the order of adding to the task queue; wherein the first interface and the second interface are used to be called to transmit target data to the consumer.
[0072] In one possible implementation, the first interface is used to be called by the consumer to request to obtain the target data, and the second interface is used to be called by the service provider to actively send the generated target data to the consumer; or, the first interface is used to be called by the service provider to actively send the generated target data to the consumer, so the second interface is used to be called by the consumer to request to obtain the target data.
[0073] In a possible implementation manner, the conditions for obtaining the target data include:
[0074] receiving a data acquisition request for the target data sent by the consumer by calling the first interface; or,
[0075] After the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed.
[0076] In a possible implementation, the processing module 402 is configured to:
[0077] Determine an interface description file of a first interface associated with the data interface task;
[0078] It is determined based on the interface description file whether there is a timing requirement between the first interface and other second interfaces.
[0079] In a possible implementation, after adding the data interface task to the task queue, the processing module 402 is used to:
[0080] Based on the first task thread corresponding to the task queue, each task is processed sequentially in the order in which each task is added to the task queue.
[0081] In a possible implementation manner, when the target data acquisition condition includes that after the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed, the processing module 402 is used to:
[0082] The first interface is called to send the target data to the consumer.
[0083] In a possible implementation manner, the processing module 402 is further configured to:
[0084] When it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, a second task thread is started to process the data interface task to send the target data to the consumer.
[0085] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0086] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 5 As shown, it is a schematic diagram of the structure of a computer device 500 provided in an embodiment of the present disclosure, including a processor 501, a memory 502, and a bus 503. Among them, the memory 502 is used to store execution instructions, including a memory 5021 and an external memory 5022; the memory 5021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 501, and the data exchanged with the external memory 5022 such as a hard disk. The processor 501 exchanges data with the external memory 5022 through the memory 5021. When the computer device 500 is running, the processor 501 communicates with the memory 502 through the bus 503, so that the processor 501 executes the following instructions:
[0087] In response to satisfying the acquisition condition of the target data, generating a data interface task for feeding back the target data to the consumer;
[0088] When it is detected that there is a timing requirement between the first interface associated with the data interface task and the other second interface, the data interface task is added to the task queue so that the tasks are processed in sequence according to the order in which they are added to the task queue; wherein the first interface and the second interface are used to be called to transmit target data to the consumer.
[0089] In one possible implementation, in the instructions executed by the processor 501, the first interface is used to be called by the consumer to request to obtain the target data, and the second interface is used to be called by the service provider to actively send the generated target data to the consumer; or, the first interface is used to be called by the service provider to actively send the generated target data to the consumer, so the second interface is used to be called by the consumer to request to obtain the target data.
[0090] In a possible implementation manner, in the instruction executed by the processor 501, the condition for obtaining the target data includes:
[0091] receiving a data acquisition request for the target data sent by the consumer by calling the first interface; or,
[0092] After the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed.
[0093] In a possible implementation manner, the instructions executed by the processor 501 further include detecting whether there is a timing requirement between the first interface associated with the data interface task and other second interfaces according to the following method:
[0094] Determine an interface description file of a first interface associated with the data interface task;
[0095] It is determined based on the interface description file whether there is a timing requirement between the first interface and other second interfaces.
[0096] In a possible implementation manner, the instructions executed by the processor 501, after adding the data interface task to the task queue, further include:
[0097] Based on the first task thread corresponding to the task queue, each task is processed sequentially in the order in which each task is added to the task queue.
[0098] In a possible implementation, in the instruction executed by the processor 501, the condition for obtaining the target data includes that after the consumer subscribes to the target data from the service provider, when the service provider detects that the target data has changed, the performing of the task processing includes:
[0099] The first interface is called to send the target data to the consumer.
[0100] In a possible implementation manner, in the instruction executed by the processor 501, the method further includes:
[0101] When it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, a second task thread is started to process the data interface task to send the target data to the consumer.
[0102] The embodiments of the present disclosure also provide a vehicle, which can be used to execute the steps of the data acquisition method described in the above embodiments.
[0103] The present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data acquisition method described in the above method embodiment are executed. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0104] The embodiments of the present disclosure also provide a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the data acquisition method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0105] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0106] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0107] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0108] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0109] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A data acquisition method, characterized in that: Applied to a vehicle, the vehicle is deployed with a service-oriented SOA architecture, the SOA architecture includes a service provider and a consumer, and the method includes: In response to satisfying the acquisition condition of the target data, generating a data interface task for feeding back the target data to the consumer; When it is detected that there is a timing requirement between the first interface associated with the data interface task and the other second interface, the data interface task is added to the task queue so that the tasks are processed in sequence according to the order in which they are added to the task queue; wherein the first interface and the second interface are used to be called to transmit target data to the consumer.
2. The method according to claim 1, characterized in that The first interface is used to be called by the consumer to request to obtain the target data, and the second interface is used to be called by the service party to actively send the generated target data to the consumer; or, the first interface is used to be called by the service party to actively send the generated target data to the consumer, so the second interface is used to be called by the consumer to request to obtain the target data.
3. The method according to claim 1, characterized in that The conditions for obtaining the target data include: receiving a data acquisition request for the target data sent by the consumer by calling the first interface; or, After the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed.
4. The method according to claim 3, characterized in that When the acquisition condition of the target data includes that after the consumer subscribes to the target data from the service provider, the service provider detects that the target data has changed, the task processing includes: The first interface is called to send the target data to the consumer.
5. The method according to claim 1, characterized in that The method further comprises detecting whether there is a timing requirement between the first interface associated with the data interface task and the other second interface according to the following method: Determine an interface description file of a first interface associated with the data interface task; It is determined based on the interface description file whether there is a timing requirement between the first interface and other second interfaces.
6. The method according to claim 1, characterized in that After adding the data interface task to the task queue, the method further includes: Based on the first task thread corresponding to the task queue, each task is processed sequentially in the order in which each task is added to the task queue.
7. The method according to claim 1, characterized in that The method further comprises: When it is detected that there is no timing requirement between the first interface associated with the data interface task and other second interfaces, a second task thread is started to process the data interface task to send the target data to the consumer.
8. A vehicle, characterized in that: The vehicle is used to execute the steps of the data acquisition method as described in any one of claims 1 to 7 above.
9. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the data acquisition method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the steps of the data acquisition method according to any one of claims 1 to 7 are implemented.