This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2020-139280, filed on Aug. 20, 2020, the entire contents of which are incorporated herein by reference.
The embodiment discussed herein is related to a task control apparatus and the like.
In recent years, a system has been studied that collects data (such as video data) generated by distributed devices (such as vehicles) in accordance with a request from a service. It is known that time taken for collecting data varies depending on characteristics of a data source and a location of the data source and that collected data values change over time. For example, in a case where a mobility device serves as a data source, a wireless network to which the mobility device is coupled changes depending on the location and the performance of the wireless network changes depending on a degree of congestion.
Related art is disclosed in Japanese Laid-open Patent Publication No. 2008-40718 and Japanese Laid-open Patent Publication No. 2018-63672.
According to an aspect of the embodiments, a task control apparatus includes: a memory; and a processor coupled to the memory and configured to: assign, to each request for data collection, an index based on acceptance time and a delay period allowable in data collection; input the request to a queue in order of the index; extract, in a case where a transmission timing of data collection of the request is to be delayed, the request from the queue; and re-input the request to the queue by using an index based on a period for which the transmission timing is to be delayed and an extraction pace at which requests are extracted from the queue.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
For example, when a request to a server (including a data source) is transmitted, it is determined whether or not to permit transfer of the request to the server so that the server is not overloaded. For example, when a system registers, as a message, a process that involves a long processing time in a queue, the process is divided and a plurality of messages are created so that a processing load of the system becomes approximately uniform.
There is a case where, in accordance with a data processing request, from a service, involving a delay request for completion of processing, data is collected and processed by a deadline indicated by the delay request. In such a case, if a delay occurs in collecting data, leveling performed in accordance with the delay request at the time of transmission to the data source collapses. This leads to an additional calculation resource for fully receiving the resulting load peak. As a result of occurrence of a time difference in collecting pieces of data subjected to data processing, data waiting for being processed stays. This leads to an additional memory. For example, the occurrence of a delay in collecting data causes an issue in that a load is imposed on the resources.
In one aspect, simultaneous reception of pieces of collected data subjected to data processing without imposing a load on resources may be implemented.
An embodiment of a task control apparatus and a task control method disclosed in the present application will be described in detail below based on the drawings. Note that the present disclosure is not limited to the embodiment.
First, a reference example of a distributed data collection system that collects data generated by distributed devices (such as vehicles) in accordance with a request from a service will be described with reference to
A scheduler, together with a token manager, controls transmission of the data processing requests so that the load is leveled while the deadline is met (<B>). In this example, the scheduler performs request scheduling by using earliest deadline first (EDF) scheduling. The term “EDF scheduling” used herein refers to a scheduling algorithm for processing requests sequentially from a request having the closest deadline time. Therefore, the scheduler extracts data processing requests from the request queue in order from the request with the closest deadline time while leveling the load, and outputs the data processing requests to a request transmitting unit. At this time, the scheduler updates the states of the requests in a request management table. The request transmitting unit collectively transmits data collection tasks belonging to the data processing request at the same time in order to minimize a period for which the request waiting for being processed is held in the request queue.
The token manager periodically updates a token supply amount per unit time. The token supply amount is obtained by using equation Rk=Max(R1k, R2k).
A symbol k of Rk denotes token determination time when the token supply amount is determined. R1k is obtained based on equation (1). As indicated by the request queue in
R2k is obtained based on equation (2). LK indicates a length of requests, for example, the numbers of requests in the queue. As indicated by a graph in
As illustrated in
Referring back to
In the distributed data collection system, a data receiving unit receives the collected data and inputs the collected data to a reception queue.
A received data dispatcher extracts the received data in an executable state from the reception queue and inputs the received data to a processing waiting queue. The processing waiting queue (in-memory) holds the data until collection of data subjected to data processing is completed (<C>). For example, the processing waiting queue (in-memory) holds the data until collection of data relating to the data collection tasks belonging to the data processing request is completed.
A data processing unit performs processing upon data becoming complete, and returns, as a response, the processing result to the service (<D>).
As described above, the scheduler performs transmission control so that the load is leveled in consideration of the deadline. Thus, the load is leveled also on the reception side. The request transmitting unit collectively transmits the data collection tasks belonging to the data processing request at the same time. Thus, the in-memory is efficiently used also on the reception side.
However, time taken for collecting data varies depending on characteristics of the data source and a location of the data source. In addition, collected data values change over time.
On the data reception side, a time difference occurs in completion (data collection completion) of reception of the data d1 from the mobility device v001, the data d2 from the mobility device v002, and the data d3 from the mobility device v003. This is because a wireless network to which the mobility device is coupled changes depending on the location of the mobility device and the performance of the wireless network changes depending on a degree of congestion. The delay in collecting data varies depending on characteristics of the data source and the location of the data source.
When the delay in collecting data varies, a load is imposed on resources.
As a result of occurrence of a time difference in collecting pieces of data subjected to data processing, data waiting for being processed stays. This leads to an additional memory. Consequently, the cost increases. For example, the occurrence of a delay in collecting data causes an issue in that a load is imposed on the resources.
The reason why simultaneous reception of pieces of collected data is hindered will be described with reference to
In such a circumstance, the request accepting unit sets a deadline in consideration of the delay information and stores the request in the request queue. However, there is a case where the token supply amount for leveling varies depending on the delay. Therefore, an issuance interval may not be maintained between the data collection tasks because of the changes of the data collection delays for the respective data sources. As a result, simultaneous reception of pieces of collected data by the plurality of data collection tasks belonging to a data processing request is hindered.
Accordingly, in an embodiment, a control apparatus that implements simultaneous reception of pieces of collected data without imposing a load on resources will be described.
[Configuration of Control Apparatus According to Embodiment]
The control apparatus 1 includes a data-processing-request accepting unit 11, a data-processing-request scheduler unit 12, a data receiving unit 13, a data processing unit 14, a data-transmission-source location information collecting unit 15, and a statistical information generating unit 16. The control apparatus 1 also includes a data processing request queue 21, statistical information 22, data-transmission-source location information 23, data information 24, data-collection-task state management information 25, and collected data store information 26. The data-processing-request accepting unit 11 is an example of an input unit. The data-processing-request scheduler unit 12 is an example of a re-input unit.
The data processing request queue 21 is a queue used for time-staggered transmission of a data processing request (request). The data processing request queue 21 is a priority queue in which requests are sorted in ascending order of the index value. For example, the data processing request queue 21 is an EDF queue in which requests are sorted in order from the earliest deadline time.
The statistical information 22 is information obtained by accumulating, for each data source serving as a data transmission source, as statistics, a delay time and a throughput in transmission of data at a geographical location in a time slot. The data source is a mobility device. The statistical information 22 is periodically or aperiodically updated by the statistical information generating unit 16.
The data-transmission-source location information 23 is information storing the geographical location of the data source serving as the data transmission source. The geographical location indicates, for example, a latitude and a longitude. The data-transmission-source location information 23 is updated by the data-transmission-source location information collecting unit 15.
The data information 24 is information on data held by the data source serving as the data transmission source. The data information 24 includes a size of each piece of data and an attribute of the data. It is sufficient that the data information 24 is generated and held in advance.
The data-collection-task state management information 25 is information for managing the state of data collection performed by the data collection task belonging to the data processing request. The data-collection-task state management information 25 is updated by the data-processing-request scheduler unit 12 and the data receiving unit 13.
The collected data store information 26 is information storing the body of the collected data. Data is stored in the collected data store information 26 by the data receiving unit 13 and is processed by the data processing unit 14.
The data-processing-request accepting unit 11 accepts a data processing request. The data processing request includes, for example, collection-target data information and a data-processing-delay request period. The collection-target data information is information of a data source ID for uniquely identifying a data source serving as the data transmission source 3 and of a data ID for uniquely identifying collection-target data. There are as many pieces of collection-target data information as the number of pieces of collection-target data. The data-processing-delay request period indicates a request period from issuance of a data processing request to completion of processing. The data-processing-request accepting unit 11 obtains deadline time obtained by adding the data-processing-delay request period included in the data processing request to the request acceptance time.
The data-processing-request accepting unit 11 calculates, for each piece of collection-target data information, a response delay in collecting data. For example, the data-processing-request accepting unit 11 acquires, by using the data-transmission-source location information 23, the current location of the data source serving as the data transmission source 3. The data-processing-request accepting unit 11 acquires, by using the statistical information 22, a delay and a throughput for the data source at the current location in the current time slot. The data-processing-request accepting unit 11 acquires, from the data information 24, the size of collection-target data. The data-processing-request accepting unit 11 calculates, by using the delay and the throughput for the data source and the size of the data, a delay in collecting data for the data source. The data-processing-request accepting unit 11 obtains the largest delay among the delays in collecting data that are calculated for the respective pieces of collection-target data information. The data-processing-request accepting unit 11 calculates delays to be added for respective pieces of collection-target data information at the time of transmission, by using the delays in collecting data for the respective data sources of the respective pieces of collection-target data and the largest delay so that the pieces of collection-target data may be collected at the same time. The delays to be added for the respective pieces of collection-target data information at the time of transmission may be, for example, values obtained by subtracting the respective delays in collecting data from the largest delay. For example, a piece of collection-target data with the largest delay is to be transmitted earlier than the other pieces of collection-target data. Thus, the delay to be added at the time of transmission is calculated to be 0. Pieces of collection-target data with non-largest delays are transmitted later, by the respective delays, than the piece collection-target data with the largest delay. This enables all the pieces of collection-target data to be collected at the same time.
The data-processing-request accepting unit 11 generates an entry (data processing request queue entry) to the data processing request queue 21. The data processing request queue entry includes, for example, collection-target data information and a data-processing-delay request period in association with an index and a data processing request ID. Deadline time is set as the index. Content of the data processing request is set as the data processing request ID, the data source ID and the data ID in the collection-target data information, and the data-processing-delay request period. In the collection-target data information, transmission additional information and expected transmission time are further set for each piece of collection-target data information. As the transmission additional information for each piece of collection-target data information, the corresponding delay is set. As the expected transmission time for each piece of collection-target data information, expected time when the corresponding data collection task is transmitted is set. However, it is sufficient that an initial value of “−1” is set. The data-processing-request accepting unit 11 inputs the generated data processing request queue entry to the data processing request queue 21.
[Example of Data-Processing-Request Accepting Process]
An example of a data-processing-request accepting process according to the embodiment will be described with reference to
When it takes time to acquire data from a specific data source, the data-processing-request accepting unit 11 sets a delay to be given to collection of the data in the request (<2>). For example, the data-processing-request accepting unit 11 acquires, by using the data-transmission-source location information 23 and the statistical information 22, a delay and a throughput of the data source at the current location in the time slot. The data-processing-request accepting unit 11 acquires, from the data information 24, the size of collection-target data. The data-processing-request accepting unit 11 calculates, by using the delay and the throughput of the data source at the current location in the time slot and using the size of the data, a delay in collecting the data for the data source. The data-processing-request accepting unit 11 obtains the largest delay among the delays in collecting data that are calculated for the respective pieces of collection-target data information. The data-processing-request accepting unit 11 calculates delays to be added for respective pieces of collection-target data information at the time of transmission, by using the delays in collecting data for the respective data sources of the respective pieces of collection-target data and using the largest delay so that the pieces of collection-target data may be collected at the same time. The delay may be, for example, a value obtained by subtracting the delay in collecting data from the largest delay. For example, acquisition of the piece of collection-target data with the largest delay takes longer than acquisition of the other pieces of data in the entry. Thus, the delay to be added at the time of transmission is calculated to be “0”. In the request on the upper side, a delay in collecting data of the data source vehicle_002 is set to “0”, and a delay in collecting data of the data sources vehicle_004 and vehicle_006 is set to “10”. Acquisition of the data of the data source vehicle_002 takes longer than acquisition of the pieces of data of the data sources vehicle_004 and vehicle_006. Thus, the delay to be added at the time of transmission is calculated to be “0”. The expected transmission time is set to, for example, “−1” as the initial value.
The data-processing-request accepting unit 11 inputs the data processing request queue entry to the data processing request queue 21. In the data processing request queue 21, the data processing request queue entries are sorted in ascending order of the index value.
Referring back to
The data-processing-request scheduler unit 12 further extracts the data collection task of the collection-target data information from the data processing request queue 21. If the expected transmission time is after the current time, the data-processing-request scheduler unit 12 re-calculates the index, based on the expected transmission time, the current time, and the current token supply amount. The data-processing-request scheduler unit 12 re-inputs the data collection task of this collection-target data information to the data processing request queue 21 by using the re-calculated index. This is performed to control the transmission timing in accordance with a change in the extraction time due to a change in the token supply amount if the expected transmission time is a later time point. For example, this is performed to level the load on the reception side. The cause of the change in the token supply amount is considered to be an increase or decrease in the amount of power or a change in the number of input entries (in the queue).
[Example of Data-Processing-Request Scheduler Process]
An example of a data-processing-request scheduler process according to the embodiment will be described with reference to
The data-processing-request scheduler unit 12 extracts the entry with the smallest index “1579680952” from the data processing request queue 21.
The data-processing-request scheduler unit 12 immediately transmits the collection-target data information as the data collection task if the collection-target data information satisfies a condition of “(1) AND ((2) OR (3))” among the pieces of collection-target data information. (1) indicates that the delay is the smallest among the delays for the pieces of collection-target data in the entry. (2) indicates that the expected transmission time is the initial value. (3) indicates that the expected transmission time is before the current time. In this case, the delay of “0” is the smallest among the delays for the pieces of collection-target data information in the entry. Thus, the collection-target data information with the delay of “0” corresponds to the case (1). Since the expected transmission time is the initial value of “−1”, which thus corresponds to the case (2). Therefore, since the collection-target data information with the delay of “0” satisfies the condition, the data-processing-request scheduler unit 12 immediately transmits the collection-target data information as the data collection task.
If the collection-target data information does not satisfy the above condition among the pieces of collection-target data information, the data-processing-request scheduler unit 12 performs a process of determining the location at which the entry of the collection-target data information is to be re-inserted in the data processing request queue 21 in the following manner. The collection-target data information with the delay of “10” does not satisfy (1) and thus the condition because the delay is not the smallest among the delays for the pieces of collection-target data information in the entry. Thus, the data-processing-request scheduler unit 12 performs the process of determining the location at which the entry of the collection-target data information with the delay of “10” is to be re-inserted in the data processing request queue 21.
The process of determining the location at which the entry of the collection-target data information is to be re-inserted in the data processing request queue 21 is as follows. The data-processing-request scheduler unit 12 calculates the index based on the delay and the current token supply amount, and re-inserts the entry of this collection-target data at the location corresponding to the calculated index in the data processing request queue 21. For example, in order to immediately transmit a data collection task and then transmit a data collection task after a delay (d) with the current token supply amount (TP), the entry is to be inserted at a location where the number of pieces of collection-target data is equal to the number (N) (=d×TP) in the data processing request queue 21. If the entry is inserted at this location, the inserted entry comes at the head after the time d×TP/TP=d. Thus, the data collection task may be transmitted with the delay d.
In order to determine the insertion location, information for managing the number of entries stored in the data processing request queue 21 is held. This information is for managing a relationship between the index value of an entry in the data processing request queue 21 and the cumulative number of entries up to the entry having the index value. A function, which is f(N), for obtaining an index value from the cumulative number of entries is obtained. For example, the data processing request queue 21 is scanned, and an index value in the queue and a cumulative value of the number of entries up to the entry having the index value are plotted. As a result, an approximate curve is obtained as this function. The data-processing-request scheduler unit 12 obtains a new index value by using N and the function f(N). The data-processing-request scheduler unit 12 re-inserts the entry at the location for the new index value in the data processing request queue 21 in which the entries are sorted in ascending order of the index value.
In this example, as indicated by a graph on the lower left side in
Thus, for an entry including a plurality of pieces of collection-target data, the data-processing-request scheduler unit 12 is able to transmit a data collection task with no delay and then transmit a data collection task with a delay after the delay. As a result, the data-processing-request scheduler unit 12 enables simultaneous reception of a plurality of pieces of collection-target data in the entry.
The data-processing-request scheduler unit 12 extracts the entry having the smallest index “1579680999” from the data processing request queue 21.
If the condition of “(1) AND ((2) OR (3))” is satisfied when the entry is extracted, the data-processing-request scheduler unit 12 immediately transmits the collection-target data information as the data collection task. Since the delay is the smallest among the delays for the pieces of collection-target data in the entry, (1) is satisfied. If the expected transmission time is time before the current time, (3) is satisfied. Thus, the above condition is satisfied. For example, the expected transmission time “1579681005” is before the current time (see a diagram on the lower right side in
If the condition of “(1) AND ((2) OR (3))” is not satisfied when the entry is extracted, the data-processing-request scheduler unit 12 performs the process of determining a location at which the entry is re-inserted in the data processing request queue 21 in the following manner. For example, when the delay is the smallest among the delays for the pieces of collection-target data in the entry, (1) is satisfied. However, the expected transmission time is neither the initial value nor the time before the current time (the expected transmission time is the time after the current time). In such a case, (2) and (3) are not satisfied. Thus, the above condition is not satisfied. For example, this corresponds to a case where the expected transmission time “1579681005” is time after the current time (see a diagram on the lower left side in
The data-processing-request scheduler unit 12 calculates an index based on the current token supply amount and the time d′ for which transmission is to be waited, and re-inserts the entry of this collection-target data at the location corresponding to the calculated index in the data processing request queue 21. For example, in order to transmit the data collection task after the time d′ with the current token supply amount, the entry is to be inserted at the location where the cumulative number of pieces of collection-target data in the data processing request queue 21 is equal to the number (N) (=d′×TP). If the entry is inserted at this location, the inserted entry comes at the head after the time d′×TP/TP=d′. Thus, the data collection task may be transmitted with the delay d′ from the current time.
As for the calculation of the index, the data-processing-request scheduler unit 12 calculates a new index value by using N and the function f(N). The data-processing-request scheduler unit 12 re-inserts the entry at the location for the new index value in the data processing request queue 21 in which the entries are sorted in ascending order of the index value. Since the method of obtaining the function f(N) is as described above, the description thereof will be omitted.
As indicated by a graph on the lower left side in
Thus, even after the re-insertion illustrated in
Referring back to
The data processing unit 14 performs data processing for each data processing request. For example, the data processing unit 14 extracts the collected data for the collection-target data for each request from the collected data store information 26, and performs data processing. The data processing unit 14 returns a result of the data processing to the service 5 that has transmitted the request.
The data-transmission-source location information collecting unit 15 collects location information of the data transmission source 3. For example, the data-transmission-source location information collecting unit 15 receives location information periodically transmitted from the data transmission source 3. The data-transmission-source location information collecting unit 15 stores the received current location information as the geographical location corresponding to the data transmission source 3 in the data-transmission-source location information 23.
The statistical information generating unit 16 generates statistical information of the delay and the throughput in data transmission for each data source that is the data transmission source 3. For example, the statistical information generating unit 16 performs the following processing for each data source that is the data transmission source 3. The statistical information generating unit 16 calculates, for each geographical location, an average delay and an average throughput in data transmission. The statistical information generating unit 16 acquires an entry associated with the data transmission source and the geographical location from the statistical information 22. The statistical information generating unit 16 updates the acquired entry by using the calculated average delay and average throughput. When the statistical information generating unit 16 is unable to acquire the corresponding entry from the statistical information 22, the statistical information generating unit 16 may add a new entry.
Examples of data structures of various kinds of information will be described with reference to
[Data Structure of Statistical Information]
[Data Structure of Data-Transmission-Source Location Information]
[Data Structure of Data Information]
[Data Structure of Data-Collection-Task State Management Information]
[Data Structure of Collected Data Store Information]
An example of flowcharts of respective processes will be described with reference to
[Flowchart of Data-Processing-Request Accepting Process]
An example of the data processing request (request) will be described with reference to
Referring back to
The data-processing-request accepting unit 11 searches the data-transmission-source location information 23 ([T4]) for the collection-target data information [entry i] by using the data source ID as a key, and acquires the current location of the data source (step S14). The data-processing-request accepting unit 11 searches the statistical information 22 [T3] by using the data source ID, the current location, and the time slot as keys, and acquires a delay U and throughput information Pi (step S15). The data-processing-request accepting unit 11 searches the data information 24 [T5] by using the data source ID and the data ID as keys, and acquires a data size Si (step S16).
The data-processing-request accepting unit 11 calculates a data collection delay Di (=Li+Si/PI) for the data source (step S17). The data-processing-request accepting unit 11 causes the process to proceed to step S13 in order to process another piece of collection-target data information in the data processing request [m1] (step S18).
The data-processing-request accepting unit 11 calculates, as Dmax, the maximum data collection delay Di (step S19). The data-processing-request accepting unit 11 starts the loop in order to iterate the processing up to step S22 for each of the pieces of collection-target data information in the data processing request [m1] (step S20).
The data-processing-request accepting unit 11 generates a collection-target data information entry for the collection-target data information by setting the transmission additional delay to (Dmax−Di) and setting the expected transmission time to the initial value (step S21). The data-processing-request accepting unit 11 causes the process to proceed to step S20 in order to process another piece of collection-target data information in the data processing request [m1] (step S22).
The data-processing-request accepting unit 11 sets the index to the deadline time td, and generates a data processing request queue entry [im1] including the generated collection-target data information entry (step S23). The data-processing-request accepting unit 11 stores the generated data processing request queue entry [im1] in the data processing request queue 21 that is the priority queue by using the deadline time td as the index (step S24). From the data processing request queue 21, entries are extracted in ascending order of the deadline time td.
An example of the data processing request queue entry [im1] will be described with reference to
[Flowchart of Data-Processing-Request Scheduler Process]
The data-processing-request scheduler unit 12 determines whether the “expected transmission time” is the initial value (step S33A). If it is determined that the “expected transmission time” is the initial value (Yes in step S33A), the data-processing-request scheduler unit 12 causes the process to proceed to step S33C in order to transmit the collection-target data information entry.
On the other hand, if it is determined that the “expected transmission time” is not the initial value (No in step S33A), the data-processing-request scheduler unit 12 determines whether or not the “expected transmission time” of the entry is at or before the current time (step S33B). If it is determined that the “expected transmission time” of the entry is at or before the current time (Yes in step S33B), the data-processing-request scheduler unit 12 causes the process to proceed to step S33C in order to transmit the collection-target data information entry.
In step S33C, the data-processing-request scheduler unit 12 transmits the extracted collection-target data information entry having the “transmission additional delay” of 0 to the data transmission source 3 (step S33C). For example, for the extracted collection-target data information entry, the data-processing-request scheduler unit 12 transmits a request of the data collection task [m2] to the data transmission source 3 that is the corresponding data source. An example of a request of the data collection task for the data source will be described with reference to
Referring back to
On the other hand, if it is determined that there are remaining collection-target data information entries (Yes in step S33D), the data-processing-request scheduler unit 12 extracts the entry having the “transmission additional delay” that is greater than 0 and is the smallest from among the remaining collection-target data information entries, and acquires the value Dmin of the “transmission additional delay” of the extracted entry (step S34).
The data-processing-request scheduler unit 12 starts the loop in order to iterate the processing up to step S39 for each piece of the collection-target data information in the data processing request queue entry [im1] (step S35).
The data-processing-request scheduler unit 12 updates the “transmission additional delay” to a value obtained by subtracting Dmin from the value currently set as the “transmission additional delay” (step S36). The data-processing-request scheduler unit 12 determines whether the “transmission additional delay” of the corresponding entry of the data processing request queue entry [im1] is Dmin (step S37). If it is determined that the “transmission additional delay” is not Dmin (No in step S37), the data-processing-request scheduler unit 12 causes the process to proceed to step 939.
On the other hand, if it is determined that the “transmission additional delay” is Dmin (Yes in step S37), the data-processing-request scheduler unit 12 updates the “expected transmission time” to a value obtained by adding Dmin to the current time (step S38). The data-processing-request scheduler unit 12 causes the process to proceed to step S39. The data-processing-request scheduler unit 12 causes the process to proceed to step S35 in order to process another piece of collection-target data information in the data processing request queue entry [im1] (step S39).
The data-processing-request scheduler unit 12 adds an entry to the data-collection-task state management information [T2] 25 (step S40). The data-processing-request scheduler unit 12 sets Dmin as the delay dt (step S41). The data-processing-request scheduler unit 12 causes the process to proceed to step S43 in order to calculate a new index.
If it is determined in step S33B that the “expected transmission time” of the entry is after the current time (No in step S33B), the data-processing-request scheduler unit 12 updates the delay dt to a value obtained by subtracting the current time from the expected transmission time (step S42). The data-processing-request scheduler unit 12 causes the process to proceed to step S43 in order to calculate a new index.
In step S43, the data-processing-request scheduler unit 12 acquires information on an index list (x) of the data processing request queue 21 and the cumulative number (y) of entries (tasks) for each index, and obtains a function of y=f(x) (step S43). The data-processing-request scheduler unit 12 acquires a transmission rate R of the current data transmission task, and calculates an index that enables transmission to be performed the time dt later (step S44). For example, the data-processing-request scheduler unit 12 calculates a variable x that satisfies R×dt=f(x). The value of the variable x is the index to be calculated. The transmission rate is synonymous with the token supply amount and indicates the number of transmissions per unit time.
The data-processing-request scheduler unit 12 stores the entry by using the calculated x as the index in the data processing request queue 21 that is a priority queue (step S45). The data-processing-request scheduler unit 12 ends the data-processing-request scheduler process.
[Flowchart of Data Reception Process]
An example of the data collection task response will be described with reference to
Referring back to
The data receiving unit 13 searches the data-collection-task state management information [T2] 25 by using the data collection task ID as a key, and acquires the corresponding entry. The data receiving unit 13 sets values so that the coupling timestamp=t1, the completion timestamp=t2, the geographical location=the transmission source location, and the data size=the size of the received data, and updates the entry (step S56).
The data receiving unit 13 determines whether data collection for the data processing request (request) is completed (step S57). If it is determined that data collection for the data processing request (request) is not been completed (No in step S57), the data receiving unit 13 temporarily ends the data reception process.
On the other hand, if it is determined that data collection for the data processing request (request) is completed (Yes in step S57), the data receiving unit 13 issues, to the data processing unit 14, a trigger for performing data processing for the data processing request (request) (step S58). The data receiving unit 13 ends the data reception process.
[Flowchart of Data Processing Process]
The data processing unit 14 processes the extracted data (step S62). The data processing unit 14 returns a result as a response [m4] to the data processing request (request), to the service 5 that has requested the data collection and processing (step S63).
An example of the data processing request response (for the service) will be described with reference to
[Flowchart of Transmission-Source-Location-Information Collection Process]
[Flowchart of Statistical Information Generation Process]
The statistical information generating unit 16 starts the loop in order to iterate the processing up to step S93 for each data source ID (step S83). The statistical information generating unit 16 starts the loop in order to iterate the processing up to step S92 for each geographical location (step S84). The expression “for each geographical location” used herein indicates, for example, for each mesh obtained by sectioning the map into meshes of 50 m×2 m. The statistical information generating unit 16 [A] calculates an average delay as an average of (the coupling timestamp−the request issuance timestamp) (step S85). The statistical information generating unit 16 [B] calculates an average throughput as an average of the data size/(the completion timestamp−the coupling timestamp) (step S86).
The statistical information generating unit 16 searches the statistical information [T3] 22 based on the data source ID, the time slot, and the geographical location, and acquires the corresponding entry (step S87). The statistical information generating unit 16 determines whether there is the corresponding entry (step S88). If it is determined that there is no corresponding entry (No in step S88), the statistical information generating unit 16 performs the following processing. For example, the statistical information generating unit 16 adds an entry to the statistical information [T3] 22 using, as values, the average delay and the average throughput respectively calculated in [A] and [B] by using the data source ID, the time slot, and the geographical location as keys (step S90). The statistical information generating unit 16 causes the process to proceed to step S92 in order to process the next geographical location.
On the other hand, if it is determined that there is the corresponding entry (Yes in step S88), the statistical information generating unit 16 calculates an average of the delay set in the entry acquired from the statistical information [T3] 22 and the delay calculated in [A] and an average of the throughput set in the entry acquired from the statistical information [T3] 22 and the throughput calculated in [B] (step S89). The statistical information generating unit 16 updates the corresponding entry with the calculated average delay and average throughput (step S91). The statistical information generating unit 16 causes the process to proceed to step S92 in order to process the next geographical location.
In step S92, the statistical information generating unit 16 causes the process to proceed to step S84 in order to process another geographical location for the selected data source ID (step S92). In step S93, the statistical information generating unit 16 causes the process to proceed to step S83 in order to process another data source ID.
[Effects of Embodiment]
According to the above-described embodiment, the control apparatus 1 assigns, to each request for data collection, an index based on acceptance time of the request and a delay period allowable for data collection, and inputs the request to a queue in order of the index. In a case where a transmission timing of data collection of the request is to be delayed, the control apparatus 1 extracts the request from the queue and re-inputs the request to the queue by using an index based on a period for which the transmission timing is to be delayed and an extraction pace at which requests are extracted from the queue. With such a configuration, in the case where the transmission timing of data collection of the request extracted from the queue is to be delayed, the request is re-input to the queue by using the index based on the period for which the transmission timing is to be delayed and the extraction pace at which the requests are extracted from the queue. Thus, the control apparatus 1 may implement simultaneous reception of pieces of collected data without imposing a load on resources. As a result, the control apparatus 1 may suppress an additional calculation resource for fully receiving the load peak and an additional storage resource for storing data waiting for being processed, and may not impose a load on the resources.
According to the above-described embodiment, the control apparatus 1 further adds delay periods in data collection for respective data sources to an entry that includes an index, by using the statistical information 22 that indicates communication environments of the respective data sources, and inputs the entry to which the delay periods are added to the queue in the order of the index. The control apparatus 1 identifies, from among the delay periods for the respective data sources in an entry extracted from the queue in the order of the index, a delay period, for a data source, that indicates that a transmission timing of data collection is to be delayed. The control apparatus 1 calculates an index, based on the identified delay period for the data source and the current extraction pace, and re-inputs the entry to the queue by using the calculated index. With such a configuration, the control apparatus 1 calculates the index for the data source for which the timing is to be delayed, by using the delay period and the current extraction pace, and re-inputs the entry to the queue by using this index. Thus, the control apparatus 1 may implement simultaneous reception of pieces of collected data from the data sources in the entry.
According to the above-described embodiment, the control apparatus 1 calculates expected transmission time, based on the delay period and current time. The control apparatus 1 updates the expected transmission time of the entry in accordance with the index. With such a configuration, the control apparatus 1 updates the expected transmission time in accordance with the index. Thus, when the entry is extracted next time by using the index at the current extraction pace, the time when the entry is extracted substantially matches the expected transmission time. When the request may be transmitted at the expected transmission time, pieces of collected data may be simultaneously received.
According to the above-described embodiment, the control apparatus 1 further extracts an entry from the queue in the order of the index. In a case where the expected transmission time included in the extracted entry is after the current time, the control apparatus 1 re-calculates the index, based on the expected transmission time, the current time, and the current extraction pace. The control apparatus 1 re-inputs the entry to the queue by using the calculated index. With such a configuration, even when the current extraction pace varies from the extraction pace at the time of the update of the expected transmission time, the control apparatus 1 corrects the index by using the current extraction pace and re-inputs the entry to the queue by using the corrected index. Thus, the control apparatus 1 may simultaneously receive pieces of collected data.
[Others]
The control apparatus 1 may be implemented by causing an information processing apparatus such as a known personal computer or workstation to be equipped with the individual functions. The individual functions are the data-processing-request accepting unit 11, the data-processing-request scheduler unit 12, the data receiving unit 13, the data processing unit 14, the data-transmission-source location information collecting unit 15, the statistical information generating unit 16, and the like described above. The control apparatus 1 is not limited to the information processing apparatus, and may be a distributed data collection system including apparatuses to which the individual functions are deployed separately.
The components of each apparatus illustrated in the drawings do not have to be physically configured as illustrated. For example, specific forms of dispersion and integration of the apparatuses are not limited to those illustrated in the drawings, and all or part thereof may be configured by being functionally or physically dispersed or integrated in arbitrary units according to various loads, the state of use, and the like. For example, the data-processing-request accepting unit 11 and the data-processing-request scheduler unit 12 may be integrated as one unit. On the other hand, the data-processing-request accepting unit 11 may be distributed to an accepting unit that accepts a data processing request (request), a generating unit that generates a data processing request queue entry, and an input unit that inputs the data processing request queue entry to the data processing request queue 21. Each piece of information may be coupled via a network as an external device of the control apparatus 1.
The various processes described in the embodiment above may be implemented as a result of a computer such as a personal computer or a workstation executing a program prepared in advance. Hereinafter, an example of a computer that executes a control program for implementing substantially the same functions as those of the control apparatus 1 illustrated in
As illustrated in
The drive device 213 is, for example, a device for a removable disk 211. The HDD 205 stores a control program 205a and control-related information 205b.
The CPU 203 reads the control program 205a, loads the control program 205a into the memory 201, and executes the control program 205a as processes. Such processes correspond to the respective functional units of the control apparatus 1. The control-related information 205b corresponds to the data processing request queue 21, the statistical information 22, the data-transmission-source location information 23, the data information 24, the data-collection-task state management information 25, and the collected data store information 26. For example, the removable disk 211 stores various kinds of information such as the control program 205a.
The control program 205a does not necessarily have to be initially stored in the HDD 205. For example, the control program 205a is stored in a “portable physical medium”, such as a flexible disk (FD), a compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a magneto-optical disk, or an integrated circuit (IC) card, to be inserted into the computer 200. The computer 200 may read and execute the control program 205a from these media.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2020-139280 | Aug 2020 | JP | national |