WO2018218871A1 - 属性访问控制方法、装置和车载控制系统 - Google Patents
属性访问控制方法、装置和车载控制系统 Download PDFInfo
- Publication number
- WO2018218871A1 WO2018218871A1 PCT/CN2017/109427 CN2017109427W WO2018218871A1 WO 2018218871 A1 WO2018218871 A1 WO 2018218871A1 CN 2017109427 W CN2017109427 W CN 2017109427W WO 2018218871 A1 WO2018218871 A1 WO 2018218871A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- read
- attribute
- access
- attribute value
- threshold
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0208—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
- G05B23/0213—Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/20—Pc systems
- G05B2219/24—Pc safety
- G05B2219/24065—Real time diagnostics
Definitions
- the present invention relates to the field of communications technologies, and in particular, to an attribute access control method, apparatus, and in-vehicle control system.
- attribute values provides great convenience for cross-process communication of in-vehicle control systems.
- the attribute value is usually stored in the ROM (Read Only Memory) of the vehicle control system. After the vehicle control system is down, it is transferred to RAM (Ramdom Access Memory, Volatile Random Access Memory), and the central processing unit (Central Processing Unit). , CPU) Every time you access the property value, you need to perform input/output (I/O) access to the RAM. Similarly, there is a push and pop operation flow of the calling function. When an attribute is in the system and needs to be accessed frequently, the input/output of RAM access and the stacking and popping operations of the calling function are repeated, which consumes a large amount of CPU resources and time. Vehicle control system performance.
- a primary object of the present invention is to provide a property access control method, apparatus, and vehicle control system, which are intended to reduce CPU resources and time spent by attribute access, and improve performance of an in-vehicle control system.
- an embodiment of the present invention provides an attribute access control method, where the method includes the following steps:
- the step of filtering out target read-only attribute values that are frequently accessed includes:
- the step of filtering out the target read-only attribute value that is frequently accessed includes:
- the read-only attribute value whose access frequency is greater than or equal to the second threshold is selected as the target read-only attribute value that is frequently accessed; the second threshold is greater than the first threshold.
- the step of filtering out target read-only attribute values that are frequently accessed includes:
- the read-only attribute value whose access frequency is greater than or equal to the first threshold is selected according to the access frequency from the largest to the smallest, and the preset number of read-only attribute values are selected as the target of frequent access. Read the attribute value.
- the step of acquiring an access record of the read-only attribute value in the preset period includes:
- the preset value ranges from 10 to 20 minutes.
- the first threshold has a value ranging from 15 to 25 times/minute.
- the preset number ranges from 8 to 15.
- the step of pointing the access to the target read-only attribute value to the global variable includes: [0031] replacing the calling function corresponding to the target read-only attribute value with the target only Reading the variable name of the attribute value in the global variable, so that the target read-only attribute value needs to be accessed subsequently, and the full access is directly Local variable.
- the method is applied to an onboard control system based on an Android system.
- the embodiment of the present invention also provides an attribute access control apparatus, where the apparatus includes:
- a screening module configured to filter out target read-only attribute values that are frequently accessed
- a saving module configured to save the target read-only attribute value to a global variable
- a pointing module configured to point access to the target read-only attribute value to the global variable.
- the screening module includes:
- an obtaining unit configured to acquire an access record of a read-only attribute value in the preset time
- a statistical unit configured to calculate an access frequency of each read-only attribute value in the access record
- the first selecting unit is configured to select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed.
- the screening module includes:
- an obtaining unit configured to acquire an access record of a read-only attribute value in the preset time
- a statistical unit configured to calculate an access frequency of each read-only attribute value in the access record
- a determining unit configured to determine whether the number of read-only attribute values whose access frequency is greater than or equal to the first threshold exceeds a preset number
- a first selecting unit configured to: when no preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed;
- a second selecting unit configured to: when the preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the second threshold as a target read-only attribute value that is frequently accessed;
- the screening module includes:
- an obtaining unit configured to acquire an access record of a read-only attribute value in the preset time
- a statistical unit configured to calculate an access frequency of each read-only attribute value in the access record
- a determining unit configured to determine whether the number of read-only attribute values whose access frequency is greater than or equal to the first threshold exceeds a preset number
- a first selecting unit configured to: when no preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed;
- a third selection sub-unit configured to: when a preset number of times exceeds a read-only attribute value whose access frequency is greater than or equal to the first threshold, select a preset number of read-only according to an order of access frequency from largest to smallest The attribute value is used as the target read-only attribute value for frequent access.
- the acquiring unit includes:
- adding a subunit configured to add a debug log for printing a name of the read-only attribute value at a general interface of the access attribute
- an obtaining subunit configured to obtain, from the debug log, an access record of a read-only attribute value in a preset period.
- the pointing module is configured to: replace a calling function corresponding to the target read-only attribute value with a variable name of the target read-only attribute value in the global variable, so that subsequent access is required.
- the target read-only attribute value ⁇ directly accesses the global variable.
- Embodiments of the present invention also provide an in-vehicle control system including a memory, a processor, and at least one application stored in the memory and configured to be executed by the processor
- the application is configured to execute the aforementioned attribute access control method.
- An attribute access control method provided by an embodiment of the present invention saves a target read-only attribute value that is frequently accessed into a global variable, and points an access of the target read-only attribute value to a global variable, thereby making subsequent needs
- the attribute value greatly improves the access speed of the attribute, reduces the CPU resources and the consumption of the time, and optimizes the performance of the vehicle terminal.
- 5 is a block diagram showing an embodiment of an attribute access control apparatus according to the present invention
- 6 is a block diagram showing a screening module of the attribute access control device of FIG. 5;
- FIG. 7 is a block diagram of an acquisition unit of the screening module of FIG. 6;
- FIG. 8 is another block diagram of a screening module of the attribute access control device of FIG. 5;
- FIG. 9 is another block diagram of a screening module of the attribute access control device of FIG. 5.
- an embodiment of an attribute access control method according to the present invention is provided.
- the method includes the following steps. [0075] S10. Filter out target read-only attribute values that are frequently accessed.
- the attribute access control method of the embodiment of the present invention is mainly applied to an onboard control system based on an Android system, and can of course also be applied to an onboard control system based on other operating systems.
- the method can also be applied to a mobile terminal, such as a mobile terminal device such as a mobile phone or a tablet, and of course, other terminal devices.
- the onboard control system filters out target read-only attribute values that are frequently accessed by the CPU from among a plurality of attribute parameters.
- the read-only attribute value is the attribute of the ro .
- the vehicle control system can filter the target read-only attribute value in the following manner.
- the specific process for the in-vehicle control system to filter out the target read-only attribute values of frequent access is as follows:
- the length of the preset time can be set according to actual needs, and is preferably set within 10-20 minutes, for example, the in-vehicle control system acquires an access record of the read-only attribute value within 10 minutes.
- the specific inter-segment segment can also be determined according to actual needs, such as within 10 minutes after the vehicle control system is down.
- the in-vehicle control system can obtain an access record of the read-only attribute value by: first adding a name debug log for outputting the read-only attribute value at the common interface of the access attribute (debug log) ), use the debug log to output the name of the read-only property value that was accessed; then get the access record of the read-only property value in the default period from the debug log.
- the access record of the read-only attribute value may be obtained by other methods in the prior art, and the description of the present invention will not be repeated.
- step S112 for each read-only attribute value in the access record, the onboard control system counts the number of times the read-only attribute value is accessed, and divides the number of accesses by the preset time to obtain the read-only The frequency of access to attribute values. After traversing all the read-only attribute values in the access record in turn, the access frequency of all read-only attribute values in the access record is obtained. [0087] S113. Select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed.
- step S113 for each read-only attribute value, compare the access frequency of the read-only attribute value with the size of the first threshold, and determine whether the access frequency of the read-only attribute value is greater than or equal to the first threshold.
- the access frequency of the read-only attribute value is greater than or equal to the first threshold ⁇ , it is determined that the read-only attribute value is accessed frequently, and the read-only attribute value is selected as the target read-only attribute value. After traversing all the read-only attribute values in the access record in turn, all the target read-only attribute values are obtained.
- the size of the first threshold may be set according to actual needs, and is preferably set within 15-25 times/minute, for example, set to 20 times/minute.
- the specific process for the in-vehicle control system to filter out the target read-only attribute values of frequent access is as follows:
- Steps S121 and S122 in the present solution are the same as steps S111 and S112 in the foregoing first solution, and details are not described herein again.
- S123 Determine whether the number of read-only attribute values whose access rate is greater than or equal to the first threshold exceeds a preset number. When the preset number is not exceeded (less than or equal to ⁇ ), the process proceeds to step S124; when the predetermined number is exceeded (greater than), the process proceeds to step S125.
- step S123 for each read-only attribute value, the access frequency of the read-only attribute value and the size of the first threshold are compared, and it is determined whether the access frequency of the read-only attribute value is greater than or equal to the first threshold. After traversing all the read-only attribute values in the access record in turn, the number of read-only attribute values whose access rate is greater than or equal to the first threshold is counted.
- the scheme performs the number of target read-only attribute values. Limit, limit it to a preset amount. When the number of read-only attribute values whose access rate is greater than or equal to the first threshold exceeds the preset number, the process proceeds to step S125, where the read-only attribute value with a higher access frequency is further filtered out.
- the preset number can be set according to actual needs, and is preferably set within 8-15, for example, the preset number is set. 10.
- the onboard control system selects a read-only attribute value whose access frequency is greater than or equal to the first threshold as the target of frequent access. Read the attribute value.
- the in-vehicle control system selects an access frequency from a read-only attribute value whose access frequency is greater than or equal to the first threshold.
- the specific process for the in-vehicle control system to filter out the target read-only attribute values of frequent access is as follows:
- Steps S131 and S132 in the present solution are the same as steps S111 and S112 in the foregoing first solution, and details are not described herein again.
- S133 Determine whether the number of read-only attribute values whose access rate is greater than or equal to the first threshold exceeds a preset number. When the preset number is not exceeded, the process proceeds to step S134; when the preset number is exceeded, the process proceeds to step S135.
- Steps S133 and S134 in the present solution are the same as steps S123 and S124 in the foregoing second embodiment, and are not described herein again.
- the vehicle control selects a pre-preset number of read-only attribute values with a large access frequency from the read-only attribute value whose access frequency is greater than or equal to the first threshold, as the target read-only attribute value with frequent access.
- the read-only attribute values whose access rate is greater than or equal to the first threshold are sorted according to the access frequency from large to small, and then the read-only attribute values are sequentially selected until a preset number of read-only attributes are selected.
- the preset number can be preset by 20, 50, 100, and so on.
- step S20 after filtering out the target read-only attribute value, the onboard control system copies the target read-only attribute value, and saves the copied target read-only attribute value to the global variable, and in the global variable,
- Each target read-only property value has a variable name.
- Global variables are generally stored in RAM and are fast to read.
- step S30 the in-vehicle control system replaces the calling function corresponding to the target read-only attribute value with the variable name of the target read-only attribute value in the global variable, thereby realizing access to the target read-only attribute value to the global variable. .
- the global variable is directly accessed.
- the target read-only attribute value is found in the global variable by the variable name corresponding to the target read-only attribute value, and the corresponding attribute value is read.
- the pointing module may also point the access to the target read-only attribute value to the global variable in other manners in the prior art, and the present invention will not be repeated here.
- the attribute access control method of the embodiment of the present invention saves the target read-only attribute value of the frequent access to the global variable, and points the access of the target read-only attribute value to the global variable, so that the subsequent access target is read-only.
- Attribute value ⁇ you only need to directly access the global variables in RAM, omitting the stacking and popping process of the calling function, saving the read-only property value of the calling function and the pop-up time of the calling function, greatly improving
- the attribute access speed reduces the CPU resources and the consumption of the daytime, and optimizes the performance of the vehicle control system.
- an attribute access control apparatus of the present invention includes a screening module 10, a saving module 20, and a pointing module 30, wherein: a screening module 10 is configured to filter out target read-only attribute values that are frequently accessed.
- the save module 20 is configured to save the target read-only attribute value into the global variable; and the module 30 is configured to point the access to the target read-only attribute value to the global variable.
- the screening module 10 filters out target read-only attribute values that are frequently accessed by the CPU from among a plurality of attribute parameters.
- the read-only attribute value is the attribute of the ro. header.
- the screening module 10 includes an obtaining unit 11, a statistical unit 12, and a first selecting unit 13, wherein:
- the obtaining unit 11 is configured to acquire an access record of the read-only attribute value in the preset period.
- the length of the preset time can be set according to actual needs, and is preferably set within 10-20 minutes, for example, the in-vehicle control system acquires an access record of the read-only attribute value within 10 minutes.
- the specific inter-segment segment can also be determined according to actual needs, such as within 10 minutes after the vehicle control system is down.
- the obtaining unit 11 includes an adding subunit 111 and an obtaining subunit 112, where: the adding subunit 111 is configured to add a read-only attribute value at a general interface of the access attribute.
- the name of the debug log so that the debug log can be used to print out the name of the accessed read-only attribute value; the obtaining sub-unit 112 is configured to obtain an access record of the read-only attribute value in the preset period from the debug log.
- the access record of the read-only attribute value may be obtained by other methods in the prior art, and the description of the present invention will not be repeated.
- Statistic Unit 12 Used to count the access frequency of each read-only attribute value in the access record.
- the statistics unit 12 For each read-only attribute value in the access record, the statistics unit 12 counts the number of times the read-only attribute value is accessed, and divides the number of accesses by the preset time, that is, the access frequency of the read-only attribute value is obtained. . After traversing all the read-only attribute values in the access record in turn, the access frequency of all read-only attribute values in the access record is obtained.
- the first selecting unit 13 is configured to select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed.
- the first selecting unit 13 compares the access frequency of the read-only attribute value with the size of the first threshold for each read-only attribute value, and determines whether the access frequency of the read-only attribute value is greater than or equal to the first threshold. When the access frequency of the read-only attribute value is greater than or equal to the first threshold ⁇ , it is determined that the read-only attribute value is accessed frequently, and the read-only attribute value is selected as the target read-only attribute value. After traversing all the read-only attribute values in the access record in turn, all the target read-only attribute values are obtained.
- the size of the first threshold may be set according to actual needs, and is preferably set within 15-25 times/minute, such as 20 times/minute.
- the screening module 10 includes an obtaining unit 11, a statistic unit 12, a judging unit 14, a first selecting unit 13, and a second selecting unit 15, wherein:
- the obtaining unit 11 is configured to acquire an access record of the read-only attribute value in the preset period.
- Statistic Unit 12 Used to count the access frequency of each read-only attribute value in the access record.
- the determining unit 14 is configured to determine whether the number of read-only attribute values whose access frequency is greater than or equal to the first threshold exceeds a preset number, and send the determination result to the first selecting unit 13 and the second selecting unit 15.
- the determining unit 14 compares the access frequency of the read-only attribute value with the size of the first threshold, and determines whether the access frequency of the read-only attribute value is greater than or equal to the first threshold. After traversing all the read-only attribute values in the access record in turn, the number of read-only attribute values whose access rate is greater than or equal to the first threshold is counted.
- the scheme performs the number of target read-only attribute values. Limit, limit it to a preset amount.
- the preset number can be set according to actual needs, preferably set at 8-
- the second selection unit 15 When the number of read-only attribute values whose access rate is greater than or equal to the first threshold exceeds the preset number, the second selection unit 15 further filters out the read-only attribute value with a higher access frequency.
- the first selecting unit 13 is configured to: when no preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed.
- the first selecting unit 13 selects a read-only attribute value whose access frequency is greater than or equal to the first threshold as frequent access.
- Target read-only attribute value When the number of read-only attribute values whose access rate is greater than or equal to the first threshold does not exceed the preset number, the first selecting unit 13 selects a read-only attribute value whose access frequency is greater than or equal to the first threshold as frequent access.
- the second selecting unit 15 is configured to: when the preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the second threshold as a target read-only attribute value that is frequently accessed.
- the second selecting unit 15 further selects from the read-only attribute values whose access frequency is greater than or equal to the first threshold.
- the size of the second threshold may be set according to actual needs as long as it is greater than the first threshold.
- the screening module 10 includes an obtaining unit 11, a statistical unit 12, and a judgment.
- the obtaining unit 11 is configured to obtain an access record of the read-only attribute value in the preset time.
- Statistic Unit 12 Used to count the access frequency of each read-only attribute value in the access record.
- the determining unit 14 is configured to determine whether the number of read-only attribute values whose access frequency is greater than or equal to the first threshold exceeds a preset number, and send the determination result to the first selecting unit 13 and the third selecting unit 16.
- the first selecting unit 13 is configured to: when no preset number is exceeded, select a read-only attribute value whose access frequency is greater than or equal to the first threshold as a target read-only attribute value that is frequently accessed.
- the third selecting unit 16 is configured to: when the preset quantity is exceeded, the read-only attribute value whose access frequency is greater than or equal to the first threshold, select a preset number of read-only according to the access frequency from the largest to the smallest.
- the attribute value is used as the target read-only attribute value for frequent access.
- the third selecting unit 16 further selects from the read-only attribute values whose access frequency is greater than or equal to the first threshold.
- the third selecting unit 16 sorts the read-only attribute values whose access rate is greater than or equal to the first threshold according to the access frequency from large to small, and then sequentially selects the read-only attribute value until the preset is selected.
- the preset number can be preset by 20, 50, 100, and so on.
- the saving module 20 copies the target read-only attribute value, and saves the copied target read-only attribute value to the global variable, and in the global variable, each target only The read attribute value has a variable name.
- Global variables are generally stored in RAM and are fast to read.
- the pointing module 30 replaces the calling function corresponding to the target read-only attribute value with the variable name of the target read-only attribute value in the global variable, thereby realizing that the access to the target read-only attribute value is directed to the global variable. If you need to access the target read-only attribute value, you can directly access the global variable, find the target read-only attribute value in the global variable by the variable name corresponding to the target read-only attribute value, and read the corresponding attribute value.
- the pointing module 30 may also point the access to the target read-only attribute value to the global variable by using other methods in the prior art, and the present invention will not be repeated here.
- the attribute access control device of the embodiment of the present invention is mainly applied to an onboard control system based on an Android system, and can of course also be applied to an onboard control system based on other operating systems.
- the in-vehicle control system such as a mobile terminal device such as a mobile phone or a tablet, may of course be other terminal devices.
- the attribute access control apparatus of the embodiment of the present invention saves the target read-only attribute value with frequent access to the global variable, and points the access of the target read-only attribute value to the global variable, so that the subsequent access target is read-only.
- Attribute value ⁇ you only need to directly access the global variables in the RAM, omitting the stacking and popping process of the calling function, saving the consumption of the calling function, the pop-up time, the read-only attribute value, greatly Improved attribute access speed, reduced CPU resources and consumption, and optimized terminal performance.
- attribute access control device and the attribute access control method embodiment provided by the foregoing embodiments are in the same concept, and the specific implementation process is described in the method embodiment, and the technical features in the method embodiment are in the device embodiment. The corresponding applies in the middle, and will not be described here.
- the present invention also provides an in-vehicle control system including a memory, a processor, and at least one application stored in the memory and configured to be executed by the processor, the application being configured Used to perform attribute access control methods.
- the attribute access control method includes the following steps: filtering out target read-only attribute values that are frequently accessed; saving target read-only attribute values to global variables; and accessing target read-only attribute values to global variables.
- the attribute access control method described in this embodiment is the attribute access control method involved in the foregoing embodiment of the present invention, and details are not described herein again.
- the present invention includes apparatus related to performing one or more of the operations described herein.
- These devices may be specially designed and manufactured for the required purposes, or may also include known devices in a general purpose computer.
- These devices have computer programs stored therein that are selectively activated or reconfigured.
- Such computer programs may be stored in a device (eg, computer) readable medium or in any type of medium suitable for storing electronic instructions and respectively coupled to a bus, including but not limited to any Types of disks (including floppy disks, hard disks, CDs, CD-ROMs, and magneto-optical disks), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only)
- a readable medium includes any medium that is stored or transmitted by a device (e.g., a computer) in a readable form.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Debugging And Monitoring (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
一种属性访问控制方法,其包括以下步骤:筛选出访问频繁的目标只读属性值(S11);将目标只读属性值保存到全局变量中(S12);将对目标只读属性值的访问指向全局变量(S13)。从而使得后续需要访问目标只读属性值时,只需直接访问RAM中的全局变量即可,省略了调用函数的入栈、出栈流程优化了车载控制系统性能。
Description
技术领域
[0001] 本发明涉及通信技术领域, 特别是涉及到一种属性访问控制方法、 装置和车载 控制系统。
背景技术
[0002] 属性值的使用, 为车载控制系统的跨进程通信提供了极大的便利性。 属性值通 常存储于车载控制系统的 ROM (Read only Memory , 只读存储器) 中, 车载控 制系统幵机后被调入 RAM (RamdomAccessMemory , 易挥发性随机存取存储器 ) , 中央处理器 (Central Processing Unit, CPU) 每次进行属性值访问吋, 都需 要对 RAM进行输入 /输出 (I/O) 访问操作, 同吋也存在调用函数的入栈、 出栈操 作流程。 当一个属性在系统运行中, 需要被频繁访问吋, 就会反复进行 RAM访 问的输入 /输出和对调用函数的入栈、 出栈操作, 从而消耗大量的中央处理器资 源和吋间, 进而影响车载控制系统性能。
技术问题
[0003] 本发明的主要目的为提供一种属性访问控制方法、 装置和车载控制系统, 旨在 减少属性访问吋消耗的 CPU资源和吋间, 提高车载控制系统性能。
问题的解决方案
技术解决方案
[0004] 为达以上目的, 本发明实施例提出一种属性访问控制方法, 所述方法包括以下 步骤:
[0005] 筛选出访问频繁的目标只读属性值;
[0006] 将所述目标只读属性值保存到全局变量中;
[0007] 将对所述目标只读属性值的访问指向所述全局变量。
[0008] 可选地, 所述筛选出访问频繁的目标只读属性值的步骤包括:
[0009] 获取预设吋间内只读属性值的访问记录;
[0010] 统计出所述访问记录中各只读属性值的访问频率;
[0011] 选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目标只读属性 值。
[0012] 可选地, 所述筛选出访问频繁的目标只读属性值的步骤包括:
[0013] 获取预设吋间内只读属性值的访问记录;
[0014] 统计出所述访问记录中各只读属性值的访问频率;
[0015] 判断访问频率大于或等于第一阈值的只读属性值的数量是否超过预设数量; [0016] 当没有超过预设数量吋, 选取访问频率大于或等于第一阈值的只读属性值作为 访问频繁的目标只读属性值;
[0017] 当超过预设数量吋, 选取访问频率大于或等于第二阈值的只读属性值作为访问 频繁的目标只读属性值; 所述第二阈值大于所述第一阈值。
[0018] 可选地, 所述筛选出访问频繁的目标只读属性值的步骤包括:
[0019] 获取预设吋间内只读属性值的访问记录;
[0020] 统计出所述访问记录中各只读属性值的访问频率;
[0021] 判断访问频率大于或等于第一阈值的只读属性值的数量是否超过预设数量; [0022] 当没有超过预设数量吋, 选取访问频率大于或等于第一阈值的只读属性值作为 访问频繁的目标只读属性值;
[0023] 当超过预设数量吋, 从访问频率大于或等于第一阈值的只读属性值中, 按照访 问频率从大到小的顺序选取预设数量个只读属性值作为访问频繁的目标只读属 性值。
[0024] 可选地, 所述获取预设吋间内只读属性值的访问记录的步骤包括:
[0025] 在访问属性的通用接口处添加用于打印只读属性值的名称的调试日志;
[0026] 从所述调试日志中获取预设吋间内只读属性值的访问记录。
[0027] 可选地, 所述预设吋间的取值范围为 10-20分钟。
[0028] 可选地, 所述第一阈值的取值范围为 15-25次 /分钟。
[0029] 可选地, 所述预设数量的取值范围为 8-15。
[0030] 可选地, 所述将对所述目标只读属性值的访问指向所述全局变量的步骤包括: [0031] 将所述目标只读属性值对应的调用函数替换为所述目标只读属性值在所述全局 变量中的变量名称, 以使后续需要访问所述目标只读属性值吋直接访问所述全
局变量。
[0032] 可选地, 所述方法应用于基于安卓系统的车载控制系统。
[0033] 本发明实施例同吋提出一种属性访问控制装置, 所述装置包括:
[0034] 筛选模块, 用于筛选出访问频繁的目标只读属性值;
[0035] 保存模块, 用于将所述目标只读属性值保存到全局变量中;
[0036] 指向模块, 用于将对所述目标只读属性值的访问指向所述全局变量。
[0037] 可选地, 所述筛选模块包括:
[0038] 获取单元, 用于获取预设吋间内只读属性值的访问记录;
[0039] 统计单元, 用于统计出所述访问记录中各只读属性值的访问频率;
[0040] 第一选取单元, 用于选取访问频率大于或等于第一阈值的只读属性值作为访问 频繁的目标只读属性值。
[0041] 可选地, 所述筛选模块包括:
[0042] 获取单元, 用于获取预设吋间内只读属性值的访问记录;
[0043] 统计单元, 用于统计出所述访问记录中各只读属性值的访问频率;
[0044] 判断单元, 用于判断访问频率大于或等于第一阈值的只读属性值的数量是否超 过预设数量;
[0045] 第一选取单元, 用于当没有超过预设数量吋, 选取访问频率大于或等于第一阈 值的只读属性值作为访问频繁的目标只读属性值;
[0046] 第二选取单元, 用于当超过预设数量吋, 选取访问频率大于或等于第二阈值的 只读属性值作为访问频繁的目标只读属性值;
[0047] 其中, 所述第二阈值大于所述第一阈值。
[0048] 可选地, 所述筛选模块包括:
[0049] 获取单元, 用于获取预设吋间内只读属性值的访问记录;
[0050] 统计单元, 用于统计出所述访问记录中各只读属性值的访问频率;
[0051] 判断单元, 用于判断访问频率大于或等于第一阈值的只读属性值的数量是否超 过预设数量;
[0052] 第一选取单元, 用于当没有超过预设数量吋, 选取访问频率大于或等于第一阈 值的只读属性值作为访问频繁的目标只读属性值;
[0053] 第三选取子单元, 用于当超过预设数量吋, 从访问频率大于或等于第一阈值的 只读属性值中, 按照访问频率从大到小的顺序选取预设数量个只读属性值作为 访问频繁的目标只读属性值。
[0054] 可选地, 所述获取单元包括:
[0055] 添加子单元, 用于在访问属性的通用接口处添加用于打印只读属性值的名称的 调试日志;
[0056] 获取子单元, 用于从所述调试日志中获取预设吋间内只读属性值的访问记录。
[0057] 可选地, 所述指向模块用于: 将所述目标只读属性值对应的调用函数替换为所 述目标只读属性值在所述全局变量中的变量名称, 以使后续需要访问所述目标 只读属性值吋直接访问所述全局变量。
[0058] 本发明实施例还提出一种车载控制系统, 所述车载控制系统包括存储器、 处理 器和至少一个被存储在所述存储器中并被配置为由所述处理器执行的应用程序
, 所述应用程序被配置为用于执行前述属性访问控制方法。
发明的有益效果
有益效果
[0059] 本发明实施例所提供的一种属性访问控制方法, 通过将访问频繁的目标只读属 性值保存到全局变量中, 并将目标只读属性值的访问指向全局变量, 从而使得 后续需要访问目标只读属性值吋, 只需直接访问 RAM中的全局变量即可, 省略 了调用函数的入栈、 出栈流程, 节省了对调用函数的入栈、 出栈操作吋间的消 耗只读属性值, 大大提高了属性访问速度, 减少了 CPU资源和吋间的消耗, 优化 了车载终端性能。
对附图的简要说明
附图说明
[0060] 图 1是本发明的属性访问控制方法一实施例的流程图;
[0061] 图 2是图 1中属性访问控制方法的步骤 S11的具体流程图;
[0062] 图 3是图 1中属性访问控制方法的步骤 S11的另一具体流程图;
[0063] 图 4是图 1中属性访问控制方法的步骤 S11的另一具体流程图;
[0064] 图 5是本发明的属性访问控制装置一实施例的模块示意图;
[0065] 图 6是图 5中属性访问控制装置的筛选模块的模块示意图;
[0066] 图 7是图 6中筛选模块的获取单元的模块示意图;
[0067] 图 8是图 5中属性访问控制装置的筛选模块的另一模块示意图;
[0068] 图 9是图 5中属性访问控制装置的筛选模块的另一模块示意图。
[0069] 本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步说明。
实施该发明的最佳实施例
本发明的最佳实施方式
[0070] 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限定本发 明。
[0071] 下面详细描述本发明的实施例, 所述实施例的示例在附图中示出, 其中自始至 终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。 下 面通过参考附图描述的实施例是示例性的, 仅用于解释本发明, 而不能解释为 对本发明的限制。
[0072] 本技术领域技术人员可以理解, 除非特意声明, 这里使用的单数形式"一"、 " 一个"、 "所述 "和"该"也可包括复数形式。 应该进一步理解的是, 本发明的说明 书中使用的措辞"包括"是指存在所述特征、 整数、 步骤、 操作、 元件和 /或组件 , 但是并不排除存在或添加一个或多个其他特征、 整数、 步骤、 操作、 元件、 组件和 /或它们的组。 应该理解, 当我们称元件被"连接"或"耦接"到另一元件吋 , 它可以直接连接或耦接到其他元件, 或者也可以存在中间元件。 此外, 这里 使用的"连接"或"耦接"可以包括无线连接或无线耦接。 这里使用的措辞 "和 /或"包 括一个或更多个相关联的列出项的全部或任一单元和全部组合。
[0073] 本技术领域技术人员可以理解, 除非另外定义, 这里使用的所有术语 (包括技 术术语和科学术语) , 具有与本发明所属领域中的普通技术人员的一般理解相 同的意义。 还应该理解的是, 诸如通用字典中定义的那些术语, 应该被理解为 具有与现有技术的上下文中的意义一致的意义, 并且除非像这里一样被特定定 义, 否则不会用理想化或过于正式的含义来解释。
[0074] 参照图 1, 提出本发明的属性访问控制方法一实施例, 所述方法包括以下步骤
[0075] S10、 筛选出访问频繁的目标只读属性值。
[0076] S20、 将目标只读属性值保存到全局变量中。
[0077] S30、 将对目标只读属性值的访问指向全局变量。
[0078] 本发明实施例的属性访问控制方法, 主要应用于基于安卓 (Android) 系统的 车载控制系统, 当然也可以应用于基于其它操作系统的车载控制系统。 该方法 还可用于移动终端, 如手机、 平板等便携式终端设备, 当然也可以是其它的终 端设备。 步骤 S10中, 车载控制系统从众多属性参数中筛选出 CPU访问频繁的目 标只读属性值。 只读属性值即 ro.幵头的属性。 在具体实施吋, 车载控制系统可 以通过以下方式筛选目标只读属性值。
[0079] 可选地, 如图 2所示, 车载控制系统筛选出访问频繁的目标只读属性值的具体 流程如下:
[0080] Sl l l、 获取预设吋间内只读属性值的访问记录。
[0081] 预设吋间的长短可以根据实际需要设定, 优选设定在 10-20分钟以内, 如车载 控制系统获取 10分钟内只读属性值的访问记录。
[0082] 具体的吋间段也可以根据实际需要确定, 如从车载控制系统幵机后的 10分钟内
, 从某个应用启动后的 10分钟内, CPU的负载 (资源消耗) 超过预设值后的 10 分钟内, 等等。
[0083] 在具体实施吋, 车载控制系统可以通过以下方式获取只读属性值的访问记录: 首先在访问属性的通用 (common) 接口处添加用于输出只读属性值的名称调试 日志 (debug log) , 利用该调试日志输出被访问的只读属性值的名称; 然后从 调试日志中获取预设吋间内只读属性值的访问记录。
[0084] 除此之外, 也可以采用现有技术中的其它方式获取只读属性值的访问记录, 本 发明对此不再一一列举赘述。
[0085] S112、 统计出访问记录中各只读属性值的访问频率。
[0086] 本步骤 S112中, 针对访问记录中的每一个只读属性值, 车载控制系统统计出该 只读属性值被访问的次数, 利用访问次数除以预设吋间, 即得到该只读属性值 的访问频率。 依次遍历访问记录中的所有只读属性值后, 得到访问记录中所有 只读属性值的访问频率。
[0087] S113、 选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目标只 读属性值。
[0088] 本步骤 S113中, 针对每一个只读属性值, 比较该只读属性值的访问频率与第一 阈值的大小, 判断该只读属性值的访问频率是否大于或等于第一阈值。 当该只 读属性值的访问频率大于或等于第一阈值吋, 则判定该只读属性值访问频繁, 选取该只读属性值作为目标只读属性值。 依次遍历访问记录中的所有只读属性 值后, 得到所有的目标只读属性值。
[0089] 第一阈值的大小可以根据实际需要设定, 优选设定在 15-25次 /分钟以内, 如设 定为 20次 /分钟。
[0090] 可选地, 如图 3所示, 车载控制系统筛选出访问频繁的目标只读属性值的具体 流程如下:
[0091] S121、 获取预设吋间内只读属性值的访问记录。
[0092] S122、 统计出访问记录中各只读属性值的访问频率。
[0093] 本方案中步骤 S121和 S122分别与前述第一方案中的步骤 S111和 S112相同, 在此 不再赘述。
[0094] S123、 判断访问率大于或等于第一阈值的只读属性值的数量是否超过预设数量 。 当没有超过 (小于或等于) 预设数量吋, 进入步骤 S124; 当超过 (大于) 预 设数量吋, 进入步骤 S125。
[0095] 本步骤 S123中, 针对每一个只读属性值, 比较该只读属性值的访问频率与第一 阈值的大小, 判断该只读属性值的访问频率是否大于或等于第一阈值。 依次遍 历访问记录中的所有只读属性值后, 统计出访问率大于或等于第一阈值的只读 属性值的数量。
[0096] 鉴于改变访问路径的目标只读属性值越多, 则对应的维护工作量也越大, 为了 减小维护工作量, 平衡资源消耗量, 本方案对目标只读属性值的数量进行了限 制, 将其限制在预设数量以内。 当访问率大于或等于第一阈值的只读属性值的 数量超过预设数量吋, 则进入步骤 S125, 从中进一步筛选出访问频率更高的只 读属性值。
[0097] 预设数量可以根据实际需要设定, 优选设置在 8-15个以内, 如设置预设数量为
10个。
[0098] S124、 选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目标只 读属性值。
[0099] 当访问率大于或等于第一阈值的只读属性值的数量没有超过预设数量吋, 车载 控制系统则选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目 标只读属性值。
[0100] S125、 选取访问频率大于或等于第二阈值的只读属性值作为访问频繁的目标只 读属性值。
[0101] 当访问率大于或等于第一阈值的只读属性值的数量超过了预设数量吋, 车载控 制系统则进一步从访问频率大于或等于第一阈值的只读属性值中, 选取访问频 率大于或等于第二阈值的只读属性值。 第二阈值的大小可以根据实际需要设定 , 只要大于第一阈值即可。
[0102] 可选地, 如图 4所示, 车载控制系统筛选出访问频繁的目标只读属性值的具体 流程如下:
[0103] S131、 获取预设吋间内只读属性值的访问记录。
[0104] S132、 统计出访问记录中各只读属性值的访问频率。
[0105] 本方案中步骤 S131和 S132分别与前述第一方案中的步骤 S111和 S112相同, 在此 不再赘述。
[0106] S133、 判断访问率大于或等于第一阈值的只读属性值的数量是否超过预设数量 。 当没有超过预设数量吋, 进入步骤 S134; 当超过预设数量吋, 进入步骤 S135
[0107] S134、 选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目标只 读属性值。
[0108] 本方案中步骤 S133和 S134分别与前述第二方案中的步骤 S123和 S124相同, 在此 不再赘述。
[0109] S135、 从访问频率大于或等于第一阈值的只读属性值中, 按照访问频率从大到 小的顺序选取预设数量个只读属性值作为访问频繁的目标只读属性值。
[0110] 当访问率大于或等于第一阈值的只读属性值的数量超过了预设数量吋, 车载控
制系统则进一步从访问频率大于或等于第一阈值的只读属性值中, 选取访问频 率较大的前预设数量个只读属性值, 作为访问频繁的目标只读属性值。
[0111] 例如, 将访问率大于或等于第一阈值的只读属性值按照访问频率从大到小的顺 序进行排序, 然后依序选取只读属性值, 直到选出预设数量个只读属性值为止
。 预设数量个可以是预设 20个、 50个、 100个等。
[0112] 步骤 S20中, 当筛选出目标只读属性值后, 车载控制系统则复制该目标只读属 性值, 并将复制的目标只读属性值保存到全局变量中, 且在全局变量中, 每一 个目标只读属性值具有一个变量名称。 全局变量一般保存在 RAM中, 读取速度 快。
[0113] 步骤 S30中, 车载控制系统将目标只读属性值对应的调用函数替换为目标只读 属性值在全局变量中的变量名称, 从而实现了将对目标只读属性值的访问指向 全局变量。 后续需要访问目标只读属性值吋, 则直接访问全局变量, 通过该目 标只读属性值对应的变量名称在全局变量中找到该目标只读属性值, 读取对应 的属性值。
[0114] 除此之外, 指向模块也可以采用现有技术中的其它方式将对目标只读属性值的 访问指向全局变量, 本发明在此不再一一列举赘述。
[0115] 本发明实施例的属性访问控制方法, 通过将访问频繁的目标只读属性值保存到 全局变量中, 并将目标只读属性值的访问指向全局变量, 从而使得后续需要访 问目标只读属性值吋, 只需直接访问 RAM中的全局变量即可, 省略了调用函数 的入栈、 出栈流程, 节省了对调用函数的入栈、 出栈吋间的消耗只读属性值, 大大提高了属性访问速度, 减少了 CPU资源和吋间的消耗, 优化了车载控制系统 性能。
[0116] 参照图 5, 提出本发明的属性访问控制装置, 所述装置包括筛选模块 10、 保存 模块 20和指向模块 30, 其中: 筛选模块 10, 用于筛选出访问频繁的目标只读属 性值; 保存模块 20, 用于将目标只读属性值保存到全局变量中; 指向模块 30, 用于将对目标只读属性值的访问指向全局变量。
[0117] 筛选模块 10从众多属性参数中筛选出 CPU访问频繁的目标只读属性值。 只读属 性值即 ro.幵头的属性。
[0118] 如图 6所示, 在某些实施例中, 筛选模块 10包括获取单元 11、 统计单元 12和第 一选取单元 13, 其中:
[0119] 获取单元 11 : 用于获取预设吋间内只读属性值的访问记录。
[0120] 预设吋间的长短可以根据实际需要设定, 优选设定在 10-20分钟以内, 如车载 控制系统获取 10分钟内只读属性值的访问记录。
[0121] 具体的吋间段也可以根据实际需要确定, 如从车载控制系统幵机后的 10分钟内
, 从某个应用启动后的 10分钟内, CPU的负载超过预设值后的 10分钟内, 等等
[0122] 可选地, 如图 7所示, 获取单元 11包括添加子单元 111和获取子单元 112, 其中 : 添加子单元 111用于在访问属性的通用接口处添加用于打印只读属性值的名称 调试日志, 从而可以利用该调试日志打印出被访问的只读属性值的名称; 获取 子单元 112用于从调试日志中获取预设吋间内只读属性值的访问记录。
[0123] 除此之外, 也可以采用现有技术中的其它方式获取只读属性值的访问记录, 本 发明对此不再一一列举赘述。
[0124] 统计单元 12: 用于统计出访问记录中各只读属性值的访问频率。
[0125] 针对访问记录中的每一个只读属性值, 统计单元 12统计出该只读属性值被访问 的次数, 利用访问次数除以预设吋间, 即得到该只读属性值的访问频率。 依次 遍历访问记录中的所有只读属性值后, 得到访问记录中所有只读属性值的访问 频率。
[0126] 第一选取单元 13: 用于选取访问频率大于或等于第一阈值的只读属性值作为访 问频繁的目标只读属性值。
[0127] 第一选取单元 13针对每一个只读属性值, 比较该只读属性值的访问频率与第一 阈值的大小, 判断该只读属性值的访问频率是否大于或等于第一阈值。 当该只 读属性值的访问频率大于或等于第一阈值吋, 则判定该只读属性值访问频繁, 选取该只读属性值作为目标只读属性值。 依次遍历访问记录中的所有只读属性 值后, 得到所有的目标只读属性值。
[0128] 第一阈值的大小可以根据实际需要设定, 优选设定在 15-25次 /分钟以内, 如设 定为 20次 /分钟。
[0129] 如图 8所示, 在某些实施例中, 筛选模块 10包括获取单元 11、 统计单元 12、 判 断单元 14、 第一选取单元 13和第二选取单元 15, 其中:
[0130] 获取单元 11 : 用于获取预设吋间内只读属性值的访问记录。
[0131] 统计单元 12: 用于统计出访问记录中各只读属性值的访问频率。
[0132] 判断单元 14: 用于判断访问频率大于或等于第一阈值的只读属性值的数量是否 超过预设数量, 并将判断结果发送给第一选取单元 13和第二选取单元 15。
[0133] 针对每一个只读属性值, 判断单元 14比较该只读属性值的访问频率与第一阈值 的大小, 判断该只读属性值的访问频率是否大于或等于第一阈值。 依次遍历访 问记录中的所有只读属性值后, 统计出访问率大于或等于第一阈值的只读属性 值的数量。
[0134] 鉴于改变访问路径的目标只读属性值越多, 则对应的维护工作量也越大, 为了 减小维护工作量, 平衡资源消耗量, 本方案对目标只读属性值的数量进行了限 制, 将其限制在预设数量以内。 预设数量可以根据实际需要设定, 优选设置在 8-
15个以内, 如设置预设数量为 10个。
[0135] 当访问率大于或等于第一阈值的只读属性值的数量超过预设数量吋, 则通过第 二选取单元 15从中进一步筛选出访问频率更高的只读属性值。
[0136] 第一选取单元 13: 用于当没有超过预设数量吋, 选取访问频率大于或等于第一 阈值的只读属性值作为访问频繁的目标只读属性值。
[0137] 当访问率大于或等于第一阈值的只读属性值的数量没有超过预设数量吋, 第一 选取单元 13则选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的 目标只读属性值。
[0138] 第二选取单元 15: 用于当超过预设数量吋, 选取访问频率大于或等于第二阈值 的只读属性值作为访问频繁的目标只读属性值。
[0139] 当访问率大于或等于第一阈值的只读属性值的数量超过了预设数量吋, 第二选 取单元 15则进一步从访问频率大于或等于第一阈值的只读属性值中, 选取访问 频率大于或等于第二阈值的只读属性值。 第二阈值的大小可以根据实际需要设 定, 只要大于第一阈值即可。
[0140] 如图 9所示, 在某些实施例中, 筛选模块 10包括获取单元 11、 统计单元 12、 判
断单元 14、 第一选取单元 13和第三选取单元 16, 其中:
[0141] 获取单元 11 : 用于获取预设吋间内只读属性值的访问记录。
[0142] 统计单元 12: 用于统计出访问记录中各只读属性值的访问频率。
[0143] 判断单元 14: 用于判断访问频率大于或等于第一阈值的只读属性值的数量是否 超过预设数量, 并将判断结果发送给第一选取单元 13和第三选取单元 16。
[0144] 第一选取单元 13: 用于当没有超过预设数量吋, 选取访问频率大于或等于第一 阈值的只读属性值作为访问频繁的目标只读属性值。
[0145] 第三选取单元 16: 用于当超过预设数量吋, 从访问频率大于或等于第一阈值的 只读属性值中, 按照访问频率从大到小的顺序选取预设数量个只读属性值作为 访问频繁的目标只读属性值。
[0146] 当访问率大于或等于第一阈值的只读属性值的数量超过了预设数量吋, 第三选 取单元 16则进一步从访问频率大于或等于第一阈值的只读属性值中, 选取访问 频率较大的前预设数量个只读属性值, 作为访问频繁的目标只读属性值。
[0147] 例如, 第三选取单元 16将访问率大于或等于第一阈值的只读属性值按照访问频 率从大到小的顺序进行排序, 然后依序选取只读属性值, 直到选出预设数量个 只读属性值为止。 预设数量个可以是预设 20个、 50个、 100个等。
[0148] 当筛选出目标只读属性值后, 保存模块 20则复制该目标只读属性值, 并将复制 的目标只读属性值保存到全局变量中, 且在全局变量中, 每一个目标只读属性 值具有一个变量名称。 全局变量一般保存在 RAM中, 读取速度快。
[0149] 指向模块 30将目标只读属性值对应的调用函数替换为目标只读属性值在全局变 量中的变量名称, 从而实现了将对目标只读属性值的访问指向全局变量。 后续 需要访问目标只读属性值吋, 则直接访问全局变量, 通过该目标只读属性值对 应的变量名称在全局变量中找到该目标只读属性值, 读取对应的属性值。
[0150] 除此之外, 指向模块 30也可以采用现有技术中的其它方式将对目标只读属性值 的访问指向全局变量, 本发明在此不再一一列举赘述。
[0151] 本发明实施例的属性访问控制装置, 主要应用于基于安卓系统的车载控制系统 , 当然也可以应用于基于其它操作系统的车载控制系统。 所述车载控制系统如 手机、 平板等便携式终端设备, 当然也可以是其它的终端设备。
[0152] 本发明实施例的属性访问控制装置, 通过将访问频繁的目标只读属性值保存到 全局变量中, 并将目标只读属性值的访问指向全局变量, 从而使得后续需要访 问目标只读属性值吋, 只需直接访问 RAM中的全局变量即可, 省略了调用函数 的入栈、 出栈流程, 节省了对调用函数的入栈、 出栈吋间的消耗, 只读属性值 , 大大提高了属性访问速度, 减少了 CPU资源和吋间的消耗, 优化了终端性能。
[0153] 需要说明的是: 上述实施例提供的属性访问控制装置与属性访问控制方法实施 例属于同一构思, 其具体实现过程详见方法实施例, 且方法实施例中的技术特 征在装置实施例中均对应适用, 这里不再赘述。
[0154] 本发明同吋提出一种车载控制系统, 所述车载控制系统包括存储器、 处理器和 至少一个被存储在存储器中并被配置为由处理器执行的应用程序, 所述应用程 序被配置为用于执行属性访问控制方法。 所述属性访问控制方法包括以下步骤 : 筛选出访问频繁的目标只读属性值; 将目标只读属性值保存到全局变量中; 将对目标只读属性值的访问指向全局变量。 本实施例中所描述的属性访问控制 方法为本发明中上述实施例所涉及的属性访问控制方法, 在此不再赘述。
[0155] 本领域技术人员可以理解, 本发明包括涉及用于执行本申请中所述操作中的一 项或多项的设备。 这些设备可以为所需的目的而专门设计和制造, 或者也可以 包括通用计算机中的已知设备。 这些设备具有存储在其内的计算机程序, 这些 计算机程序选择性地激活或重构。 这样的计算机程序可以被存储在设备 (例如 , 计算机) 可读介质中或者存储在适于存储电子指令并分别耦联到总线的任何 类型的介质中, 所述计算机可读介质包括但不限于任何类型的盘 (包括软盘、 硬盘、 光盘、 CD-ROM、 和磁光盘) 、 ROM (Read-Only Memory , 只读存储器 ) 、 RAM (Random Access Memory , 随机存储器) 、 EPROM (Erasable Programmable Read-Only
Memory , 可擦写可编程只读存储器) 、 EEPROM (Electrically Erasable
Programmable Read-Only Memory , 电可擦可编程只读存储器) 、 闪存、 磁性卡 片或光线卡片。 也就是, 可读介质包括由设备 (例如, 计算机) 以能够读的形 式存储或传输信息的任何介质。
[0156] 本技术领域技术人员可以理解, 可以用计算机程序指令来实现这些结构图和 /
或框图和 /或流图中的每个框以及这些结构图和 /或框图和 /或流图中的框的组合。 本技术领域技术人员可以理解, 可以将这些计算机程序指令提供给通用计算机 、 专业计算机或其他可编程数据处理方法的处理器来实现, 从而通过计算机或 其他可编程数据处理方法的处理器来执行本发明公幵的结构图和 /或框图和 /或流 图的框或多个框中指定的方案。
[0157] 本技术领域技术人员可以理解, 本发明中已经讨论过的各种操作、 方法、 流程 中的步骤、 措施、 方案可以被交替、 更改、 组合或刪除。 进一步地, 具有本发 明中已经讨论过的各种操作、 方法、 流程中的其他步骤、 措施、 方案也可以被 交替、 更改、 重排、 分解、 组合或刪除。 进一步地, 现有技术中的具有与本发 明中公幵的各种操作、 方法、 流程中的步骤、 措施、 方案也可以被交替、 更改 、 重排、 分解、 组合或刪除。
[0158] 以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利 用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运 用在其他相关的技术领域, 均同理包括在本发明的专利保护范围内。
Claims
权利要求书
一种属性访问控制方法, 其特征在于, 包括以下步骤:
筛选出访问频繁的目标只读属性值;
将所述目标只读属性值保存到全局变量中;
将对所述目标只读属性值的访问指向所述全局变量。
根据权利要求 1所述的属性访问控制方法, 其特征在于, 所述筛选出 访问频繁的目标只读属性值的步骤包括:
获取预设吋间内只读属性值的访问记录;
统计出所述访问记录中各只读属性值的访问频率;
选取访问频率大于或等于第一阈值的只读属性值作为访问频繁的目标 只读属性值。
根据权利要求 1所述的属性访问控制方法, 其特征在于, 所述筛选出 访问频繁的目标只读属性值的步骤包括:
获取预设吋间内只读属性值的访问记录;
统计出所述访问记录中各只读属性值的访问频率;
判断访问频率大于或等于第一阈值的只读属性值的数量是否超过预设 数量;
当没有超过预设数量吋, 选取访问频率大于或等于第一阈值的只读属 性值作为访问频繁的目标只读属性值;
当超过预设数量吋, 选取访问频率大于或等于第二阈值的只读属性值 作为访问频繁的目标只读属性值; 所述第二阈值大于所述第一阈值。 根据权利要求 1所述的属性访问控制方法, 其特征在于, 所述筛选出 访问频繁的目标只读属性值的步骤包括:
获取预设吋间内只读属性值的访问记录;
统计出所述访问记录中各只读属性值的访问频率;
判断访问频率大于或等于第一阈值的只读属性值的数量是否超过预设 当没有超过预设数量吋, 选取访问频率大于或等于第一阈值的只读属
性值作为访问频繁的目标只读属性值;
当超过预设数量吋, 从访问频率大于或等于第一阈值的只读属性值中 , 按照访问频率从大到小的顺序选取预设数量个只读属性值作为访问 频繁的目标只读属性值。
根据权利要求 2-4任一项所述的属性访问控制方法, 其特征在于, 所 述获取预设吋间内只读属性值的访问记录的步骤包括:
在访问属性的通用接口处添加用于打印只读属性值的名称的调试日志 从所述调试日志中获取预设吋间内只读属性值的访问记录。
根据权利要求 2-4任一项所述的属性访问控制方法, 其特征在于, 所 述预设吋间的取值范围为 10-20分钟。
根据权利要求 2-4任一项所述的属性访问控制方法, 其特征在于, 所 述第一阈值的取值范围为 15-25次 /分钟。
根据权利要求 3或 4所述的属性访问控制方法, 其特征在于, 所述预设 数量的取值范围为 8-15。
根据权利要求 1-4任一项所述的属性访问控制方法, 其特征在于, 所 述将对所述目标只读属性值的访问指向所述全局变量的步骤包括: 将所述目标只读属性值对应的调用函数替换为所述目标只读属性值在 所述全局变量中的变量名称, 以使后续需要访问所述目标只读属性值 吋直接访问所述全局变量。
根据权利要求 1-4任一项所述的属性访问控制方法, 其特征在于, 所 述方法应用于基于安卓系统的车载控制系统。
一种属性访问控制装置, 其特征在于, 包括:
筛选模块, 用于筛选出访问频繁的目标只读属性值;
保存模块, 用于将所述目标只读属性值保存到全局变量中; 指向模块, 用于将对所述目标只读属性值的访问指向所述全局变量。 根据权利要求 11所述的属性访问控制装置, 其特征在于, 所述筛选模 块包括:
获取单元, 用于获取预设吋间内只读属性值的访问记录;
统计单元, 用于统计出所述访问记录中各只读属性值的访问频率; 第一选取单元, 用于选取访问频率大于或等于第一阈值的只读属性值 作为访问频繁的目标只读属性值。
[权利要求 13] 根据权利要求 11所述的属性访问控制装置, 其特征在于, 所述筛选模 块包括:
获取单元, 用于获取预设吋间内只读属性值的访问记录;
统计单元, 用于统计出所述访问记录中各只读属性值的访问频率; 判断单元, 用于判断访问频率大于或等于第一阈值的只读属性值的数 量是否超过预设数量;
第一选取单元, 用于当没有超过预设数量吋, 选取访问频率大于或等 于第一阈值的只读属性值作为访问频繁的目标只读属性值; 第二选取单元, 用于当超过预设数量吋, 选取访问频率大于或等于第 二阈值的只读属性值作为访问频繁的目标只读属性值;
其中, 所述第二阈值大于所述第一阈值。
[权利要求 14] 根据权利要求 11所述的属性访问控制装置, 其特征在于, 所述筛选模 块包括:
获取单元, 用于获取预设吋间内只读属性值的访问记录;
统计单元, 用于统计出所述访问记录中各只读属性值的访问频率; 判断单元, 用于判断访问频率大于或等于第一阈值的只读属性值的数 量是否超过预设数量;
第一选取单元, 用于当没有超过预设数量吋, 选取访问频率大于或等 于第一阈值的只读属性值作为访问频繁的目标只读属性值; 第三选取子单元, 用于当超过预设数量吋, 从访问频率大于或等于第 一阈值的只读属性值中, 按照访问频率从大到小的顺序选取预设数量 个只读属性值作为访问频繁的目标只读属性值。
[权利要求 15] 根据权利要求 12-14任一项所述的属性访问控制装置, 其特征在于, 所述获取单元包括:
添加子单元, 用于在访问属性的通用接口处添加用于打印只读属性值 的名称的调试日志;
获取子单元, 用于从所述调试日志中获取预设吋间内只读属性值的访 问记录。
[权利要求 16] 根据权利要求 12-14任一项所述的属性访问控制装置, 其特征在于, 所述预设吋间的取值范围为 10-20分钟。
[权利要求 17] 根据权利要求 12-14任一项所述的属性访问控制装置, 其特征在于, 所述第一阈值的取值范围为 15-25次 /分钟。
[权利要求 18] 根据权利要求 13或 14所述的属性访问控制装置, 其特征在于, 所述预 设数量的取值范围为 8-15。
[权利要求 19] 根据权利要求 11-14任一项所述的属性访问控制装置, 其特征在于, 所述指向模块用于: 将所述目标只读属性值对应的调用函数替换为所 述目标只读属性值在所述全局变量中的变量名称, 以使后续需要访问 所述目标只读属性值吋直接访问所述全局变量。
[权利要求 20] 根据权利要求 11-14任一项所述的属性访问控制装置, 其特征在于, 所述装置应用于基于安卓系统的车载控制系统。
[权利要求 21] —种车载控制系统, 包括存储器、 处理器和至少一个被存储在所述存 储器中并被配置为由所述处理器执行的应用程序, 其特征在于, 所述 应用程序被配置为用于执行权利要求 1至 10任一项所述的属性访问控 制方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710392705.6A CN107219841A (zh) | 2017-05-27 | 2017-05-27 | 属性访问控制方法和装置 |
| CN201710392705.6 | 2017-05-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018218871A1 true WO2018218871A1 (zh) | 2018-12-06 |
Family
ID=59948085
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/109427 Ceased WO2018218871A1 (zh) | 2017-05-27 | 2017-11-03 | 属性访问控制方法、装置和车载控制系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107219841A (zh) |
| WO (1) | WO2018218871A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107219841A (zh) * | 2017-05-27 | 2017-09-29 | 深圳市沃特沃德股份有限公司 | 属性访问控制方法和装置 |
| CN114879975B (zh) * | 2022-06-15 | 2025-08-19 | 新华三半导体技术有限公司 | 一种代码编译方法、装置及电子设备 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101051962A (zh) * | 2007-05-22 | 2007-10-10 | 网御神州科技(北京)有限公司 | 一种可扩展动态网络监控系统及其监控方法 |
| JP2010282441A (ja) * | 2009-06-04 | 2010-12-16 | Sharp Corp | モジュール間依存強度算出装置、モジュール間依存強度測定方法およびモジュール間依存強度測定プログラム |
| JP2011028598A (ja) * | 2009-07-28 | 2011-02-10 | Panasonic Corp | リファクタリング支援装置およびプログラム |
| CN104461806A (zh) * | 2013-09-16 | 2015-03-25 | 中兴通讯股份有限公司 | 一种数据断点监控方法、装置及调试器 |
| CN104572707A (zh) * | 2013-10-18 | 2015-04-29 | 北京卓易讯畅科技有限公司 | 一种用于提供优选对象信息的方法与设备 |
| CN107219841A (zh) * | 2017-05-27 | 2017-09-29 | 深圳市沃特沃德股份有限公司 | 属性访问控制方法和装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102520687B (zh) * | 2011-12-12 | 2014-02-19 | 攀钢集团攀枝花钢钒有限公司 | 基于opc的通用接口系统及控制方法 |
| CN106708711B (zh) * | 2015-11-17 | 2020-01-31 | 阿里巴巴集团控股有限公司 | 一种日志信息输出控制方法及装置 |
-
2017
- 2017-05-27 CN CN201710392705.6A patent/CN107219841A/zh active Pending
- 2017-11-03 WO PCT/CN2017/109427 patent/WO2018218871A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101051962A (zh) * | 2007-05-22 | 2007-10-10 | 网御神州科技(北京)有限公司 | 一种可扩展动态网络监控系统及其监控方法 |
| JP2010282441A (ja) * | 2009-06-04 | 2010-12-16 | Sharp Corp | モジュール間依存強度算出装置、モジュール間依存強度測定方法およびモジュール間依存強度測定プログラム |
| JP2011028598A (ja) * | 2009-07-28 | 2011-02-10 | Panasonic Corp | リファクタリング支援装置およびプログラム |
| CN104461806A (zh) * | 2013-09-16 | 2015-03-25 | 中兴通讯股份有限公司 | 一种数据断点监控方法、装置及调试器 |
| CN104572707A (zh) * | 2013-10-18 | 2015-04-29 | 北京卓易讯畅科技有限公司 | 一种用于提供优选对象信息的方法与设备 |
| CN107219841A (zh) * | 2017-05-27 | 2017-09-29 | 深圳市沃特沃德股份有限公司 | 属性访问控制方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107219841A (zh) | 2017-09-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2014000485A1 (zh) | 内容过滤方法和装置 | |
| CN108495195A (zh) | 一种网络直播排行榜生成方法、装置、设备及存储介质 | |
| CN110874265A (zh) | 一种快速采集数据方法、装置、设备及存储介质 | |
| CN103077718A (zh) | 语音处理方法、系统和终端 | |
| CN104503840A (zh) | 对终端资源进行优化的方法及装置 | |
| CN112083988A (zh) | 屏幕刷新率控制方法、移动终端及计算机可读存储介质 | |
| CN110445828A (zh) | 一种基于Redis的数据分布式处理方法及其相关设备 | |
| CN115296913A (zh) | 一种适应flink作业规则的快速编排系统 | |
| CN106294188A (zh) | 存储空间处理方法及装置 | |
| CN104918273A (zh) | 移动终端的网络接入方法及装置 | |
| CN104424142B (zh) | 一种多核处理器系统中访问共享资源的方法与装置 | |
| CN108111427A (zh) | 一种终端设备中数据流量控制方法及装置 | |
| CN118963948A (zh) | 中断处理方法、装置、计算机设备及存储介质 | |
| CN111400148A (zh) | 应用程序的管理方法、装置、设备及介质 | |
| CN108463813B (zh) | 一种进行数据处理的方法和装置 | |
| CN116131911A (zh) | 终端接入网络的方法、终端、通信系统及存储介质 | |
| CN116896550B (zh) | 一种降低服务器压力的软件更新方法、系统和存储介质 | |
| CN114095215A (zh) | 处理访问控制列表的方法、装置、设备及介质 | |
| CN109542662B (zh) | 一种内存管理方法、装置、服务器及存储介质 | |
| CN107219841A (zh) | 属性访问控制方法和装置 | |
| CN108781170A (zh) | 一种配置装置及方法 | |
| CN108462595B (zh) | 账号处理系统及处置窗口期的确定方法、服务器 | |
| CN113992364B (zh) | 一种网络数据包阻断优化方法以及系统 | |
| CN110401653A (zh) | 一种请求过滤方法和装置 | |
| CN114546288A (zh) | 一种降低关键命令时延的方法、系统、设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17912116 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17912116 Country of ref document: EP Kind code of ref document: A1 |