CN112631524B - Storage medium distribution method and device and electronic equipment - Google Patents

Storage medium distribution method and device and electronic equipment Download PDF

Info

Publication number
CN112631524B
CN112631524B CN202011602112.6A CN202011602112A CN112631524B CN 112631524 B CN112631524 B CN 112631524B CN 202011602112 A CN202011602112 A CN 202011602112A CN 112631524 B CN112631524 B CN 112631524B
Authority
CN
China
Prior art keywords
data acquisition
storage medium
acquisition device
code rate
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011602112.6A
Other languages
Chinese (zh)
Other versions
CN112631524A (en
Inventor
商俊健
胡钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Haikang Auto Software Co ltd
Original Assignee
Hangzhou Haikang Auto Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Haikang Auto Software Co ltd filed Critical Hangzhou Haikang Auto Software Co ltd
Priority to CN202011602112.6A priority Critical patent/CN112631524B/en
Publication of CN112631524A publication Critical patent/CN112631524A/en
Application granted granted Critical
Publication of CN112631524B publication Critical patent/CN112631524B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Management Or Editing Of Information On Record Carriers (AREA)

Abstract

The embodiment of the invention provides a storage medium distribution method, a storage medium distribution device and electronic equipment, and relates to the technical field of data storage. The method comprises the following steps: determining the code rate proportion of the code rate of each data acquisition device in the sum of the code rates of a plurality of data acquisition devices; determining a performance proportion of the specified physical performance of each storage medium in the sum of the specified physical performances of the plurality of storage media; based on the principle that the code rate ratio is matched with the performance ratio, distributing a storage medium for each data acquisition device according to each determined code rate ratio and each determined performance ratio; wherein each data acquisition device stores acquired data in a storage medium allocated for that data acquisition device. Compared with the prior art, the scheme provided by the embodiment of the application can meet the requirement of a user on balanced storage of data when the storage medium is distributed to each data acquisition device.

Description

Storage medium distribution method and device and electronic equipment
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a storage medium allocation method and apparatus, and an electronic device.
Background
Currently, with the development of technology, technicians construct various data storage systems, such as various video monitoring systems including vehicle-mounted monitoring systems, and the like, and these data storage systems are also gradually applied to more and more technical fields, such as the vehicle-mounted security field, and the like.
In general, a data storage system may include a plurality of data capture devices and a plurality of storage media, each of which may correspond to at least one data capture device for storing data captured by the at least one video capture device.
In the related art, when allocating storage media to the respective data acquisition devices in the data storage system, the storage media are typically allocated to each data acquisition device in sequence according to a mounting order, for example, an earlier-accessed storage medium is allocated to an earlier-accessed data acquisition device, and a later-accessed storage medium is allocated to a later-accessed data acquisition device.
However, since the code rates of different data acquisition devices may be different and the hardware performances of different storage media may also be different, for example, the storage capacities, writing speeds, and the like of different storage media are different, in the above related art, the storage media allocated to each data acquisition device generally cannot meet the requirement of a user for performing balanced storage on data in practical applications.
For example, the user may want each storage medium to be capable of storing data collected by each data collection device in a balanced manner, so as to share storage pressure of each storage medium and improve data writing speed, and for example, the user may want each storage medium to be capable of writing the obtained data in a more balanced time period, so as to improve writing efficiency of the entire data storage system.
Based on this, how to allocate storage media for each data acquisition device in a data storage system including a plurality of data acquisition devices and a plurality of storage media to meet the requirement of a user on balanced storage of data is a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the invention aims to provide a storage medium distribution method, a storage medium distribution device and electronic equipment, and provides a storage medium distribution method for realizing balanced storage of data.
The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a storage medium allocation method, where the method includes:
determining the code rate ratio of the code rate of each data acquisition device in the sum of the code rates of a plurality of data acquisition devices;
determining a performance proportion of the specified physical performance of each storage medium in the sum of the specified physical performances of the plurality of storage media;
based on the principle that the code rate ratio is matched with the performance ratio, distributing a storage medium for each data acquisition device according to each determined code rate ratio and each determined performance ratio;
wherein each data acquisition device stores acquired data in a storage medium allocated for that data acquisition device.
Optionally, in a specific implementation manner, the code rate of each data acquisition device is: acquiring the code rate of the data stream of the data acquired by the data acquisition equipment by using a storage medium distributed for the data acquisition equipment; and each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
Optionally, in a specific implementation manner, the step of allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio includes:
traversing the data acquisition equipment, and when traversing each data acquisition equipment, if a storage medium with the current residual performance ratio not less than the code rate ratio of the data acquisition equipment exists in the storage media, allocating the storage medium to the data acquisition equipment; after traversing the plurality of data acquisition devices, if the residual data acquisition devices which are not allocated with the storage media exist, allocating the storage media for the residual data acquisition devices according to a preset allocation rule; wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all data acquisition devices of which the allocated storage medium is the storage medium;
or,
traversing the plurality of storage media, and when traversing to each storage medium, if at least one data acquisition device with the sum of the code rate ratios not greater than the performance ratio of the storage medium exists in the remaining data acquisition devices without the storage medium, allocating the storage medium to the at least one data acquisition device; after traversing the plurality of storage media, if the residual data acquisition equipment which is not allocated with the storage media exists, allocating the storage media for the residual data acquisition equipment according to a preset allocation rule.
Optionally, in a specific implementation manner, the step of allocating a storage medium to each remaining data acquisition device according to a preset allocation rule includes:
allocating any storage medium to each remaining data acquisition device;
or,
distributing any storage medium with the current remaining performance proportion not being zero to each remaining data acquisition device;
or,
allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
Optionally, in a specific implementation manner, before the step of allocating a storage medium to each data acquisition device according to each determined rate ratio and each determined performance ratio based on a principle that the rate ratio matches the performance ratio, the method further includes:
determining target data acquisition equipment in the plurality of data acquisition equipment based on a user instruction, and distributing target storage media in the plurality of storage media to the target data acquisition equipment according to the code rate of the target data acquisition equipment and the specified physical performance of each storage medium;
or,
determining a target storage medium in the plurality of storage media based on a user instruction, and distributing the target storage medium to target data acquisition equipment in the plurality of data acquisition equipment according to the designated physical performance of the target storage medium and the code stream of each data acquisition equipment;
the step of allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio includes:
based on the principle that the code rate ratio is matched with the performance ratio, distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium;
wherein, the general data acquisition equipment is: a data acquisition device of the plurality of data acquisition devices other than the target data acquisition device; the general storage medium is: a storage medium other than the target storage medium among the plurality of storage media.
Optionally, in a specific implementation manner, the step of allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio includes:
establishing corresponding relations between the plurality of data acquisition devices and the plurality of storage media according to the determined rate occupation ratios and the determined performance occupation ratios on the basis of a principle that the rate occupation ratios are matched with the performance occupation ratios;
and if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and a preset reference parameter meets a difference value condition, distributing the storage medium for each data acquisition device according to the corresponding relation.
Optionally, in a specific implementation manner, when the specified physical property is a storage capacity, the reference parameter is: the code rate is determined based on the ratio of the sum of the storage capacities of the plurality of storage media to the sum of the code rates of the plurality of data acquisition devices; the storage parameters of each storage medium are: the code rate is determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
when the specified physical property is a writing speed, the reference parameters are: the sum of the code rates of the plurality of data acquisition devices and the sum of the writing speeds of the plurality of storage media are determined based on the ratio; the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: and in the corresponding relation, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
In a second aspect, an embodiment of the present invention provides a storage medium distribution apparatus, including:
the code rate ratio calculation module is used for determining the code rate ratio of the code rate of each data acquisition device in the sum of the code rates of the data acquisition devices;
the performance ratio calculation module is used for determining the performance ratio of the specified physical performance of each storage medium in the sum of the specified physical performances of the plurality of storage media;
the storage medium distribution module is used for distributing storage media for each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio;
wherein each data acquisition device stores acquired data in a storage medium allocated for that data acquisition device.
Optionally, in a specific implementation manner, the code rate of each data acquisition device is: a storage medium allocated to the data acquisition equipment acquires the code rate of a data stream of the data acquired by the data acquisition equipment; and each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
Optionally, in a specific implementation manner, the storage medium allocation module includes:
the first traversal submodule is used for traversing the plurality of data acquisition devices, and when each data acquisition device is traversed, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device exists in the plurality of storage media, the storage medium is allocated to the data acquisition device; after traversing the plurality of data acquisition devices, if the remaining data acquisition devices without the storage media are available, triggering a first storage media allocation submodule; wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all the data acquisition devices of which the allocated storage medium is the storage medium;
or,
the second traversal submodule is used for traversing the plurality of storage media, and distributing the storage media to at least one data acquisition device if the sum of the code rate ratio is not greater than the performance ratio of the storage media in the remaining data acquisition devices which are not distributed with the storage media when traversing to each storage media; after traversing the plurality of storage media, if the residual data acquisition equipment without the storage media is available, triggering the first storage media allocation submodule;
and the first storage medium distribution submodule is used for distributing the storage medium for each residual data acquisition device according to a preset distribution rule.
Optionally, in a specific implementation manner, the first storage medium allocation sub-module is specifically configured to:
allocating any storage medium to each remaining data acquisition device;
or,
distributing any storage medium with the current residual performance ratio not being zero for each residual data acquisition device;
or,
allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
Optionally, in a specific implementation manner, the apparatus further includes:
a first target allocation submodule, configured to determine, based on a user instruction, a target data acquisition device among the multiple data acquisition devices before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate a target storage medium among the multiple storage media to the target data acquisition device according to a code rate of the target data acquisition device and specified physical performance of each storage medium;
or,
a second target allocation submodule, configured to determine a target storage medium in the plurality of storage media based on a user instruction before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate the target storage medium to a target data acquisition device in the plurality of data acquisition devices according to an assigned physical performance of the target storage medium and a code stream of each data acquisition device;
the storage medium allocation module is specifically configured to:
based on the principle that the code rate ratio is matched with the performance ratio, distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium;
wherein, the general data acquisition equipment is: a data acquisition device of the plurality of data acquisition devices other than the target data acquisition device; the general storage medium is: a storage medium other than the target storage medium among the plurality of storage media.
Optionally, in a specific implementation manner, the storage medium allocating module includes:
the relation establishment submodule is used for establishing the corresponding relation between the plurality of data acquisition devices and the plurality of storage media according to each determined code rate ratio and each determined performance ratio on the basis of a principle that the code rate ratio is matched with the performance ratio;
and the second storage medium distribution submodule is used for distributing the storage medium for each data acquisition device according to the corresponding relation if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and the preset reference parameter meets the difference value condition.
Alternatively, in one particular implementation,
when the specified physical property is a storage capacity, the reference parameters are: the code rate is determined based on the ratio of the sum of the storage capacities of the plurality of storage media to the sum of the code rates of the plurality of data acquisition devices; the storage parameters of each storage medium are: the code rate and the value are determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
when the specified physical property is a writing speed, the reference parameters are: the sum of the code rates of the plurality of data acquisition devices and the sum of the writing speeds of the plurality of storage media are determined based on the ratio; the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: and in the corresponding relation, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory;
a memory for storing a computer program;
a processor, configured to implement the steps of any storage medium allocation method provided by the first aspect of the present invention when executing the program stored in the memory.
Optionally, in a specific implementation manner, the electronic device further includes: a communication interface and a communication bus; the processor, the communication interface and the memory are used for completing mutual communication through the communication bus.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of any one of the storage medium allocation methods provided in the first aspect of the present invention.
In a fifth aspect, an embodiment of the present invention provides a computer program product including instructions, which when run on a computer, cause the computer to perform the steps of any one of the storage medium allocation methods provided in the first aspect of the present invention.
The embodiment of the invention has the following beneficial effects:
as can be seen from the above, by applying the scheme provided by the embodiment of the present invention, when the storage medium is allocated to each data acquisition device, the bit rate ratio of each data acquisition device and the performance ratio of each storage medium can be determined, and then, based on the principle that the bit rate ratio matches with the performance ratio, the storage medium is allocated to each data acquisition device according to the determined bit rate ratio and performance ratio, so that each data acquisition device can store the acquired data in the storage medium allocated to the data acquisition device.
Based on this, by applying the scheme provided by the embodiment of the present invention, based on the principle that the bit rate ratio of each data acquisition device matches the performance ratio of each storage medium, and according to the bit rate ratio of each data acquisition device and the performance ratio of each storage medium, the storage medium is allocated to each data acquisition device, and a storage medium allocation method for realizing balanced storage of data can be provided, so that when each data acquisition device stores acquired data in the storage medium allocated to the data acquisition device, the requirement of a user on balanced storage of the data can be met.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 (a) is a vehicle video surveillance system as a data storage system;
FIG. 1 (b) is a road monitoring system as a data storage system;
FIG. 1 (c) is a schematic structural diagram of an intelligent rearview mirror;
FIG. 2 is a flowchart illustrating a storage medium allocation method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an embodiment of S203 in FIG. 2;
fig. 4 is a schematic flowchart of another specific implementation manner of S203 in fig. 2;
FIG. 5 is a flow chart illustrating another storage medium allocation method according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a storage medium allocation method according to another embodiment of the present invention;
FIG. 7 is a flowchart illustrating another embodiment of S203 in FIG. 2;
FIG. 8 is a schematic structural diagram of a storage medium distribution apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a management node according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
For a data storage system including a plurality of data acquisition devices and a plurality of storage media, since code rates of different data acquisition devices may be different and hardware performances of different storage media may also be different, in the related art, when a storage medium is allocated to each data acquisition device in the data storage system, the storage medium allocated to each data acquisition device generally cannot meet requirements of a user for performing balanced storage on data in practical application. Based on this, how to allocate storage media to each data acquisition device in a data storage system including a plurality of data acquisition devices and a plurality of storage media to meet the requirement of a user on balanced storage of data is a problem to be solved urgently at present.
In order to solve the above technical problem, an embodiment of the present invention provides a storage medium allocation method.
The distribution method can be applied to any data storage scene, the data storage scene comprises a plurality of data acquisition devices and a plurality of storage media, and the data acquired by the data acquisition devices are stored in the storage media. The data acquisition device can be various electronic devices which can be used for acquiring various data, such as a video camera, a recording device and the like, and the storage medium can be various devices which can be used for storing various data, such as a memory card, a digital video recorder, a memory and the like.
Furthermore, the distribution method can be applied to various electronic devices such as a server, a central control device, a desktop computer and the like, and the electronic devices can distribute the storage medium in the data storage scene for each data acquisition device in the data storage scene.
For example, the allocation method may be applied to management nodes in various data storage systems, and the data storage system may further include a plurality of data acquisition devices and a plurality of storage media. The management node may apply the allocation method to allocate storage media for each data acquisition device in the data storage system.
For example, in the field of in-vehicle security, an in-vehicle video surveillance system having a plurality of cameras and a plurality of memory cards may be used as a data storage system suitable for the distribution method. As shown in fig. 1 (a), a plurality of cameras 101 in the in-vehicle video monitoring system may serve as a plurality of data acquisition devices in a data storage system, a plurality of memory cards 102 may serve as a plurality of storage media in the data storage system, and an in-vehicle central control device 103 may serve as a management node in the data storage system. In this way, the in-vehicle central control apparatus 103 can apply the allocation method to allocate the memory card 102 to each camera 101.
For example, in the field of intelligent transportation, a road monitoring system in a certain region can be used as a data storage system suitable for the allocation method. As shown in fig. 1 (b), the ball machines 104 installed at various road positions in the area may serve as a plurality of data acquisition devices in a data storage system, the traffic control center general control console 106 may serve as a management node in the data storage system, and the digital hard disk video recorders 105 communicatively connected to the traffic control center general control console 106 may serve as a plurality of storage media in the data storage system. Thus, the traffic control center master console 106 can apply the distribution method to distribute the digital hard disk video recorder 105 to each ball machine 104.
For another example, the allocation method may be applied to an electronic device to which a plurality of data collection devices are associated and which has a plurality of storage media, so that the electronic device may allocate a storage medium to each data collection device associated with itself by applying the allocation method.
The data acquisition device associated with the electronic device may include: the data acquisition equipment is installed on the electronic equipment, and the data acquisition equipment is in communication connection with the electronic equipment, so that the electronic equipment stores the data acquired by the data acquisition equipment installed on the electronic equipment into a local storage medium, acquires the data acquired by the data acquisition equipment in communication connection through data transmission, and stores the acquired data into the local storage medium.
For example, in the field of vehicle security, an intelligent rearview mirror associated with multiple cameras and having multiple memory cards may apply the allocation method to allocate the memory cards to the associated cameras. As shown in fig. 1 (c), a schematic structural diagram of an intelligent rearview mirror is shown, wherein the intelligent rearview mirror is provided with a built-in camera 301, so that the intelligent rearview mirror can utilize the built-in camera 301 to realize functions related to driving records, and the intelligent rearview mirror is in communication connection with a reversing camera 302 arranged at the rear part of a vehicle, so that the intelligent rearview mirror can assist driving operations such as reversing by means of the reversing camera 302; in addition, two memory cards 303 are installed locally on the intelligent rearview mirror, so that since both the image collected by the built-in camera 301 and the data collected by the reversing camera 302 acquired by the intelligent rearview mirror through data transmission need to be stored in the local storage medium of the intelligent rearview mirror, the control module 300 of the intelligent rearview mirror can allocate the memory cards 303 to the built-in camera 301 and the reversing camera 302 by using the allocation method.
The storage medium allocation method provided by the embodiment of the invention can comprise the following steps:
determining the code rate ratio of the code rate of each data acquisition device in the sum of the code rates of a plurality of data acquisition devices;
determining a performance ratio of the specified physical property of each storage medium among the specified physical properties of the plurality of storage media;
based on the principle that the code rate ratio is matched with the performance ratio, distributing a storage medium for each data acquisition device according to each determined code rate ratio and each determined performance ratio;
wherein each data acquisition device stores acquired data in a storage medium allocated for that data acquisition device.
As can be seen from the above, by applying the scheme provided by the embodiment of the present invention, when the storage medium is allocated to each data acquisition device, the bit rate ratio of each data acquisition device and the performance ratio of each storage medium can be determined, and then, based on the principle that the bit rate ratio matches with the performance ratio, the storage medium is allocated to each data acquisition device according to the determined bit rate ratio and performance ratio, so that each data acquisition device can store the acquired data in the storage medium allocated to the data acquisition device.
Based on this, by applying the scheme provided by the embodiment of the present invention, based on the principle that the bit rate ratio of each data acquisition device matches the performance ratio of each storage medium, and allocating the storage medium to each data acquisition device according to the bit rate ratio of each data acquisition device and the performance ratio of each storage medium, a storage medium allocation method for realizing balanced storage of data can be provided, so that when each data acquisition device stores the acquired data in the storage medium allocated to the data acquisition device, the requirement of a user on balanced storage of the data can be met.
A storage medium allocation method according to an embodiment of the present invention is specifically described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a storage medium allocation method according to an embodiment of the present invention, and as shown in fig. 2, the allocation method may include the following steps:
s201: determining the code rate proportion of the code rate of each data acquisition device in the sum of the code rates of a plurality of data acquisition devices;
the code rate is: the number of data bits transmitted per unit time during data transmission is also referred to as bit rate, and the code rate may be different for different data acquisition devices.
For a plurality of data acquisition devices, the sum of the code rates of the plurality of data acquisition devices can be calculated, and then, the ratio of the code rate of each data acquisition device in the sum of the code rates can be determined to obtain the ratio of the code rate of the data acquisition device.
The code rate ratio of each data acquisition device can be calculated by the following formula:
P(i)=C(i)/[C(1)+C(2)+…+C(i)+…+C(n)]
wherein, P (i) is the code rate ratio of the ith data acquisition equipment, C (i) is the code rate of the ith data acquisition equipment, n is the number of the plurality of data acquisition equipment, and i is more than or equal to 1 and less than or equal to n.
S202: determining a performance ratio of the specified physical property of each storage medium among the specified physical properties of the plurality of storage media;
wherein the specified physical properties may include: storage capacity or writing speed; of course, other physical properties may also be included, and the embodiments of the present invention are not limited in this respect.
According to the requirement of the user for the balanced storage of the data, the physical property aimed at by the requirement can be determined as the specified physical property of the storage medium. For example, when a user desires to achieve a balanced load so that the retention periods of the respective storage media are relatively consistent, the specified physical property may be the storage capacity. The storage period is as follows: the storage capacity of a storage medium is used throughout, requiring the time consumed to overwrite stored data from scratch. For another example, when the user wants to achieve balanced writing so that the time length of writing the acquired data in the unit time of each storage medium is relatively consistent, the specified physical property may be the writing speed of the storage medium.
Based on this, the specified physical property may include a storage capacity or a writing speed, and of course, the specified physical property may also be other physical properties of the storage medium, and the embodiment of the present invention is not particularly limited, and the property value of the specified physical property may be different for different storage media. For example, the storage capacities of different storage media may differ, and/or the writing speeds of different storage media may differ, etc.
For a plurality of storage media, the sum of the specified physical properties of the plurality of storage media can be calculated, and then the ratio of the specified physical property of each storage media in the sum of the specified physical properties can be determined to obtain the performance ratio of the storage media.
Wherein, the performance proportion of each storage medium can be calculated by the following formula:
P'(j)=H(j)/[H(1)+H(2)+…+H(j)+…+H(m)]
wherein P' (j) is the performance proportion of the j-th storage medium, H (j) is the designated physical performance of the j-th storage medium, m is the number of the plurality of storage media, and j is more than or equal to 1 and less than or equal to m.
S203: and based on the principle that the code rate ratio is matched with the performance ratio, allocating a storage medium for each data acquisition device according to the determined each code rate ratio and each performance ratio.
After the code rate ratio of each data acquisition device and the performance ratio of each storage medium are determined, the storage medium can be allocated to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio.
The matching of the code rate ratio and the performance ratio can be understood as follows: and allocating a storage medium with higher performance ratio for the data acquisition equipment with higher code rate ratio or the plurality of data acquisition equipment with higher sum of code rate ratios, and allocating a storage medium with lower performance ratio for the data acquisition equipment with lower code rate ratio or the plurality of data acquisition equipment with lower sum of code rate ratios.
In this way, the storage medium with higher performance can store the data acquired by the data acquisition device with higher code rate or the data acquired by the data acquisition devices with higher sum of code rate, while the storage medium with lower performance can store the data acquired by the data acquisition device with lower code rate or the data acquired by the data acquisition devices with lower sum of code rate.
Based on this, by matching the code rate ratio and the performance ratio, in the data storage process, each storage medium can have the same or similar storage parameters, such as a storage period and the like, so that the requirement of a user for performing balanced storage on data is met.
After the storage media are allocated to each data acquisition device, the corresponding relationship between each data acquisition device and each storage media in the data storage process can be obtained, wherein one data acquisition device corresponds to one storage media, and one storage media can correspond to at least one data acquisition device. In this way, during the data process, each data acquisition device can store the acquired data in the storage medium allocated to the data acquisition device.
For example, the plurality of data acquisition devices are data acquisition devices 1, 2, and 3, and the plurality of storage media are storage media a and b, and with the storage medium allocation method provided in the above embodiment of the present invention, after allocating a storage medium to each data acquisition device, the obtained correspondence relationship is shown in the following table:
Figure BDA0002869603400000131
Figure BDA0002869603400000141
in this way, during data storage, the data collection device 1 and the data collection device 2 can store the collected data in the storage medium a, and the data collection device 3 can store the collected data in the storage medium b.
Furthermore, the process of storing the data acquired by each data acquisition device into the storage medium allocated to each data acquisition device may be different for each data acquisition device of different types.
For example, for an analog camera, after data is acquired, for example, after an image and/or a video is acquired, the data is not encoded locally, but the acquired data is sent to an electronic device where a storage medium is located, and the electronic device where the storage medium is located encodes the data, so that the electronic device where the storage medium is located transmits a data stream obtained after encoding to the storage medium for storage according to a certain code rate. Thus, for an analog camera, the code rate of the analog camera can be understood as: acquiring a code rate of a data stream of data acquired by the analog camera for a storage medium allocated to the analog camera, wherein the data stream of the data acquired by the analog camera can be stored in real time for the storage medium allocated to the analog camera, and the data stream is: and the data stream is obtained by coding the data collected by the analog camera.
For another example, in the case of an IPC (IP Camera), after data is acquired by the IPC, for example, after an image and/or a video is acquired, the data may be directly encoded locally, so that a data stream obtained by encoding the data is sent to a storage medium allocated to the IPC according to a certain code rate. Thus, for the storage medium, it can acquire the data stream at the code rate at which the IPC transmits the data stream. Thus, for IPC, the code rate of IPC can also be understood as: the storage medium allocated to the IPC obtains a code rate of a data stream of the data collected by the IPC, wherein the storage medium allocated to the IPC can store the obtained data stream of the data collected by the IPC in real time, and the data stream is: and the data stream is obtained by encoding the data collected by the IPC. Wherein the IP is an abbreviation of Internet Protocol (IP).
Based on this, optionally, in a specific implementation manner, the code rate of each data acquisition device may be: a storage medium allocated to the data acquisition equipment acquires the code rate of a data stream of the data acquired by the data acquisition equipment; correspondingly, each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
The analog camera and the IPC device are only used for illustrating different types of data acquisition devices, but are not limited, and the types of the data acquisition devices are not limited in the present application.
As can be seen from the above, by applying the scheme provided in the embodiment of the present invention, based on the principle that the bit rate ratio of each data acquisition device matches with the performance ratio of each storage medium, and allocating a storage medium to each data acquisition device according to the bit rate ratio of each data acquisition device and the performance ratio of each storage medium, a storage medium allocation method for achieving balanced storage of data can be provided, so that when each data acquisition device stores acquired data in a storage medium allocated to the data acquisition device, a requirement of a user on balanced storage of data can be met.
Optionally, in a specific implementation manner, as shown in fig. 3, in step S203, based on a principle that the code rate ratio matches the performance ratio, allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio, may include the following steps S2031 to 2032:
s2031: traversing a plurality of data acquisition devices, and when each data acquisition device is traversed, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device exists in a plurality of storage media, allocating the storage medium to the data acquisition device;
wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all data acquisition devices of which the allocated storage medium is the storage medium;
s2032: after traversing the plurality of data acquisition devices, if the remaining data acquisition devices which are not allocated with the storage media exist, allocating the storage media for the remaining data acquisition devices according to a preset allocation rule.
In this particular implementation, the storage medium may be allocated to each data acquisition device by traversing the plurality of data acquisition devices.
In traversing to each data acquisition device, a current remaining performance fraction of the respective storage medium may first be determined. For each storage medium, if the storage medium is not allocated to any data acquisition device currently, that is, the storage medium is not allocated to any data acquisition device, the current remaining performance ratio of the storage medium is the performance ratio of the storage medium; if the storage medium is already allocated to at least one data acquisition device currently, that is, the storage medium is already allocated to the at least one data acquisition device, the current remaining performance ratio of the storage medium is the performance ratio of the storage medium, and the sum of the code rate ratios of the at least one data acquisition device is subtracted to obtain a difference.
That is, the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all the data acquisition devices of which the allocated storage medium is the storage medium.
In this way, when traversing to each data acquisition device, if there is a storage medium whose current remaining performance fraction is not less than the code rate fraction of the data acquisition device among the plurality of storage media, the storage medium may be allocated to the data acquisition device.
Optionally, after the storage medium is allocated to the data acquisition device, the current remaining performance ratio of the storage medium may be further updated, where the updated current remaining performance of the storage medium is: before the storage medium is allocated to the data acquisition equipment, the current residual performance ratio of the storage medium is subtracted by the code rate ratio of the data acquisition equipment to obtain a difference value.
Optionally, for each data acquisition device, when there are a plurality of storage media with a current remaining performance ratio not less than the code rate ratio of the data acquisition device, for convenience of description, the storage media with a current remaining performance ratio not less than the code rate ratio of the data acquisition device may be referred to as candidate storage media.
In this case, the data acquisition device may be allocated a storage medium with the largest current remaining performance proportion among the plurality of candidate storage media; the data storage device may also be assigned any one of a plurality of candidate storage media; it is reasonable to allocate a storage medium with the smallest difference between the current remaining performance fraction and the bit rate fraction of the data storage device among the plurality of candidate storage media. Of course, the storage medium allocated to the data acquisition device may also be determined in other manners among the plurality of candidate storage media, and thus, the embodiment of the present invention is not particularly limited.
Correspondingly, when traversing each data acquisition device, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device does not exist in the plurality of storage media, the data acquisition device can be determined as the remaining data acquisition device, the storage medium is not allocated to the data acquisition device temporarily, and the storage medium is allocated to the data acquisition device after all the data acquisition devices are traversed.
In this way, after traversing the plurality of data acquisition devices, if there are remaining data acquisition devices to which no storage medium is allocated, the storage medium may be allocated to each remaining data acquisition device according to a preset allocation rule.
To this end, the allocation of the storage medium to each data acquisition device is completed.
Optionally, in another specific implementation manner, as shown in fig. 4, in the step S203, based on a principle that the code rate ratio matches the performance ratio, allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio may include the following steps S203A to S203B:
S203A: traversing a plurality of storage media, and when traversing each storage medium, if at least one data acquisition device with the sum of the code rate ratios not larger than the performance ratio of the storage medium exists in the remaining data acquisition devices without the storage medium, allocating the storage medium to the at least one data acquisition device.
S203B: after traversing a plurality of storage media, if the residual data acquisition equipment which is not allocated with the storage media exists, allocating the storage media for each residual data acquisition equipment according to a preset allocation rule.
In this particular implementation, the storage medium may be allocated for each data acquisition device by traversing the plurality of storage media.
When traversing to each storage medium, determining each remaining data acquisition device which is not allocated with the storage medium at present, and if at least one data acquisition device with a sum of code rate ratios not greater than a performance ratio of the storage medium exists in the determined remaining data acquisition devices, allocating the storage medium to the at least one data acquisition device.
Optionally, for each storage medium, when there are multiple data acquisition device combinations and each data acquisition device combination includes at least one data acquisition device whose sum of the code rate ratios is not greater than the performance ratio of the storage medium, in this case, the storage medium may be allocated to at least one data acquisition device included in a device combination whose sum of the code rate ratios is the largest among the multiple data acquisition device combinations; the storage medium can also be distributed to at least one data acquisition device in a plurality of data acquisition device combinations, wherein any one device combination comprises the data acquisition devices; it is also possible to allocate the storage medium to at least one data acquisition device included in a combination of devices having the largest difference between the sum of the code rate ratios and the performance ratio of the storage medium among a plurality of groups of data acquisition devices, which is reasonable. Of course, the storage medium may also be distributed to at least one data acquisition device included in one of the multiple data acquisition device combinations by other ways, which is not specifically limited in the embodiment of the present invention.
In the above case that there are multiple data acquisition device combinations for each storage medium, and each data acquisition device combination includes at least one data acquisition device whose sum of the code rate ratios is not greater than the performance ratio of the storage medium, it is reasonable that the same data acquisition device may belong to only the data acquisition device combination, or to multiple data acquisition device combinations.
Correspondingly, when traversing each storage medium, if the bit rate ratio of any data acquisition device is greater than the performance ratio of the storage medium in the remaining data acquisition devices which are not allocated with the storage medium, the storage medium can be temporarily not allocated to any remaining data acquisition device, and the next storage medium is continuously traversed.
In this way, after traversing a plurality of storage media, if there are remaining data acquisition devices to which no storage media are allocated, the storage media may be allocated to each remaining data acquisition device according to a preset allocation rule.
To this end, the allocation of the storage medium to each data acquisition device is completed.
Optionally, in a specific implementation manner, in step S2032 and step S203B, allocating a storage medium to each remaining data acquisition device according to a preset allocation rule, where the method includes the following steps:
step 1: allocating any storage medium to each remaining data acquisition device;
or,
and 2, step: distributing any storage medium with the current remaining performance proportion not being zero to each remaining data acquisition device;
or,
and step 3: allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
That is, in this specific implementation manner, for each remaining data acquisition device, a storage medium may be randomly selected from a plurality of storage media, so that the randomly selected storage medium is allocated to the remaining data acquisition device;
for each residual data acquisition device, a storage medium with a current residual performance ratio not zero in the plurality of storage media can be determined, and a storage medium is randomly selected from the storage media with the current residual performance ratio not zero, so that the randomly selected storage medium with the current residual performance ratio not zero is distributed to the residual data acquisition device;
for each remaining data acquisition device, the difference between the current remaining performance ratio of each storage medium and the code rate ratio of the remaining data acquisition device may also be determined, so that the storage medium with the smallest difference is determined as the designated storage medium, and the determined designated storage medium is allocated to the remaining data acquisition device.
Of course, the storage medium may be allocated to each remaining data acquisition device in other manners, for example, the storage medium with the largest current remaining performance ratio may be allocated to each remaining data acquisition device. The embodiment of the present invention is not particularly limited.
Example one, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 and 3 is 4M/s, and the code rate of the data acquisition equipment 2 is 2M/s.
The performance of storage media a and b is 50%, the code rate of data acquisition devices 1 and 3 is 40%, and the code rate of data acquisition device 2 is 20%.
Aiming at the data acquisition equipment 1, the current residual performance proportion of the storage media a and b is 50 percent and is not less than the code rate proportion of the data acquisition equipment 1, so that the storage media a are distributed to the data acquisition equipment 1;
for the data acquisition device 2, the current remaining performance proportion of the storage medium a is 10%, and the current remaining performance proportion of the storage medium b is 50%, then the current remaining performance proportion of the storage medium b is not less than that of the data acquisition device 2, and therefore the storage medium b can be allocated to the data acquisition device 2;
for data acquisition device 3, the current remaining performance proportion of storage medium a is 10%, the current remaining performance proportion of storage medium b is 30%, the current remaining performance proportions of storage media a and b are both less than the code rate proportion of data acquisition device 3, and the current remaining performance proportion of storage medium b is greater than the current remaining performance proportion of storage medium a, so that storage medium b can be allocated to data acquisition device 3.
Example two, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 is 5M/s, the code rate of the data acquisition equipment 2 is 3M/s, and the code rate of the data acquisition equipment 3 is 2M/s.
The performance ratios of the storage media a and b are both 50%, the code rate ratio of the data acquisition device 1 is 50%, the code rate ratio of the data acquisition device 2 is 30%, and the performance ratio of the data acquisition device 3 is 20%.
Aiming at the data acquisition equipment 1, the current residual performance occupation ratios of the storage media a and b are both 50 percent and are not less than the code rate occupation ratio of the data acquisition equipment 1, so that the storage media a can be distributed to the data acquisition equipment 1;
for the data acquisition device 2, the current remaining performance proportion of the storage medium a is 0, and the current remaining performance proportion of the storage medium b is 50%, then the current remaining performance proportion of the storage medium b is not less than that of the data acquisition device 2, and therefore the storage medium b can be allocated to the data acquisition device 2;
for the data acquisition device 3, the current remaining performance proportion of the storage medium a is 0, the current remaining performance proportion of the storage medium b is 20%, and the current remaining performance proportion of the storage medium b is not less than the code rate proportion of the data acquisition device 3, so that the storage medium b can be allocated to the data acquisition device 3.
Example three, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 is 6M/s, the code rate of the data acquisition equipment 2 is 3M/s, and the code rate of the data acquisition equipment 3 is 1M/s.
The performance ratios of the storage media a and b are both 50%, the code rate ratio of the data acquisition device 1 is 60%, the code rate ratio of the data acquisition device 2 is 30%, and the performance ratio of the data acquisition device 3 is 10%.
For the data acquisition equipment 1, the current remaining performance occupation ratios of the storage media a and b are both 50% and are both smaller than the code rate occupation ratio of the data acquisition equipment 1, so that the data acquisition equipment 1 can be determined to be the remaining data acquisition equipment;
for the data acquisition equipment 2, the current residual performance proportion of the storage media a and b is 50%, and the current residual performance proportion is not less than the code rate proportion of the data acquisition equipment 2, so that the storage media a can be allocated to the data acquisition equipment 2;
for data acquisition device 3, the current remaining performance of storage medium a is 20%, the current remaining performance of storage medium b is 50%, and the current remaining performance of storage media a and b is not less than the code rate of data acquisition device 3, so that storage medium a can be allocated for data acquisition device 3;
again for data acquisition device 1, the current remaining performance ratio of storage medium a is 10%, the current remaining performance ratio of storage medium b is 50%, the current remaining performance ratios of storage media a and b are both less than the code rate ratio of data acquisition device 1, and the difference between the current remaining performance ratio of storage medium a and the code rate ratio of data acquisition device 1 is 50%, and the difference between the current remaining performance ratio of storage medium b and the code rate ratio of data acquisition device 1 is 10%, so that storage medium b can be allocated to data acquisition device 1.
Example four, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 and 3 is 4M/s, and the code rate of the data acquisition equipment 2 is 2M/s.
The performance of storage media a and b are both 50%, the code rate of data acquisition devices 1 and 3 is 40%, and the code rate of data acquisition device 2 is 20%.
For the storage medium a, the code rate occupation ratio of the data acquisition equipment 1 is not more than the performance occupation ratio of the storage medium a, so that the storage medium a can be allocated to the data acquisition equipment 1;
for the storage medium b, the code rate ratio of the data acquisition devices 2 and 3 is not greater than the performance ratio of the storage medium b, and the sum of the code rate ratios of the data acquisition devices 2 and 3 is greater than the performance ratio of the storage medium b, so that the storage medium b can be allocated to the data acquisition device 3;
up to this point, there is a remaining data acquisition device 2, and the current remaining performance percentages of the storage media a and b are both 10%, so that the correspondence between the data acquisition device 2 and the storage medium b may be determined, and the storage medium a may also be allocated to the data acquisition device 2.
Example five, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 is 5M/s, the code rate of the data acquisition equipment 2 is 3M/s, and the code rate of the data acquisition equipment 3 is 2M/s.
The performance ratios of the storage media a and b are both 50%, the code rate ratio of the data acquisition device 1 is 50%, the code rate ratio of the data acquisition device 2 is 30%, and the performance ratio of the data acquisition device 3 is 20%.
For the storage medium a, the code rate ratio of the data acquisition equipment 1 is not greater than the performance ratio of the storage medium a, and the sum of the code rate ratios of the data acquisition equipment 2 and the data acquisition equipment 3 is not greater than the performance ratio of the storage medium a, so that the storage medium a can be allocated to the data acquisition equipment 1;
for the storage medium b, the sum of the code rate ratios of the data acquisition device 2 and the data acquisition device 3 is not greater than the performance ratio of the storage medium b, and therefore, the storage medium b may be allocated to the data acquisition device 2, and the storage medium b may be allocated to the data acquisition device 3.
Example six, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a and b, and the physical property is specified as a storage capacity. The storage capacity of the storage media a and b is 8G, the code rate of the data acquisition equipment 1 is 6M/s, the code rate of the data acquisition equipment 2 is 3M/s, and the code rate of the data acquisition equipment 3 is 1M/s.
The performance ratios of the storage media a and b are both 50%, the code rate ratio of the data acquisition device 1 is 60%, the code rate ratio of the data acquisition device 2 is 30%, and the performance ratio of the data acquisition device 3 is 10%.
For the storage medium a, the sum of the code rate ratios of the data acquisition device 2 and the data acquisition device 3 is not greater than the performance ratio of the storage medium a, so that the storage medium a can be allocated to the data acquisition device 2, and the storage medium a can be allocated to the data acquisition device 3;
for the storage medium b, the code rate ratio of the data acquisition device 1 is greater than the performance ratio of the storage medium b, and therefore, it may be determined that the data acquisition device 1 is a remaining data acquisition device, and thus, the current remaining performance ratio of the storage medium a is 10%, the current remaining performance ratio of the storage medium b is 50%, the current remaining performance ratios of the storage media a and b are both less than the code rate ratio of the data acquisition device 1, and a difference between the current remaining performance ratio of the storage medium a and the code rate ratio of the data acquisition device 1 is 50%, and a difference between the current remaining performance ratio of the storage medium b and the code rate ratio of the data acquisition device 1 is 10%, and therefore, the storage medium b may be allocated to the data acquisition device 1.
The first to sixth examples are only used for the above steps 1 to 3 to illustrate, but not limited to, and other technical solutions capable of implementing the above steps 1 to 3 also belong to the protection scope of the embodiment of the present invention.
In many cases, a user may pay more attention to data collected by a certain data collection device among the data collection devices, so that, when data is stored, the storage requirement of the data collected by the data collection device may be different from that of the data collected by other data collection devices.
For example, for an on-vehicle monitoring system, for a camera located behind a vehicle, a user wants a storage time length of data collected by the camera located behind the vehicle relative to that of other cameras, and video data collected by the camera located behind the vehicle can have a longer storage time length.
Optionally, in a specific implementation manner, as shown in fig. 5, a storage medium allocation method provided in an embodiment of the present invention may further include the following steps:
s204: and determining target data acquisition equipment in the plurality of data acquisition equipment based on the user instruction, and distributing target storage media in the plurality of storage media to the target data acquisition equipment according to the code rate of the target data acquisition equipment and the specified physical performance of each storage medium.
Correspondingly, in this specific implementation manner, in step S203, based on the principle that the code rate ratio matches with the performance ratio, allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio may include the following step S205:
s205: distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio;
wherein, general data acquisition equipment is: a data acquisition device other than the target data acquisition device among the plurality of data acquisition devices; the general storage media are: a storage medium other than the target storage medium among the plurality of storage media.
In this specific implementation manner, the user may determine a target data acquisition device of the plurality of data acquisition devices according to a requirement in actual application, and send a user instruction to the electronic device. The user instruction may include a target data acquisition device specified by a user and specified storage parameters for the target data acquisition device.
Thus, the electronic device can determine the target data acquisition device in the plurality of data acquisition devices based on the received user instruction, and allocate the target storage medium in the plurality of storage media to the target data acquisition device according to the code rate of the target data acquisition device and the designated physical performance of each storage medium.
For example, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a, b, and c, and the physical property is specified as a storage capacity. The storage capacity of the storage medium a is 8G, the storage capacities of the storage media b and c are 6G, the code rates of the data acquisition devices 1 and 3 are both 4M/s, and the code rate of the data acquisition device 2 is 2M/s. The user desires that the data of the data collecting apparatus 2 be stored for a long time period, and the storage period of the storage medium for storing the data collecting apparatus 2 is not less than 1h (hour).
Then it may be determined that the data acquisition device 2 is the target data acquisition device, and according to the code rate of the data acquisition device 2 and the storage capacities of the storage media a, b, and c, it may be calculated to obtain:
when the storage medium a only stores the data collected by the data collecting device 2, the storage period of the storage medium a is
Figure BDA0002869603400000231
Wherein, 1.14h>1h;
When the storage medium b or c only stores the data collected by the data collecting device 2, the storage period of the storage medium b or c is
Figure BDA0002869603400000232
Wherein, 0.85h<1h;
Based on this, it is determined that the target storage medium among the plurality of storage media is the storage medium a, and the storage medium a may be allocated to the data collecting apparatus 2.
Furthermore, after the target data acquisition device and the target storage medium are determined, the devices except the target data acquisition device in the plurality of data acquisition devices can be used as a universal data acquisition device, and the media except the target storage medium in the plurality of storage media can be used as a universal storage medium.
Therefore, the universal storage medium can be allocated to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio.
In addition, in many cases, a user may pay more attention to the storage performance of a certain storage medium among a plurality of storage media, and thus, at the time of data storage, the demand for the storage performance of the storage medium may be different from the demand for the storage performance of other storage media.
For example, for a road monitoring system, for a certain digital hard disk recorder, a user wants to shorten a time period consumed by the digital hard disk recorder for writing data acquired in a unit time period compared with a time period consumed by other digital hard disk recorders for writing data acquired in the unit time period.
Optionally, in a specific implementation manner, as shown in fig. 6, a storage medium allocation method provided in an embodiment of the present invention further includes the following steps:
s206: determining a target storage medium in the plurality of storage media based on a user instruction, and distributing the target storage medium to target data acquisition equipment in the plurality of data acquisition equipment according to the designated physical performance of the target storage medium and the code stream of each data acquisition equipment;
correspondingly, in this specific implementation manner, in step S203, based on the principle that the bit rate ratio matches the performance ratio, allocating a storage medium to each data acquisition device according to each determined bit rate ratio and each determined performance ratio may include the following step S207:
s207: distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio;
wherein, general data acquisition equipment is: a data acquisition device other than the target data acquisition device among the plurality of data acquisition devices; the general storage media are: a storage medium other than the target storage medium among the plurality of storage media.
In this specific implementation manner, a user may determine a target storage medium among the plurality of storage media according to a requirement in actual application, and send a user instruction to the electronic device. The user instruction may include a target storage medium specified by a user and specified storage parameters for the target storage medium.
Thus, the electronic device can determine a target storage medium in the plurality of storage media based on the received user instruction, and allocate the target storage medium to the target data acquisition device in the plurality of data acquisition devices according to the designated physical performance of the target storage medium and the code stream of each data acquisition device.
For example, the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, the plurality of storage media are storage media a, b, and c, and the physical property is specified as a writing speed. The writing speed of the storage medium a is 10M/s, the storage capacities of the storage media b and c are 5M/s, the code rates of the data acquisition devices 1 and 3 are both 4M/s, and the code rate of the data acquisition device 2 is 2M/s. The user wants that the time length consumed for the storage medium a to write the acquired data in the unit time length is not more than 0.25s.
Then it can be determined that the storage medium a is the target storage medium, and according to the writing speed of the storage medium a and the code rates of the data acquisition devices 1, 2, and 3, it can be calculated to obtain:
when the storage medium a writes the data acquired by the storage data acquisition device 2, the time length consumed for the storage medium a to write the data acquired in the unit time length is
Figure BDA0002869603400000251
Wherein, 0.2s<0.25s;
When the storage medium a writes the data acquired by the storage data acquisition device 1 or 3, the time length consumed for the storage medium a to write the data acquired in the unit time length is
Figure BDA0002869603400000252
Wherein, 0.4s>0.25s;
Based on this, if it is determined that the data collecting device 2 among the plurality of data collecting devices is the target data collecting device, the storage medium a may be allocated to the data collecting device 2.
Furthermore, after the target data acquisition device and the target storage medium are determined, the devices except the target data acquisition device in the plurality of data acquisition devices can be used as a universal data acquisition device, and the media except the target storage medium in the plurality of storage media can be used as a universal storage medium.
Therefore, the universal storage medium can be allocated to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio.
Optionally, in a specific implementation manner, as shown in fig. 7, in step S203, based on a principle that the bit rate ratio matches the performance ratio, allocating a storage medium to each data acquisition device according to each determined bit rate ratio and each determined performance ratio, may include the following steps 208 to 209:
s208: establishing corresponding relations between a plurality of data acquisition devices and a plurality of storage media according to the determined rate occupation ratios and the determined performance occupation ratios on the basis of the principle that the rate occupation ratios are matched with the performance occupation ratios;
s209: and if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and the preset reference parameter meets the difference value condition, distributing the storage medium for each data acquisition device according to the corresponding relation.
In this specific implementation manner, after the code rate ratio of each data acquisition device and the performance ratio of each storage medium are determined, a corresponding relationship between a plurality of data acquisition devices and a plurality of storage media can be established according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio is matched with the performance ratio; and further, determining the storage parameters of each storage medium based on the established corresponding relationship, and if the difference value between the storage parameters of each storage medium and the preset reference parameters meets the difference value condition, allocating the storage medium to each data acquisition device according to the established corresponding relationship.
Optionally, if the number of the established corresponding relationships between the multiple data acquisition devices and the multiple storage media is multiple, it may be determined, for each corresponding relationship, one by one whether the difference between the storage parameter of each storage medium determined based on the corresponding relationship and the preset reference parameter satisfies the difference condition, so as to obtain the corresponding relationship that the difference between the storage parameter of each storage medium and the preset reference parameter satisfies the difference condition.
In this way, after determining the corresponding relationship that the difference between the storage parameter of each storage medium and the preset reference parameter satisfies the difference condition, the storage medium may be allocated to each data acquisition device according to the corresponding relationship.
Wherein, the difference condition may be: is less than a preset threshold value; it can also be: is positioned in the range of a preset threshold value; the method can also be as follows: not greater than a preset threshold, etc., as is reasonable.
Correspondingly, if the difference between the storage parameter of each storage medium determined based on the established corresponding relationship between the plurality of data acquisition devices and the plurality of storage media and the preset reference parameter does not satisfy the difference condition, the storage media can be allocated to each data acquisition device according to the current existing storage media allocation method.
For example, a storage medium is randomly allocated for each data storage device;
for another example, if the plurality of established correspondence relationships between the plurality of data acquisition devices and the plurality of storage media are multiple, and the difference between the storage parameter of each storage medium determined based on the established correspondence relationship between each plurality of data acquisition devices and the plurality of storage media and the preset reference parameter does not satisfy the difference condition, the correspondence relationship with the smallest difference between the storage parameter of each storage medium and the preset reference parameter may be selected from the plurality of correspondence relationships, so that the storage medium is allocated to each data acquisition device according to the selected correspondence relationship, and thus, the storage effect represented by the storage parameter of each storage medium may be as close as possible to the requirement of the user for balanced storage of data in the data storage process.
Optionally, in a specific implementation manner, when the specified physical property is a storage capacity, the preset reference parameter is: determined based on a ratio of a sum of specified physical properties of the plurality of storage media to a sum of code rates of the plurality of data acquisition devices; accordingly, the storage parameters of each storage medium are: the code rate is determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: in the above correspondence, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
In this specific implementation, when the physical property is specified as the storage capacity, the reference parameter may be determined based on a ratio of a sum of the storage capacity properties of the plurality of storage media to a sum of the code rates of the plurality of data acquisition devices.
Furthermore, for each storage medium, the sum of the code rates of each data acquisition device corresponding to the storage medium can be calculated, so that the storage parameter of the storage medium can be determined based on the ratio of the storage capacity of the storage medium to the calculated sum of the code rates.
Thus, after the reference parameter and the storage parameter of each storage medium are determined, the difference value between the storage parameter of each storage medium and the reference parameter can be determined, and whether the difference value meets the difference value condition or not can be judged.
If it is determined that the storage parameters of each storage medium all satisfy the difference condition, the storage medium may be allocated to each data acquisition device according to the established correspondence between the data acquisition devices and the storage media.
For example, the physical property is specified as a storage capacity, and the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, and the plurality of storage media are storage media a and b, with a difference condition of less than 5min (minutes). In the obtained storage medium allocation method, the data acquisition equipment 1 corresponds to the storage medium a, and the data acquisition equipment 2 and 3 correspond to the storage medium b.
The reference parameters can be calculated as:
Figure BDA0002869603400000271
further, the storage parameters of the storage medium a are:
Figure BDA0002869603400000272
and the difference value with the reference parameter is: 6.82min, wherein, 6.82min>5min;
The storage parameters of the storage medium b are:
Figure BDA0002869603400000273
and the difference value with the reference parameter is: 4.55min, wherein, 4.55<5min;
Obviously, the above-mentioned established correspondence between a plurality of data acquisition devices and a plurality of storage media cannot make the difference between the storage parameter of each storage medium and the preset reference parameter satisfy the difference condition.
Optionally, in another specific implementation, when the specified physical property is a writing speed, the preset reference parameter is: determined based on a ratio of a sum of code rates of the plurality of data acquisition devices to a sum of specified physical properties of the plurality of storage media; accordingly, the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: in the above correspondence, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
In this specific implementation, when the specified physical property is the writing speed, the reference parameter may be determined based on a ratio of a sum of code rates of the plurality of data acquisition devices to a sum of writing speeds of the plurality of storage media.
Furthermore, for each storage medium, the sum of the code rates of each data acquisition device corresponding to the storage medium can be calculated, so that the storage parameter of the storage medium can be determined based on the ratio of the calculated sum of the code rates to the writing speed of the storage medium. .
Thus, after the reference parameter and the storage parameter of each storage medium are determined, the difference value between the storage parameter of each storage medium and the reference parameter can be determined, and whether the difference value meets the difference value condition or not can be judged.
If it is determined that the storage parameter of each storage medium meets the difference condition, the storage medium may be allocated to each data acquisition device according to the established correspondence between the plurality of data acquisition devices and the plurality of storage media.
For example, the physical property is specified as a storage capacity, and the plurality of data collecting apparatuses are data collecting apparatuses 1, 2, and 3, and the plurality of storage media are storage media a and b, and the difference condition is less than 0.2s (second). The writing speed of the storage medium a is 10M/s, the writing rate of the storage medium b is 5M/s, the code rates of the data acquisition devices 1 and 3 are both 4M/s, and the code rate of the data acquisition device 2 is 2M/s.
Then the reference parameters can be calculated as:
Figure BDA0002869603400000281
further, the storage parameters of the storage medium a are:
Figure BDA0002869603400000282
and the difference value with the reference parameter is: 0.07s, wherein, 0.07s<0.2s;
The storage parameters of the storage medium b are:
Figure BDA0002869603400000283
and the difference value with the reference parameter is: 0.13s, wherein, 0.13s<0.2s;
Obviously, the above-mentioned established correspondence between a plurality of data acquisition devices and a plurality of storage media enables the difference between the storage parameter of each storage medium and the preset reference parameter to satisfy the difference condition, so that the storage media can be allocated to each data acquisition device according to the above-mentioned established correspondence between a plurality of data acquisition devices and a plurality of storage media.
It should be noted that any storage medium allocation method provided by the above embodiments of the present invention may be executed by an electronic device to allocate storage media to a plurality of data acquisition devices.
Accordingly, when allocating a storage medium to a plurality of data acquisition devices, a technician may determine, by using any of the storage medium allocation methods provided in the embodiments of the present invention, the storage medium allocated to each data acquisition device to obtain an allocation result, and then configure the determined allocation result into the electronic device, so that the electronic device may allocate the storage medium to the plurality of data acquisition devices according to the configured allocation result.
Corresponding to the storage medium distribution method provided by the embodiment of the invention, the embodiment of the invention also provides a storage medium distribution device.
Fig. 8 is a schematic structural diagram of a storage medium distribution apparatus according to an embodiment of the present invention, and as shown in fig. 8, the apparatus includes the following modules:
a code rate ratio calculation module 810, configured to determine a code rate ratio of the code rate of each data acquisition device in a sum of code rates of multiple data acquisition devices;
a performance ratio calculation module 820 for determining a performance ratio of the specified physical performance of each storage medium among the specified physical performances of the plurality of storage media;
a storage medium allocation module 830, configured to allocate a storage medium to each data acquisition device according to the determined rate ratio and performance ratio based on a principle that the rate ratio matches the performance ratio;
wherein each data acquisition device stores acquired data in a storage medium allocated for that data acquisition device.
As can be seen from the above, by applying the scheme provided by the embodiment of the present invention, when the storage medium is allocated to each data acquisition device, the bit rate ratio of each data acquisition device and the performance ratio of each storage medium can be determined, and then, based on the principle that the bit rate ratio matches with the performance ratio, the storage medium is allocated to each data acquisition device according to the determined bit rate ratio and performance ratio, so that each data acquisition device can store the acquired data in the storage medium allocated to the data acquisition device.
Based on this, by applying the scheme provided by the embodiment of the present invention, based on the principle that the bit rate ratio of each data acquisition device matches the performance ratio of each storage medium, and according to the bit rate ratio of each data acquisition device and the performance ratio of each storage medium, the storage medium is allocated to each data acquisition device, and a storage medium allocation method for realizing balanced storage of data can be provided, so that when each data acquisition device stores acquired data in the storage medium allocated to the data acquisition device, the requirement of a user on balanced storage of the data can be met.
Optionally, in a specific implementation manner, the code rate of each data acquisition device is: acquiring the code rate of the data stream of the data acquired by the data acquisition equipment by using a storage medium distributed for the data acquisition equipment; and each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
Optionally, in a specific implementation manner, the storage medium allocating module 830 includes:
the first traversal submodule is used for traversing the plurality of data acquisition devices, and when each data acquisition device is traversed, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device exists in the plurality of storage media, the storage medium is allocated to the data acquisition device; after traversing the plurality of data acquisition devices, if the remaining data acquisition devices without the storage media are available, triggering a first storage media allocation submodule; wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all data acquisition devices of which the allocated storage medium is the storage medium;
or,
the second traversal submodule is used for traversing the plurality of storage media, and distributing the storage media to at least one data acquisition device if the sum of the code rate ratio is not greater than the performance ratio of the storage media in the remaining data acquisition devices which are not distributed with the storage media when traversing to each storage media; after traversing the plurality of storage media, if the residual data acquisition equipment without the storage media is available, triggering the first storage media allocation submodule;
and the first storage medium distribution submodule is used for distributing the storage medium for each residual data acquisition device according to a preset distribution rule.
Optionally, in a specific implementation manner, the first storage medium allocation sub-module is specifically configured to:
allocating any storage medium to each remaining data acquisition device;
or,
distributing any storage medium with the current remaining performance proportion not being zero to each remaining data acquisition device;
or,
allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
Optionally, in a specific implementation manner, the apparatus further includes:
a first target allocation submodule, configured to determine, based on a user instruction, a target data acquisition device among the multiple data acquisition devices before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate a target storage medium among the multiple storage media to the target data acquisition device according to a code rate of the target data acquisition device and specified physical performance of each storage medium;
or,
a second target allocation submodule, configured to determine a target storage medium in the plurality of storage media based on a user instruction before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate the target storage medium to a target data acquisition device in the plurality of data acquisition devices according to an assigned physical performance of the target storage medium and a code stream of each data acquisition device;
the storage medium allocation module 830 is specifically configured to:
distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio;
wherein, the general data acquisition equipment is: a data acquisition device of the plurality of data acquisition devices other than the target data acquisition device; the general storage medium is: a storage medium other than the target storage medium among the plurality of storage media.
Optionally, in a specific implementation manner, the storage medium allocating module 830 includes:
the relation establishing submodule is used for establishing corresponding relations between the plurality of data acquisition devices and the plurality of storage media according to the determined code rate ratio and the determined performance ratio on the basis of the principle that the code rate ratio is matched with the performance ratio;
and the second storage medium distribution submodule is used for distributing the storage medium for each data acquisition device according to the corresponding relation if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and the preset reference parameter meets the difference value condition.
Alternatively, in one particular implementation,
when the specified physical property is a storage capacity, the reference parameters are: the code rate is determined based on the ratio of the sum of the storage capacities of the plurality of storage media to the sum of the code rates of the plurality of data acquisition devices; the storage parameters of each storage medium are: the code rate is determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
when the specified physical property is a writing speed, the reference parameters are: the sum of the code rates of the plurality of data acquisition devices and the sum of the writing speeds of the plurality of storage media are determined based on a ratio; the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: and in the corresponding relation, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
In response to the storage medium allocation method provided by the above-mentioned embodiment of the present invention, an embodiment of the present invention further provides an electronic device, as shown in fig. 9, including a processor 901 and a memory 903,
a memory 903 for storing computer programs;
the processor 901 is configured to implement the steps of any storage medium allocation method provided in the foregoing embodiments of the present invention when executing the program stored in the memory 903.
Optionally, in a specific implementation manner, the electronic device further includes: a communication interface and a communication bus; the processor 901, the communication interface, and the memory 903 complete communication with each other through the communication bus.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the storage medium allocation methods provided in the embodiments of the present invention.
In another embodiment, the present invention further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform the steps of any of the storage medium allocation methods provided in the above-mentioned embodiments of the present invention.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, apparatus embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are substantially similar to method embodiments and therefore are described with reference to the method embodiments for some portions of the description herein.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (11)

1. A storage medium allocation method, the method comprising:
determining the code rate ratio of the code rate of each data acquisition device in the sum of the code rates of a plurality of data acquisition devices;
determining a performance ratio of the specified physical property of each storage medium among the specified physical properties of the plurality of storage media;
based on the principle that the code rate ratio is matched with the performance ratio, distributing a storage medium for each data acquisition device according to each determined code rate ratio and each determined performance ratio;
each data acquisition device stores acquired data into a storage medium allocated to the data acquisition device;
the step of allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio includes:
traversing the plurality of data acquisition devices, and when traversing each data acquisition device, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device exists in the plurality of storage media, allocating the storage medium to the data acquisition device; after traversing the plurality of data acquisition devices, if the residual data acquisition devices which are not allocated with the storage media exist, allocating the storage media for the residual data acquisition devices according to a preset allocation rule; wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all the data acquisition devices of which the allocated storage medium is the storage medium;
or,
traversing the plurality of storage media, and when traversing to each storage medium, if at least one data acquisition device with the sum of the code rate ratios not greater than the performance ratio of the storage medium exists in the remaining data acquisition devices without the storage medium, allocating the storage medium to the at least one data acquisition device; after traversing the plurality of storage media, if the residual data acquisition equipment which is not allocated with the storage media exists, allocating the storage media for the residual data acquisition equipment according to a preset allocation rule;
or,
establishing corresponding relations between the plurality of data acquisition devices and the plurality of storage media according to the determined code rate ratio and the determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio;
and if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and the preset reference parameter meets the difference value condition, distributing the storage medium for each data acquisition device according to the corresponding relation.
2. The method of claim 1, wherein the code rate for each data acquisition device is: acquiring the code rate of the data stream of the data acquired by the data acquisition equipment by using a storage medium distributed for the data acquisition equipment; and each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
3. The method of claim 1, wherein the step of allocating storage media for each remaining data collection device according to a preset allocation rule comprises:
allocating any storage medium to each remaining data acquisition device;
or,
distributing any storage medium with the current residual performance ratio not being zero for each residual data acquisition device;
or,
allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
4. The method according to claim 1 or 2, wherein before the step of allocating a storage medium to each data acquisition device according to the determined rate ratio and performance ratio based on the principle that the rate ratio matches the performance ratio, the method further comprises:
determining target data acquisition equipment in the plurality of data acquisition equipment based on a user instruction, and distributing target storage media in the plurality of storage media to the target data acquisition equipment according to the code rate of the target data acquisition equipment and the specified physical performance of each storage medium;
or,
determining a target storage medium in the plurality of storage media based on a user instruction, and distributing the target storage medium to a target data acquisition device in the plurality of data acquisition devices according to the specified physical performance of the target storage medium and the code stream of each data acquisition device;
the step of allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio includes:
based on the principle that the code rate ratio is matched with the performance ratio, distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium;
wherein, the general data acquisition equipment is: a data acquisition device of the plurality of data acquisition devices other than the target data acquisition device; the general storage medium is: a storage medium other than the target storage medium among the plurality of storage media.
5. The method of claim 1,
when the specified physical property is a storage capacity, the reference parameters are: the sum of the storage capacities of the plurality of storage media and the sum of the code rates of the plurality of data acquisition devices are determined; the storage parameters of each storage medium are: the code rate is determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
when the specified physical property is a writing speed, the reference parameters are: the sum of the code rates of the plurality of data acquisition devices and the sum of the writing speeds of the plurality of storage media are determined based on the ratio; the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: and in the corresponding relation, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
6. A storage media distribution apparatus, the apparatus comprising:
the code rate ratio calculation module is used for determining the code rate ratio of the code rate of each data acquisition device in the sum of the code rates of the data acquisition devices;
the performance ratio calculation module is used for determining the performance ratio of the specified physical performance of each storage medium in the sum of the specified physical performances of the plurality of storage media;
the storage medium distribution module is used for distributing storage media for each data acquisition device according to each determined code rate ratio and each determined performance ratio based on the principle that the code rate ratio is matched with the performance ratio;
each data acquisition device stores acquired data into a storage medium allocated to the data acquisition device;
the storage medium allocation module includes:
the first traversal submodule is used for traversing the plurality of data acquisition devices, and when each data acquisition device is traversed, if a storage medium with the current remaining performance ratio not less than the code rate ratio of the data acquisition device exists in the plurality of storage media, the storage medium is allocated to the data acquisition device; after traversing the plurality of data acquisition devices, if the residual data acquisition devices without the storage media are available, triggering a first storage media distribution sub-module; wherein the current remaining performance of each storage medium is: the performance ratio of the storage medium is the difference value of the sum of the code rate ratios of all data acquisition devices of which the allocated storage medium is the storage medium;
or,
the second traversal submodule is used for traversing the plurality of storage media, and when traversing to each storage medium, if at least one data acquisition device with the sum of the code rate ratio not greater than the performance ratio of the storage medium exists in the remaining data acquisition devices without the storage medium, the storage medium is allocated to the at least one data acquisition device; after traversing the plurality of storage media, if the residual data acquisition equipment without the storage media is available, triggering the first storage media allocation submodule;
the first storage medium distribution submodule is used for distributing storage media for each residual data acquisition device according to a preset distribution rule;
or,
the relation establishing submodule is used for establishing corresponding relations between the plurality of data acquisition devices and the plurality of storage media according to the determined code rate ratio and the determined performance ratio on the basis of the principle that the code rate ratio is matched with the performance ratio;
and the second storage medium distribution sub-module is used for distributing the storage medium for each data acquisition device according to the corresponding relation if the difference value between the storage parameter of each storage medium determined based on the corresponding relation and a preset reference parameter meets a difference value condition.
7. The apparatus of claim 6, wherein the code rate for each data acquisition device is: acquiring the code rate of the data stream of the data acquired by the data acquisition equipment by using a storage medium distributed for the data acquisition equipment; and each storage medium stores the acquired data stream of the data acquired by the data acquisition equipment in real time according to the code rate of the data acquisition equipment allocated to the storage medium.
8. The apparatus of claim 6, wherein the first storage medium allocation submodule is further configured to:
allocating any storage medium to each remaining data acquisition device;
or,
distributing any storage medium with the current residual performance ratio not being zero for each residual data acquisition device;
or,
allocating a designated storage medium to each remaining data acquisition device; wherein the specified storage medium is: and the storage medium with the minimum difference between the current residual performance ratio and the code rate ratio of the residual data acquisition equipment.
9. The apparatus of claim 6 or 7, further comprising:
a first target allocation submodule, configured to determine, based on a user instruction, a target data acquisition device among the multiple data acquisition devices before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate a target storage medium among the multiple storage media to the target data acquisition device according to a code rate of the target data acquisition device and specified physical performance of each storage medium;
or,
a second target allocation submodule, configured to determine a target storage medium in the multiple storage media based on a user instruction before allocating a storage medium to each data acquisition device according to each determined code rate ratio and each determined performance ratio based on a principle that the code rate ratio matches the performance ratio, and allocate the target storage medium to a target data acquisition device in the multiple data acquisition devices according to specified physical performance of the target storage medium and a code stream of each data acquisition device;
the storage medium allocation module is specifically configured to:
distributing a universal storage medium to each universal data acquisition device according to the code rate ratio of each universal data acquisition device and the performance ratio of each universal storage medium based on the principle that the code rate ratio is matched with the performance ratio;
wherein, the general data acquisition equipment is: a data acquisition device of the plurality of data acquisition devices other than the target data acquisition device; the general storage medium is: a storage medium other than the target storage medium among the plurality of storage media.
10. The apparatus of claim 6,
when the specified physical property is a storage capacity, the reference parameters are: the code rate is determined based on the ratio of the sum of the storage capacities of the plurality of storage media to the sum of the code rates of the plurality of data acquisition devices; the storage parameters of each storage medium are: the code rate is determined based on the ratio of the storage capacity of the storage medium to the code rate and the value corresponding to the storage medium;
when the specified physical property is a writing speed, the reference parameters are: the sum of the code rates of the plurality of data acquisition devices and the sum of the writing speeds of the plurality of storage media are determined based on the ratio; the storage parameters of each storage medium are: the code rate and the value corresponding to the storage medium are determined according to the ratio of the writing speed of the storage medium;
wherein, the sum of the code rates corresponding to each storage medium is: and in the corresponding relation, the sum of the code rates of the data acquisition devices corresponding to the storage medium.
11. An electronic device comprising a processor and a memory;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored on the memory.
CN202011602112.6A 2020-12-29 2020-12-29 Storage medium distribution method and device and electronic equipment Active CN112631524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011602112.6A CN112631524B (en) 2020-12-29 2020-12-29 Storage medium distribution method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011602112.6A CN112631524B (en) 2020-12-29 2020-12-29 Storage medium distribution method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN112631524A CN112631524A (en) 2021-04-09
CN112631524B true CN112631524B (en) 2023-04-07

Family

ID=75286890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011602112.6A Active CN112631524B (en) 2020-12-29 2020-12-29 Storage medium distribution method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112631524B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0793892A (en) * 1993-09-21 1995-04-07 Mitsubishi Electric Corp Semiconductor memory audio recording and reproducing device
US20090003172A1 (en) * 2006-12-29 2009-01-01 Hiroshi Yahata Playback device, recording device, disc medium, and method
CN101557510A (en) * 2008-04-09 2009-10-14 华为技术有限公司 Method, system and device for processing video coding
CN102883143B (en) * 2012-09-21 2016-06-08 浙江宇视科技有限公司 A kind of method adjusting RAID array buffer memory
CN107077514B (en) * 2016-05-23 2021-05-25 深圳市大疆创新科技有限公司 Data storage method and equipment
CN108881972B (en) * 2018-08-01 2021-06-15 广州视源电子科技股份有限公司 Code rate allocation method, device, equipment and storage medium
TWI681396B (en) * 2018-12-06 2020-01-01 群聯電子股份有限公司 Decoding method, memory controlling circuit unit and memory storage device
CN110149554B (en) * 2019-05-31 2021-06-15 Oppo广东移动通信有限公司 Video image processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112631524A (en) 2021-04-09

Similar Documents

Publication Publication Date Title
CN108845877B (en) Method, device and system for managing memory
CN111597040B (en) Resource allocation method, device, storage medium and electronic equipment
CN110648534A (en) Traffic data chaining method and device of Internet of things based on block chain
CN112214313A (en) Memory allocation method and related equipment
CN112631524B (en) Storage medium distribution method and device and electronic equipment
CN108376377A (en) A kind of method, apparatus and server for finding pet
CN110633326A (en) Method and system for uplink of weather data of Internet of things on block chain
CN113347171B (en) Internet of things equipment disposal method and method for setting equipment resources in internet of things equipment
CN116319810A (en) Flow control method, device, equipment, medium and product of distributed system
CN112330828B (en) Vehicle information processing method and device for parking lot, terminal device and storage medium
CN111090520B (en) User allocation method and device for exclusive resources, electronic equipment and storage medium
KR102385702B1 (en) Data analysis service method and data analysis service system using the method
CN113419792A (en) Event processing method and device, terminal equipment and storage medium
CN112653735A (en) Vehicle-mounted application data transmission method and device and vehicle
CN111625358A (en) Resource allocation method and device, electronic equipment and storage medium
CN111858497A (en) Storage type conversion method, device and equipment
KR101093019B1 (en) System for restoring transmission data using main memory direct control of mobile communications terminal and method provide therefor
CN111199003A (en) Multi-webpage window management method and device and terminal equipment
CN111310166A (en) Authority management method, device, equipment and storage medium
CN110716963B (en) Method for providing adaptively configured user data and related equipment
CN111104528A (en) Picture obtaining method and device and client
CN111163088B (en) Message processing method, system and device and electronic equipment
CN113609076B (en) File storage method and file reading method
CN112543213B (en) Data processing method and device
CN113741787B (en) Data storage method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant