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

By comparing the data to be deployed with the deployed data, dynamically applying for memory and deploying data, the problem of data structures exceeding reserved fields caused by algorithm updates is solved, flexible data deployment and compatibility are achieved, and the user experience is optimized.

CN119356595BActive Publication Date: 2025-10-21HANGZHOU HUACHENG SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when an algorithm update causes a data structure to exceed a reserved field, the data structure needs to be redefined, resulting in low coding efficiency and difficulty in backward compatibility. Configuration information is lost when users upgrade, reducing the user experience.

Method used

By comparing the data to be deployed with the deployed data, dynamically applying for target memory, and deploying the data to be deployed to the target memory, the default configuration information is replaced with user configuration information, supporting variable-length data storage.

Benefits of technology

It implements a flexible data deployment method, improves the flexibility and compatibility of data deployment, optimizes the code architecture, retains user configuration information, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356595B_ABST
    Figure CN119356595B_ABST
Patent Text Reader

Abstract

The application discloses a data deployment method and device based on 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 indicates that there is data change between the to-be-deployed data and the deployed data, applying 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. The above scheme can improve the flexibility of data deployment.
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 often used to store data. These structures are then written to chips such as Flash memory in binary format for deployment. Data structures often have reserved fields, primarily to meet specific alignment requirements or to reserve space for future expansion, preventing the addition of new fields from corrupting the existing data structure.

[0003] However, as algorithms continue to update and iterate, when the data in the algorithm gradually expands to the point where it exceeds the reserved fields of the structure, the data structure must be invalidated and a new data structure must be redefined. However, this approach not only reduces coding efficiency but also makes backward compatibility with other devices difficult.

[0004] If, after purchasing a device, the user upgrades it and the expanded fields exceed the reserved fields, the only option is to restore the device to factory settings. This restores all other configurations previously set by the user, reducing the user experience. Therefore, there is currently a lack of a flexible algorithm deployment method that can solve this 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] A 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 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 the object 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 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.

[0011] In one embodiment, 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 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 in 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; and 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, perform data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result; a memory application module, which 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; 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 comprising a memory and a processor, wherein the processor is configured 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 having program instructions stored thereon, which, when executed by a processor, implements the above-mentioned data deployment method based on dynamic memory application.

[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. Therefore, based on the data to be deployed, target memory is requested from the image acquisition device; and the data to be deployed is deployed based on the target memory. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by requesting 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 and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.

[0020] Figure 1 This 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 This is a structural diagram of an embodiment of an 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 following describes the embodiments of the present application in detail with reference to the accompanying drawings.

[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 simply a description of the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: 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 associated objects 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 with examples. In traditional data deployment methods, data structures are often used to store data, and the data structures are written to chips such as Flash in binary data format 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. For example, the data deployment method of the embodiment of the present application is mainly illustrated 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] Strings such as AlgName (algorithm display name) and AlgPackName (algorithm package name) are data elements defined during the initial data development process. If algorithm data is written to the device using the aforementioned data structure format, and subsequent updates to the algorithm cause the number of parameter variables in the structure to exceed the reserved fields, the original data structure will be destroyed, requiring a new definition of the data structure.

[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 on 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 preceding 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 This is a flowchart illustrating an exemplary embodiment of the data deployment method based on dynamic memory application of the present application. This method can be applied to image acquisition devices, which can be monocular devices and / or multi-camera devices (e.g., binocular cameras, trinocular cameras, etc.), specifically, monocular and / or multi-camera IPC image acquisition devices (IP CAMERA).

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

[0048] Step S110 : In response to the received data to be deployed, a data comparison process is performed 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. For example, 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). Both are feasible ways of downloading and updating data, which are not limited here. It can also be 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 refer to the target detection algorithm in the aforementioned example, etc., which will not be described here. Generally, 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 trip line detection algorithm (ObjectLine) based on the deployed data, the data to be deployed can be the target trip line 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 trip line 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] For example, after receiving the data to be deployed, the image acquisition device compares the data to be deployed with the deployed data in the aforementioned example to obtain a data comparison result. Based on the data comparison result, it can be determined whether there are any data changes between the two data. Based on the data changes, it can also be determined whether the update based on the current data to be deployed is to update the values ​​of existing parameters or to add or subtract 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] To illustrate this in conjunction with the previous steps, if the data comparison results indicate that there are data changes 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). Therefore, it is necessary to apply for the corresponding target memory from the image acquisition device for the data to be deployed.

[0066] Data change refers to the difference between the amount of data to be deployed and the amount of data already deployed. For example, in the previous example, the deployed data is the target detection algorithm, while the data to be deployed is the target detection algorithm and the target tripwire detection algorithm. Therefore, there is a data change between the data to be deployed and the data already deployed.

[0067] For example, the image acquisition device can request 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 are no data changes between the to-be-deployed data and the already-deployed data, the to-be-deployed data can be deployed and processed based on the memory space originally corresponding to the already-deployed data. For example, if the "ID" in the already-deployed data is "134300" and the "ID" in the to-be-deployed data is "134400," the ID in the already-deployed data can be updated and replaced in the original memory space, without having to re-determine and request target memory.

[0068] Step S130 : Deploy 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] For example, 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, thereby achieving the purpose of variable-length data storage. Thus, during the data deployment process, the data to be deployed will not be limited by the size of its data structure definition, but will depend 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 without repeatedly modifying the data structure in the algorithm data. Specifically, it can also involve the application scenario of memory expansion. For example, the initial memory of the image acquisition device when it leaves the factory is 8MB. When more and more algorithm data needs to be deployed later, the storage medium can be replaced in the image acquisition device or more storage media can be loaded (for example, 16MB Flash or even Flash with larger memory). It only needs to adapt the driver of the storage medium, and its upper-layer application (for example, the APP application running in the target terminal) does not need to be adjusted, thereby optimizing the overall code architecture.

[0071] It can be seen that when responding to receiving the data to be deployed, the present application performs a data comparison process between the data to be deployed and the deployed data in the image acquisition device, thereby obtaining 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, then it indicates that running the data to be deployed requires more or less memory than running the deployed data, and therefore, based on the data to be deployed, a target memory is requested from the image acquisition device; and the data to be deployed is deployed based on the target memory. In this way, when the image acquisition device receives the data to be deployed, data can be deployed by requesting the target memory, thereby improving the flexibility of data deployment and realizing data deployment based on dynamic memory request.

[0072] Based on the above embodiment, the embodiment of the present 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 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, a data comparison result is obtained indicating that there is no data change between the deployed data and the data to be deployed.

[0074] As described in conjunction with the above embodiments, the data comparison result can 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 respectively 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 embodiment, the present embodiment describes the steps of requesting 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, where the data attributes include a total number of bytes or information about the object to be deployed; 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 attributes refer 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 objects 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 memory size you want to allocate is input as a parameter into the malloc function, and you can use this function to apply for memory space of the corresponding memory size. The full name of calloc is contiguous allocation, which means dynamic memory allocation and clearing. 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 you can use this function to calculate the required memory size and apply for memory space of the corresponding memory size; 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 dynamic memory application 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 matching memory is requested from the image acquisition device based on the amount of data to be deployed. It should be noted that the matching memory can refer to memory of the same size as the amount of data to be deployed, or it can be memory larger than the amount of data to be deployed, and this application does not limit this. After successfully requesting matching memory, it can be used as the target memory for deploying the data to be deployed.

[0081] Based on the above embodiment, 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 embodiment, the data to be deployed can be serialized before being deployed into 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 into the target memory. The deployment process may include, but is not limited to, one or more of the following methods: 1. Storing the data to be deployed into 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 operate normally based on the default configuration information when the data to be deployed is deployed in the target memory. Taking 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 the 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 (Product Definition, PD), which is not limited here. The main function of the PD configuration file is 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 for 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), the same configuration as above is not required. For example, some products require that the factory default configuration time period is only effective during daytime. Therefore, when deploying the default configuration information of the algorithm data for these products, the PD configuration file can be simultaneously input and the time period is pre-set in the PD configuration file to only be effective during daytime. 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. This allows, after distributing the same algorithm data to different image acquisition devices, to still modify the configuration information of different image acquisition devices when running the algorithm data 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 (i.e., the image acquisition device had no relevant historical data prior to receiving the data to be deployed), deployment and operation can be performed based on the default configuration information. For example, if the image acquisition device's deployed data is an animal detection algorithm, while the data to be deployed has a new vehicle detection algorithm, and both detection algorithms can have separate sensitivity settings, the default sensitivity in the default configuration information can be used when deploying the vehicle detection algorithm. 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. This preserves the user configuration and improves the user experience. For example, if the image acquisition device's deployed data is the initial animal detection algorithm, while the data to be deployed is the updated current animal detection algorithm, and the user has customized the initial animal detection algorithm (generating user configuration information corresponding to the initial 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 when deploying 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, target deployment data is generated based on the modification instruction and the current deployment data; and the current deployment data deployed in the target memory is switched to the target deployment data.

[0089] In conjunction with the aforementioned embodiment, after the data to be deployed is deployed, the current deployment data in the image acquisition device is obtained. During the use of the image acquisition device, the user may modify the current deployment data. For example, in the aforementioned example, the user may modify the sensitivity of the detection algorithm. In addition, the user may also modify the enable status of the current deployment data, the algorithm runtime, the algorithm operation rules, and other configuration information, which will not be detailed here.

[0090] It should be noted that after receiving a 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. Methods for modifying the current deployment data may include, but are 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 and after the modification). Then, the current deployment data deployed in the target memory is switched to the target deployment data for loading and execution, so that the image acquisition device operates according to the target deployment data and its configuration information.

[0091] Based on the above embodiment, 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 the 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] With reference to the above embodiment, in the process of modifying the current deployment data, it is possible to determine whether the configuration information of the current deployment data is the default configuration information, and then select a corresponding data modification method.

[0094] It's understandable that to ensure fault tolerance during data updates and modifications, the image acquisition device's default configuration information must be retained. This means that when a user modifies the default configuration information in the currently deployed data, the original currently deployed data must be retained. The target deployment data can then be obtained by copying the currently deployed data to obtain the copied current deployment data. This allows the image acquisition device to revert to the default configuration information if data or operational issues arise while operating based on the target deployment data.

[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, then 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 a modification instruction. The current deployment data includes at least one deployment channel. Specifically, the method of this embodiment includes the following steps:

[0097] A target deployment channel is determined from at least one deployment channel of current deployment data based on the modification instruction; and configuration information in the target deployment channel is analyzed to determine whether it is default configuration information.

[0098] Among them, the deployment channel corresponds to the lens in the image acquisition device. As explained in the above examples, the data deployment method of the present application can be applied to monocular cameras and / or multi-lens cameras. "Lens" refers to the lens of the image acquisition device, and "monocular" and "multi-lens" refer to the number of lenses of the image acquisition device. In this application, each lens on the same image acquisition device should have a corresponding algorithm channel in the algorithm data to ensure that different lenses do not interfere with each other 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, representing the two algorithm channels in the target detection algorithm package of the binocular camera, which also 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 for channel 0, and the data content in the second set of square brackets [] represents the target detection algorithm package configuration for channel 1. If the image acquisition device supports three or more cameras, the algorithm data in JSON format of this application can also flexibly support the configuration expansion of different channels in the same algorithm for multi-camera devices.

[0102] It should be noted that, taking the target detection algorithm as an example, the Object target detection algorithm package can store algorithms shared by different algorithm channels, and different algorithm channels can store configuration information for each algorithm channel to execute algorithm data. For example, the configuration content framework that can be stored is composed of AlgName (algorithm display name) and Config (algorithm configuration). The algorithm configuration can also include but is not limited to link (algorithm linkage content) and rule (algorithm rule content), etc., which are not limited here. For example, 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-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. 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 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 can be deployed is verified; if the verification result indicates that the data to be deployed can be deployed, the data to be deployed is obtained.

[0108] With reference to the above-mentioned embodiment, before the image acquisition device receives the data to be deployed, if it receives an acquisition instruction for 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, the algorithm data deployment in the data to be deployed, resource parameters such as Flash, MMA, OS, CPU, and IPU required for runtime, the algorithm display name, algorithm package name, algorithm version, algorithm package version, and algorithm MD5 value. The image acquisition device's current operating information and one or more of the above resource verification information are combined 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 data to be deployed is supported, the image acquisition device may acquire the data to be deployed and deploy the data to be deployed according to the method in the aforementioned embodiment. If the verification result indicates that the data to be deployed is not supported (for example, the image acquisition device currently has insufficient computing power, insufficient CPU resources, insufficient operating memory, insufficient Flash storage space, needs to upgrade the program, needs to upgrade the model, or there is an algorithm conflict), the image acquisition device may pause or stop acquiring the data to be deployed and generate corresponding fault information based on the current problem 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. Insufficient Flash storage space will occur, 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 the animal detection algorithm (Animal), and the data to be deployed is the vehicle detection algorithm (Vehicle). By matching the data names, 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, 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 that currently needs to be run. If it is detected that the resource files that one or more algorithm data (algorithm packages) depend 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 trip wire 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 be downloaded again, thereby realizing an abnormal protection mechanism for the image acquisition device.

[0114] On the basis of the above embodiments, it should be noted that in the embodiments of the present application, in the specific application process of the present application, when the algorithm data is loaded into the image acquisition device for the first time, it is usually possible to choose to run the algorithm using the default configuration information 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, algorithm enable switch, etc. in the aforementioned embodiment), the corresponding algorithm data will be generated for the user's modification operation (custom operation), and the algorithm configuration information under the corresponding algorithm channel will be generated.

[0115] For example, this embodiment uses a trinocular camera as an example. After leaving the factory, only the target detection algorithm is deployed for the trinocular camera. Therefore, the target detection algorithm package for the trinocular camera should contain three algorithm channels corresponding to the three cameras of the trinocular camera, and the target detection algorithm configuration information 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 trinocular camera will generate the corresponding user configuration information for channel 0, and the target detection algorithm for channel 0 will be run based on this 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, thus reducing unnecessary configuration content.

[0116] For example, when the object detection algorithm package is first loaded into a trinocular image acquisition device, the default configuration information is used to run the object detection algorithm for channels 0, 1, and 2. No user configuration information is present in the configuration table of the image acquisition device. If the user modifies the object detection algorithm for the first camera in the trinocular image acquisition device, user configuration information is generated in the configuration table based on the modification instructions and corresponds to the algorithm channel 0 for 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 trinocular 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 object detection algorithms for the first, second, and third cameras in the trinocular image acquisition device, user configuration information will be generated in the configuration table based on the modification instructions, and will correspond to algorithm channel 0 for the first camera, algorithm channel 1 for the second camera, and algorithm channel 2 for 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 string, integer and other data. Because it is a dynamic memory application, the expansion of the Flash file is not affected, and the backward compatibility is good. In addition, it can also support different algorithm name configurations for the same algorithm package, as well as support different channels and different configurations for 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, a preset data definition tool can be used to perform macro definition processing (#define) on the target data in the image acquisition device, which will not be described in detail 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 fixed-length algorithm data, that is, the type of algorithm data it corresponds to is equivalent to the fixed-length format of the data structure category; while CfgHeadType_Variable refers to variable-length algorithm data, that is, the type of algorithm data it corresponds to 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 methods and will not be elaborated 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 (UE), a computer, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a 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 computer-readable instructions 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 configured to, in response to the received data to be deployed, perform data comparison processing on the data to be deployed and the deployed data in the image acquisition device to obtain a data comparison result.

[0133] The memory application module 220 is configured 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 data to be deployed, a data comparison result between the data to be deployed and the deployed data is obtained by performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device. 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. Therefore, based on the data to be deployed, a target memory is requested from the image acquisition device; and the data to be deployed is deployed based on the target memory. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by requesting 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 apparatus provided in the above embodiments and the methods provided in the above embodiments are based on the same concept. The specific manner in which the various modules and units perform their operations has been described in detail in the method embodiments and will not be repeated here. In actual applications, the apparatus provided in the above embodiments can, as needed, allocate the above functions to different functional modules, i.e., divide the internal structure of the apparatus into different functional modules to perform all or part of the functions described above. This is not a limitation herein.

[0137] The functions of each module can be found in the embodiment of the data deployment method based on dynamic memory application, which will not be described here in detail.

[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. Electronic device 100 includes memory 101 and processor 102. Processor 102 is configured to execute program instructions stored in memory 101 to implement the steps of any of the aforementioned embodiments of the data deployment method based on dynamic memory application. In a specific implementation scenario, electronic device 100 may include, but is not limited to, a microcomputer and a server. In addition, electronic device 100 may also include mobile devices such as laptops and tablet computers, which are 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 called 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 (DSP), an application-specific integrated circuit (ASIC), a 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 data to be deployed, a data comparison result between the data to be deployed and the deployed data is obtained by performing data comparison processing on the data to be deployed and the deployed data in the image acquisition device. 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. Therefore, based on the data to be deployed, a target memory is requested from the image acquisition device; and the data to be deployed is deployed based on the target memory. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by requesting the target memory, thereby improving the flexibility of data deployment and realizing data deployment based on dynamic memory request.

[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 of any of the above-mentioned data deployment method embodiments based on dynamic memory application.

[0142] In this exemplary storage medium, by executing program instructions in the storage medium, in response to receiving 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, target memory is requested from the image acquisition device; and the data to be deployed is deployed based on the target memory. In this way, when the image acquisition device receives the data to be deployed, data deployment can be performed by requesting target memory, which improves the flexibility of data deployment and realizes data deployment based on dynamic memory request.

[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. For the sake of brevity, it will not be repeated here.

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

[0145] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, 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, the functional units in the various embodiments 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 units. If the integrated unit is implemented in the format of a 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

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 includes: 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; wherein, if the amount of the data to be deployed is different from the amount of the deployed data, obtaining a data comparison result indicating that there is a data change 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, applying for a target memory from the image acquisition device based on the data to be deployed; The step of applying for a target memory from the image acquisition device based on the data to be deployed includes: determining the amount of data to be deployed according to data attributes of the data to be deployed, the data attributes including the total number of bytes or information of the object to be deployed; applying for a 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; 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 the same as the number of the deployed objects, a data comparison result is obtained, indicating 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 deploying the data to be deployed based on the target memory includes: Deploying 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.

4. The method according to claim 1, wherein 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; Switch the current deployment data deployed in the target memory to the target deployment data.

5. The method according to claim 4, 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.

6. The method according to claim 5, 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 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.

7. 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 the data to be deployed is supported for deployment, the data to be deployed is acquired.

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

9. 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 7 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