Data deployment method and device based on dynamic memory application and storage medium

Through the dynamic application of memory and data comparison processing, the problems of data deployment in the existing technology were solved, and the compatibility of data deployment and the improvement of user experience were realized.

CN119356595AActive Publication Date: 2025-01-24HANGZHOU HUACHENG SOFTWARE TECH CO LTD

Patent Information

Application Number
CN202411172557.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-24
Estimated Expiration
2044-08-23

AI Technical Summary

Technical Problem

In the prior art, when algorithm updates and data expansion, it is difficult to deploy data flexibly, resulting in reduced encoding efficiency and difficulty in backward compatible devices. Users need to restore factory settings after upgrading, affecting the user experience.

Method used

The data deployment method based on dynamic application memory is adopted, and the target memory is dynamically applied by comparing the differences between the deployment data and the deployed data, and the deployment data to be deployed will be deployed to replace the default configuration information to the user configuration information.

Benefits of technology

It achieves the flexibility and compatibility of data deployment, avoids the problem of redefining the data structure due to the size limit of the data structure, and improves the coding efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356595A_ABST
    Figure CN119356595A_ABST
Patent Text Reader

Abstract

The invention discloses a data deployment method and device based on a dynamic application memory and a storage medium, the data deployment method comprises the following steps: in response to received to-be-deployed data, performing data comparison processing on the to-be-deployed data and deployed data in an image acquisition device to obtain a data comparison result; if the data comparison result represents that data change exists between the to-be-deployed data and the deployed data, applying for a target memory from the image acquisition device based on the to-be-deployed data; and performing deployment processing on the to-be-deployed data based on the target memory. According to the scheme, the flexibility of data deployment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data deployment method, device and storage medium based on dynamic memory application. Background Art

[0002] In software coding scenarios, data structures are usually used to store data, and the data structures are written in binary data format to chips such as Flash for deployment. Data structures usually have reserved fields preset, mainly used to meet specific alignment requirements or reserve space for future expansion to avoid damaging the original data structure after adding new fields.

[0003] However, as the algorithm is continuously updated and iterated, when the data in the algorithm gradually expands to exceed the reserved fields of the structure, the data structure can only be invalidated and a new data structure needs to be redefined. However, this method not only reduces the coding efficiency, but also makes it difficult to be backward compatible with devices.

[0004] If the expanded fields exceed the reserved fields when upgrading the device after the user purchases it, the only option is to restore the device to factory settings, which will restore other configuration information previously set by the user, reducing the user experience. Therefore, there is currently a lack of a flexible algorithm deployment method that can solve the above problem. Summary of the invention

[0005] The present application at least provides a data deployment method, apparatus, device and computer-readable storage medium based on dynamic memory application.

[0006] The first aspect of the present application provides a data deployment method based on dynamic memory application, comprising: in response to received data to be deployed, performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, applying for a target memory from the image acquisition device based on the data to be deployed; and deploying the data to be deployed based on the target memory.

[0007] In one embodiment, the data to be deployed is compared with the deployed data in the image acquisition device to obtain a data comparison result, including: comparing the number of objects to be deployed in the data to be deployed with the number of deployed objects in the deployed data; if the number of objects to be deployed is different from the number of deployed objects, obtaining a data comparison result indicating that there is a data change between the deployed data and the data to be deployed; if the number of objects to be deployed is the same as the number of deployed objects, obtaining a data comparison result indicating that there is no data change between the deployed data and the data to be deployed.

[0008] In one embodiment, applying for target memory from the image acquisition device based on the data to be deployed includes: determining the amount of data to be deployed based on data attributes of the data to be deployed, the data attributes including the total number of bytes or information of objects to be deployed; applying for matching memory from the image acquisition device according to the amount of data to be deployed; and determining the matching memory as the target memory.

[0009] In one embodiment, the deploying the data to be deployed based on the target memory includes: deploying the data to be deployed to the target memory; and replacing default configuration information of the data to be deployed in the target memory with user configuration information of the deployed data.

[0010] In one embodiment, after the data to be deployed is deployed based on the target memory, the method further includes: in response to receiving a modification instruction for current deployment data, generating target deployment data based on the modification instruction and the current deployment data; and switching the current deployment data deployed in the target memory to the target deployment data.

[0011] In one embodiment, in response to receiving a modification instruction for current deployment data, generating target deployment data based on the modification instruction and the current deployment data includes: in response to receiving the modification instruction, analyzing whether the configuration information in the current deployment data is default configuration information; if so, modifying the default configuration information in the current deployment data based on the modification data carried by the modification instruction to obtain the target deployment data.

[0012] In one embodiment, the current deployment data includes at least one deployment channel, and the response to receiving the modification instruction, analyzing whether the configuration information in the current deployment data is default configuration information includes: determining a target deployment channel from at least one deployment channel of the current deployment data based on the modification instruction; and analyzing whether the configuration information in the target deployment channel is the default configuration information.

[0013] In one embodiment, before responding to the received data to be deployed, the method further includes: in response to receiving an instruction to obtain the data to be deployed, obtaining resource verification information of the data to be deployed; verifying whether the deployment of the data to be deployed is supported based on the resource verification information and current operation information; if the verification result indicates that the deployment of the data to be deployed is supported, obtaining the data to be deployed.

[0014] The second aspect of the present application provides a data deployment device based on dynamic memory application, including: a data comparison module, which is used to respond to the received data to be deployed, compare the data to be deployed with the deployed data in the image acquisition device, and obtain a data comparison result; a memory application module, which is used to apply for a target memory from the image acquisition device based on the data to be deployed if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data; and a data deployment module, which is used to deploy the data to be deployed based on the target memory.

[0015] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned data deployment method based on dynamic memory application.

[0016] A fourth aspect of the present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned data deployment method based on dynamic memory application is implemented.

[0017] In the above scheme, in response to receiving the data to be deployed, the data to be deployed is compared with the deployed data in the image acquisition device to obtain a data comparison result between the data to be deployed and the deployed data; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, it indicates that running the data to be deployed requires more or less memory than running the deployed data, so based on the data to be deployed, a target memory is requested from the image acquisition device; based on the target memory, the data to be deployed is deployed. In this way, when the image acquisition device receives the data to be deployed, data can be deployed by requesting the target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory request.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0020] Figure 1 It is a flowchart of an exemplary embodiment of the data deployment method based on dynamic memory application of the present application;

[0021] Figure 2 is a block diagram of a data deployment device based on dynamic memory application, shown in an exemplary embodiment of the present application;

[0022] Figure 3 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0023] Figure 4 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0024] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0025] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0026] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0027] For ease of understanding, the technical problem to be solved by this application is now illustrated by example. In traditional data deployment methods, data structures are often used to store data, and the data structures are written in binary data format to chips such as Flash for data deployment. Its data flow can be roughly summarized as: 1. Define string integer; 2. Define data structure; 3. Convert to binary data; 4. Deploy to chip. Exemplarily, the data deployment method of the embodiment of the present application is mainly explained by taking the algorithm-related data, code-related data, etc. involved in the image acquisition device as an example. The data structure format of the algorithm data can be shown as an example:

[0028] / / Algorithm display structure

[0029] typedef struct ShowCfg

[0030] {

[0031] char AlgName

[16] ; / / algorithm display name

[0032] char AlgPackName

[16] ; / / algorithm package name

[0033] char ID

[16] ; / / algorithm identification value

[0034] int8 res[3]; / / reserved field

[0035] }ShowCfg

[0036] Among them, strings such as AlgName (algorithm display name) and AlgPackName (algorithm package name) are data elements that have been defined in the initial process of data development. If the algorithm data is written to the device in the format of the above data structure, if the subsequent continuous update of the algorithm causes the number of parameter variables in the structure to exceed the reserved field, it is equivalent to destroying the original data structure and the data structure needs to be redefined.

[0037] In this application, the data structure formats mentioned in the above examples, such as algorithm data, code data, etc., can be converted into JSON format (JavaScript Object Notation). In the data structure in JSON format, data is stored in the form of key-value pairs, each key-value pair is separated by a comma, square brackets [] are used to represent a JSON array, and curly brackets {} are used to represent a JSON object. The JSON object contains various data elements. The specific conversion method may include but is not limited to converting the algorithm data in the existing data structure format into JSON format through a preset script file in the algorithm development end, or the algorithm development end responds to the data editing instructions received during the algorithm development process (including but not limited to adding, changing, deleting, etc.), converting the data structure format into JSON format based on the data editing instructions, or directly adding algorithm data in JSON format, etc., which are not limited here. The data flow of this application can be roughly summarized as: 1. Define string integer; 2. Generate JSON data; 3. Dynamically apply for memory; 4. Convert to binary data; 5. Deploy to the chip. The JSON format of the algorithm data can be shown as an example: [

[0039] {

[0040] "AlgName":"Object",

[0041] "AlgPackName":"Object",

[0042] "ID":"134300"

[0043] } ]

[0045] The algorithm data in JSON format shown in the above example reflects the algorithm data in the Object algorithm package (target detection algorithm package), such as Target Detection Algorithm (Object).

[0046] See also Figure 1 , Figure 1 The present invention is a flowchart of an exemplary embodiment of the data deployment method based on dynamic memory application of the present invention. The present method can be applied to an image acquisition device, which can be a monocular device and / or a multi-eye device (such as a binocular camera, a trinocular camera, etc.), and specifically, can be a monocular and / or multi-eye IPC image acquisition device (IP CAMERA).

[0047] Specifically, the following steps may be included:

[0048] Step S110 , in response to the received data to be deployed, performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result.

[0049] Among them, the data to be deployed refers to the algorithm-related data waiting to be deployed to the image acquisition device, such as the algorithm package in the aforementioned example, etc., which will not be elaborated here. Normally, when the image acquisition device needs to download or update its algorithm-related data, it will initiate a corresponding request to the server to obtain the data to be deployed. Exemplarily, it can be that the image acquisition device initiates a data acquisition request to the server, or it can be that the target terminal device (such as a mobile phone, computer, etc.) that has a communication connection with the image acquisition device initiates a data acquisition request to the server (for example, an APP application of the image acquisition device is running on the target terminal device), which are all feasible implementation methods for data download and update, which are not limited here. It is also possible that the server actively sends a request for data download or data update to the image acquisition device and / or the above-mentioned target terminal device, etc., which will not be elaborated here.

[0050] Deployed data refers to algorithm-related data that has been deployed to the image acquisition device. Similarly, you can also refer to the target detection algorithm in the previous example, etc., which will not be elaborated here. Usually, the data to be deployed is used to update the deployed data. For example, the deployed data includes the target detection algorithm in the target detection algorithm package. If you need to add a target tripwire detection algorithm (ObjectLine) based on the deployed data, the data to be deployed can be the target tripwire detection algorithm added to the target detection algorithm package. For example, the data to be deployed can be a target detection algorithm package (Object), which can include a target detection algorithm (Object) and a target tripwire detection algorithm (ObjectLine): [

[0052] {

[0053] "AlgName":"Object",

[0054] "AlgPackName":"Object",

[0055] "ID":"134300"

[0056] }

[0057] {

[0058] "AlgName":"ObjectLine",

[0059] "AlgPackName":"Object",

[0060] "ID":"131200"

[0061] } ]

[0063] Exemplarily, after the image acquisition device receives the data to be deployed, the data to be deployed and the deployed data in the above example are compared to obtain the data comparison result. According to the data comparison result, it can be determined whether there is a data change between the two data. According to the data change, it can also be determined whether the update based on the current data to be deployed is to update the value of the existing parameter, or to add or reduce the parameters in the algorithm package.

[0064] Step S120 , if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, a target memory is requested from the image acquisition device based on the data to be deployed.

[0065] Combined with the above steps, if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, the memory space occupied by the deployed data in the image acquisition device may not be suitable for the data to be deployed (there may be a problem of too little memory or too much memory), so it is necessary to apply for the corresponding target memory from the image acquisition device for the data to be deployed.

[0066] The data change refers to the change between the data volume of the data to be deployed and the data volume of the deployed data. For example, in the above example, the deployed data is the target detection algorithm, and the data to be deployed is the target detection algorithm and the target tripwire detection algorithm, so there is a data change between the data to be deployed and the deployed data.

[0067] For example, the image acquisition device can apply for a target memory of a corresponding size from a storage medium such as Flash based on the memory size required by the target detection algorithm and the target tripwire detection algorithm. If there is no data change between the data to be deployed and the deployed data, the data to be deployed can be deployed based on the memory space originally corresponding to the deployed data. For example, if the "ID" in the deployed data is "134300" and the "ID" in the data to be deployed is "134400", then the ID in the deployed data can be updated and replaced in the original memory space without re-determining and applying for the target memory.

[0068] Step S130 , deploying the data to be deployed based on the target memory.

[0069] The deployment process may include but is not limited to storage processing, loading and running processing of the data to be deployed, etc., which is not limited here.

[0070] Exemplarily, in the process of deploying the data to be deployed in the target memory, the data to be deployed needs to be serialized and converted into binary data, so as to realize the conversion of the object into a byte stream, and then save it in Flash, so as to achieve the purpose of variable-length data storage. Thus, in the data deployment process, the data to be deployed will not be limited by the size defined by its data structure, but depends on the hardware conditions of the storage medium of the image acquisition device. In short, as long as the Flash of the image acquisition device is large enough, this dynamic memory application method can be used to continuously expand the data, and the data structure in the algorithm data does not need to be repeatedly modified. Specifically, it can also involve the application scenario of memory expansion, such as the initial memory of the image acquisition device when it leaves the factory is 8MB. When more and more algorithm data need to be deployed later, the storage medium can be replaced in the image acquisition device or more storage media (such as 16MB Flash or even Flash with larger memory) can be loaded. It only needs to adapt the driver of the storage medium, and its upper-level application (such as the APP application running in the target terminal) does not need to be adjusted, which optimizes the overall code architecture.

[0071] It can be seen that in response to receiving the data to be deployed, the present application performs data comparison processing between the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result between the data to be deployed and the deployed data; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, it indicates that running the data to be deployed requires more or less memory than running the deployed data, so based on the data to be deployed, a target memory is requested from the image acquisition device; based on the target memory, the data to be deployed is deployed. In this way, when the image acquisition device receives the data to be deployed, data can be deployed by requesting the target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory request.

[0072] Based on the above embodiments, the present embodiment of the application describes the steps of performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain the data comparison result. Specifically, the method of this embodiment includes the following steps:

[0073] The number of objects to be deployed in the data to be deployed is compared with the number of deployed objects in the deployed data; if the number of objects to be deployed is different from the number of deployed objects, a data comparison result is obtained that indicates that there is a data change between the deployed data and the data to be deployed; if the number of objects to be deployed is the same as the number of deployed objects, a data comparison result is obtained that indicates that there is no data change between the deployed data and the data to be deployed.

[0074] As described in conjunction with the foregoing embodiments, the data comparison result may represent whether there is a data change between the data to be deployed and the deployed data from one or more aspects.

[0075] Exemplarily, the data comparison result can be obtained by comparing the number of objects to be deployed in the data to be deployed with the number of deployed objects in the deployed data. Among them, the objects to be deployed and the deployed objects are both JSON objects. For details, please refer to the above example description, which will not be repeated here. For example, in the target detection algorithm package, the algorithm-related data (JSON data) of the target detection algorithm can be a JSON object, and the algorithm-related data of the target tripwire detection algorithm can also be a JSON object. Therefore, it can be clearly known that there is one JSON object corresponding to the target detection algorithm in the deployed data of the above example, and there are two JSON objects corresponding to the target detection algorithm and the target tripwire detection algorithm in the data to be deployed, so the number of data to be deployed is different from the number of deployed objects, and it is determined that there is a data change between the deployed data and the data to be deployed. If the number of objects to be deployed is the same as the number of deployed objects, it is obtained that there is no data change between the deployed data and the data to be deployed.

[0076] Based on the above embodiments, the present embodiment of the application describes the steps of applying for target memory from the image acquisition device based on the data to be deployed. Specifically, the method of this embodiment includes the following steps:

[0077] The amount of data to be deployed is determined based on data attributes of the data to be deployed, wherein the data attributes include the total number of bytes or information of the object to be deployed; a matching memory is requested from the image acquisition device according to the amount of data to be deployed; and the matching memory is determined as the target memory.

[0078] The data attribute refers to the attribute information of the data to be deployed, which may include but is not limited to the total number of bytes of the data to be deployed or the information of the object to be deployed (such as the number of objects to be deployed, the size of the objects to be deployed).

[0079] Exemplarily, the method of applying for memory can be performed using the malloc function and / or the calloc function. The full name of malloc is memory allocation, which is called dynamic memory allocation in Chinese. In short, the expected memory size to be allocated is input as a parameter into the malloc function, and the memory space of the corresponding memory size can be applied through the function. The full name of calloc is contiguous allocation, which means dynamic memory allocation and zeroing. The calloc function also supports dynamic memory allocation. In short, the number of objects in the JSON array that need to apply for memory and the size (bytes) of each object are input as parameters into the calloc function, and the required memory size can be calculated through the function and the memory space of the corresponding memory size can be applied; or the number of elements that need to apply for memory and the size of each element are input as parameters into the calloc function. The specific implementation principle can refer to the explanation of the malloc function and the calloc function in the prior art. In addition, this application can also refer to other methods of dynamically applying for memory in the prior art (such as realloc, etc.), which will not be repeated here.

[0080] Furthermore, through the above example method, the amount of data to be deployed is determined based on the data attributes of the data to be deployed, and then a matching memory is applied for from the image acquisition device based on the amount of data to be deployed. It should be noted that the matching memory may refer to a memory of the same size as the amount of data to be deployed, or a memory larger than the amount of data to be deployed, which is not limited in this application. After successfully applying for the matching memory, it can be used as the target memory for deploying the data to be deployed.

[0081] Based on the above embodiments, the embodiment of the present application describes the steps of deploying the data to be deployed based on the target memory. Specifically, the method of this embodiment includes the following steps:

[0082] Deploy the data to be deployed into the target memory; replace the default configuration information of the data to be deployed in the target memory with the user configuration information of the deployed data.

[0083] In conjunction with the above-mentioned embodiments, the data to be deployed can be serialized before being deployed to the target memory. Serialization refers to the process of converting an object into a byte stream (which can be binary data) to store the object or transfer the object to a memory, database or file. The serialized data to be deployed is then deployed to the target memory. The deployment process may include but is not limited to: 1. Storing the data to be deployed in the target memory; 2. Loading the data to be deployed and running it, etc., which are not limited here.

[0084] It should be noted that the data to be deployed includes preset default configuration information so that it can run normally based on the default configuration information when the data to be deployed is deployed in the target memory. Take the target detection algorithm in the above example as an example. For example, the configuration information may include target detection sensitivity (divided into 5 levels in total), and the target detection sensitivity (default sensitivity) in the default configuration information is set to level 3. Therefore, when the data to be deployed is successfully deployed in the target memory, the target detection algorithm can be run based on level 3 target detection sensitivity. Among them, the default configuration information preset when the device leaves the factory may include but is not limited to the default configuration of the code header file of the algorithm data, and may also be configuration information such as the packaging environment product definition configuration (ProductDefinition, PD), which is not limited here. The role of the PD configuration file is mainly to integrate with the default configuration file to obtain the final default configuration information. For example, if the PD configuration file is not configured in the algorithm data of the image acquisition device, then the default configuration information of the image acquisition device is the default configuration of the code header file; if the PD configuration file is configured in the algorithm data of the image acquisition device, then the default configuration content that needs to be adjusted corresponding to the PD configuration file is integrated based on the default configuration of the code header file to form the final default configuration information.

[0085] For example, in the default configuration information of a certain algorithm data, the code header file is in the default configuration, the target detection algorithm is enabled in the on state, its detection sensitivity is level 3, the detection time period is all day, and the intelligent tracking function is enabled. However, for some special products (image acquisition devices), it is not required to follow the same configuration as above. For example, some products require that the factory default configuration time period is only effective during the day. Therefore, when deploying the default configuration information of the algorithm data for these products, the PD configuration file can be input synchronously, and the time period is pre-set in the PD configuration file to be only during the day, so the final default configuration information generated is (code header file default configuration + PD configuration file): the target detection algorithm is enabled in the on state, its detection sensitivity is level 3, the detection time period is daytime, and the intelligent tracking function is enabled. As a result, after distributing the same algorithm data to different image acquisition devices, the configuration information of different image acquisition devices when running the algorithm data can still be modified through the PD configuration file, so that different image acquisition devices can achieve different effects based on the same algorithm and different PD configurations.

[0086] It should also be noted that if the data to be deployed is new data relative to the image acquisition device (that is, the image acquisition device does not have relevant historical data before receiving the data to be deployed), it can be deployed and run based on the default configuration information. For example, the deployed data of the image acquisition device is an animal detection algorithm, and the data to be deployed has a new vehicle detection algorithm, and the sensitivity of the two detection algorithms can be set separately, so when deploying the vehicle detection algorithm, the default sensitivity in the default configuration information can be used. If the data to be deployed is updated data relative to the image acquisition device, the default configuration information in the data to be deployed can be updated and replaced based on the user configuration information in the deployed data after the data to be deployed is deployed, thereby retaining the user configuration and improving the user experience. For example, the deployed data of the image acquisition device is the initial animal detection algorithm, and the data to be deployed is the updated current animal detection algorithm, and the user has customized the initial animal detection algorithm (generated the user configuration information corresponding to the initial animal detection algorithm), so when deploying the current animal detection algorithm, the user configuration information corresponding to the initial animal detection algorithm can be used to replace the default configuration information in the current animal detection algorithm.

[0087] Based on the above embodiment, the embodiment of the present application describes the steps after the data to be deployed is deployed based on the target memory. Specifically, the method of this embodiment includes the following steps:

[0088] In response to receiving a modification instruction for the current deployment data, generating target deployment data based on the modification instruction and the current deployment data; and switching the current deployment data deployed in the target memory to the target deployment data.

[0089] In conjunction with the above-mentioned embodiment, after the data to be deployed is deployed, the current deployment data in the image acquisition device is obtained. The user may modify the current deployment data during the use of the image acquisition device, such as modifying the sensitivity of the detection algorithm in the above-mentioned example, and may also modify the enabling state of the current deployment data, the algorithm running time, the algorithm running rules, and more configuration information, etc., which will not be elaborated here.

[0090] It should be noted that after receiving the modification instruction for the current deployment data, the current deployment data will be modified based on the modification instruction to generate the target deployment data. Among them, the method of modifying the current deployment data may include but is not limited to directly modifying the current deployment data; or copying the current deployment data and modifying the copied current deployment data (thereby saving both the data before the modification and the data after the modification). Then, the current deployment data deployed in the target memory is switched to the target deployment data for loading and running, so that the image acquisition device runs according to the target deployment data and its configuration information.

[0091] Based on the above embodiments, the embodiment of the present application describes the steps of generating target deployment data based on the modification instruction and the current deployment data in response to receiving a modification instruction for the current deployment data. Specifically, the method of this embodiment includes the following steps:

[0092] In response to receiving the modification instruction, analyzing whether the configuration information in the current deployment data is the default configuration information; if so, modifying the default configuration information in the current deployment data based on the modification data carried by the modification instruction to obtain the target deployment data.

[0093] In conjunction with the above-mentioned embodiment, in the process of modifying the current deployment data, it can be determined whether the configuration information of the current deployment data is the default configuration information, and then the corresponding data modification method can be selected.

[0094] It is understandable that in order to ensure that the image acquisition device has a fault-tolerant mechanism during data update, data modification, etc., its default configuration information should be retained. That is, when the user modifies the default configuration information in the current deployment data, the original current deployment data needs to be retained, and the current deployment data is copied to obtain the copied current deployment data, and then the default configuration information of the copied current deployment data is modified to obtain the target deployment data. Therefore, when the image acquisition device is running based on the target deployment data, if there are data problems, operation problems, etc., it can also fall back to the default configuration information.

[0095] If the configuration information in the current deployment data has been modified (customized) by the user when the user modifies the current deployment data, at least one of the methods of directly modifying the current deployment data or copying and modifying the current deployment data can be selected for modification.

[0096] Based on the above embodiment, the embodiment of the present application describes the steps of analyzing whether the configuration information in the current deployment data is the default configuration information in response to receiving the modification instruction. The current deployment data includes at least one deployment channel. Specifically, the method of this embodiment includes the following steps:

[0097] Determine a target deployment channel from at least one deployment channel of current deployment data based on the modification instruction; and analyze whether configuration information in the target deployment channel is default configuration information.

[0098] Among them, the deployment channel corresponds to the lens in the image acquisition device. It has been explained in the above examples that the data deployment method of the present application can be applied to monocular cameras and / or multi-eye cameras. "Eye" refers to the lens of the image acquisition device, and "monocular" and "multi-eye" refer to the number of lenses of the image acquisition device. In this application, each eye on the same image acquisition device should have a corresponding algorithm channel in the algorithm data to achieve non-interference between different eyes when running the algorithm.

[0099] For the same algorithm data, the configuration information stored in different algorithm channels can be the same or different. The following is a brief description of the configuration information of the target detection algorithm in the binocular camera:

[0100]

[0101] It can be seen that there are two sets of square brackets [] in the Object target detection algorithm package, which represent the two algorithm channels in the target detection algorithm package of the binocular camera, and correspond to the two cameras in the binocular camera. The data content in the first set of square brackets [] represents the target detection algorithm package configuration of channel 0, and the data content in the second set of square brackets [] represents the target detection algorithm package configuration of channel 1. If the image acquisition device supports three or more eyes, the algorithm data in JSON format of this application can also flexibly support the configuration extension of different channels of multi-eye devices in the same algorithm.

[0102] It should be noted that, taking the target detection algorithm as an example, the algorithms shared by different algorithm channels can be stored in the Object target detection algorithm package, and the configuration information of each algorithm channel executing the algorithm data can be stored in different algorithm channels. For example, the configuration content framework that can be stored is composed of AlgName (algorithm display name) and Config (algorithm configuration). The algorithm configuration may also include but is not limited to link (algorithm linkage content) and rule (algorithm rule content), etc., which are not limited here. Exemplarily, for a binocular camera, one of the cameras (such as the first camera) can implement the target detection algorithm based on the configuration information in Object[0] when running the target detection algorithm, while the other camera (such as the second camera) can implement the target detection algorithm based on the configuration information in Object[1] when running the target detection algorithm, thereby achieving the effect of sharing algorithm data but not sharing configuration information, so as to avoid the problem of interference between the cameras of the multi-eye camera during operation.

[0103] Exemplarily, the algorithm linkage content refers to the fact that several algorithms in the image acquisition device can be set to respond in a linkage manner. For example, the target detection algorithm and the category detection algorithm can be linked. When the image acquisition device detects the target object based on the target detection algorithm, the category detection algorithm can be linked to perform category detection on the target object. In addition, there can be a variety of linkage combinations of algorithm data, depending on the specific application scenario, which will not be elaborated here. During the operation of the image acquisition device, the user can customize the algorithm data that needs to be linked by issuing instructions, thereby generating link data content. The algorithm rule content may include but is not limited to some operating rules set when the algorithm data is running. For example, the target detection algorithm will detect moving objects in a specified area.

[0104] Therefore, in an embodiment of the present application, when a modification instruction is received, the target deployment channel should be determined based on the modification instruction, and then the algorithm configuration information in the target deployment channel should be modified. This may also include determining whether the configuration information in the target deployment channel is the default configuration information, which will not be elaborated here.

[0105] For example, if a user modifies and adjusts the target detection function corresponding to the second camera through an APP application running on the target terminal device, the target terminal device will generate a corresponding modification instruction in response to the user's operation, and the modification instruction may include the corresponding algorithm and algorithm channel. Therefore, after the binocular camera receives the modification instruction sent by the target terminal device, it will modify the configuration information in Object[1] based on the modification instruction, but will not modify the configuration information in Object[0] corresponding to the first camera, and the first camera and the second camera can still call the algorithm that can be shared under the same algorithm package (Object).

[0106] Based on the above embodiment, the embodiment of the present application describes the steps before responding to the received data to be deployed. Specifically, the method of this embodiment includes the following steps:

[0107] In response to receiving an instruction to obtain the data to be deployed, resource verification information of the data to be deployed is obtained; based on the resource verification information and current operation information, whether the data to be deployed is supported for deployment is verified; if the verification result indicates that the data to be deployed is supported for deployment, the data to be deployed is obtained.

[0108] With reference to the foregoing embodiment, before the image acquisition device receives the data to be deployed, if it receives an instruction to obtain the data to be deployed, it is necessary to first obtain the resource verification information of the data to be deployed, and verify whether the image acquisition device supports the deployment of the data to be deployed through the resource verification information and the current operation information of the image acquisition device.

[0109] The instruction to obtain the data to be deployed may be actively sent by the server, or may be sent by the user through the target terminal device, etc., which is not limited here.

[0110] Resource verification information may include, but is not limited to, algorithm data deployment in the data to be deployed, resource parameters such as Flash\MMA\OS\CPU\IPU required for runtime, algorithm display name, algorithm package name, algorithm version, algorithm package version, algorithm MD5 value, etc., which are not limited here. Combine the current running information of the image acquisition device with one or more of the above resource verification information to verify whether the image acquisition device currently supports the deployment of the data to be deployed.

[0111] If the verification result indicates that the deployment of the data to be deployed is supported, the image acquisition device can obtain the data to be deployed and deploy the data to be deployed with reference to the method in the above embodiment. If the verification result indicates that the deployment of the data to be deployed is not supported (for example, the image acquisition device currently has insufficient computing power, insufficient CPU resources, insufficient running memory, insufficient Flash storage space, needs to upgrade the program, needs to upgrade the model, algorithm conflicts, etc.), the image acquisition device can pause or stop acquiring the data to be deployed, and generate corresponding fault information based on the current problems and feedback it to the target terminal device and / or server.

[0112] For example, the deployment and operation of the data to be deployed requires 2MB of Flash storage, but only 1MB of Flash storage remains under the current operation information of the image acquisition device, then there will be a problem of insufficient Flash storage space, so that the data cannot be successfully deployed. Or, according to the current operation information of the image acquisition device, it is determined that the algorithm data to be deployed is an animal detection algorithm (Animal), and the data to be deployed is a vehicle detection algorithm (Vehicle). Through data name matching, it can be known that there is a data conflict problem, so the data cannot be successfully deployed. In addition, by setting an identification value in the data (such as an MD5 value or other numerical value, which is not limited here), the identification value of the data to be deployed by the image acquisition device is verified with the identification value of the data to be deployed on the server, and it can also be determined whether the data can be successfully deployed. This can also improve the security of the data deployment process.

[0113] In addition, in addition to verifying whether the image acquisition device supports it before obtaining the data to be deployed, it can also be verified after the data to be deployed is deployed. After the image acquisition device is powered on or after downloading / updating the algorithm data, it will detect the resource files required for the algorithm data currently required to run. If it is detected that the resource files that one or more algorithm data (algorithm packages) rely on are missing or the resource files are abnormal, the algorithms related to the algorithm package (for example, the target detection algorithm package may include but is not limited to: including target detection algorithm, target tripwire detection algorithm, target area detection algorithm, etc.) will be uniformly deleted to ensure that other algorithms in the image acquisition device except the target detection algorithm package can operate normally, so that the image acquisition device can work normally as much as possible. Furthermore, the deleted algorithm package can also be downloaded again, thereby realizing the abnormal protection mechanism for the image acquisition device.

[0114] On the basis of the above embodiments, the embodiments of the present application also need to explain that, in the specific application process of the present application, when the algorithm data is loaded in the image acquisition device for the first time, it is usually possible to choose to use the default configuration information to run the algorithm and the default algorithm is enabled. Among them, the default configuration information can be obtained from the header file of the corresponding algorithm package. If the user makes a configuration modification to the algorithm package (such as adjusting the sensitivity in the aforementioned embodiments, the algorithm enable switch, etc.), the corresponding algorithm data will be generated for the user's modification operation (custom operation), and the algorithm configuration information under the algorithm channel will be corresponding.

[0115] Exemplarily, this embodiment is described by taking a three-eye camera as an example. After leaving the factory, only the target detection algorithm is deployed in the three-eye camera. Therefore, there should be three algorithm channels in the target detection algorithm package of the three-eye camera, corresponding to the three cameras of the three-eye camera, and the configuration information of the target detection algorithm in the three algorithm channels should be the default configuration information. If the user adjusts the enable switch of the target detection algorithm in algorithm channel 0, the configuration information (configuration table) of the three-eye camera will generate the user configuration information corresponding to channel 0 accordingly, and run the target detection algorithm of channel 0 based on the user configuration information. For channel 1 and channel 2, the target detection algorithm in each channel can continue to run based on the default configuration information without generating a new algorithm configuration, thereby reducing unnecessary configuration content.

[0116] For example, when the target detection algorithm package is first loaded into the three-eye image acquisition device, when channel 0, channel 1, and channel 2 all run the target detection algorithm with the default configuration information, there is no user configuration information in the configuration table of the image acquisition device. If the user modifies the configuration of the target detection algorithm of the first camera in the three-eye image acquisition device, the user configuration information will be generated in the configuration table based on the modification instruction and will correspond to the algorithm channel 0 of the first camera.

[0117]

[0118] If the user modifies the configuration of the target detection algorithm of the first camera and the second camera in the three-eye image acquisition device, the user configuration information will be generated in the configuration table based on the modification instruction, and will correspond to the algorithm channel 0 of the first camera and the algorithm channel 1 of the second camera.

[0119]

[0120]

[0121] If the user modifies the configuration of the target detection algorithms of the first camera, the second camera, and the third camera in the three-camera image acquisition device, the user configuration information will be generated in the configuration table based on the modification instructions, and will correspond to the algorithm channel 0 of the first camera, the algorithm channel 1 of the second camera, and the algorithm channel 2 of the third camera.

[0122]

[0123]

[0124] In summary, through the data deployment method of the present application, it is possible to use a dynamic memory application method during the data deployment process, support variable-length configuration data storage, and improve the scalability and compatibility of the data deployment process. Compared with the traditional data deployment method based on data structures, when the data to be deployed exceeds the reserved field, the structure can only be invalidated when using the data structure, and the structure can be re-expanded and redefined. After the present application uses JSON, when the Flash file needs to expand the data content, it only needs to add content in JSON format, and after dynamically applying for memory, the data to be deployed in JSON format is converted into strings, integers and other data. Because it is a dynamic memory application, the expansion of the Flash file is not affected, and the downward compatibility is good. In addition, it can also support the configuration of different algorithm names in the same algorithm package, and support different configurations of different channels in the same algorithm package and the same algorithm name.

[0125] It should be noted that, in order to further simplify the data stored in the image acquisition device, the target data in the image acquisition device can also be macro-defined (#define) through a preset data definition tool, which will not be elaborated here.

[0126] It should also be noted that in the specific implementation of this application, not all algorithm data can be converted into JSON format for deployment. For example, some or all algorithm data can be selectively converted into JSON format for deployment. For example, the data type of the algorithm data can be predefined in the configuration header file.

[0127]

[0128] }CfgHeadType;

[0129] Among them, CfgHeadType_Constant refers to algorithm data of fixed length, that is, the type of algorithm data corresponding to it is equivalent to the fixed-length format of the data structure category; and CfgHeadType_Variable refers to algorithm data of variable length, that is, the type of algorithm data corresponding to it is equivalent to the variable-length format of the JSON category. Therefore, the corresponding data deployment method can be selected according to the data type included in each algorithm data. As for the data deployment method of the data structure, please refer to the existing method, which will not be repeated here.

[0130] It should be further explained that the execution subject of the data deployment method based on dynamic memory application can be a data deployment device based on dynamic memory application, for example, the data deployment method based on dynamic memory application can be executed by a terminal device or a server or other processing device, wherein the terminal device can be a user equipment (User Equipment, UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the data deployment method based on dynamic memory application can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0131] Figure 2 FIG. 1 is a block diagram of a data deployment device based on dynamic memory application according to an exemplary embodiment of the present application. Figure 2 As shown, the exemplary data deployment device 200 based on dynamic memory application includes: a data comparison module 210, a memory application module 220 and a data deployment module 230. Specifically:

[0132] The data comparison module 210 is used to perform data comparison processing on the data to be deployed and the deployed data in the image acquisition device in response to the received data to be deployed, so as to obtain a data comparison result.

[0133] The memory application module 220 is used to apply for target memory from the image acquisition device based on the data to be deployed if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data.

[0134] The data deployment module 230 is used to deploy the data to be deployed based on the target memory.

[0135] In this exemplary data deployment device based on dynamic memory application, in response to receiving the data to be deployed, the data to be deployed is compared with the deployed data in the image acquisition device to obtain a data comparison result between the data to be deployed and the deployed data; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, it indicates that running the data to be deployed requires more or less memory than running the deployed data, so based on the data to be deployed, a target memory is applied from the image acquisition device; based on the target memory, the data to be deployed is deployed. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by applying for the target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory application.

[0136] It should be noted that the device provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0137] Among them, the functions of each module can be found in the implementation example of the data deployment method based on dynamic memory application, which will not be repeated here.

[0138] See also Figure 3 , Figure 3 1 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 100 includes a memory 101 and a processor 102, and the processor 102 is used to execute program instructions stored in the memory 101 to implement the steps in any of the above-mentioned data deployment method embodiments based on dynamic memory application. In a specific implementation scenario, the electronic device 100 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 100 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0139] Specifically, the processor 102 is used to control itself and the memory 101 to implement the steps in any of the above-mentioned data deployment method embodiments based on dynamic memory application. The processor 102 can also be referred to as a CPU (Central Processing Unit). The processor 102 may be an integrated circuit chip with signal processing capabilities. The processor 102 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 102 can be implemented by an integrated circuit chip.

[0140] In this exemplary electronic device, in response to receiving the data to be deployed, the data to be deployed is compared with the deployed data in the image acquisition device to obtain a data comparison result between the data to be deployed and the deployed data; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, it indicates that running the data to be deployed requires more or less memory than running the deployed data, so based on the data to be deployed, a target memory is requested from the image acquisition device; based on the target memory, the data to be deployed is deployed. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by applying for the target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory application.

[0141] See also Figure 4 , Figure 4 The computer-readable storage medium 110 stores program instructions 111 that can be executed by a processor, and the program instructions 111 are used to implement the steps in any of the above-mentioned data deployment method embodiments based on dynamic memory application.

[0142] In this exemplary storage medium, by running the program instructions in the storage medium, in response to receiving the data to be deployed, the data to be deployed is compared with the deployed data in the image acquisition device to obtain the data comparison result between the data to be deployed and the deployed data; if the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, it indicates that running the data to be deployed requires more or less memory than running the deployed data, so based on the data to be deployed, a target memory is requested from the image acquisition device; based on the target memory, the data to be deployed is deployed. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by applying for the target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory application.

[0143] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0144] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other formats.

[0146] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the format of hardware or in the format of software functional unit. If the integrated unit is implemented in the format of software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the format of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A data deployment method based on dynamic memory application, characterized in that: The method is applied to an image acquisition device, and the method comprises: In response to the received data to be deployed, performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result; If the data comparison result indicates that there is a data change between the data to be deployed and the deployed data, applying for a target memory from the image acquisition device based on the data to be deployed; The data to be deployed is deployed based on the target memory.

2. The method according to claim 1, characterized in that The step of performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result includes: Comparing the number of objects to be deployed in the to-be-deployed data with the number of deployed objects in the deployed data; If the number of the objects to be deployed is different from the number of the deployed objects, a data comparison result indicating that there is a data change between the deployed data and the data to be deployed is obtained; If the number of the objects to be deployed is the same as the number of the deployed objects, a data comparison result is obtained, which indicates that there is no data change between the deployed data and the data to be deployed.

3. The method according to claim 1, characterized in that The applying for target memory from the image acquisition device based on the data to be deployed includes: Determine the amount of data to be deployed based on data attributes of the data to be deployed, wherein the data attributes include the total number of bytes or information of objects to be deployed; Applying for matching memory from the image acquisition device according to the amount of data to be deployed; The matched memory is determined as the target memory.

4. The method according to claim 1, characterized in that The deploying the data to be deployed based on the target memory includes: Deploy the data to be deployed into the target memory; The default configuration information of the data to be deployed in the target memory is replaced with the user configuration information of the deployed data.

5. The method according to claim 1, characterized in that: After the to-be-deployed data is deployed based on the target memory, the method further includes: In response to receiving a modification instruction for current deployment data, generating target deployment data based on the modification instruction and the current deployment data; The current deployment data deployed in the target memory is switched to the target deployment data.

6. The method according to claim 5, characterized in that In response to receiving a modification instruction for current deployment data, generating target deployment data based on the modification instruction and the current deployment data includes: In response to receiving the modification instruction, analyzing whether the configuration information in the current deployment data is default configuration information; If so, the default configuration information in the current deployment data is modified based on the modification data carried by the modification instruction to obtain the target deployment data.

7. The method according to claim 6, characterized in that The current deployment data includes at least one deployment channel, and in response to receiving the modification instruction, analyzing whether the configuration information in the current deployment data is the default configuration information includes: Determining a target deployment channel from at least one deployment channel of the current deployment data based on the modification instruction; Analyze whether the configuration information in the target deployment channel is the default configuration information.

8. The method according to claim 1, characterized in that: Before responding to the received data to be deployed, the method further includes: In response to receiving an instruction to obtain the data to be deployed, obtaining resource verification information of the data to be deployed; Verifying whether deployment of the data to be deployed is supported based on the resource verification information and the current operation information; If the verification result indicates that deployment of the data to be deployed is supported, the data to be deployed is acquired.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 8.

10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Application deployment method and device, computer equipment and storage medium

    CN113360172A

  • Model training method and device, target detection method and device and readable storage medium

    CN116090517A

  • One-click deployment of data processing systems

    US20030055919A1

  • Dynamic protection of one or more deployed copies of a master operating system image

    US20140101422A1

  • Dynamically configurable templates to support versatile deployment of configurations at network devices

    US20220350966A1

Cited By

  • Cloud AI monitoring camera multi-algorithm simultaneous opening method and device and storage medium

    CN120856902A